96 static void setNThreads(
int nThreads) { sNThreads = nThreads; }
100 const ParamSpaceCharge mParamGrid{mGrid3D.
getParamSC()};
101 inline static DataT sConvergenceError{1e-6};
103 inline static int sNThreads{4};
106 static DataT getGridSizePhiInv();
190 void restrict2D(
Vector& matricesCurrentCharge,
const Vector& residue,
const int tnRRow,
const int tnZColumn,
const int iphi)
const;
209 void restrict3D(
Vector& matricesCurrentCharge,
const Vector& residue,
const int tnRRow,
const int tnZColumn,
const int newPhiSlice,
const int oldPhiSlice)
const;
221 void restrictBoundary3D(
Vector& matricesCurrentCharge,
const Vector& residue,
const int tnRRow,
const int tnZColumn,
const int newPhiSlice,
const int oldPhiSlice)
const;
241 void relax3D(
Vector& matricesCurrentV,
const Vector& matricesCurrentCharge,
const int tnRRow,
const int tnZColumn,
const int iPhi,
const int symmetry,
const DataT h2,
const DataT tempRatioZ,
242 const std::vector<DataT>& coefficient1,
const std::vector<DataT>& coefficient2,
const std::vector<DataT>& coefficient3,
const std::vector<DataT>& coefficient4)
const;
261 void relax2D(
Vector& matricesCurrentV,
const Vector& matricesCurrentCharge,
const int tnRRow,
const int tnZColumn,
const DataT h2,
const DataT tempFourth,
const DataT tempRatio,
262 std::vector<DataT>& coefficient1, std::vector<DataT>& coefficient2);
279 void interp2D(
Vector& matricesCurrentV,
const Vector& matricesCurrentVC,
const int tnRRow,
const int tnZColumn,
const int iphi)
const;
298 void interp3D(
Vector& matricesCurrentV,
const Vector& matricesCurrentVC,
const int tnRRow,
const int tnZColumn,
const int newPhiSlice,
const int oldPhiSlice)
const;
312 void addInterp3D(
Vector& matricesCurrentV,
const Vector& matricesCurrentVC,
const int tnRRow,
const int tnZColumn,
const int newPhiSlice,
const int oldPhiSlice)
const;
324 void addInterp2D(
Vector& matricesCurrentV,
const Vector& matricesCurrentVC,
const int tnRRow,
const int tnZColumn,
const int tnPhi)
const;
353 void vCycle3D2D(
const int symmetry,
const int gridFrom,
const int gridTo,
const int nPre,
const int nPost,
const DataT ratioZ,
const DataT ratioPhi, std::vector<Vector>& tvArrayV,
354 std::vector<Vector>& tvCharge, std::vector<Vector>& tvResidue, std::vector<DataT>& coefficient1, std::vector<DataT>& coefficient2, std::vector<DataT>& coefficient3,
355 std::vector<DataT>& coefficient4, std::vector<DataT>& inverseCoefficient4)
const;
382 void vCycle3D(
const int symmetry,
const int gridFrom,
const int gridTo,
const int nPre,
const int nPost,
const DataT ratioZ, std::vector<Vector>& tvArrayV, std::vector<Vector>& tvCharge,
383 std::vector<Vector>& tvResidue, std::vector<DataT>& coefficient1, std::vector<DataT>& coefficient2, std::vector<DataT>& coefficient3,
384 std::vector<DataT>& coefficient4, std::vector<DataT>& inverseCoefficient4)
const;
401 void vCycle2D(
const int gridFrom,
const int gridTo,
const int nPre,
const int nPost,
const DataT gridSizeR,
const DataT ratio, std::vector<Vector>& tvArrayV,
402 std::vector<Vector>& tvCharge, std::vector<Vector>& tvResidue);
420 void wCycle2D(
const int gridFrom,
const int gridTo,
const int gamma,
const int nPre,
const int nPost,
const DataT gridSizeR,
const DataT ratio,
421 std::vector<Vector>& tvArrayV, std::vector<Vector>& tvCharge, std::vector<Vector>& tvResidue);
444 void residue3D(
Vector& residue,
const Vector& matricesCurrentV,
const Vector& matricesCurrentCharge,
const int tnRRow,
const int tnZColumn,
const int tnPhi,
const int symmetry,
const DataT ih2,
const DataT tempRatioZ,
445 const std::vector<DataT>& coefficient1,
const std::vector<DataT>& coefficient2,
const std::vector<DataT>& coefficient3,
const std::vector<DataT>& inverseCoefficient4)
const;
465 void residue2D(
Vector& residue,
const Vector& matricesCurrentV,
const Vector& matricesCurrentCharge,
const int tnRRow,
const int tnZColumn,
const DataT ih2,
const DataT inverseTempFourth,
466 const DataT tempRatio, std::vector<DataT>& coefficient1, std::vector<DataT>& coefficient2);
475 void restrictBoundary2D(
Vector& matricesCurrentCharge,
const Vector& residue,
const int tnRRow,
const int tnZColumn,
const int tnPhi)
const;
478 void calcCoefficients(
unsigned int from,
unsigned int to,
const DataT h,
const DataT tempRatioZ,
const DataT tempRatioPhi, std::vector<DataT>& coefficient1,
479 std::vector<DataT>& coefficient2, std::vector<DataT>& coefficient3, std::vector<DataT>& coefficient4)
const;
482 void calcCoefficients2D(
unsigned int from,
unsigned int to,
const DataT h, std::vector<DataT>& coefficient1, std::vector<DataT>& coefficient2)
const;
487 bool isPowerOfTwo(
const int i)
const
489 return ((
i > 0) && !(
i & (
i - 1)));