OPALX (Object Oriented Parallel Accelerator Library for Exascal) MINIorX
OPALX
FieldSolverCmd.h
Go to the documentation of this file.
1//
2// Class FieldSolver
3// The class for the OPAL FIELDSOLVER command.
4// A FieldSolver definition is used by most physics commands to define the
5// particle charge and the reference momentum, together with some other data.
6//
7// Copyright (c) 200x - 2022, Paul Scherrer Institut, Villigen PSI, Switzerland
8//
9// All rights reserved
10//
11// This file is part of OPAL.
12//
13// OPAL is free software: you can redistribute it and/or modify
14// it under the terms of the GNU General Public License as published by
15// the Free Software Foundation, either version 3 of the License, or
16// (at your option) any later version.
17//
18// You should have received a copy of the GNU General Public License
19// along with OPAL. If not, see <https://www.gnu.org/licenses/>.
20//
21#ifndef OPAL_FieldSolver_HH
22#define OPAL_FieldSolver_HH
23#include <string>
25#include "Algorithms/PartData.h"
27
28#include "Ippl.h"
29
30enum class FieldSolverCmdType : short { NONE = -1, FFT = 0 };
31
32// The attributes of class FieldSolverCmd.
33namespace FIELDSOLVER {
34 enum {
35 TYPE, // The field solver name
36 NX, // mesh sixe in x
37 NY, // mesh sixe in y
38 NZ, // mesh sixe in z
39 PARFFTX, // parallelized grid in x
40 PARFFTY, // parallelized grid in y
41 PARFFTZ, // parallelized grid in z
42 BCFFTX, // boundary condition in x [FFT + AMR_MG only]
43 BCFFTY, // boundary condition in y [FFT + AMR_MG only]
44 BCFFTZ, // boundary condition in z [FFT + AMR_MG only]
45 GREENSF, // holds greensfunction to be used [FFT + P3M only]
46 BBOXINCR, // how much the boundingbox is increased
48 };
49}
50
51class FieldSolverCmd : public Definition {
52public:
55
56 virtual ~FieldSolverCmd();
57
59 virtual FieldSolverCmd* clone(const std::string& name);
60
62 static FieldSolverCmd* find(const std::string& name);
63
64 std::string getType();
65
67 double getNX() const;
68
70 double getNY() const;
71
73 double getNZ() const;
74
75 void setNX(double);
76
77 void setNY(double);
78
79 void setNZ(double);
80
81 double getBoxIncr() const;
82
84 virtual void update();
85
87 virtual void execute();
88
89 bool hasValidSolver();
90
93
94 ippl::Vector<bool, 3> getDomDec() const;
95
96 Inform& printInfo(Inform& os) const;
97
98private:
99 // Not implemented.
102
103 // Clone constructor.
104 FieldSolverCmd(const std::string& name, FieldSolverCmd* parent);
105
106 std::string fsName_m;
108};
109
119
120inline Inform& operator<<(Inform& os, const FieldSolverCmd& fs) {
121 return fs.printInfo(os);
122}
123
124#endif // OPAL_FieldSolverCmd_HH
Inform & operator<<(Inform &os, const FieldSolverCmd &fs)
FieldSolverCmdType
bool getBool(const Attribute &attr)
Return logical value.
Definition(int size, const char *name, const char *help)
Constructor for exemplars.
std::vector< Attribute > itsAttr
The object attributes.
Definition Object.h:216
virtual void execute()
Execute (init) the field solver data.
virtual FieldSolverCmd * clone(const std::string &name)
Make clone.
FieldSolverCmdType fsType_m
static FieldSolverCmd * find(const std::string &name)
Find named FieldSolverCmd.
Inform & printInfo(Inform &os) const
void operator=(const FieldSolverCmd &)
void setNZ(double)
FieldSolverCmd()
Exemplar constructor.
double getNX() const
Return meshsize.
std::string fsName_m
virtual ~FieldSolverCmd()
double getNY() const
Return meshsize.
double getNZ() const
Return meshsize.
FieldSolverCmd(const FieldSolverCmd &)
virtual void update()
Update the field solver data.
double getBoxIncr() const
std::string getType()
FieldSolverCmdType getFieldSolverCmdType() const
void setNY(double)
ippl::Vector< bool, 3 > getDomDec() const
void setNX(double)