OPALX (Object Oriented Parallel Accelerator Library for Exascale) MINIorX
OPALX
NullSolver.h
Go to the documentation of this file.
1//
2// Class NullSolver
3// Dummy solver which can be used when we require no action
4// to be done on our LHS in the simulation while keeping the
5// software design of the PIC framework in-tact.
6//
7
8#ifndef IPPL_NULL_SOLVER_H
9#define IPPL_NULL_SOLVER_H
10
11#include "Poisson.h"
12
13namespace ippl {
14
15 template <typename FieldLHS, typename FieldRHS>
16 class NullSolver : public Poisson<FieldLHS, FieldRHS> {
17 public:
19 using typename Base::lhs_type, typename Base::rhs_type;
20
21 // constructors
23 : Base() {}
24
26 using T = typename FieldLHS::value_type::value_type;
27 static_assert(std::is_floating_point<T>::value, "Not a floating point type");
28
29 Base::setRhs(rhs);
31 }
32
34 : Base(lhs, rhs) {}
35
36 void solve() override {
37 // Overwrite the RHS (source rho) with the solution (potential phi), which is 0
38 *(this->rhs_mp) = 0.0;
39
40 // The gradient of the potential, which is the E-field, is also 0
41 if (this->lhs_mp != nullptr) {
42 *(this->lhs_mp) = 0.0;
43 }
44 }
45 };
46
47} // namespace ippl
48
49#endif
Implementations for FFT constructor/destructor and transforms.
Definition: Archive.h:20
NullSolver(rhs_type &rhs)
Definition: NullSolver.h:25
NullSolver(lhs_type &lhs, rhs_type &rhs)
Definition: NullSolver.h:33
void solve() override
Definition: NullSolver.h:36
lhs_type * lhs_mp
Definition: Poisson.h:123
virtual void setDefaultParameters()
Definition: Poisson.h:131
FieldRHS rhs_type
Definition: Poisson.h:25
virtual void setRhs(rhs_type &rhs)
Definition: Poisson.h:96
rhs_type * rhs_mp
Definition: Poisson.h:122
FieldLHS lhs_type
Definition: Poisson.h:24