IPPL (Independent Parallel Particle Layer)
IPPL
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.
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

Protected Member Functions

void applyBCs ()
 Applies the boundary conditions.

Protected Attributes

SourceField::Mesh_t * mesh_mp
FieldLayout< Dim > * layout_mp
NDIndex< Dimdomain_m
Vector_t hr_m
Vector< int, Dimnr_m
scalar dt
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).

Definition at line 28 of file FDTDSolverBase.h.

Member Typedef Documentation

◆ scalar

template<typename EMField, typename SourceField, fdtd_bc boundary_conditions>
using ippl::FDTDSolverBase< EMField, SourceField, boundary_conditions >::scalar = typename EMField::value_type::value_type

Definition at line 31 of file FDTDSolverBase.h.

◆ SourceVector_t

template<typename EMField, typename SourceField, fdtd_bc boundary_conditions>
using ippl::FDTDSolverBase< EMField, SourceField, boundary_conditions >::SourceVector_t = typename SourceField::value_type

Definition at line 33 of file FDTDSolverBase.h.

◆ Vector_t

template<typename EMField, typename SourceField, fdtd_bc boundary_conditions>
using ippl::FDTDSolverBase< EMField, SourceField, boundary_conditions >::Vector_t = Vector<typename EMField::value_type::value_type, Dim>

Definition at line 32 of file FDTDSolverBase.h.

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.

Initializes the solver by setting the source and electromagnetic fields.

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

Definition at line 18 of file FDTDSolverBase.hpp.

References ippl::Maxwell< EMField, SourceField >::setEMFields(), and ippl::Maxwell< EMField, SourceField >::setSources().

Here is the call graph for this function:

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.

Definition at line 81 of file FDTDSolverBase.hpp.

References A_n, A_nm1, A_np1, nr_m, and ippl::periodic.

◆ 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.

Definition at line 101 of file FDTDSolverBase.hpp.

References A_n, A_nm1, A_np1, ippl::Maxwell< EMField, SourceField >::Bn_mp, dt, ippl::Maxwell< EMField, SourceField >::En_mp, hr_m, and ippl::Maxwell< EMField, SourceField >::JN_mp.

Referenced by solve().

Here is the caller graph for this function:

◆ 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.

Definition at line 59 of file FDTDSolverBase.h.

References dt.

◆ initialize()

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

◆ mergeParameters()

template<typename EMField, typename SourceField>
void ippl::Maxwell< EMField, SourceField >::mergeParameters ( const ParameterList & params)
inlineinherited

Merges another parameter set into the solver's parameters, overwriting existing parameters in case of conflict

Parameters
paramsParameter list with desired values

Definition at line 63 of file Maxwell.h.

◆ setEMFields()

template<typename EMField, typename SourceField>
void ippl::Maxwell< EMField, SourceField >::setEMFields ( EMField & E,
EMField & B )
inlineinherited

Set the problem LHS (electromagnetic fields)

Parameters
EThe electric field
BThe magnetic field

Definition at line 52 of file Maxwell.h.

Referenced by ippl::FDTDSolverBase< EMField, SourceField, boundary_conditions >::FDTDSolverBase(), and ippl::Maxwell< FieldType, FieldType >::Maxwell().

Here is the caller graph for this function:

◆ 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.

Definition at line 46 of file FDTDSolverBase.hpp.

◆ setSources()

template<typename EMField, typename SourceField>
virtual void ippl::Maxwell< EMField, SourceField >::setSources ( SourceField & four_current)
inlinevirtualinherited

Set the problem RHS (charge & current densities)

Parameters
four_currentThe four current field (rho, J)

Definition at line 45 of file Maxwell.h.

Referenced by ippl::FDTDSolverBase< EMField, SourceField, boundary_conditions >::FDTDSolverBase(), and ippl::Maxwell< FieldType, FieldType >::Maxwell().

Here is the caller graph for this function:

◆ 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 >.

