seidart.routines.prjrun module

seidart.routines.prjrun.cpml_parameters(sig_max: float, alpha_max: float, kappa_max: float, distance, N: int, dt: float)
seidart.routines.prjrun.cpmlcompute(modelclass: Model, domain: Domain, direction: str, half: bool = False) None

Computes CPML parameters for a given direction and updates model/domain.

Parameters:
  • modelclass (Model) – The model class instance to update.

  • domain (Domain) – The domain class instance to update.

  • direction (str) – Direction to compute CPML (‘x’, ‘y’, or ‘z’).

  • half (bool) – Flag to compute half CPML parameters. Defaults to False.

seidart.routines.prjrun.domain_initialization(prjfile: str) Tuple[Domain, Material, Model, Model]

Initializes the simulation domain and materials, and prepares seismic and electromagnetic models based on a project file.

This function reads simulation parameters from a specified project file and uses them to initialize the domain, material properties, and two models (seismic and electromagnetic). It performs checks to ensure all necessary parameters are specified and modifies the material list by removing RGB values.

Parameters:

prjfile (str) – The path to the project file containing initialization parameters for the domain, materials, and models.

Returns:

A tuple containing initialized Domain, Material, and two Model instances (seismic and electromagnetic).

Return type:

Tuple[Domain, Material, Model, Model]

Each Model instance is checked to ensure required parameters are provided, and the material list is pruned to exclude RGB values before final checks are performed.

seidart.routines.prjrun.ecpml_parameters2(domain, modelclass, dist, direction)

Compute the boundary values for variable permittivity and conductivity values at the boundary.

seidart.routines.prjrun.ecpml_parameters3(domain, modelclass, dist, direction)
seidart.routines.prjrun.main(prjfile: str, model_type: str, append_to_prjfile: bool, pwd: str, double_precision: bool, use_complex_equations: bool) None

Main function orchestrating domain initialization, status checking, and model execution based on provided command line arguments.

Initializes the simulation domain and material properties from a project file, checks the status of seismic and electromagnetic models, and runs the specified model(s) with configured settings. The function allows for re-computation and appending of material coefficients to the project file and supports both seismic and electromagnetic model types with options for precision and complex equations.

Parameters:
  • prjfile (str) – The path to the project file containing simulation settings.

  • model_type (str) – Specifies the type of model to run (‘s’ for seismic, ‘e’ for electromagnetic).

  • append_to_prjfile (bool) – Flag indicating whether to append computed coefficients to the project file.

  • pwd (str) – The working directory where the project file is located.

  • double_precision (bool) – Flag indicating whether to use double precision for simulation outputs.

  • use_complex_equations (bool) – Flag indicating whether to use complex equations for electromagnetic simulations.

seidart.routines.prjrun.runelectromag(modelclass: Model, material: Material, domain: Domain, use_complex_equations: bool = False, single_precision: bool = True) None

Runs the electromagnetic model with options for complex equations and precision.

Parameters:
  • modelclass (Model) – The electromagnetic model class instance.

  • material (Material) – The material class instance.

  • domain (Domain) – The domain class instance.

  • use_complex_equations (bool) – Flag to use complex equations in modeling.

  • single_precision (bool) – Flag for single precision data processing.

seidart.routines.prjrun.runseismic(modelclass: Model, material: Material, domain: Domain, single_precision: bool = True) None

Runs the seismic model using the initialized modelclass, material, and domain.

Parameters:
  • modelclass (Model) – The seismic model class instance.

  • material (Material) – The material class instance.

  • domain (Domain) – The domain class instance.

  • single_precision (bool) – Flag for single precision data processing.

seidart.routines.prjrun.status_check(modelclass: Model, material: Material, domain: Domain, prjfile: str, append_to_prjfile: bool = True) None

Checks the status of the modeling classes and appends coefficients to the project file if necessary.

Parameters:
  • modelclass (Union[Model, None]) – The model class to check.

  • material (Material) – The material class instance.

  • domain (Domain) – The domain class instance.

  • prjfile (str) – Path to the project file.

  • append_to_prjfile (bool) – Flag to append coefficients to the project file. Defaults to True.