Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
19 changes: 19 additions & 0 deletions DiskHalo/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# A trivial example of a disk and halo simulation

This will test your build and provide a starting point of exploring
parameters. The bases configured here have low resolution and quick to
compute, so we are not supplying a precomputed basis. The configuration
in the `../Nbody` directory will build a higher resolution, more accurate
basis more typical of a real simulation.

## How to run

First, change the ldlibdir parameter to point at your
library install directory. Then, execute the command:

mpirun -np 6 exp -f config.yml

assuming that you have a machine with 6 cores. Since config.yml is
the default, you simply execute the simpler command:

mpirun -np 6 exp
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
18 changes: 0 additions & 18 deletions DiskHaloA/README.md

This file was deleted.

37 changes: 0 additions & 37 deletions DiskHaloB/README

This file was deleted.

40 changes: 40 additions & 0 deletions Halo/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# A simple spherical halo example

This is a simple example of using an adaptive spherical basis,
sphereSL. The model only has one component, a spherical halo.

The target halo model is specified here in the ascii file
SLGridSph.model. The basis parameters are in the parameters node.
The basis will be computed and tabled on a grid from r in $[0.0001,
1.95]$ with $4000$ grid points. The maximum spherical harmonic order
is $l=6$ and harmonic has 20 radial basis functions. The radial
interval is scaled to the interval $[-1, 1]$ with a scale factor
r_s=0.0667 using the scaling function

$$ x=(r/r_s - 1)/(r/r_s + 1). $$

Therefore, $r_s$ should be chosen to be roughly the scale parameter of
the model. The parameter self_consistent tells the code to recompute
the basis at every step. If false, the gravitational field is fixed
after the first evaluation. Use the web page documentation for
additional details on these parameters.

## Run instructions

First, change the ldlibdir parameter to point at your
library install directory. Then, execute the command:

mpirun -np 6 exp -f config.yml

or

mpirun -np 6 exp

assuming that you have a machine with 6 cores. Note: `config.yml` is
the default name. You only need `-f file` for alternate file names.

## Bonus run

There is a second test config file in this directory: `fixed.yml`.
This one runs the component in a fixed potential using the `userhalo`
external potential.
File renamed without changes.
4 changes: 2 additions & 2 deletions SimpleHalo/config.yml → Halo/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Components:
rmax: 1.95
Lmax: 6
nmax: 20
rs: 0.0667
rmapping : 0.0667
self_consistent: true
modelname: SLGridSph.model

Expand Down Expand Up @@ -71,5 +71,5 @@ External:
Interaction:

# None: only one component

...
File renamed without changes.
File renamed without changes.
50 changes: 50 additions & 0 deletions Nbody/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# N-body simulation example

A more complex example of a disk and halo simulation using higher
resolution adaptive bases more typical of a real Nbody simulation.
The cylindrical tables will take much longer to compute but provide
better dynamical fidelity. The cache file can be reused for new runs
with the same Cylinder parameters.

## How to run

First, change the ldlibdir parameter to point at your library install
directory. Then, execute the command:

mpirun -np 6 exp -f config.yml

or

mpirun -np 6 exp

assuming that you have a machine with 6 cores. Note: `config.yml` is
the default name. You only need `-f file` for alternate file names.

## A few details

The EJ* parameters in halo.conf and disk.conf instruct the Component
class to adjust the expansion center to follow the gravitational
potential minumum. Use the web page documentation for additional
details on these parameters.

EXP will look for basis-function cache file when it creates the
cylindrical basis class. This cache file contains a pre-made set of
disk basis functions. The EOF cache file is not provided because it
is too big for GitHub. EXP will make the basis and save it as cache
file on the fly if a cache file is found. It will be read from the
`outdir` directory. If you'd like to have a different outdir from
this current working dir, please move the .eof.cache.run0 to your
`outdir`.

Alternatively, you can premake the cache file using pyEXP as follows:

mpirun python3 make_cyl_basis.py

The disk basis in takes some time to compute, so a precomputed basis is
supplied. However, you can delete the eof cache and build it again for
testing.

## Prerun example

The directory `data` contains some snapshots and coefficients for use
with the pyEXP tutorials.
File renamed without changes.
6 changes: 3 additions & 3 deletions DiskHaloB/config.yml → Nbody/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ Components:
force :
id : sphereSL
parameters : {numr: 2000, rmin: 0.0001, rmax: 1.95, Lmax: 6,
nmax: 20, rs: 0.0667, self_consistent: true, modelname:
nmax: 20, rmapping: 0.0667, self_consistent: true, modelname:
SLGridSph.model, pcadiag: true, pcavtk: true, npca: 100, tk_type: Hall}

- name : star disk
parameters : {nlevel: 1, EJdamp: 0.8, EJdryrun: true, EJ: 2, nEJkeep: 256, nEJwant: 500, EJkinE: false, EJext: false, EJdiag: false, EJdT: 1.0e-8, indexing: true}
bodyfile : disk.bods
force :
id : cylinder
parameters : {acyl: 0.01, hcyl: 0.001, lmaxfid: 32, mmax: 6, nmaxfid: 32, nmax: 12, ncylnx: 128, ncylny: 64, rnum: 200, pnum: 0, tnum: 80, ashift: 0, vflag: 0, logr: false, density: true, self_consistent: true, npca: 100, pcadiag: true, pcavtk: true, tk_type: Hall}
parameters : {acyl: 0.01, hcyl: 0.001, lmaxfid: 32, mmax: 6, nmaxfid: 32, nmax: 12, ncylodd: 3, ncylnx: 128, ncylny: 64, rnum: 200, pnum: 0, tnum: 80, ashift: 0, vflag: 0, logr: false, density: true, self_consistent: true, npca: 100, pcadiag: true, pcavtk: true, tk_type: Hall}
#
# The parameters could be expressed like this, equivalently:
#
Expand Down Expand Up @@ -92,5 +92,5 @@ External:
# be inverted using the 'allcouples: false' flag in the 'Global' map
# ------------------------------------------------------------------------
Interaction:

...
Loading