Simulation base class.
More...
|
| def | __init__ (self, name, meshes, solver_sequence, dt_controller, time=[0., 1.], write_steps=1, cfl_max=1, flexible_writeout=False, global_verbosity='info', verbosity='info', variables=[], num_partitions=1, enable_fpe=True, copy_other_files=[]) |
| |
| def | generate (self) |
| |
| def | __str__ (self) |
| |
| def | write (self, f=None) |
| | Writes this simulation input file to disk.
|
| |
| def | run (self, category, local_path=None, site_path='warpy_config.py', wxm_args=[], gen_xdmf=True, tar_run=False, detect_nonscalar=True, sim_param=None) |
| | runs this simulation.
|
| |
| def | setup_sim (self, category, local_path=None, site_path='warpy_config.py', wxm_args=[], sim_param=None, gen_xdmf=None, tar_run=None) |
| | Setups the simulation run directory.
|
| |
| def | gen_xdmf (self, category, local_path=None, site_path='warpy_config.py', detect_nonscalar=True) |
| |
◆ __init__()
| def warpy.simulation.simulation.__init__ |
( |
|
self, |
|
|
|
name, |
|
|
|
meshes, |
|
|
|
solver_sequence, |
|
|
|
dt_controller, |
|
|
|
time = [0., 1.], |
|
|
|
write_steps = 1, |
|
|
|
cfl_max = 1, |
|
|
|
flexible_writeout = False, |
|
|
|
global_verbosity = 'info', |
|
|
|
verbosity = 'info', |
|
|
|
variables = [], |
|
|
|
num_partitions = 1, |
|
|
|
enable_fpe = True, |
|
|
|
copy_other_files = [] |
|
) |
| |
- Parameters
-
| name | simulation run name |
| meshes | |
| solver_sequence | |
| time | [begin, end] simulation time |
| dt_controller | |
| write_steps | how many steps to write out |
| cfl_max | |
| flexible_writeout | True to allow writeout time to adjust to the nearest dt rather than being at fixed intervals |
| global_verbosity | notset, debug, info, warning, error, critical, disabled |
| verbosity | notset, debug, info, warning, error, critical, disabled |
| variables | List of tuples of (variable, num_copies) |
| num_partitions | number of partitions per MPI rank (> 1 is useful for testing) |
| enable_fpe | True to enable floating point exception throwing. This is useful for explicit sims to stop the simulation early once it NaN's out |
Reimplemented in warpy.rkdg_sim.rkdg_sim, warpy.dg_sim.dg_sim, and warpy.fvm_sim.fvm_sim.
◆ __str__()
| def warpy.simulation.simulation.__str__ |
( |
|
self | ) |
|
◆ gen_xdmf()
| def warpy.simulation.simulation.gen_xdmf |
( |
|
self, |
|
|
|
category, |
|
|
|
local_path = None, |
|
|
|
site_path = 'warpy_config.py', |
|
|
|
detect_nonscalar = True |
|
) |
| |
◆ generate()
| def warpy.simulation.simulation.generate |
( |
|
self | ) |
|
◆ run()
| def warpy.simulation.simulation.run |
( |
|
self, |
|
|
|
category, |
|
|
|
local_path = None, |
|
|
|
site_path = 'warpy_config.py', |
|
|
|
wxm_args = [], |
|
|
|
gen_xdmf = True, |
|
|
|
tar_run = False, |
|
|
|
detect_nonscalar = True, |
|
|
|
sim_param = None |
|
) |
| |
runs this simulation.
Resolves parameters in the with the following priority (highest priority to lowest):
- local config file
- site config file
- Parameters
-
| category | |
| local_path | path to the local config file, or None to not use any local config file. This is relative to the current working directory (if given a relative path). |
| site_path | path to the site config file (if any). Path is relative to search the warpy install directory (if given a relative path). |
| wxm_args | extra arguments to pass to WARPXM |
| gen_xdmf | True to generate plot xdmf file after running the simulation |
| detect_nonscalar | True to allow xdmf generator to detect vector/tensor fields. |
| wxm_args | |
| sim_param | |
- Returns
- return code from running WARPXM
◆ setup_sim()
| def warpy.simulation.simulation.setup_sim |
( |
|
self, |
|
|
|
category, |
|
|
|
local_path = None, |
|
|
|
site_path = 'warpy_config.py', |
|
|
|
wxm_args = [], |
|
|
|
sim_param = None, |
|
|
|
gen_xdmf = None, |
|
|
|
tar_run = None |
|
) |
| |
Setups the simulation run directory.
Resolves parameters in the with the following priority (highest priority to lowest):
- local config file
- site config file
- Parameters
-
| category | |
| local_path | path to the local config file, or None to not use any local config file. This is relative to the current working directory (if given a relative path). |
| site_path | path to the site config file (if any). Path is relative to search the warpy install directory (if given a relative path). |
| wxm_args | extra arguments to pass to WARPXM |
| wxm_args | |
| sim_param | |
- Returns
- return code from running WARPXM
◆ write()
| def warpy.simulation.simulation.write |
( |
|
self, |
|
|
|
f = None |
|
) |
| |
Writes this simulation input file to disk.
- Parameters
-
| f | either a file object, filename, or None for default target path. |
◆ cfl_max
| warpy.simulation.simulation.cfl_max |
◆ copy_other_files
| warpy.simulation.simulation.copy_other_files |
◆ dt_controller
| warpy.simulation.simulation.dt_controller |
◆ h_acts
| warpy.simulation.simulation.h_acts |
◆ meshes
| warpy.simulation.simulation.meshes |
◆ name
| warpy.simulation.simulation.name |
◆ root
| warpy.simulation.simulation.root |
◆ seq_groups
| warpy.simulation.simulation.seq_groups |
◆ solver_sequence
| warpy.simulation.simulation.solver_sequence |
◆ variables
| warpy.simulation.simulation.variables |
The documentation for this class was generated from the following file: