IPPL (Independent Parallel Particle Layer)
IPPL
Loading...
Searching...
No Matches
ippl::StandardFDTDSolver< EMField, SourceField, boundary_conditions > Class Template Reference

A solver for Maxwell's equations using the Finite-Difference Time-Domain (FDTD) method. More...

#include <StandardFDTDSolver.h>

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

Public Types

using scalar = typename EMField::value_type::value_type
using Vector_t
using SourceVector_t

Public Member Functions

 StandardFDTDSolver (SourceField &source, EMField &E, EMField &B)
 Constructs a StandardFDTDSolver.
virtual void step () override
 Advances the simulation by one time step.
virtual void initialize () override
 Initializes the solver.
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.
void evaluate_EB ()
 Evaluates the electric and magnetic fields.
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
EMField * En_mp
EMField * Bn_mp

Detailed Description

template<typename EMField, typename SourceField, fdtd_bc boundary_conditions = periodic>
class ippl::StandardFDTDSolver< EMField, SourceField, boundary_conditions >

A solver for Maxwell's equations using the Finite-Difference Time-Domain (FDTD) method.

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 33 of file StandardFDTDSolver.h.

Member Typedef Documentation

◆ scalar

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

Definition at line 45 of file StandardFDTDSolver.h.

◆ SourceVector_t

template<typename EMField, typename SourceField, fdtd_bc boundary_conditions = periodic>
using ippl::StandardFDTDSolver< EMField, SourceField, boundary_conditions >::SourceVector_t
Initial value:

Definition at line 49 of file StandardFDTDSolver.h.

◆ Vector_t

template<typename EMField, typename SourceField, fdtd_bc boundary_conditions = periodic>
using ippl::StandardFDTDSolver< EMField, SourceField, boundary_conditions >::Vector_t
Initial value:

Definition at line 47 of file StandardFDTDSolver.h.

Constructor & Destructor Documentation

◆ StandardFDTDSolver()

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

Constructs a StandardFDTDSolver.

Constructor for the StandardFDTDSolver class.

Parameters
sourceThe source field.
EThe electric field.
BThe magnetic field.

This constructor initializes the StandardFDTDSolver with the given source field and electromagnetic fields and initializes the solver.

Parameters
sourceThe source field.
EThe electric field.
BThe magnetic field.

Definition at line 19 of file StandardFDTDSolver.hpp.

References ippl::FDTDSolverBase< EMField, SourceField, periodic >::FDTDSolverBase(), and initialize().

Here is the call graph for this function:

Member Function Documentation

◆ applyBCs()

void ippl::FDTDSolverBase< EMField, SourceField, boundary_conditions >::applyBCs ( )
protectedinherited

Applies the boundary conditions.

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

Definition at line 88 of file FDTDSolverBase.hpp.

References A_n.

Referenced by ippl::NonStandardFDTDSolver< EMField, SourceField, boundary_conditions >::step(), and ippl::StandardFDTDSolver< EMField, SourceField, boundary_conditions >::step().

Here is the caller graph for this function:

◆ evaluate_EB()

void ippl::FDTDSolverBase< EMField, SourceField, boundary_conditions >::evaluate_EB ( )
inherited

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 77 of file FDTDSolverBase.hpp.

◆ getDt()

scalar ippl::FDTDSolverBase< EMField, SourceField, boundary_conditions >::getDt ( ) const
inlineinherited

Gets the time step size.

Returns
The time step size.

Definition at line 59 of file FDTDSolverBase.h.

◆ initialize()

template<typename EMField, typename SourceField, fdtd_bc boundary_conditions>
void ippl::StandardFDTDSolver< EMField, SourceField, boundary_conditions >::initialize ( )
overridevirtual

Initializes the solver.

This function initializes the solver by setting up the layout, mesh, and fields. It retrieves the mesh spacing, domain, and mesh size, and initializes the fields to zero.

Implements ippl::FDTDSolverBase< EMField, SourceField, periodic >.

Definition at line 95 of file StandardFDTDSolver.hpp.

