IPPL API Reference
Independent Parallel Particle Layer C++ API
Loading...
Searching...
No Matches
ippl::FEMMaxwellDiffusionSolver< FieldType > Class Template Reference

A solver for the electric diffusion equation given by \( \nabla \times \nabla \times E + E = f \text{ in } \Omega\) and \( n \times E = 0 \text{ on } \partial \Omega\) using the Nédélec basis functions. More...

#include <FEMMaxwellDiffusionSolver.h>

+ Inheritance diagram for ippl::FEMMaxwellDiffusionSolver< FieldType >:
+ Collaboration diagram for ippl::FEMMaxwellDiffusionSolver< FieldType >:

Public Types

using Base = Maxwell< FieldType, FieldType >
 
using MeshType = typename FieldType::Mesh_t
 
using PCGSolverAlgorithm_t = CG< FEMVector< T >, FEMVector< T >, FEMVector< T >, FEMVector< T >, FEMVector< T >, FEMVector< T >, FEMVector< T > >
 
using ElementType = std::conditional_t< Dim==2, ippl::QuadrilateralElement< T >, ippl::HexahedralElement< T > >
 
using QuadratureType = GaussJacobiQuadrature< T, 5, ElementType >
 
using NedelecType = NedelecSpace< T, Dim, 1, ElementType, QuadratureType, FieldType >
 

Public Member Functions

 FEMMaxwellDiffusionSolver (FieldType &lhs, FieldType &rhs, const FEMVector< point_t > &rhsVector)
 
void setRhs (FieldType &rhs, const FEMVector< point_t > &rhsVector)
 
void solve () override
 Solve the equation using finite element methods.
 
int getIterationCount ()
 
getResidue () const
 
Kokkos::View< point_t * > reconstructToPoints (const Kokkos::View< point_t * > &positions)
 Reconstructs function values at arbitrary points in the mesh.
 
template<typename F >
getL2Error (const F &analytic)
 Given an analytical solution computes the L2 norm error.
 
- Public Member Functions inherited from ippl::Maxwell< FieldType, FieldType >
 Maxwell ()
 
 Maxwell (FieldType &four_current, FieldType &E, FieldType &B)
 
virtual void setSources (FieldType &four_current)
 
void setEMFields (FieldType &E, FieldType &B)
 
void mergeParameters (const ParameterList &params)
 

Protected Member Functions

virtual void setDefaultParameters ()
 Sets the default values for the CG solver. Defaults are: max Iterations = 10, tolerance = 1e-13.
 

Protected Attributes

PCGSolverAlgorithm_t pcg_algo_m
 The CG Solver we use.
 
std::unique_ptr< FEMVector< T > > rhsVector_m
 FEM represenation of the rhs We use this to store the rhs b of the System Ax = b used in the Galerkin FEM scheme.
 
std::unique_ptr< FEMVector< T > > lhsVector_m
 FEM represenation of the solution vector We use this to store the solution x of the System Ax = b used in the Galerkin FEM scheme.
 
ElementType refElement_m
 the reference element we have.
 
QuadratureType quadrature_m
 The quadrature rule we use.
 
NedelecType nedelecSpace_m
 The Nedelec Space object.
 
- Protected Attributes inherited from ippl::Maxwell< FieldType, FieldType >
ParameterList params_m
 
FieldType * JN_mp
 
FieldType * En_mp
 
FieldType * Bn_mp
 

Additional Inherited Members

- Static Public Attributes inherited from ippl::Maxwell< FieldType, FieldType >
static constexpr unsigned Dim
 

Detailed Description

template<typename FieldType>
class ippl::FEMMaxwellDiffusionSolver< FieldType >

A solver for the electric diffusion equation given by \( \nabla \times \nabla \times E + E = f \text{ in } \Omega\) and \( n \times E = 0 \text{ on } \partial \Omega\) using the Nédélec basis functions.

Template Parameters
FieldTypeThe type used to represent a field on a mesh.

Member Function Documentation

◆ getIterationCount()

template<typename FieldType >
int ippl::FEMMaxwellDiffusionSolver< FieldType >::getIterationCount ( )
inline

Query how many iterations were required to obtain the solution the last time this solver was used

Returns
Iteration count of last solve

◆ getL2Error()

template<typename FieldType >
template<typename F >
T ippl::FEMMaxwellDiffusionSolver< FieldType >::getL2Error ( const F &  analytic)
inline

Given an analytical solution computes the L2 norm error.

Parameters
analyticThe analytical solution functor
Returns
error - The error ||u - analytical||_L2

◆ getResidue()

template<typename FieldType >
T ippl::FEMMaxwellDiffusionSolver< FieldType >::getResidue ( ) const
inline

Query the residue

Returns
Residue norm from last solve

◆ reconstructToPoints()

template<typename FieldType >
Kokkos::View< point_t * > ippl::FEMMaxwellDiffusionSolver< FieldType >::reconstructToPoints ( const Kokkos::View< point_t * > &  positions)
inline

Reconstructs function values at arbitrary points in the mesh.

This function can be used to retrieve the values of a solution function at arbitrary points inside of the mesh.

Note
Currently the function is able to handle both cases, where we have that positions only contains positions which are inside of local domain of this MPI rank (i.e. each rank gets its own unique position ) and where positions contains the positions of all ranks (i.e. positions is the same for all ranks). If in the future it can be guaranteed, that each rank will get its own positions then certain parts of the function implementation can be removed. Instructions for this are given in the implementation itself.
Parameters
positionsThe points at which the function should be evaluated. A Kokkos::View which stores in each element a 2D/3D point.
Returns
The function evaluated at the given points, stored inside of Kokkos::View where each element corresponts to the function value at the point described by the same element inside of positions.

◆ solve()

template<typename FieldType >
void ippl::FEMMaxwellDiffusionSolver< FieldType >::solve ( )
inlineoverridevirtual

Solve the equation using finite element methods.

Implements ippl::Maxwell< FieldType, FieldType >.

Member Data Documentation

◆ nedelecSpace_m

template<typename FieldType >
NedelecType ippl::FEMMaxwellDiffusionSolver< FieldType >::nedelecSpace_m
protected

The Nedelec Space object.

This is the representation of the Nedelec space that we have and which we use to interact with all the Nedelec stuff.


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