How to implement the following projection of a gradient to reduce spurious on Level Set Method?

4 months ago by
Hi folks,

I am new here and I would like some help, if it is possible, to implement the following problem.

Assuming \( \nabla \phi^{n+1} \equiv \vec{\psi}^{n+1} \), where \(\vec{\psi} \) has higher order elements than \( \nabla \phi \) and \(\phi\) is a known function.

\( \int_{\Omega} \vec{v}\cdot \vec{\psi}^{n+1} + \mu \nabla \vec{v}\cdot \nabla \vec{\psi}^{n+1} d\Omega \) = \( \int_{\Omega} \vec{v}\cdot \nabla \phi^{n+1}d\Omega \)

where \( \mu = 0.0005h\) (\( h\) is the mesh size) is a filter parameter  and \(\vec{v}\) is a piecewise vector-evaluated test function.

Thanks for your time!
Community: FEniCS Project
what is the unknown?  \(\psi\)?  In this case it is a vector as well : \(\vec{\psi}\).  Then you have the integrand
\nabla \vec{v} \cdot \nabla \vec{\psi}
which is a matrix!  Perhaps you mean to use the inner product
\nabla \vec{v} : \nabla \vec{\psi}

Finally, if \(\phi\) is the unknown, what exactly is the purpose of using \(\psi\)?  This appears redundant.  Perhaps restate the problem in strong form.
written 4 months ago by pf4d  
You are right in everything (it is redundant) and I made corrections in my post as well. The problem here is the following: the function \(\phi\) is known and the approach in my post is one way to calculate the gradient of \(\phi\), I mean \(\vec{\psi}\), in order reduce errors. 

If you have any idea about how I can implement this Fenics, it would be really helpful. Thanks for your time any way!
written 4 months ago by Cassia  

1 Answer

4 months ago by
You can specify higher-order function spaces for the projection of gradients and the like via the syntax
V      = VectorFunctionSpace(mesh, 'CG', 2)
grad_u = project(grad(u), V)​

Read the docs regarding project function:

In my case this is true when \(\mu=0\).

I am sorry, but is this make sense?
Grad_u = project(grad(u),v)+mu*project(grad(u),grad(v))​
written 4 months ago by Cassia  
No, that doesn't make sense...  I suggest you test these ideas with a terminal such as Ipython.

I am not entirely certain what you want to do, but note that you can add extra terms like
grad_u = project(grad(u) + extra_vector_math, V)​​
where *extra_vector_math* is an expression with terms defined on arbitrary function spaces.
written 4 months ago by pf4d  
Please login to add an answer/comment or follow this question.

Similar posts:
Search »