-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: Periodic cartesian meshes #60
Comments
Another MWE, now in 2D, illustrating my latter point: m1 = CartesianDiscreteModel((0,3,0,3),(3,3);isperiodic=(true,true))
m2 = CartesianDiscreteModel((0,3,0,3),(3,3);isperiodic=(false,false))
t1 = get_grid_topology(m1)
t2 = get_grid_topology(m2)
# These two are very different
Geometry.get_faces(t1,2,0)
Geometry.get_faces(t2,2,0)
# These two are the same
get_cell_node_ids(m1)
get_cell_node_ids(m2) The cell-to-node map are completely different between the grid and the topology... |
Update: I now believe that P4est cannot correctly handle periodic meshes on it's own... The current fix sets the p4est connectivity to correctly reflect the periodicity. This seems to cause p4est to incorrectly compute the new vertex coordinates in the cells that contain periodic nodes. It seems to simply use a linear combination of the coarse cell vertex coordinates to determine the new vertex coordinates (which is wrong in cells containing periodic nodes). |
Update: after talking in Slack, it seems to be possible. in p4est_connectivity we have vertices (geometry) and corners (topology). At present, from GridapP4est, we are treating these two indistinguishably. |
Solved in #61 , closing issue. |
So there is a bug with periodic cartesian models in GridapP4est, where the periodicity is not correctly applied to the p4est mesh. See the following MWE:
The problem comes from the fact that the p4est connectivity is computed from the model cell nodes ids and node coordinates (see here). However, in a
CartesianDiscreteModel
those seem to NOT have periodicity. I.ereshape(collect(get_cell_node_ids(cmodel)),(3,)) !== Geometry.get_faces(ctopo,3,0)
for some reason.The periodic cell-to-node map can only be obtained from the topology (see fix).
I don't know why this happens, and it might also be a bug (?).
EDIT: So the issue is that the model cannot be periodic, only the topology can. Otherwise it breaks the cell-maps, which are FE functions based on the node coordinates. For reference, with the current changes we have that this code gives the wrong answer:
This means the fix is a lot more involved, since the connectivity for the grid and the topology are different (I believe). So my fix does not work.
The text was updated successfully, but these errors were encountered: