OPALX (Object Oriented Parallel Accelerator Library for Exascal) master (dc2a29eed580)
OPALX
Loading...
Searching...
No Matches
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
24#include <string>
26#include "Algorithms/PartData.h"
30
31#include "Ippl.h"
32
33enum class FieldSolverCmdType : short { NONE = -1, FFT = 0, OPEN = 1, CG = 2 };
34
35// The attributes of class FieldSolverCmd.
36namespace FIELDSOLVER {
37 enum {
38 TYPE, // The field solver name
39 BINS, // Name of BINNING definition or NONE
40 NX, // mesh size in x
41 NY, // mesh size in y
42 NZ, // mesh size in z
43 PARFFTX, // parallelized grid in x
44 PARFFTY, // parallelized grid in y
45 PARFFTZ, // parallelized grid in z
46 BCFFTX, // boundary condition in x [FFT + AMR_MG only]
47 BCFFTY, // boundary condition in y [FFT + AMR_MG only]
48 BCFFTZ, // boundary condition in z [FFT + AMR_MG only]
49 GREENSF, // holds greensfunction to be used [FFT + P3M only]
50 BBOXINCR, // how much the boundingbox is increased
51 SIZE
52 };
53}
54
55class FieldSolverCmd : public Definition {
56public:
59
60 virtual ~FieldSolverCmd();
61
63 virtual FieldSolverCmd* clone(const std::string& name);
64
66 static FieldSolverCmd* find(const std::string& name);
67
68 std::string getType();
69 std::string getBinsName() const;
71
74
76 double getNX() const;
77
79 double getNY() const;
80
82 double getNZ() const;
83
84 void setNX(double);
85
86 void setNY(double);
87
88 void setNZ(double);
89
90 double getBoxIncr() const;
91
93 virtual void update();
94
96 virtual void execute();
97
98 bool hasValidSolver();
99
100 bool hasBinningCmd() const { return getBinningCmd() != nullptr; }
101
104
105 ippl::Vector<bool, 3> getDomDec() const;
106
107 Inform& printInfo(Inform& os) const;
108
109private:
110 // Not implemented.
113
114 // Clone constructor.
115 FieldSolverCmd(const std::string& name, FieldSolverCmd* parent);
116
117 std::string fsName_m;
119};
120
128
129inline Inform& operator<<(Inform& os, const FieldSolverCmd& fs) { return fs.printInfo(os); }
130
131#endif // OPAL_FieldSolverCmd_HH
Inform & operator<<(Inform &os, const FieldSolverCmd &fs)
FieldSolverCmdType
Handler for boundary conditions per spatial dimension.
Definition BCHandler.hpp:29
The base class for all OPAL definitions.
Definition Definition.h:29
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.
BinningCmd * getBinningCmd() const
std::string fsName_m
virtual ~FieldSolverCmd()
double getNY() const
Return meshsize.
double getNZ() const
Return meshsize.
FieldSolverCmd(const FieldSolverCmd &)
std::string getBinsName() const
virtual void update()
Update the field solver data.
double getBoxIncr() const
std::string getType()
FieldSolverCmdType getFieldSolverCmdType() const
bool hasBinningCmd() const
void setNY(double)
ippl::Vector< bool, 3 > getDomDec() const
void setNX(double)
std::vector< Attribute > itsAttr
The object attributes.
Definition Object.h:210
bool getBool(const Attribute &attr)
Return logical value.
Simple FFT implementation using Cooley-Tukey algorithm.
Definition GSLFFT.h:77