OPALX (Object Oriented Parallel Accelerator Library for Exascale) 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"
28
29#include "Ippl.h"
30
31enum class FieldSolverCmdType : short { NONE = -1, FFT = 0, OPEN = 1 };
32
33// The attributes of class FieldSolverCmd.
34namespace FIELDSOLVER {
35 enum {
36 TYPE, // The field solver name
37 NX, // mesh sixe in x
38 NY, // mesh sixe in y
39 NZ, // mesh sixe in z
40 PARFFTX, // parallelized grid in x
41 PARFFTY, // parallelized grid in y
42 PARFFTZ, // parallelized grid in z
43 BCFFTX, // boundary condition in x [FFT + AMR_MG only]
44 BCFFTY, // boundary condition in y [FFT + AMR_MG only]
45 BCFFTZ, // boundary condition in z [FFT + AMR_MG only]
46 GREENSF, // holds greensfunction to be used [FFT + P3M only]
47 BBOXINCR, // how much the boundingbox is increased
48 SIZE
49 };
50}
51
52class FieldSolverCmd : public Definition {
53public:
56
57 virtual ~FieldSolverCmd();
58
60 virtual FieldSolverCmd* clone(const std::string& name);
61
63 static FieldSolverCmd* find(const std::string& name);
64
65 std::string getType();
66
69
71 double getNX() const;
72
74 double getNY() const;
75
77 double getNZ() const;
78
79 void setNX(double);
80
81 void setNY(double);
82
83 void setNZ(double);
84
85 double getBoxIncr() const;
86
88 virtual void update();
89
91 virtual void execute();
92
93 bool hasValidSolver();
94
97
99
100 Inform& printInfo(Inform& os) const;
101
102private:
103 // Not implemented.
106
107 // Clone constructor.
108 FieldSolverCmd(const std::string& name, FieldSolverCmd* parent);
109
110 std::string fsName_m;
112};
113
115 return fsType_m;
116}
122}
123
124inline Inform& operator<<(Inform& os, const FieldSolverCmd& fs) {
125 return fs.printInfo(os);
126}
127
128#endif // OPAL_FieldSolverCmd_HH
Inform & operator<<(Inform &os, const FieldSolverCmd &fs)
FieldSolverCmdType
bool getBool(const Attribute &attr)
Return logical value.
Definition: Attributes.cpp:100
The base class for all OPAL definitions.
Definition: Definition.h:30
std::vector< Attribute > itsAttr
The object attributes.
Definition: Object.h:216
Handler for boundary conditions per spatial dimension.
Definition: BCHandler.hpp:26
virtual void execute()
Execute (init) the field solver data.
BCHandler< 3 > constructBCHandler() const
Returns solver boundary conditions handler object.
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)
void setFieldSolverCmdType()
ippl::Vector< bool, 3 > getDomDec() const
void setNX(double)
Definition: Inform.h:40