IPPL (Independent Parallel Particle Layer)
IPPL
Loading...
Searching...
No Matches
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
52 void setEMFields(EMField& E, EMField& B) {
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
Definition Archive.h:20
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
virtual void setSources(SourceField &four_current)
Definition Maxwell.h:45
static constexpr unsigned Dim
Definition Maxwell.h:22
void mergeParameters(const ParameterList &params)
Definition Maxwell.h:63