-
Notifications
You must be signed in to change notification settings - Fork 9
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
Plot 2D surfaces in 3D space using P4estMesh{NDIMS, NDIMS_AMBIENT}
#107
base: main
Are you sure you want to change the base?
Conversation
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.
Do you have a test for the new functionality (2D surface in 3D)?
I will add one! At first, I didn't understand how this could be done without adding TrixiAtmo.jl as a dependency, but now I see the https://github.com/trixi-framework/Trixi2Vtk_reference_files repository, which I could add some TrixiAtmo.jl output to. Edit: Would it make more sense to generate the |
Running TrixiAtmo.jl within the test is probably not feasible right now, as we haven't had our first release yet. Therefore, I think the only way to properly test this for now is to store both the |
In the long run, we should run TrixiAtmo.jl for the tests. If you do not want to make a public release, you could store both files in the reference repo as you suggested. |
I agree; once there's a public release of TrixiAtmo.jl (which will be quite soon), it will be run similarly to Trixi.jl within the tests. In the meantime, I've added tests which use |
This PR adapts #82 to use the
NDIMS_AMBIENT
type parameter, which I added toP4estMesh
in trixi-framework/Trixi.jl#2068. This was released in Trixi.jl v0.8.9, so I have removed compat for versions of Trixi before 0.9 (@sloede or @ranocha please let me know if this is not necessary, or if you'd like to maintain compatibility with earlier versions of Trixi.jl). The main change is in the function below:Trixi2Vtk.jl/src/vtktools.jl
Lines 234 to 246 in 6fffc3e
I have kept the call to
size(node_coordinates, 1)
incalc_vtk_points_cells
from #82 and added a comment explaining why. This is needed because the argumentnode_coordinates
is anAbstractArray{<:Any,4}
, so we can't access any further information about the dimensions from type parameters. I don't expect this to be particularly problematic, because we already have to do this for the other dimensions ofnode_coordinates
to determine the sizes of the new arraysvtk_points
andvtk_cells
. See below:Trixi2Vtk.jl/src/vtktools.jl
Lines 589 to 621 in 6fffc3e
Note that even when using the covariant solver in TrixiAtmo.jl, which can use an exact representation of the curved surface within the solver internals, the reinterpolation functionality in Trixi2Vtk will always use a polynomial representation of the mesh, and there will therefore be some (usually small) deviation from the true solution on the surface. This is due to the fact that Trixi2Vtk.jl calls Trixi.jl's
calc_node_coordinates
, which is based on a polynomial mesh representation.