diff --git a/doc/RTD/source/VELOCIraptorInterface/stfwithswift.rst b/doc/RTD/source/VELOCIraptorInterface/stfwithswift.rst index a663c37f93a6cede8c4528583c44183059414432..ed261b76abbcefaf5643a69069bb4b8ea1a0894c 100644 --- a/doc/RTD/source/VELOCIraptorInterface/stfwithswift.rst +++ b/doc/RTD/source/VELOCIraptorInterface/stfwithswift.rst @@ -50,8 +50,10 @@ HDF5 library, not a parallel build. Compiling SWIFT --------------- The next part is compiling SWIFT with VELOCIraptor and assumes you already -downloaded SWIFT from the GitLab_, this can be done by running:: +downloaded SWIFT from the GitLab_, this can be done by running +.. code:: bash + ./autogen.sh ./configure --with-velociraptor=/path/to/VELOCIraptor-STF/src make @@ -60,16 +62,16 @@ In which ``./autogen.sh`` only needs to be run once after the code is cloned from the GitLab_, and ``/path/to/`` is the path to the ``VELOCIraptor-STF`` directory on your machine. In general ``./configure`` can be run with other options as desired. After this we can run SWIFT with VELOCIraptor, but for this -we first need to add several lines to the yaml file of our simulation:: +we first need to add several lines to the yaml file of our simulation - #structure finding options - StructureFinding: - config_file_name: stf_input_6dfof_dmonly_sub.cfg - basename: ./stf - output_time_format: 1 - scale_factor_first: 0.02 - delta_time: 1.02 +.. code:: YAML + + StructureFinding: + config_file_name: stf_input_6dfof_dmonly_sub.cfg + basename: ./stf + scale_factor_first: 0.02 + delta_time: 1.02 In which we specify the ``.cfg`` file that is used by VELOCIraptor and the other parameters which SWIFT needs to use. In the case of diff --git a/examples/DwarfGalaxy/dwarf_galaxy.yml b/examples/DwarfGalaxy/dwarf_galaxy.yml index 0d815a99c42249bcbbdaf21dbaa34a55f61731aa..4c5e2a82b017725929138de011b1f3ed1fe9f1ef 100644 --- a/examples/DwarfGalaxy/dwarf_galaxy.yml +++ b/examples/DwarfGalaxy/dwarf_galaxy.yml @@ -10,10 +10,8 @@ InternalUnitSystem: StructureFinding: config_file_name: stf_input.cfg # Name of the STF config file. basename: ./stf # Common part of the name of output files. - output_time_format: 0 # Specifies the frequency format of structure finding. 0 for simulation steps (delta_step) and 1 for simulation time intervals (delta_time). scale_factor_first: 0.92 # Scale-factor of the first snaphot (cosmological run) time_first: 0.01 # Time of the first structure finding output (in internal units). - delta_step: 1000 # Time difference between consecutive structure finding outputs (in internal units) in simulation steps. delta_time: 1.10 # Time difference between consecutive structure finding outputs (in internal units) in simulation time intervals. # Cosmological parameters diff --git a/examples/EAGLE_25/eagle_25.yml b/examples/EAGLE_25/eagle_25.yml index 0aec970db486a164696b23fdc1e281fbe4853486..cab0dbcd5efc0528ddc65a6dde1e5c2d7cb6b9a9 100644 --- a/examples/EAGLE_25/eagle_25.yml +++ b/examples/EAGLE_25/eagle_25.yml @@ -10,10 +10,8 @@ InternalUnitSystem: StructureFinding: config_file_name: stf_input.cfg # Name of the STF config file. basename: ./stf # Common part of the name of output files. - output_time_format: 0 # Specifies the frequency format of structure finding. 0 for simulation steps (delta_step) and 1 for simulation time intervals (delta_time). scale_factor_first: 0.92 # Scale-factor of the first snaphot (cosmological run) time_first: 0.01 # Time of the first structure finding output (in internal units). - delta_step: 1000 # Time difference between consecutive structure finding outputs (in internal units) in simulation steps. delta_time: 1.10 # Time difference between consecutive structure finding outputs (in internal units) in simulation time intervals. # Cosmological parameters diff --git a/examples/EAGLE_6/eagle_6.yml b/examples/EAGLE_6/eagle_6.yml index 7c64c1cdedb6c8e9714471f4bad9611f548d05fa..e80fac8167a832c17cd10e1d2ae7cd854f314d17 100644 --- a/examples/EAGLE_6/eagle_6.yml +++ b/examples/EAGLE_6/eagle_6.yml @@ -10,10 +10,8 @@ InternalUnitSystem: StructureFinding: config_file_name: stf_input.cfg # Name of the STF config file. basename: ./stf # Common part of the name of output files. - output_time_format: 0 # Specifies the frequency format of structure finding. 0 for simulation steps (delta_step) and 1 for simulation time intervals (delta_time). scale_factor_first: 0.92 # Scale-factor of the first snaphot (cosmological run) time_first: 0.01 # Time of the first structure finding output (in internal units). - delta_step: 1000 # Time difference between consecutive structure finding outputs (in internal units) in simulation steps. delta_time: 1.10 # Time difference between consecutive structure finding outputs (in internal units) in simulation time intervals. # Cosmological parameters diff --git a/examples/SmallCosmoVolume_DM/small_cosmo_volume_dm.yml b/examples/SmallCosmoVolume_DM/small_cosmo_volume_dm.yml index 910137edc442c994a9f31a8c62e16818ca4ae97d..ebe3a78ee0d03eb53752b1dfa8fa749931a754a9 100644 --- a/examples/SmallCosmoVolume_DM/small_cosmo_volume_dm.yml +++ b/examples/SmallCosmoVolume_DM/small_cosmo_volume_dm.yml @@ -10,7 +10,6 @@ InternalUnitSystem: StructureFinding: config_file_name: stf_input_6dfof_dmonly_sub.cfg basename: ./stf - output_time_format: 1 scale_factor_first: 0.02 delta_time: 1.02 diff --git a/examples/SmallCosmoVolume_VELOCIraptor/small_cosmo_volume.yml b/examples/SmallCosmoVolume_VELOCIraptor/small_cosmo_volume.yml index c8157a7a0e0065b1f58667fb8437b9e3883eda75..39425f3085105be222b71e738bca8e9467377143 100644 --- a/examples/SmallCosmoVolume_VELOCIraptor/small_cosmo_volume.yml +++ b/examples/SmallCosmoVolume_VELOCIraptor/small_cosmo_volume.yml @@ -61,7 +61,6 @@ InitialConditions: StructureFinding: config_file_name: stfconfig_input.cfg basename: ./stf - output_time_format: 1 scale_factor_first: 0.02 delta_time: 1.02 diff --git a/examples/parameter_example.yml b/examples/parameter_example.yml index 9fdfc993c3f9ad125f4f588db159c6ef5c997c84..49fa279b64ca2cedf8d0a51ed3fd0a41bb1dcac3 100644 --- a/examples/parameter_example.yml +++ b/examples/parameter_example.yml @@ -156,6 +156,16 @@ DomainDecomposition: itr: 100 # When adaptive defines the ratio of inter node communication time to data redistribution time, in the range 0.00001 to 10000000.0. # Lower values give less data movement during redistributions, at the cost of global balance which may require more communication. +# Structure finding options (requires velociraptor) +StructureFinding: + config_file_name: stf_input.cfg # Name of the STF config file. + basename: ./stf # Common part of the name of output files. + scale_factor_first: 0.92 # Scale-factor of the first snaphot (cosmological run) + time_first: 0.01 # Time of the first structure finding output (in internal units). + delta_time: 1.10 # Time difference between consecutive structure finding outputs (in internal units) in simulation time intervals. + output_list_on: 0 # (Optional) Enable the output list + output_list: stflist.txt # (Optional) File containing the output times (see documentation in "Parameter File" section) + # Parameters related to the equation of state ------------------------------------------ EoS: @@ -286,15 +296,3 @@ EAGLEChemistry: init_abundance_Magnesium: 0.000 # Inital fraction of particle mass in Magnesium init_abundance_Silicon: 0.000 # Inital fraction of particle mass in Silicon init_abundance_Iron: 0.000 # Inital fraction of particle mass in Iron - -# Structure finding options (requires velociraptor) -StructureFinding: - config_file_name: stf_input.cfg # Name of the STF config file. - basename: ./stf # Common part of the name of output files. - output_time_format: 0 # Specifies the frequency format of structure finding. 0 for simulation steps (delta_step) and 1 for simulation time intervals (delta_time). - scale_factor_first: 0.92 # Scale-factor of the first snaphot (cosmological run) - time_first: 0.01 # Time of the first structure finding output (in internal units). - delta_step: 1000 # Time difference between consecutive structure finding outputs (in internal units) in simulation steps. - delta_time: 1.10 # Time difference between consecutive structure finding outputs (in internal units) in simulation time intervals. - output_list_on: 0 # (Optional) Enable the output list - output_list: stflist.txt # (Optional) File containing the output times (see documentation in "Parameter File" section) diff --git a/src/velociraptor_interface.c b/src/velociraptor_interface.c index f60a18d86604af2c2e4fd3706a603cbf6ce27199..ccf1e95352c9e69c39ed454ba50fea652bd319f5 100644 --- a/src/velociraptor_interface.c +++ b/src/velociraptor_interface.c @@ -264,7 +264,6 @@ void velociraptor_invoke(struct engine *e) { const int nr_cells = s->nr_cells; int *cell_node_ids = NULL; static int stf_output_count = 0; - int active_stf_output_count; /* Allow thread to run on any core for the duration of the call to * VELOCIraptor so that @@ -294,15 +293,9 @@ void velociraptor_invoke(struct engine *e) { /* Append base name with either the step number or time depending on what * format is specified in the parameter file. */ char outputFileName[PARSER_MAX_LINE_SIZE + 128]; - if (e->stf_output_freq_format == io_stf_steps) - active_stf_output_count = e->step; - else if (e->stf_output_freq_format == io_stf_time) - active_stf_output_count = stf_output_count; - else - active_stf_output_count = 0; snprintf(outputFileName, PARSER_MAX_LINE_SIZE + 128, "%s_%04i.VELOCIraptor", - e->stfBaseName, active_stf_output_count); + e->stfBaseName, stf_output_count); /* Allocate and populate an array of swift_vel_parts to be passed to * VELOCIraptor. */ @@ -350,7 +343,7 @@ void velociraptor_invoke(struct engine *e) { } /* Call VELOCIraptor. */ - if (!InvokeVelociraptor(nr_gparts, nr_hydro_parts, active_stf_output_count, + if (!InvokeVelociraptor(nr_gparts, nr_hydro_parts, stf_output_count, swift_parts, cell_node_ids, outputFileName)) error("Exiting. Call to VELOCIraptor failed on rank: %d.", e->nodeID); diff --git a/src/velociraptor_interface.h b/src/velociraptor_interface.h index 1f29be11c9dd8e267c87201b0a438979fec3775b..67ca9153d3301dedc1f7529eedce8e63f8b392c0 100644 --- a/src/velociraptor_interface.h +++ b/src/velociraptor_interface.h @@ -22,14 +22,6 @@ /* Config parameters. */ #include "../config.h" -/** - * @brief The different formats for when to run structure finding. - */ -enum io_stf_output_format { - io_stf_steps = 0, /*!< Output every N steps */ - io_stf_time /*!< Output at fixed time intervals */ -}; - /* Forward declaration */ struct engine;