-
Notifications
You must be signed in to change notification settings - Fork 738
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
Generalize DataOut::write_vtk for simplex mesh #10701
Conversation
Depending on VtkFlags, the quads/hexes may not be subdivided, but are written as VTK high-order Lagrange cells (#6994 ). I wonder if this should also be done for simplices as well? Then you have support for arbitrary order cells/elements and the logic of the class will remain in line with hex/quad. I can help with the VTK part of the implementation if needed. |
That would be great and very much appreciated! My suggestion is that we get a first working simplex implementation in deal.II (with my current implementation and all the other PRs) and then based on that we can make additional improvementsl |
No problem, I just wanted to bring this up and let you know. |
@agrayver Thanks! I will! |
29cdb57
to
be3704e
Compare
189c262
to
9364a87
Compare
I have rebased this branch. I will add a test once #10659 is merged. I need the mapping for creating the patches. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good overall, but I have a few comments (and wait for the promised tests).
source/base/data_out_base.cc
Outdated
@@ -851,6 +867,27 @@ namespace | |||
"it.")); | |||
} | |||
|
|||
/** | |||
* Write dim-dimensional cell with @p n_point vertices and first vertex at | |||
* number start and further. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain what 'further' means?
source/base/data_out_base.cc
Outdated
@@ -2371,6 +2432,26 @@ namespace DataOutBase | |||
|
|||
for (const auto &patch : patches) | |||
{ | |||
// special treatment of simplices since they are not subdivided, s.t, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// special treatment of simplices since they are not subdivided, s.t, | |
// special treatment of simplices since they are not subdivided, such that |
if (patch.reference_cell_type != ReferenceCell::get_hypercube(dim)) | ||
{ | ||
Point<spacedim> node; | ||
|
||
for (unsigned int point_no = 0; point_no < patch.data.n_cols(); | ||
++point_no) | ||
{ | ||
for (unsigned int d = 0; d < spacedim; ++d) | ||
node[d] = | ||
patch.data(patch.data.size(0) - spacedim + d, point_no); | ||
|
||
out.write_point(count++, node); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will that change once we support higher order simplex elements, i.e., is the if(...) continue
code a temporary solution that waits for further code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personally, I would like to keep on having the specialization since it also works (for mixed meshes) and older versions of Paraview.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean the specialization for the quadratic version of those or the plain linear one? It is clear that we cannot use the tensor product variant below for simplices. But then my comment simply boils down to the question whether we can restructure the code and properly indent by if
/ else
rather than if ... continue
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
e3fd7e9
to
2311a9e
Compare
@kronbichler I have added the test and applied the suggestions! |
2311a9e
to
a3f52df
Compare
/rebuild |
In the case of triangles and tetrahedrons, the input argument
n_subdivisions
inDataOut::build_patches()
gets a new meaning: the cells are not subdivided. Instead, we switch between linear (5/22) and quadratic (10/24) VTK cell types. See also here (p. 9).The proposed change enables:
The code will not compile at the moment because it depends on features from the other PRs.
FYI @DanielPaukner