Propagator base class#
Propagator base class.
- class struphy.propagators.base.Propagator[source]#
Bases:
objectBase class for propagators used in StruphyModels.
Note
All Struphy propagators are subclasses of
Propagatorand must be added tostruphy/propagatorsin one of the modulespropagators_fields.py,propagators_markers.pyorpropagators_coupling.py. Only propagators that update both a FEEC and a PIC species go intopropagators_coupling.py.- class Variables[source]#
Bases:
objectDefine variable names and types to be updated by the propagator.
- property var1#
- class Options(opt1: str = ('implicit',))[source]#
Bases:
object- OptsTemplate#
alias of
Literal[‘implicit’, ‘explicit’]
- opt1: str = ('implicit',)#
- 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#
List of initialization kernels for evaluation at \(\boldsymbol \eta^n\) in an iterative
Pusher.
- property eval_kernels#
List of evaluation kernels 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 spaces and projectors.
- property domain#
Domain object that characterizes the mapping from the logical to the physical domain.
- property mass_ops#
Weighted mass operators.
- property basis_ops#
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(kernel, column_nr: int, comps: tuple | int, args_init: tuple)[source]#
Add an initialization kernel to self.init_kernels.
- Parameters:
kernel (pyccel func) – The kernel function.
column_nr (int) – The column index at which the result is stored in marker array.
comps (tuple | int) – None or (0) for scalar-valued function evaluation. In vector valued case, allows to specify which components to save at column_nr:column_nr + len(comps).
args_init (tuple) – The arguments for the kernel function.
- add_eval_kernel(kernel, column_nr: int, comps: tuple | int, args_eval: tuple, alpha: float | int | tuple | list = 1.0)[source]#
Add an evaluation kernel to self.eval_kernels.
- Parameters:
kernel (pyccel func) – The kernel function.
column_nr (int) – The column index at which the result is stored in marker array.
comps (tuple | int) – None for scalar-valued function evaluation. In vecotr valued case, allows to specify which components to save at column_nr:column_nr + len(comps).
args_init (tuple) – The arguments for the kernel function.
alpha (float | int | tuple | list) – Evaluations in kernel are at the weighted average alpha[i]*markers[:, i] + (1 - alpha[i])*markers[:, buffer_idx + i], for i=0,1,2. If float or int or then alpha = [alpha]*dim, where dim is the dimension of the phase space (<=6). alpha[i] must be between 0 and 1.