References ippl::FDTDSolverBase< EMField, SourceField, periodic >::A_n, ippl::FDTDSolverBase< EMField, SourceField, periodic >::A_nm1, ippl::FDTDSolverBase< EMField, SourceField, periodic >::A_np1, Dim, ippl::FDTDSolverBase< EMField, SourceField, periodic >::domain_m, ippl::FDTDSolverBase< EMField, SourceField, periodic >::dt, ippl::FDTDSolverBase< EMField, SourceField, periodic >::hr_m, ippl::FDTDSolverBase< EMField, SourceField, periodic >::JN_mp, ippl::FDTDSolverBase< EMField, SourceField, periodic >::layout_mp, ippl::FDTDSolverBase< EMField, SourceField, periodic >::mesh_mp, ippl::FDTDSolverBase< EMField, SourceField, periodic >::nr_m, ippl::periodic, and ippl::FDTDSolverBase< EMField, SourceField, periodic >::setPeriodicBoundaryConditions().

Referenced by StandardFDTDSolver().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mergeParameters()

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()

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.

◆ setPeriodicBoundaryConditions()

void ippl::FDTDSolverBase< EMField, SourceField, boundary_conditions >::setPeriodicBoundaryConditions ( )
inherited

Sets periodic boundary conditions.

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

Definition at line 52 of file FDTDSolverBase.hpp.

Referenced by ippl::NonStandardFDTDSolver< EMField, SourceField, boundary_conditions >::initialize(), and ippl::StandardFDTDSolver< EMField, SourceField, boundary_conditions >::initialize().

Here is the caller graph for this function:

◆ setSources()

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.

◆ solve()

void ippl::FDTDSolverBase< EMField, SourceField, boundary_conditions >::solve ( )
overridevirtualinherited

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 47 of file FDTDSolverBase.hpp.

◆ step()

template<typename EMField, typename SourceField, fdtd_bc boundary_conditions>
void ippl::StandardFDTDSolver< EMField, SourceField, boundary_conditions >::step ( )
overridevirtual

Advances the simulation by one time step.

This function updates the fields by one time step using the FDTD method. It calculates the new field values based on the current and previous field values, as well as the source field. The boundary conditions are applied after the update.

Implements ippl::FDTDSolverBase< EMField, SourceField, periodic >.

Definition at line 33 of file StandardFDTDSolver.hpp.

References ippl::FDTDSolverBase< EMField, SourceField, periodic >::A_n, ippl::FDTDSolverBase< EMField, SourceField, periodic >::A_nm1, ippl::FDTDSolverBase< EMField, SourceField, periodic >::A_np1, ippl::absorbing, ippl::FDTDSolverBase< EMField, SourceField, periodic >::applyBCs(), ippl::FDTDSolverBase< EMField, SourceField, periodic >::dt, ippl::getRangePolicy(), ippl::FDTDSolverBase< EMField, SourceField, periodic >::hr_m, ippl::Maxwell< EMField, SourceField >::JN_mp, ippl::FDTDSolverBase< EMField, SourceField, periodic >::layout_mp, and ippl::FDTDSolverBase< EMField, SourceField, periodic >::nr_m.

Here is the call graph for this function:

◆ timeShift()

void ippl::FDTDSolverBase< EMField, SourceField, boundary_conditions >::timeShift ( )
inherited

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 68 of file FDTDSolverBase.hpp.

Member Data Documentation

◆ A_n

◆ A_nm1

◆ A_np1

◆ Bn_mp

EMField* ippl::Maxwell< EMField, SourceField >::Bn_mp
protectedinherited

Definition at line 81 of file Maxwell.h.

◆ Dim

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

Definition at line 44 of file StandardFDTDSolver.h.

Referenced by initialize().

◆ domain_m

◆ dt

◆ En_mp

EMField* ippl::Maxwell< EMField, SourceField >::En_mp
protectedinherited

Definition at line 80 of file Maxwell.h.

◆ hr_m

◆ JN_mp

◆ layout_mp

◆ mesh_mp

SourceField::Mesh_t* ippl::FDTDSolverBase< EMField, SourceField, boundary_conditions >::mesh_mp
protectedinherited

◆ nr_m

◆ params_m

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: