Open FabienSalmon opened 2 years ago
@FabienSalmon thanks for bringing this up. Are you using the VTX reader or the core reader in ParaView? Only VTX supports unstructured data and it uses a single cell type defined by a uint32_t
. I'd follow the example schema in the docs. Let me know if you have any questions. Hope it helps.
Thank you for your quick reply. Indeed, I use the VTX reader and read the bp4 directory in paraview.
So, if I understand well, it is not possible to use different kinds of cells so far? So, even if I have some square cells, I have to use polygonal cells in 2D if I have at least one polygon among my cells (and define the type as a scalar)?
Hi @FabienSalmon that's correct. Does VTK support that use-case? It's been a while, I have to check their file format docs where the schemas are defined. Thanks.
Ok, thank you for the reply. I do not think VTK supports this case but not sure.
I have another question, not with a direct link with that of this thread, but still deriving from it.
I want to use polyhedron cells and there is no example for that on the adios2 website.
Like the connectivity array, I guess there are some differences when we use the xml format. When writing a vtu file, we need to specify the offsets that are not needed for xml. For polyhedron, we need faces and faceoffsets. Do we need faceoffsets with xml ? I do not find neither how to write the faces array with xml, it does not seem to be exactly the same as vtu, but there is a great lack of information about that on the web.
Thank you if you have the answers.
I relaunch the discussion because after some tries, it does not seem possible to deal with polygons with adios2. Actually, I think that having different sizes is a major problem for adios2. Besides, the given example on the website is based on mfem which does not encompass polygons or polyhedron.
So it seems even less possible to have a polyhedron mesh.
Am I correct ?
Thank you
@FabienSalmon do you have a plain text vtu file example (not adios2) that works for your case? That would be a good starting point since vtu is a rich environment and the adios2 VTX reader is just translating schemas to corresponding VTK data structures. Let me know.
Thank you for your reply. I do not have such an example but it seems to me that the information given to adios2 must be structured differently as in a simple file. For instance, and I think this is the issue, adios2 seems to require the connectivity array to be of rank 2: connectivity(number of points in the cell, number of cells)
But when you have different kind of cells, you necessarily have some components that are not used (I put 0 for them).
I tried a case with only rectangles and it works perfectly with adios2, I can visualize it with types = 7 (so polygon). I add for instance one to the size of the first dimension of the connectivity : connectivity(6 instead of 5, n_cells). Then it fails whereas I let for connectivity(1,n) = 4 for the 4 vertices of each rectangle.
I tried to write the connectivity array as a one dimension array without zeros, but it does not seem possible to do that, paraview does not recognize the adios2 output.
@FabienSalmon yes, that's why a working example would be useful to see first if the VTK backend can actually support the case, that way we can accommodate the logic in the VTX VTK reader (that's where the functionality resides, not in adios2).
Ok, so to understand, you want a VTU file of a case? If so, it will be far different from the structure of XML VTU but I can give you that
@FabienSalmon great, thanks! Only VTU and VTI are supported by the VTK's ADIOS2 VTX reader.
Here an XML file representing a simple mesh with 2 cells test2.zip
Here a VTU file representing the same mesh test2vtu.zip
I think I might have an explanation but not sure, please, tell me what do you think.
Adios2 simply write the arrays. So, when we write the connectivity array if there are cells composing of a different number of points, we have for instance:
4 1 2 3 4 0
3 2 4 5 0 0
5 1 4 5 6 2
where the first column is the number of vertices. We must have some zeros (or other numbers) in the connectivity array. But, to be read by paraview, we might need to have
4 1 2 3 4
3 2 4 5
5 1 4 5 6 2
without the zeros like all the examples provided on the web in VTU. But we cannot remove these zeros in the framework of adios2. Do you think the problem stems from that ?
Thank you
@FabienSalmon this scenario was never supported nor was in the roadmap. Let's treat it as a new feature since the visualization was written for specific cases. I'll try to find some time to explore options in the VTX reader. Thanks!
Ok thank you for the reply.
Hope you will find time to do that, I think it would be of great interest for adios2.
Hello,
I use adios2 to make, for instance, a 2D square with rectangle cells and it works perfectly when I open it with paraview.
To do that I use a type equal to 8 and I use the following lines to add this variable (in fortran):
bpls -lav gives the following output:
Now, in order to use other kinds of cells, I tried to pass the types as an array. Thus, I created an array of the same size as the connectivity (so the number of cells) and did:
bpls -lav gives the following output:
I expected this to work exactly in the same way as previously, but it does not. I can show the points of the geometry, but not the cells, paraview does not want even if it does not crash. Did I miss something? In other words, do we need to add something else to use an array for the types instead of a scalar? Or is this a bug in adios2?
Thank you for your replies