Quad Mesh Fails during evaluation on coordinates

Hello everyone,

I’m trying to create a trial demo as it is showed in Cahn-Hilliard demo of FEniCS.

https://fenicsproject.org/docs/dolfin/2018.1.0/python/demos/cahn-hilliard/demo_cahn-hilliard.py.html

I’m trying quad elements in elasticity and when i try to compile u(coord_x,coord_y) in 2D it gives error as following:

*** DOLFIN encountered an error. If you are not able to resolve this issue
*** using the information listed below, you can ask for help at


*** fenics-support@googlegroups.com


*** Remember to include the error message listed below and, if possible,
*** include a minimal running example to reproduce the error.


*** -------------------------------------------------------------------------
*** Error: Unable to intersect cell and point.
*** Reason: Intersection is only implemented for simplex meshes.
*** Where: This error was encountered inside Cell.cpp.
*** Process: 0


*** DOLFIN version: 2018.1.0

but it works fine if I used triangular elements. Do you suggest any method to evaluate a results in terms of displacement (u) at a specific coordinates in quad mesh ?

Thanks.

Hi,
As the error says, this is not implemented for quadrilateral and hexahedral cells.
Most likely, this feature will be added to dolfinx later this year

@CMA
Quad collision has now been added to dolfinx making it possible to do evaluation for quadrilaterals.

Hi, dokken

I am using the C++ version of FEniCS. I noticed methods such as evaluate_basis are called when a Function object evaluate values. Are these methods neccessary when a function is evaluated? Are there some unimaginable errors if I bypass these methods and use coordinate_dofs and dofs to evaluate a function directly?
I do not know how to write evaluate_basis for hexahedron by myself but I want to evaluate a function on hexahedron mesh.

Thank you very much!

If you are only interested in the function values at physical coordinates where there are degrees of freedom, you can access the function vector directly.

u=Function(V)
arr= u.vector().get_local()

The order in the array follows
X= V.tabulate_dof_coordinates()
Evaluate basis is used because if you evaluate a function at a non-dof coordinate, a linear combination of dof values has to be made

Thank you very much.

It seems unavoidable. Hope evaluation for function in hexahedron mesh in the future.

After reading more source code, I tried to write a hexahedron evaluation function. My program dose not work inc the fashion of fenics and only implemented for box cell not all hexahedron cell. However, It is enough for me!