OPALX (Object Oriented Parallel Accelerator Library for Exascale) MINIorX
OPALX
Maxwell.h
Go to the documentation of this file.
1//
2// Class Maxwell
3// Base class for solvers for Maxwell's equations
4//
5
6#ifndef IPPL_MAXWELL_H
7#define IPPL_MAXWELL_H
8
9#include "Types/Vector.h"
10
11#include "Field/Field.h"
12
16
17namespace ippl {
18
19 template <typename EMField, typename SourceField>
20 class Maxwell {
21 public:
22 constexpr static unsigned Dim = EMField::dim;
23
28
36 Maxwell(SourceField& four_current, EMField& E, EMField& B) {
37 setSources(four_current);
38 setEMFields(E, B);
39 }
40
45 virtual void setSources(SourceField& four_current) { JN_mp = &four_current; }
46
53 En_mp = &E;
54 Bn_mp = &B;
55 }
56
57
63 void mergeParameters(const ParameterList& params) { params_m.merge(params); }
64
68 virtual void solve() = 0;
69
70 virtual ~Maxwell() {}
71
72 protected:
73 // Parameters
75
76 // Field for four-current (rho, J)
77 SourceField* JN_mp = nullptr;
78
79 // E and B fields
80 EMField* En_mp = nullptr;
81 EMField* Bn_mp = nullptr;
82 };
83} // namespace ippl
84
85#endif
Implementations for FFT constructor/destructor and transforms.
Definition: Archive.h:20
Abstract base class for electromagnetic fields.
Definition: EMField.h:188
ParameterList params_m
Definition: Maxwell.h:74
virtual void solve()=0
virtual ~Maxwell()
Definition: Maxwell.h:70
Maxwell(SourceField &four_current, EMField &E, EMField &B)
Definition: Maxwell.h:36
void setEMFields(EMField &E, EMField &B)
Definition: Maxwell.h:52
EMField * En_mp
Definition: Maxwell.h:80
EMField * Bn_mp
Definition: Maxwell.h:81
virtual void setSources(SourceField &four_current)
Definition: Maxwell.h:45
static constexpr unsigned Dim
Definition: Maxwell.h:22
SourceField * JN_mp
Definition: Maxwell.h:77
void mergeParameters(const ParameterList &params)
Definition: Maxwell.h:63
void merge(const ParameterList &p) noexcept
Definition: ParameterList.h:86