Python API
Math
Spherical harmonics
Compute the tesseral spherical harmonics. |
Point
General 3-element vector structure. |
Function wrappers
Vector spatial function. |
Angular quadrature
Quadrature points
Angular quadrature point. |
Base class
Angular quadrature. |
Product quadratures
Product quadrature. |
|
Curvilinear product quadrature. |
Gauss-Legendre quadrature for 1D, slab geometry. |
|
Gauss-Legendre-Chebyshev quadrature for 2D, XY geometry. |
|
Gauss-Legendre-Chebyshev quadrature for 3D, XYZ geometry. |
Gauss-Legendre-Chebyshev product quadrature for 2D, RZ geometry. |
Triangular quadrature
Triangular quadrature base class. |
Triangular Gauss-Legendre-Chebyshev quadrature for 2D, XY geometry. |
|
Triangular Gauss-Legendre-Chebyshev quadrature for 3D, XYZ geometry. |
Lebedev quadrature
Lebedev quadrature for 2D, XY geometry. |
|
Lebedev quadrature for 3D, XYZ geometry. |
Simplified LDFES quadrature
Piecewise-linear finite element quadrature using quadrilaterals. |
|
Two-dimensional variant of the piecewise-linear finite element quadrature. |
Field functions
Base class
Field function. |
Grid-based
Field function grid based. |
Interpolation
Field functions returned by solver methods such as
GetScalarFluxFieldFunction(...), CreateFieldFunction(...), and
GetAngularFieldFunctionList(...) are snapshots of the solver state at the
time of the call. To obtain field functions from a newer solver state, call the
corresponding solver method again.
Field-function interpolators are configured by assigning a field function and
any geometry- or operation-specific settings, then calling Execute().
Execute() rebuilds any required internal interpolation state each time it is
called; no separate initialization step is required.
Base class for field-function interpolation objects. |
|
Interpolate the field function at a point. |
|
Line based interpolation function. |
|
Volume based interpolation function. |
Mesh
Mesh
Mesh continuum. |
Surface mesh
Surface mesh. |
Mesh generator
Generic mesh generator. |
Extruded mesh generator. |
|
Orthogonal mesh generator. |
|
From file mesh generator. |
|
Split file mesh generator. |
|
Distributed mesh generator. |
Graph partitioner
Generic graph partitioner. |
Koch, Baker and Alcouffe based partitioning. |
|
Basic linear partitioning. |
|
PETSc based partitioning. |
Logical volume
Base class
Generic logical volume. |
Logical volume types
Boolean logical volume. |
|
Right circular cylinder logical volume. |
|
Rectangular parallel piped logical volume. |
|
Spherical logical volume. |
|
Surface mesh logical volume. |
Response evaluator
Response evaluator by folding sources against adjoint solutions. |
Source
Point sources, defined by its location and a group-wise strength vector. |
|
Multi-group isotropic volumetric sources. |
Cross section
Multi-group cross section. |
Problem
Note
Forward/adjoint mode transitions are destructive by design. In Python there are three valid ways to set mode:
Set
options={'adjoint': ...}in the problem constructor.Call
problem.SetOptions(adjoint=...).Call
problem.SetAdjoint(...)(low-level equivalent).
A mode transition triggers:
reinitializes material mode (forward vs adjoint),
clears point and volumetric sources,
clears boundary conditions,
zeros scalar and angular flux state.
The block-id to cross-section map is preserved. After switching mode, reapply the desired driving terms (sources and boundaries) before solving.
SetOptions is additive: only explicitly supplied options are updated.
If adjoint is omitted in a SetOptions call, the current mode is unchanged.
Adjoint mode is applied to the mapped MultiGroupXS objects themselves.
If the same cross-section object is shared across multiple problems, toggling
adjoint mode in one problem affects all problems using that object.
Base class
Base class for all problems. |
|
Base class for all linear Boltzmann problems. |
Discrete ordinates problem
Note
Steady-state <-> transient mode transitions are non-destructive for problem setup.
Calling SetTimeDependentMode() or SetSteadyStateMode() preserves:
mesh and discretization,
block-id to cross-section mapping,
boundary conditions and source definitions,
scalar flux moments (
phi_new/phi_oldstate).
For SetTimeDependentMode(), OpenSn needs angular fluxes
(psi) for the transient RHS time term. That means
save_angular_flux=True must already be enabled on the problem.
For SetSteadyStateMode(), transient-only internals are reset, but the
configured angular-flux storage setting is otherwise unchanged.
Base class for discrete ordinates problems in Cartesian geometry. |
Discrete ordinates curvilinear problem
Base class for discrete ordinates problems in curvilinear geometry. |
Solvers
Solver base class
Base class for all solvers. |
Steady state source solver
Steady state solver. |
Transient solver
Transient solver. |
Non-linear k-eigen
Non-linear k-eigenvalue solver. |
Power iteration solver
Power iteration k-eigenvalue solver. |
Acceleration methods
Discrete ordinates k-eigen acceleration base class
Base class for discrete ordinates k-eigenvalue acceleration methods. |
Discrete ordinates k-eigen acceleration
Construct an SCDSA accelerator for the power iteration k-eigenvalue solver. |
|
Construct an SMM accelerator for the power iteration k-eigenvalue solver. |
Settings
Important
Functions in this section are only available to the module mode. For the
console mode, refer to opensn --help for more information.
Logs
Set verbosity level (0 to 3). |
|
Enable/disable color output. |
|
Allow PETSc error handler. |
Caliper configuration
Set configuration to the Caliper manager. |
|
Start the Caliper manager and mark the program begin. |
Argument vector
Overwrite OpenSn settings using |
|
Finalize OpenSn context. |