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

Add an abstract class which automates tabulation of parametric, spherically-symmetric, collisionless mass distributions #775

Merged
merged 7 commits into from
Jan 28, 2025

Conversation

abensonca
Copy link
Collaborator

  • Works for any parametric, spherically-symmetric, collisionless mass distribution
  • Class must specify methods:
    • density() - gives $\rho(r)$ (optionally also densityGradientRadial() - easy to derive);
    • parameters() - returns $\hat{\rho}$, $\hat{r}$, $\mathbf{p}$ (density normalization, radius normalization, other parameters);
    • factoryTabulation() - returns an instance of the class with $\hat{\rho}=1$, $\hat{r}=1$, and whatever $\mathbf{p}$ is provided to it - used to perform numerical integrations to build the tables;
    • suffix() - a suffix for use in tabulation file names (typically an MD5 hash generated automatically from the source code)
  • Handles $M(r)$, $\phi(r)$, ℘₁,₂,₃ $(r)$, $\sigma(r)$, $F(k)$, $E(r)$, $r_\mathrm{ff}(t)$, $\mathrm{d}r_\mathrm{ff}/\mathrm{d}t(t)$;
  • Can override any of these with analytic solutions if available;
  • Results automatically tabulated (in parallel) over required range, stored/restored to/from file.

Copy link

⚠️ Possible misspelled word 'retabulated' in file 'source/mass_distributions.spherical.tabulated.F90'
⚠️ Possible misspelled word 'tabulatd' in file 'source/mass_distributions.spherical.tabulated.F90'
⚠️ Possible misspelled word 'pre' in file 'source/mass_distributions.F90'
⚠️ Possible misspelled word 'pre' in file 'source/mass_distributions.spherical.F90'
⚠️ Possible misspelled word 'pre' in file 'source/mass_distributions.spherical.F90'

Copy link

⚠️ Possible misspelled word 'retabulated' in file 'source/mass_distributions.spherical.tabulated.F90'
⚠️ Possible misspelled word 'pre' in file 'source/mass_distributions.F90'
⚠️ Possible misspelled word 'pre' in file 'source/mass_distributions.spherical.F90'
⚠️ Possible misspelled word 'pre' in file 'source/mass_distributions.spherical.F90'

…private`

This avoids segfaults with some compiler versions if these pointers are instead just marked as `private` in the `!$omp parallel` directive.
Copy link

⚠️ Possible misspelled word 'retabulated' in file 'source/mass_distributions.spherical.tabulated.F90'
⚠️ Possible misspelled word 'pre' in file 'source/mass_distributions.F90'
⚠️ Possible misspelled word 'pre' in file 'source/mass_distributions.spherical.F90'
⚠️ Possible misspelled word 'pre' in file 'source/mass_distributions.spherical.F90'

@abensonca abensonca added this pull request to the merge queue Jan 28, 2025
Merged via the queue into master with commit 2a8a5af Jan 28, 2025
304 checks passed
@abensonca abensonca deleted the featMassDistributionsTabulated branch January 28, 2025 23:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant