IPPL API Reference
Independent Parallel Particle Layer C++ API
Loading...
Searching...
No Matches
NullSolver.h
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
13
namespace
ippl
{
14
15
template
<
typename
FieldLHS,
typename
FieldRHS>
16
class
NullSolver
:
public
Poisson
<FieldLHS, FieldRHS> {
17
public
:
18
using
Base
=
Poisson<FieldLHS, FieldRHS>
;
19
using
typename Base::lhs_type,
typename
Base::rhs_type;
20
21
// constructors
22
NullSolver
()
23
:
Base
() {}
24
25
NullSolver
(rhs_type& rhs) {
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);
30
this->
setDefaultParameters
();
31
}
32
33
NullSolver
(lhs_type& lhs, rhs_type& rhs)
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
ippl::NullSolver
Definition
NullSolver.h:16
ippl::NullSolver::solve
void solve() override
Definition
NullSolver.h:36
ippl::Poisson
Definition
Poisson.h:16
ippl::Poisson::setDefaultParameters
virtual void setDefaultParameters()
Definition
Poisson.h:131
ippl::Poisson::setRhs
virtual void setRhs(rhs_type &rhs)
Definition
Poisson.h:96
ippl
Definition
Archive.h:20
ippl-src
src
PoissonSolvers
NullSolver.h
Generated by
1.9.8