Propagator base class#

Propagator base class.

class struphy.propagators.base.Propagator[source]#

Bases: object

Base class for propagators used in StruphyModels.

Note

All Struphy propagators are subclasses of Propagator and must be added under struphy/propagators/.

class Variables[source]#

Bases: object

Define variable names and types to be updated by the propagator.

property var1#
class Options(opt1: str = ('implicit',))[source]#

Bases: OptionsBase

Template for configuration options of a propagator.

Subclasses should override this to define specific propagator options.

OptsTemplate#

alias of Literal[‘implicit’, ‘explicit’]

opt1: str = ('implicit',)#
abstract property options: Options#
abstract allocate()[source]#

Allocate all data/objects of the instance.

show_options()[source]#

Print the options of the propagator.

update_feec_variables(**new_coeffs)[source]#

Return max_diff = max(abs(new - old)) for each new_coeffs, update feec coefficients and update ghost regions.

Returns:

diffs – max_diff for all feec variables.

Return type:

dict

property init_kernels: tuple[KernelSetup, ...]#

Tuple of initialization kernel setups for evaluation at \(\boldsymbol \eta^n\) in an iterative Pusher.

property eval_kernels: tuple[KernelSetup, ...]#

Tuple of evaluation kernel setups for evaluation at \(\alpha_i \eta_{i}^{n+1,k} + (1 - \alpha_i) \eta_{i}^n\) for \(i=1, 2, 3\) and different \(\alpha_i \in [0,1]\), in an iterative Pusher.

property rank#

MPI rank, is 0 if no communicator.

property derham: Derham#

Derham spaces and projectors.

property domain: Domain#

Domain object that characterizes the mapping from the logical to the physical domain.

property mass_ops: WeightedMassOperators#

Weighted mass operators.

property basis_ops: BasisProjectionOperators#

Basis projection operators.

property projected_equil: ProjectedFluidEquilibriumWithB#

Fluid equilibrium projected on 3d Derham sequence with commuting projectors.

property time_state#

A pointer to the time variable of the dynamics (‘t’).

add_time_state(time_state)[source]#

Add a pointer to the time variable of the dynamics (‘t’).

Parameters:

time_state (ndarray) – Of size 1, holds the current physical time ‘t’.

add_init_kernel(setup: KernelSetup)[source]#

Register an evaluation at the start of each push.

The setup names the callable, its arguments, and the exact output marker columns. Its evaluation weights must all be zero.

add_eval_kernel(setup: KernelSetup)[source]#

Register an evaluation before each pusher stage/iteration.

The setup’s alpha weights determine both the evaluation state and the preceding MPI sort.