Definition at line 32 of file FDTDSolverBase.hpp.

References evaluate_EB(), step(), and timeShift().

Here is the call graph for this function:

◆ step()

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

Steps the solver forward in time. This is a pure virtual function.

Implemented in ippl::NonStandardFDTDSolver< EMField, SourceField, boundary_conditions >, and ippl::StandardFDTDSolver< EMField, SourceField, boundary_conditions >.

Referenced by solve().

Here is the caller graph for this function:

◆ 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.

Definition at line 69 of file FDTDSolverBase.hpp.

References A_n, and A_nm1.

Referenced by solve().

Here is the caller graph for this function:

Member Data Documentation

◆ A_n

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

Definition at line 61 of file FDTDSolverBase.h.

Referenced by applyBCs(), evaluate_EB(), and timeShift().

◆ A_nm1

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

Definition at line 63 of file FDTDSolverBase.h.

Referenced by applyBCs(), evaluate_EB(), and timeShift().

◆ A_np1

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

Definition at line 62 of file FDTDSolverBase.h.

Referenced by applyBCs(), and evaluate_EB().

◆ Bn_mp

template<typename EMField, typename SourceField>
EMField* ippl::Maxwell< EMField, SourceField >::Bn_mp = nullptr
protectedinherited

◆ Dim

template<typename EMField, typename SourceField, fdtd_bc boundary_conditions>
unsigned ippl::FDTDSolverBase< EMField, SourceField, boundary_conditions >::Dim = EMField::dim
staticconstexpr

Definition at line 30 of file FDTDSolverBase.h.

◆ domain_m

template<typename EMField, typename SourceField, fdtd_bc boundary_conditions>
NDIndex<Dim> ippl::FDTDSolverBase< EMField, SourceField, boundary_conditions >::domain_m
protected

Definition at line 92 of file FDTDSolverBase.h.

◆ dt

template<typename EMField, typename SourceField, fdtd_bc boundary_conditions>
scalar ippl::FDTDSolverBase< EMField, SourceField, boundary_conditions >::dt
protected

Definition at line 96 of file FDTDSolverBase.h.

Referenced by evaluate_EB(), and getDt().

◆ En_mp

template<typename EMField, typename SourceField>
EMField* ippl::Maxwell< EMField, SourceField >::En_mp = nullptr
protectedinherited

◆ hr_m

template<typename EMField, typename SourceField, fdtd_bc boundary_conditions>
Vector_t ippl::FDTDSolverBase< EMField, SourceField, boundary_conditions >::hr_m
protected

Definition at line 93 of file FDTDSolverBase.h.

Referenced by evaluate_EB().

◆ JN_mp

template<typename EMField, typename SourceField>
SourceField* ippl::Maxwell< EMField, SourceField >::JN_mp = nullptr
protectedinherited

◆ layout_mp

template<typename EMField, typename SourceField, fdtd_bc boundary_conditions>
FieldLayout<Dim>* ippl::FDTDSolverBase< EMField, SourceField, boundary_conditions >::layout_mp
protected

Definition at line 91 of file FDTDSolverBase.h.

◆ mesh_mp

template<typename EMField, typename SourceField, fdtd_bc boundary_conditions>
SourceField::Mesh_t* ippl::FDTDSolverBase< EMField, SourceField, boundary_conditions >::mesh_mp
protected

Definition at line 90 of file FDTDSolverBase.h.

◆ nr_m

template<typename EMField, typename SourceField, fdtd_bc boundary_conditions>
Vector<int, Dim> ippl::FDTDSolverBase< EMField, SourceField, boundary_conditions >::nr_m
protected

Definition at line 95 of file FDTDSolverBase.h.

Referenced by applyBCs().

◆ params_m

template<typename EMField, typename SourceField>
ParameterList ippl::Maxwell< EMField, SourceField >::params_m
protectedinherited

Definition at line 74 of file Maxwell.h.


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