Skip to content

Fix vertex mesh compilation with geometry tables. - #882

Merged
jorgensd merged 4 commits into
mainfrom
dokken/point-coordinate-tables
Sep 14, 2026
Merged

jorgensd merged 4 commits into
mainfrom
dokken/point-coordinate-tables

Conversation

@jorgensd

Copy link
Copy Markdown
Member

An issue I was already aware of due to work in Dolfinx-adjoint and FEniCSx_ii (reported by @finsberg).
Evaluating spatial coordinates on a point mesh has been broken for a while in FFCx.
This was also reported in: #879

The issue in the existing code is that the coordinate element of a point mesh is a DG-0 function.
This returns a basis table of a single number (1), which is correctly classified in the table generator as ttype="ones".
However, in FFCx we drop all "ones" and "zeros" tables, and therefore have to manually handle code generation for those cases.

This PR fixes this for coordinate dofs. The new generated code becomes:

double x_c0 = coordinate_dofs[0];
double x_c1 = coordinate_dofs[1];
double x_c2 = coordinate_dofs[2];

for a 3D point.

AI disclosure

The test was manually implemented by me.
The fix was created with the help of CLAUDE (Opus 5). The code has been revised and simplified by me.

@jorgensd
jorgensd added this pull request to the merge queue Sep 14, 2026
Merged via the queue into main with commit bd08eb6 Sep 14, 2026
17 of 18 checks passed
@jorgensd
jorgensd deleted the dokken/point-coordinate-tables branch September 14, 2026 08:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant