WARPXM v1.10.0
Loading...
Searching...
No Matches
warpy.simulation.simulation Class Reference

Simulation base class. More...

Inheritance diagram for warpy.simulation.simulation:
warpy.dg_sim.dg_sim warpy.fvm_sim.fvm_sim warpy.rkdg_sim.rkdg_sim

Detailed Description

Simulation base class.

Public Member Functions

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, 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)
 Setups the simulation run directory.
 
def gen_xdmf (self, category, local_path=None, site_path='warpy_config.py', detect_nonscalar=True)
 

Public Attributes

 name
 
 meshes
 
 root
 
 cfl_max
 
 dt_controller
 
 solver_sequence
 
 seq_groups
 
 h_acts
 
 variables
 
 copy_other_files
 

Constructor & Destructor Documentation

◆ __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
namesimulation run name
meshes
solver_sequence
time[begin, end] simulation time
dt_controller
write_stepshow many steps to write out
cfl_max
flexible_writeoutTrue to allow writeout time to adjust to the nearest dt rather than being at fixed intervals
global_verbositynotset, debug, info, warning, error, critical, disabled
verbositynotset, debug, info, warning, error, critical, disabled
variablesList of tuples of (variable, num_copies)
num_partitionsnumber of partitions per MPI rank (> 1 is useful for testing)
enable_fpeTrue 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.

Member Function Documentation

◆ __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,
  detect_nonscalar = True,
  sim_param = None 
)

runs this simulation.

Resolves parameters in the with the following priority (highest priority to lowest):

  1. local config file
  2. site config file
Parameters
category
local_pathpath 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_pathpath to the site config file (if any). Path is relative to search the warpy install directory (if given a relative path).
wxm_argsextra arguments to pass to WARPXM
gen_xdmfTrue to generate plot xdmf file after running the simulation
detect_nonscalarTrue 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 
)

Setups the simulation run directory.

Resolves parameters in the with the following priority (highest priority to lowest):

  1. local config file
  2. site config file
Parameters
category
local_pathpath 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_pathpath to the site config file (if any). Path is relative to search the warpy install directory (if given a relative path).
wxm_argsextra 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
feither a file object, filename, or None for default target path.

Member Data Documentation

◆ 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: