Hello,
sorry in advance for posting this here, as this is most likely not a JuAFEM issue, but a problem with an external mesh. Also apologies for not being able to create a copy-pastable MWE. Any insight is appreciated regardless.
I wanted to be able to use Fenics meshes, so I created a package to import them. It is very limited at the moment (eg. only tetrahedral meshes), but should be sufficient for what I want to do, which is solving the heat equation on a gear mesh, as a proof of concept / learning example. So I can say
grid = import_grid(path,output=:juafem_grid)
and it returns a Grid
with the boundary matrix defined, but no facesets. Adding them to the mesh above can be done by
addfaceset!(grid, "bottom", x -> norm(x[3]) ā 0.025)
addfaceset!(grid, "top", x -> norm(x[3]) ā 0.413226)
This grid should be usable for the heat equation example almost directly, only by setting dim
to 3
, and handling the boundary conditions differently:
ch = ConstraintHandler(dh);
dbc_bottom = Dirichlet(:u, getfaceset(grid,"bottom"), (x,t) -> 0)
dbc_top = Dirichlet(:u, getfaceset(grid,"top"), (x,t) -> 0)
add!(ch,dbc_bottom)
add!(ch,dbc_top)
close!(ch)
update!(ch, 0.0)
The issue is that trying to assemble the stiffness matrix triggers a det(J) is not positive
positive error. If I try it with JuAFEMās own
grid = generate_grid(Tetrahedron, (10,10,10))
with the same BCs, it works perfectly. I donāt expect anyone to try and reproduce this, as that would be quite time consuming, but maybe someone has an idea just by reading this.
My guess would be (assuming I did everything right) is that the Fenics representation doesnāt observe the same face orientation rules as JuAFEM does, because every row in the connectivity matrix is in ascending order (while grid_generator
creates āunorderedā tetrahedrons, probably with common faces having the same orientation in both tets).
Thanks for reading this far