-
Notifications
You must be signed in to change notification settings - Fork 32
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
3D regular spatial grids in Cylindrical and Spherical coordinates and related Mesh updates #237
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This pull request requires an incompatible change to some existing ski files.
Description
This pull request brings a fairly substantial update to the family of regular spatial grids in SKIRT, i.e. those grids using a mesh to define the grid points in each direction. The important changes are described below.
3D regular grids in non-Cartesian coordinates
This update adds 3D spatial grids in cylindrical and spherical coordinates; the family of regular spatial grids now includes:
CartesianSpatialGrid
(always 3D)Cylinder2DSpatialGrid
,Cylinder3DSpatialGrid
Sphere1DSpatialGrid
,Sphere2DSpatialGrid
,Sphere3DSpatialGrid
All spherical and cylindrical spatial grids now support an optional minimum radius, implying a central (spherical or cylindrical) hole. Furthermore, the code has been streamlined and documentation has been added for the path segment generator algorithms.
Meshes
The following updates were made to the family of
Mesh
classes, used to define the grid cell boundaries in each coordinate direction for regular spatial grids:SymLogMesh
class defines a logarithmic grid that is symmetrically reflected around a central bin. This is analogous to theSymPowMesh
class.Incompatible change to ski files
Removing the distinction between moveable and anchored meshes requires an incompatible change to most ski files that use a regular spatial grid. Specifically, all occurrences of
type="MoveableMesh"
must be replaced bytype="Mesh"
. This can be accomplished manually in a text editor, or it can be performed automatically by the PTS ski file upgrade procedure. See the user guide topic Upgrading SKIRT parameter files for more information.Motivation
When importing snapshots of hydro-dynamical simulations of models with (approximate) cylindrical or spherical symmetry, it can be beneficial to use the same or a similar grid to perform radiative transfer in SKIRT. For example, an axisymmetric model that includes bulk velocities defined in cylindrical coordinates will turn into a fully 3D model in SKIRT,
because SKIRT requires a full 3D grid to support kinematics.
Tests
New functional tests have been added to verify the new grids and meshes. The existing tests still work, with only small binary incompatibilities resulting from streamlining the code in just a few cases.