Commit cd50b092 authored by Peter W. Draper's avatar Peter W. Draper
Browse files

Merge branch 'periodic_flag_in_yaml_file' into 'master'

Read the periodicity flag from the YAML file

Closes #466

See merge request !642
parents 197e3b7f 80d7fd79
......@@ -117,15 +117,6 @@ GADGET-2 based analysis programs:
+ ``Time``, time of the start of the simulation in internal units or expressed
as a scale-factor for cosmological runs. SWIFT ignores this and reads it from
the parameter file.
RuntimePars
~~~~~~~~~~~
In the ``/RuntimePars/``, the following attributes are required:
+ ``PeriodicBoundariesOn``, a flag to tell the code whether or not you
have periodic boundaries switched on. Again, this is historical; it should be
set to 1 (default) if you have the code running in periodic mode, or 0 otherwise.
Particle Data
......@@ -145,7 +136,7 @@ individual particle type (e.g. ``/PartType0/``) that have the following *dataset
velocities divided by ``sqrt(a)`` (see below for a fix).
+ ``ParticleIDs``, an array of length N that are unique identifying numbers for
each particle. Note that these have to be unique to a particle, and cannot be
the same even between particle types. The **IDs must be >1**. 0 or negative
the same even between particle types. The **IDs must be >= 0**. Negative
IDs will be rejected by the code.
+ ``Masses``, an array of length N that gives the masses of the particles.
......@@ -216,8 +207,6 @@ You should have an HDF5 file with the following structure:
Flag_Entropy_ICs=0
NumPart_Total=[0, 1, 0, 0, 4, 5]
NumPart_Total_HighWord=[0, 0, 0, 0, 0, 0]
RuntimePars/
PeriodicBoundariesOn=1
Units/
Unit current in cgs (U_I)=1.0
Unit length in cgs (U_L)=1.0
......
......@@ -44,8 +44,9 @@ SPH:
# Parameters related to the initial conditions
InitialConditions:
file_name: ./agora_disk.hdf5 # The file to read
cleanup_h_factors: 1 # Remove the h-factors inherited from Gadget
shift: [674.1175, 674.1175, 674.1175] # (Optional) A shift to apply to all particles read from the ICs (in internal units).
periodic: 0 # Non-periodic BCs
cleanup_h_factors: 1 # Remove the h-factors inherited from Gadget
shift: [674.1175, 674.1175, 674.1175] # Centre the box
# Dimensionless pre-factor for the time-step condition
LambdaCooling:
......
......@@ -6,4 +6,4 @@ if [ "$#" -ne 1 ]; then
exit
fi
wget https://obswww.unige.ch/~lhausamm/swift/IC/AgoraDisk/$1
wget https://obswww.unige.ch/~lhausamm/swift/IC/AgoraDisk/$1.hdf5
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
......@@ -39,7 +39,8 @@ SPH:
# Parameters related to the initial conditions
InitialConditions:
file_name: ./constantBox.hdf5
periodic: 1
Scheduler:
max_top_level_cells: 8
cell_split_size: 50
......
......@@ -32,7 +32,8 @@ SPH:
# Parameters related to the initial conditions
InitialConditions:
file_name: ./coolingBox.hdf5 # The file to read
periodic: 1
# Dimensionless pre-factor for the time-step condition
LambdaCooling:
lambda_nH2_cgs: 1e-22 # Cooling rate divided by square Hydrogen number density (in cgs units [erg * s^-1 * cm^3])
......
......@@ -32,7 +32,8 @@ SPH:
# Parameters related to the initial conditions
InitialConditions:
file_name: CoolingHalo.hdf5 # The file to read
periodic: 1
# External potential parameters
IsothermalPotential:
vrot: 200. # rotation speed of isothermal potential in internal units
......
......@@ -91,10 +91,6 @@ grp.attrs["Unit current in cgs (U_I)"] = 1.
grp.attrs["Unit temperature in cgs (U_T)"] = 1.
# Runtime parameters
grp = file.create_group("/RuntimePars")
grp.attrs["PeriodicBoundariesOn"] = periodic
# set seed for random number
np.random.seed(1234)
......
......@@ -102,10 +102,6 @@ grp.attrs["MassTable"] = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
grp.attrs["Flag_Entropy_ICs"] = [0, 0, 0, 0, 0, 0]
grp.attrs["Dimension"] = 3
# Runtime parameters
grp = file.create_group("/RuntimePars")
grp.attrs["PeriodicBoundariesOn"] = periodic
# set seed for random number
np.random.seed(1234)
......
......@@ -32,7 +32,8 @@ SPH:
# Parameters related to the initial conditions
InitialConditions:
file_name: CoolingHalo.hdf5 # The file to read
periodic: 1
# External potential parameters
IsothermalPotential:
vrot: 200. # Rotation speed of isothermal potential in internal units
......
......@@ -92,11 +92,6 @@ grp.attrs["Unit time in cgs (U_t)"] = const_unit_length_in_cgs / const_unit_velo
grp.attrs["Unit current in cgs (U_I)"] = 1.
grp.attrs["Unit temperature in cgs (U_T)"] = 1.
# Runtime parameters
grp = file.create_group("/RuntimePars")
grp.attrs["PeriodicBoundariesOn"] = periodic
# set seed for random number
np.random.seed(1234)
......
......@@ -102,10 +102,6 @@ grp.attrs["MassTable"] = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
grp.attrs["Flag_Entropy_ICs"] = [0, 0, 0, 0, 0, 0]
grp.attrs["Dimension"] = 3
# Runtime parameters
grp = file.create_group("/RuntimePars")
grp.attrs["PeriodicBoundariesOn"] = periodic
# set seed for random number
np.random.seed(1234)
......
......@@ -34,7 +34,8 @@ SPH:
# Parameters related to the initial conditions
InitialConditions:
file_name: Disc-Patch.hdf5 # The file to read
periodic: 1
# External potential parameters
DiscPatchPotential:
surface_density: 10.
......
......@@ -111,10 +111,6 @@ grp.attrs["MassTable"] = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
grp.attrs["Flag_Entropy_ICs"] = [0, 0, 0, 0, 0, 0]
grp.attrs["Dimension"] = 3
#Runtime parameters
grp = file.create_group("/RuntimePars")
grp.attrs["PeriodicBoundariesOn"] = periodic
# set seed for random number
numpy.random.seed(1234)
......
......@@ -37,7 +37,8 @@ EoS:
# Parameters related to the initial conditions
InitialConditions:
file_name: Disc-Patch.hdf5 # The file to read
periodic: 1
# External potential parameters
DiscPatchPotential:
surface_density: 10.
......
......@@ -34,7 +34,8 @@ SPH:
# Parameters related to the initial conditions
InitialConditions:
file_name: Disc-Patch-dynamic.hdf5 # The file to read
periodic: 1
# External potential parameters
DiscPatchPotential:
surface_density: 10.
......
......@@ -182,10 +182,6 @@ grp.attrs["MassTable"] = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
grp.attrs["Flag_Entropy_ICs"] = [0, 0, 0, 0, 0, 0]
grp.attrs["Dimension"] = 3
#Runtime parameters
grp = file.create_group("/RuntimePars")
grp.attrs["PeriodicBoundariesOn"] = 1
# write gas particles
grp0 = file.create_group("/PartType0")
......
......@@ -34,7 +34,8 @@ SPH:
# Parameters related to the initial conditions
InitialConditions:
file_name: Disc-Patch.hdf5 # The file to read
periodic: 1
# External potential parameters
DiscPatchPotential:
surface_density: 10.
......
......@@ -168,10 +168,6 @@ grp.attrs["MassTable"] = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
grp.attrs["Flag_Entropy_ICs"] = [0, 0, 0, 0, 0, 0]
grp.attrs["Dimension"] = 1
#Runtime parameters
grp = file.create_group("/RuntimePars")
grp.attrs["PeriodicBoundariesOn"] = 1
# write gas particles
grp0 = file.create_group("/PartType0")
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment