-
-
Notifications
You must be signed in to change notification settings - Fork 393
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
read multiple XDMF Grids #622
base: main
Are you sure you want to change the base?
Conversation
So what does this do when multiple grids are present in a file? Merge them into one? |
Into one |
... That's for the cells. Multiple grids are implemented here for their |
Not sure if this is way we should do it. It seems we're mixing the notions of sets/tags and meshes here. If there are multiple meshes in a file, why not return multiple mesh objects, too? |
I wouldn't want to work around XDMF this way. If there are multiple cell types in a mesh, then it seems that -- unfortunately! -- the XDMF standards wants to see |
Indeed, most codes divide the mesh into submeshes by cells. Some are point-centered though, point_sets make sense here as well. |
So that, in XDMF terms, multiple Topologies can share a Geometry; in meshio terms, That's for what I imagine is the more common use-case, when the different Grids have Topologies with different cell types. But then what should the reader do if the cell-types match? (Again with shared points.) The interpretation of the intent of such a XDMF Domain that I went with is subdomaina. I can't think of another interpretation, which would have the same cell-types and points but different connectivity. |
No, it is the standard itself that suggests the present approach.
|
This sounds interesting but different. Could you send an example? Aren't there points along the interface? I had assumed that Anyway this doesn't seem to be what the XDMF authors are getting at with ‘several Grids share the same Geometry but have separate Topology‘. |
To get another idea of how to interpret an XDMF file containing several The
That is: ParaView has doubled the points! Further:
and
ParaView's behaviour in doubling the points is a bit disappointing, but it is exporting the Grids as EXODUS element blocks in a single EXODUS mesh rather than as multiple EXODUS meshes. Were ParaView able to realize that the second The interpretation of the present PR is: [[0. 1. 0.]
[1. 0. 0.]
[2. 0. 0.]
[2. 2. 0.]
[1. 2. 0.]
[0. 3. 0.]] and {'quad': array([[1, 2, 3, 4]], dtype=int32),
'triangle': array([[0, 1, 4],
[0, 4, 5]], dtype=int32)} |
I thought about it some more and I'm still having a hard time convincing myself this is right approach. When seeing multiple |
Multiple meshio meshes aren't connected; they don't share points ('geometry ' in XDMF). The purpose of the present approach is to support the case discussed in XDMF Model and format:
Practical use case: a boundary value problem. Say 2D. One defines the geometry in (py)gmsh and marks the domain as Physical Surface and the boundary as Physical Curve. On meshing this in Gmsh, one gets triangles and lines for the domain and boundary, respectively. These cells of different type ('topology' in XDMF) share the same points; their connectivity data indexes into a common array of points. This is naturally represented in meshio with a single Mesh with a single array of points but multiple arrays of cells. This is how meshio has always represented such oases. XDMF can do this too, as stated in the specification, but meshio can't read such XDMF without this PR. |
In the example you're linking, one has two It'd be much clearer to say that one It seems that the intended mixed-element mesh in XDMF is the |
Yes, it should be checked that the Geometries coincide. This WIP doesn't do that yet. I think this should be easy though as the Geometry refers to a DataItem which has an XML name and these have to be unique so we only have to store and compare these nsmes rather then the numerical arrays of points. When I saw the recent use of the point_sets attribute in another meshio module, I thought that that looked like a natural home for these names.
Or one Mesh with point_sets. If the XDMF truly intended two Meshes, why wouldn't it use two Xdmf? I don't get the mesh optimizer example. Could you elaborate? As in optimesh? I haven't used that yet and don't know what data structures are required. Without having done so, I thought it would be a function Mesh -> Mesh. |
No, the spec explicitly refers to cases in which 'several Grids share the same Geometry but have separate Topology:'. The XDMF format is flexible, compared to say MEDIT, it enables more than one way of representing the same thing. The Mixed option is valid but not a good fit for meshio. Meshio should read it but should also feel free to avoid writing it whenever there is an alternative that is value XDMF. That's what I'm trying to get to. This might become clearer once I get to writing Mesh.cells as XDMF. This becomes easy using the idiom xdmf#15, except that without the present PR, meshio can't read it back. |
I read this as "several meshes share the same Geometry...".
optimesh indeed, or moving mesh methods. There are a bunch of applications where you have groups of meshes with different geometry and topology; XDMF allows you to store them in one file going like
So in this case, we'd probably want to return a list of meshes from meshio. Would you agree? |
This is for #568.
This is atop #621 and is the second part of the splitting up of #610.