IPPL (Independent Parallel Particle Layer)
IPPL
Loading...
Searching...
No Matches
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
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
T
double T
Definition
BumponTailInstability.cpp:23
Poisson.h
ippl
Definition
Archive.h:20
ippl::NullSolver< VField_t< T, Dim >, Field_t< Dim > >::Base
Poisson< VField_t< T, Dim >, Field_t< Dim > > Base
Definition
NullSolver.h:18
ippl::NullSolver::NullSolver
NullSolver()
Definition
NullSolver.h:22
ippl::NullSolver< VField_t< T, Dim >, Field_t< Dim > >::rhs_type
Field_t< Dim > rhs_type
ippl::NullSolver::NullSolver
NullSolver(rhs_type &rhs)
Definition
NullSolver.h:25
ippl::NullSolver::NullSolver
NullSolver(lhs_type &lhs, rhs_type &rhs)
Definition
NullSolver.h:33
ippl::NullSolver::solve
void solve() override
Definition
NullSolver.h:36
ippl::NullSolver< VField_t< T, Dim >, Field_t< Dim > >::lhs_type
VField_t< T, Dim > lhs_type
ippl::Poisson::Poisson
Poisson()
Definition
Poisson.h:45
ippl::NullSolver< VField_t< T, Dim >, Field_t< Dim > >::lhs_mp
lhs_type * lhs_mp
Definition
Poisson.h:123
ippl::Poisson::setDefaultParameters
virtual void setDefaultParameters()
Definition
Poisson.h:131
ippl::Poisson::rhs_type
FieldRHS rhs_type
Definition
Poisson.h:25
ippl::Poisson::setRhs
virtual void setRhs(rhs_type &rhs)
Definition
Poisson.h:96
ippl::NullSolver< VField_t< T, Dim >, Field_t< Dim > >::rhs_mp
rhs_type * rhs_mp
Definition
Poisson.h:122
ippl::Poisson::lhs_type
FieldLHS lhs_type
Definition
Poisson.h:24