IPPL API Reference
Independent Parallel Particle Layer C++ API
Loading...
Searching...
No Matches
ippl::FDTDSolverBase< EMField, SourceField, boundary_conditions > Class Template Referenceabstract

Base class for FDTD solvers in the ippl library. More...

#include <FDTDSolverBase.h>

+ Inheritance diagram for ippl::FDTDSolverBase< EMField, SourceField, boundary_conditions >:
+ Collaboration diagram for ippl::FDTDSolverBase< EMField, SourceField, boundary_conditions >:

Public Types

using scalar = typename EMField::value_type::value_type
 
using Vector_t = Vector< typename EMField::value_type::value_type, Dim >
 
using SourceVector_t = typename SourceField::value_type
 

Public Member Functions

 FDTDSolverBase (SourceField &source, EMField &E, EMField &B)
 Constructor for the FDTDSolverBase class.
 
void solve () override
 Solves the FDTD equations.
 
void setPeriodicBoundaryConditions ()
 Sets periodic boundary conditions.
 
scalar getDt () const
 Gets the time step size.
 
void timeShift ()
 Shifts the saved fields in time.
 
virtual void step ()=0
 Steps the solver forward in time. This is a pure virtual function.
 
void evaluate_EB ()
 Evaluates the electric and magnetic fields.
 
virtual void initialize ()=0
 Initializes the solver. This is a pure virtual function.
 
- Public Member Functions inherited from ippl::Maxwell< EMField, SourceField >
 Maxwell ()
 
 Maxwell (SourceField &four_current, EMField &E, EMField &B)
 
virtual void setSources (SourceField &four_current)
 
void setEMFields (EMField &E, EMField &B)
 
void mergeParameters (const ParameterList &params)
 

Public Attributes

SourceField A_n
 
SourceField A_np1
 
SourceField A_nm1
 

Static Public Attributes

static constexpr unsigned Dim = EMField::dim
 
- Static Public Attributes inherited from ippl::Maxwell< EMField, SourceField >
static constexpr unsigned Dim = EMField::dim
 

Protected Member Functions

void applyBCs ()
 Applies the boundary conditions.
 

Protected Attributes

SourceField::Mesh_t * mesh_mp
 
FieldLayout< Dim > * layout_mp
 
NDIndex< Dim > domain_m
 
Vector_t hr_m
 
Vector< int, Dim > nr_m
 
scalar dt
 
- Protected Attributes inherited from ippl::Maxwell< EMField, SourceField >
ParameterList params_m
 
SourceField * JN_mp = nullptr
 
EMField * En_mp = nullptr
 
EMField * Bn_mp = nullptr
 

Detailed Description

template<typename EMField, typename SourceField, fdtd_bc boundary_conditions>
class ippl::FDTDSolverBase< EMField, SourceField, boundary_conditions >

Base class for FDTD solvers in the ippl library.

Template Parameters
EMFieldThe type representing the electromagnetic field.
SourceFieldThe type representing the source field.
boundary_conditionsThe boundary conditions to be applied (default is periodic).

Constructor & Destructor Documentation

◆ FDTDSolverBase()

template<typename EMField , typename SourceField , fdtd_bc boundary_conditions>
ippl::FDTDSolverBase< EMField, SourceField, boundary_conditions >::FDTDSolverBase ( SourceField &  source,
EMField &  E,
EMField &  B 
)

Constructor for the FDTDSolverBase class.

Parameters
sourceReference to the source field.
EReference to the electric field.
BReference to the magnetic field.

Member Function Documentation

◆ applyBCs()

template<typename EMField , typename SourceField , fdtd_bc boundary_conditions>
void ippl::FDTDSolverBase< EMField, SourceField, boundary_conditions >::applyBCs ( )
protected

Applies the boundary conditions.

Applies the specified boundary conditions (periodic or absorbing) to the fields.

◆ evaluate_EB()

template<typename EMField , typename SourceField , fdtd_bc boundary_conditions>
void ippl::FDTDSolverBase< EMField, SourceField, boundary_conditions >::evaluate_EB ( )

Evaluates the electric and magnetic fields.

Computes the electric and magnetic fields based on the current, previous, and next time step field values, as well as the source field.

◆ getDt()

template<typename EMField , typename SourceField , fdtd_bc boundary_conditions>
scalar ippl::FDTDSolverBase< EMField, SourceField, boundary_conditions >::getDt ( ) const
inline

Gets the time step size.

Returns
The time step size.

◆ initialize()

template<typename EMField , typename SourceField , fdtd_bc boundary_conditions>
virtual void ippl::FDTDSolverBase< EMField, SourceField, boundary_conditions >::initialize ( )
pure virtual

◆ setPeriodicBoundaryConditions()

template<typename EMField , typename SourceField , fdtd_bc boundary_conditions>
void ippl::FDTDSolverBase< EMField, SourceField, boundary_conditions >::setPeriodicBoundaryConditions ( )

Sets periodic boundary conditions.

Configures the solver to use periodic boundary conditions by setting the appropriate boundary conditions for the fields.

◆ solve()

template<typename EMField , typename SourceField , fdtd_bc boundary_conditions>
void ippl::FDTDSolverBase< EMField, SourceField, boundary_conditions >::solve ( )
overridevirtual

Solves the FDTD equations.

Advances the simulation by one time step, shifts the time for the fields, and evaluates the electric and magnetic fields at the new time.

Implements ippl::Maxwell< EMField, SourceField >.

◆ step()

template<typename EMField , typename SourceField , fdtd_bc boundary_conditions>
virtual void ippl::FDTDSolverBase< EMField, SourceField, boundary_conditions >::step ( )
pure virtual

◆ timeShift()

template<typename EMField , typename SourceField , fdtd_bc boundary_conditions>
void ippl::FDTDSolverBase< EMField, SourceField, boundary_conditions >::timeShift ( )

Shifts the saved fields in time.

Copies the current field values to the previous time step field and the next time step field values to the current field.


The documentation for this class was generated from the following files: