Is there any practical way to be used on Quadrature Projection ?


107
views
0
3 months ago by
Hello everyone,

I'm dealing with a function and I am trying to project it to Quadrature space by using
T=project(voigt(T_n), V1, form_compiler_parameters={"quadrature_degree":2})
So that is actually consistent with quadrature points but since there is a very complicated UFL algebra for T_n, kernel cannot handle that projection. Then I tried to use what David suggest previously to be used in complicated UFL variables:

def projectToQuadPts(toProject,VS):
    u = TrialFunction(VS)
    v = TestFunction(VS)
    lhsForm = inner(u,v)*dx
    rhsForm = inner(toProject,v)*dx
    p = {"representation":"quadrature"}
    A = assemble(lhsForm,form_compiler_parameters=p)
    B = assemble(rhsForm,form_compiler_parameters=p)
    u = Function(VS)
    # Because the matrix is diagonal, it should be inverted exactly by the
    # Jacobi preconditioner on the first iteration.  
    PETScKrylovSolver("cg","jacobi").solve(A,u.vector(),B)
    return u​

but also it does not work. Both of the project kills the kernel in Jupyter and the code fails. Is there any other method to be applied such a case ?

Best Regards,
Community: FEniCS Project
This is very vague question. What are you trying to do, what do you expect and what is the problem? Be sure to post an MWE.
written 3 months ago by Jan Blechta  
Please login to add an answer/comment or follow this question.

Similar posts:
Search »