Skip to content
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
merged 28 commits into from
Feb 3, 2025

Conversation

petercamps
Copy link
Contributor

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:

  • The artificial distinction between moveable and anchored meshes has been removed. All meshes can now be used anywhere, as long as it makes sense for the model under consideration. This requires a ski file upgrade; see below.
  • The new SymLogMesh class defines a logarithmic grid that is symmetrically reflected around a central bin. This is analogous to the SymPowMesh 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 by type="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.

@petercamps petercamps merged commit 1726ed2 into SKIRT:master Feb 3, 2025
6 checks passed
@petercamps petercamps deleted the othergrids branch February 3, 2025 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant