Apply Global Shift to Mesh Coordinates #62
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implements a new feature that allows to shift the mesh coordinates using a global shifting vector
MeshShift(3)
.This feature is particularly useful in cases where the PostDeform functionality is used, which typically acts on a predescribed area of the mesh (i.e. the spherical deformation assuming the origin to be the center of the sphere). In the actual simulation or if other transformation steps are performed it might be beneficial to move that origin to another location after readin from external mesh generators or before writeout, since the simulation (initial/boundary conditions) might expect another location of the coordinate system's origin. The default behavior doesn't change, so it's completely backwards compatible.
One example where this functionality can be useful is a mesh similar to the
2D-2
case defined in: Benchmark Computations of Laminar Flow Around a Cylinder, Schäfer et al. 1996..The parameter file to generate such a mesh (including shifting) is also added as
tutorials/1-06-curved-postdeform/parameter_cylinderinchannel.ini
, which also serves as a unit test for the functionality.The actual shifting is performed in the routines already available for the
MeshScale
functionality. Scaling and shifting can be both applied independently either just after readin and before writing the mesh to disk. If both are applied in the same stage, scaling is always applied first before shifting the coordinates.I hope that there is no identical functionality implemented yet that I overlooked...