OPAL (Object Oriented Parallel Accelerator Library)
2021.1.99
OPAL
|
#include <MGPoissonSolver.h>
Public Types | |
typedef Tpetra::Vector | TpetraVector_t |
typedef Tpetra::MultiVector | TpetraMultiVector_t |
typedef Tpetra::Map | TpetraMap_t |
typedef Tpetra::Vector ::scalar_type | TpetraScalar_t |
typedef Tpetra::Vector ::global_ordinal_type | TpetraGlobalOrdinal_t |
typedef Tpetra::Operator | TpetraOperator_t |
typedef MueLu::TpetraOperator | MueLuTpetraOperator_t |
typedef Tpetra::CrsMatrix | TpetraCrsMatrix_t |
typedef Teuchos::MpiComm< int > | Comm_t |
typedef Teuchos::ParameterList | ParameterList_t |
typedef Belos::SolverManager< TpetraScalar_t, TpetraMultiVector_t, TpetraOperator_t > | SolverManager_t |
typedef Belos::LinearProblem< TpetraScalar_t, TpetraMultiVector_t, TpetraOperator_t > | LinearProblem_t |
Public Member Functions | |
MGPoissonSolver (PartBunch *beam, Mesh_t *mesh, FieldLayout_t *fl, std::vector< BoundaryGeometry * > geometries, std::string itsolver, std::string interpl, double tol, int maxiters, std::string precmode) | |
~MGPoissonSolver () | |
void | computePotential (Field_t &rho, Vector_t hr) |
void | computePotential (Field_t &rho, Vector_t hr, double zshift) |
void | setGeometry (std::vector< BoundaryGeometry * > geometries) |
set a geometry More... | |
double | getXRangeMin (unsigned short) |
double | getXRangeMax (unsigned short) |
double | getYRangeMin (unsigned short) |
double | getYRangeMax (unsigned short) |
double | getZRangeMin (unsigned short) |
double | getZRangeMax (unsigned short) |
void | test (PartBunchBase< double, 3 > *) |
void | printLoadBalanceStats () |
useful load balance information More... | |
void | extrapolateLHS () |
void | resizeMesh (Vector_t &origin, Vector_t &hr, const Vector_t &rmin, const Vector_t &rmax, double dh) |
Inform & | print (Inform &os) const |
Public Member Functions inherited from PoissonSolver | |
virtual void | solve (AmrScalarFieldContainer_t &, AmrScalarFieldContainer_t &, AmrVectorFieldContainer_t &, unsigned short, unsigned short, bool=true) |
virtual void | hasToRegrid () |
virtual | ~PoissonSolver () |
Protected Member Functions | |
void | setupBelosList () |
Setup the parameters for the Belos iterative solver. More... | |
void | setupMueLuList () |
Setup the parameters for the SAAMG preconditioner. More... | |
Private Member Functions | |
void | deletePtr () |
void | computeMap (NDIndex< 3 > localId) |
recomputes the map More... | |
void | IPPLToMap3D (NDIndex< 3 > localId) |
void | ComputeStencil (Vector_t hr, Teuchos::RCP< TpetraVector_t > RHS) |
Private Attributes | |
bool | isMatrixfilled_m |
bool | useLeftPrec_m |
BoundaryGeometry * | currentGeometry |
holding the currently active geometry More... | |
std::vector< BoundaryGeometry * > | geometries_m |
container for multiple geometries More... | |
int | repartFreq_m |
bool | verbose_m |
flag specifying if we are verbose More... | |
double | tol_m |
tolerance for the iterative solver More... | |
int | maxiters_m |
maximal number of iterations for the iterative solver More... | |
int | precmode_m |
preconditioner mode More... | |
int | numBlocks_m |
maximum number of blocks in Krylov space More... | |
int | recycleBlocks_m |
number of vectors in recycle space More... | |
std::unique_ptr< IrregularDomain > | bp_m |
structure that holds boundary points More... | |
Teuchos::RCP< TpetraVector_t > | RHS |
right hand side of our problem More... | |
Teuchos::RCP< TpetraVector_t > | LHS |
left hand side of the linear system of equations we solve More... | |
Teuchos::RCP< TpetraCrsMatrix_t > | A |
matrix used in the linear system of equations More... | |
Teuchos::RCP< TpetraMap_t > | map_p |
Map holding the processor distribution of data. More... | |
Teuchos::RCP< const Comm_t > | comm_mp |
communicator used by Trilinos More... | |
unsigned int | nLHS_m |
last N LHS's for extrapolating the new LHS as starting vector More... | |
Teuchos::RCP< TpetraMultiVector_t > | P_mp |
std::deque< TpetraVector_t > | OldLHS |
Teuchos::RCP< LinearProblem_t > | problem_mp |
Teuchos::RCP< SolverManager_t > | solver_mp |
Teuchos::RCP< MueLuTpetraOperator_t > | prec_mp |
MueLu preconditioner object. More... | |
Teuchos::ParameterList | MueLuList_m |
parameter list for the MueLu solver More... | |
Teuchos::ParameterList | belosList |
parameter list for the iterative solver (Belos) More... | |
PartBunch * | itsBunch_m |
PartBunch object. More... | |
Mesh_t * | mesh_m |
FieldLayout_t * | layout_m |
NDIndex< 3 > | domain_m |
Vector_t | hr_m |
mesh spacings in each direction More... | |
Vektor< int, 3 > | nr_m |
current number of mesh points in each direction More... | |
Vektor< int, 3 > | orig_nr_m |
global number of mesh points in each direction More... | |
IpplTimings::TimerRef | FunctionTimer1_m |
IpplTimings::TimerRef | FunctionTimer2_m |
IpplTimings::TimerRef | FunctionTimer3_m |
IpplTimings::TimerRef | FunctionTimer4_m |
IpplTimings::TimerRef | FunctionTimer5_m |
IpplTimings::TimerRef | FunctionTimer6_m |
IpplTimings::TimerRef | FunctionTimer7_m |
IpplTimings::TimerRef | FunctionTimer8_m |
Additional Inherited Members | |
Protected Types inherited from PoissonSolver | |
typedef Field< int, 3, Mesh_t, Center_t > | IField_t |
typedef Field< std::complex< double >, 3, Mesh_t, Center_t > | CxField_t |
Definition at line 73 of file MGPoissonSolver.h.
typedef Teuchos::MpiComm<int> MGPoissonSolver::Comm_t |
Definition at line 84 of file MGPoissonSolver.h.
typedef Belos::LinearProblem<TpetraScalar_t, TpetraMultiVector_t, TpetraOperator_t> MGPoissonSolver::LinearProblem_t |
Definition at line 94 of file MGPoissonSolver.h.
typedef MueLu::TpetraOperator MGPoissonSolver::MueLuTpetraOperator_t |
Definition at line 82 of file MGPoissonSolver.h.
typedef Teuchos::ParameterList MGPoissonSolver::ParameterList_t |
Definition at line 86 of file MGPoissonSolver.h.
typedef Belos::SolverManager<TpetraScalar_t, TpetraMultiVector_t, TpetraOperator_t> MGPoissonSolver::SolverManager_t |
Definition at line 90 of file MGPoissonSolver.h.
typedef Tpetra::CrsMatrix MGPoissonSolver::TpetraCrsMatrix_t |
Definition at line 83 of file MGPoissonSolver.h.
typedef Tpetra::Vector ::global_ordinal_type MGPoissonSolver::TpetraGlobalOrdinal_t |
Definition at line 80 of file MGPoissonSolver.h.
typedef Tpetra::Map MGPoissonSolver::TpetraMap_t |
Definition at line 78 of file MGPoissonSolver.h.
typedef Tpetra::MultiVector MGPoissonSolver::TpetraMultiVector_t |
Definition at line 77 of file MGPoissonSolver.h.
typedef Tpetra::Operator MGPoissonSolver::TpetraOperator_t |
Definition at line 81 of file MGPoissonSolver.h.
typedef Tpetra::Vector ::scalar_type MGPoissonSolver::TpetraScalar_t |
Definition at line 79 of file MGPoissonSolver.h.
typedef Tpetra::Vector MGPoissonSolver::TpetraVector_t |
Definition at line 76 of file MGPoissonSolver.h.
MGPoissonSolver::MGPoissonSolver | ( | PartBunch * | beam, |
Mesh_t * | mesh, | ||
FieldLayout_t * | fl, | ||
std::vector< BoundaryGeometry * > | geometries, | ||
std::string | itsolver, | ||
std::string | interpl, | ||
double | tol, | ||
int | maxiters, | ||
std::string | precmode | ||
) |
Definition at line 77 of file MGPoissonSolver.cpp.
References A, belosList, bp_m, currentGeometry, domain_m, FunctionTimer1_m, FunctionTimer2_m, FunctionTimer3_m, FunctionTimer4_m, FunctionTimer5_m, FunctionTimer6_m, FunctionTimer7_m, FunctionTimer8_m, geometries_m, PartBunchBase< T, Dim >::get_hr(), UniformCartesian< Dim, MFLOAT >::get_meshSpacing(), BoundaryGeometry::getA(), BoundaryGeometry::getB(), BoundaryGeometry::getC(), FieldLayout< Dim >::getDomain(), BoundaryGeometry::getFilename(), BoundaryGeometry::getL1(), BoundaryGeometry::getL2(), FieldLayout< Dim >::getLocalNDIndex(), BoundaryGeometry::getmaxcoords(), BoundaryGeometry::getmincoords(), IpplTimings::getTimer(), BoundaryGeometry::getTopology(), hr_m, IpplInfo::Info, itsBunch_m, layout_m, LHS, map_p, mesh_m, Options::nLHS, nLHS_m, Options::numBlocks, numBlocks_m, orig_nr_m, prec_mp, precmode_m, problem_mp, Options::recycleBlocks, recycleBlocks_m, repartFreq_m, REUSE_HIERARCHY, REUSE_PREC, RHS, setupBelosList(), setupMueLuList(), solver_mp, STD_PREC, useLeftPrec_m, and verbose_m.
MGPoissonSolver::~MGPoissonSolver | ( | ) |
Definition at line 217 of file MGPoissonSolver.cpp.
References deletePtr(), problem_mp, and solver_mp.
|
private |
recomputes the map
Definition at line 227 of file MGPoissonSolver.cpp.
References deletePtr(), extrapolateLHS(), PartBunchBase< T, Dim >::getLocalTrackStep(), IPPLToMap3D(), itsBunch_m, and repartFreq_m.
Referenced by computePotential().
given a charge-density field rho and a set of mesh spacings hr, compute the scalar potential in 'open space'
rho | (inout) scalar field of the potential |
hr | mesh spacings in each direction |
Implements PoissonSolver.
Definition at line 296 of file MGPoissonSolver.cpp.
References A, Communicate::barrier(), Track::block, bp_m, IpplInfo::Comm, comm_mp, computeMap(), ComputeStencil(), endl(), ERRORMSG, FunctionTimer1_m, FunctionTimer2_m, FunctionTimer3_m, FunctionTimer4_m, FunctionTimer5_m, FunctionTimer6_m, FunctionTimer7_m, FunctionTimer8_m, PartBunchBase< T, Dim >::getdT(), FieldLayout< Dim >::getLocalNDIndex(), PartBunchBase< T, Dim >::getLocalTrackStep(), INFOMSG, INFORM_ALL_NODES, itsBunch_m, layout_m, level3(), LHS, BareField< T, Dim >::localElement(), Track::localTimeSteps, map_p, MueLuList_m, IpplInfo::myNode(), nLHS_m, nr_m, numBlocks_m, OldLHS, orig_nr_m, prec_mp, precmode_m, problem_mp, recycleBlocks_m, reduce(), REUSE_HIERARCHY, REUSE_PREC, RHS, solver_mp, IpplTimings::startTimer(), STD_PREC, IpplTimings::stopTimer(), useLeftPrec_m, and verbose_m.
Implements PoissonSolver.
Definition at line 223 of file MGPoissonSolver.cpp.
|
private |
returns a discretized stencil that has Neumann BC in z direction and Dirichlet BC on the surface of a specified geometry
hr | gridspacings in each direction |
RHS | right hand side might be scaled |
Definition at line 519 of file MGPoissonSolver.cpp.
References A, IrregularDomain::Stencil< T >::back, bp_m, IrregularDomain::Stencil< T >::center, IrregularDomain::Stencil< T >::east, IrregularDomain::Stencil< T >::front, isMatrixfilled_m, map_p, IrregularDomain::Stencil< T >::north, RHS, IrregularDomain::Stencil< T >::south, and IrregularDomain::Stencil< T >::west.
Referenced by computePotential().
|
private |
Definition at line 208 of file MGPoissonSolver.cpp.
References A, isMatrixfilled_m, LHS, map_p, prec_mp, and RHS.
Referenced by computeMap(), and ~MGPoissonSolver().
void MGPoissonSolver::extrapolateLHS | ( | ) |
Definition at line 236 of file MGPoissonSolver.cpp.
References LHS, map_p, Hypervolume::n, nLHS_m, OldLHS, and P_mp.
Referenced by computeMap().
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
private |
converts IPPL grid to a 3D map
localId | local IPPL grid node indices |
Definition at line 498 of file MGPoissonSolver.cpp.
References bp_m, comm_mp, and map_p.
Referenced by computeMap().
void MGPoissonSolver::printLoadBalanceStats | ( | ) |
useful load balance information
Definition at line 590 of file MGPoissonSolver.cpp.
References comm_mp, endl(), gmsg, map_p, max(), Hypervolume::maxn, min(), and reduce().
|
inlinevirtual |
Reimplemented from PoissonSolver.
Definition at line 128 of file MGPoissonSolver.h.
References bp_m.
void MGPoissonSolver::setGeometry | ( | std::vector< BoundaryGeometry * > | geometries | ) |
set a geometry
|
protected |
Setup the parameters for the Belos iterative solver.
Definition at line 614 of file MGPoissonSolver.cpp.
References belosList, maxiters_m, numBlocks_m, recycleBlocks_m, tol_m, and verbose_m.
Referenced by MGPoissonSolver().
|
protected |
Setup the parameters for the SAAMG preconditioner.
Definition at line 632 of file MGPoissonSolver.cpp.
References comm_mp, max(), MueLuList_m, precmode_m, REUSE_HIERARCHY, REUSE_PREC, and STD_PREC.
Referenced by MGPoissonSolver().
|
inlinevirtual |
Implements PoissonSolver.
Definition at line 122 of file MGPoissonSolver.h.
|
private |
matrix used in the linear system of equations
Definition at line 176 of file MGPoissonSolver.h.
Referenced by computePotential(), ComputeStencil(), deletePtr(), and MGPoissonSolver().
|
private |
parameter list for the iterative solver (Belos)
Definition at line 198 of file MGPoissonSolver.h.
Referenced by MGPoissonSolver(), and setupBelosList().
|
private |
structure that holds boundary points
Definition at line 169 of file MGPoissonSolver.h.
Referenced by computePotential(), ComputeStencil(), getXRangeMax(), getXRangeMin(), getYRangeMax(), getYRangeMin(), getZRangeMax(), getZRangeMin(), IPPLToMap3D(), MGPoissonSolver(), and resizeMesh().
|
private |
communicator used by Trilinos
Definition at line 182 of file MGPoissonSolver.h.
Referenced by computePotential(), IPPLToMap3D(), printLoadBalanceStats(), and setupMueLuList().
|
private |
holding the currently active geometry
Definition at line 148 of file MGPoissonSolver.h.
Referenced by MGPoissonSolver().
|
private |
Definition at line 208 of file MGPoissonSolver.h.
Referenced by MGPoissonSolver().
|
private |
Definition at line 218 of file MGPoissonSolver.h.
Referenced by computePotential(), and MGPoissonSolver().
|
private |
Definition at line 219 of file MGPoissonSolver.h.
Referenced by computePotential(), and MGPoissonSolver().
|
private |
Definition at line 220 of file MGPoissonSolver.h.
Referenced by computePotential(), and MGPoissonSolver().
|
private |
Definition at line 221 of file MGPoissonSolver.h.
Referenced by computePotential(), and MGPoissonSolver().
|
private |
Definition at line 222 of file MGPoissonSolver.h.
Referenced by computePotential(), and MGPoissonSolver().
|
private |
Definition at line 223 of file MGPoissonSolver.h.
Referenced by computePotential(), and MGPoissonSolver().
|
private |
Definition at line 224 of file MGPoissonSolver.h.
Referenced by computePotential(), and MGPoissonSolver().
|
private |
Definition at line 225 of file MGPoissonSolver.h.
Referenced by computePotential(), and MGPoissonSolver().
|
private |
container for multiple geometries
Definition at line 151 of file MGPoissonSolver.h.
Referenced by MGPoissonSolver().
|
private |
mesh spacings in each direction
Definition at line 211 of file MGPoissonSolver.h.
Referenced by MGPoissonSolver(), and print().
|
private |
Definition at line 140 of file MGPoissonSolver.h.
Referenced by ComputeStencil(), and deletePtr().
|
private |
PartBunch object.
Definition at line 201 of file MGPoissonSolver.h.
Referenced by computeMap(), computePotential(), and MGPoissonSolver().
|
private |
Definition at line 205 of file MGPoissonSolver.h.
Referenced by computePotential(), and MGPoissonSolver().
|
private |
left hand side of the linear system of equations we solve
Definition at line 174 of file MGPoissonSolver.h.
Referenced by computePotential(), deletePtr(), extrapolateLHS(), and MGPoissonSolver().
|
private |
Map holding the processor distribution of data.
Definition at line 179 of file MGPoissonSolver.h.
Referenced by computePotential(), ComputeStencil(), deletePtr(), extrapolateLHS(), IPPLToMap3D(), MGPoissonSolver(), and printLoadBalanceStats().
|
private |
maximal number of iterations for the iterative solver
Definition at line 160 of file MGPoissonSolver.h.
Referenced by setupBelosList().
|
private |
Definition at line 204 of file MGPoissonSolver.h.
Referenced by MGPoissonSolver().
|
private |
parameter list for the MueLu solver
Definition at line 196 of file MGPoissonSolver.h.
Referenced by computePotential(), and setupMueLuList().
|
private |
last N LHS's for extrapolating the new LHS as starting vector
Definition at line 185 of file MGPoissonSolver.h.
Referenced by computePotential(), extrapolateLHS(), and MGPoissonSolver().
|
private |
current number of mesh points in each direction
Definition at line 213 of file MGPoissonSolver.h.
Referenced by computePotential().
|
private |
maximum number of blocks in Krylov space
Definition at line 164 of file MGPoissonSolver.h.
Referenced by computePotential(), MGPoissonSolver(), and setupBelosList().
|
private |
Definition at line 187 of file MGPoissonSolver.h.
Referenced by computePotential(), and extrapolateLHS().
|
private |
global number of mesh points in each direction
Definition at line 215 of file MGPoissonSolver.h.
Referenced by computePotential(), and MGPoissonSolver().
|
private |
Definition at line 186 of file MGPoissonSolver.h.
Referenced by extrapolateLHS().
|
private |
MueLu preconditioner object.
Definition at line 193 of file MGPoissonSolver.h.
Referenced by computePotential(), deletePtr(), and MGPoissonSolver().
|
private |
preconditioner mode
Definition at line 162 of file MGPoissonSolver.h.
Referenced by computePotential(), MGPoissonSolver(), and setupMueLuList().
|
private |
Definition at line 189 of file MGPoissonSolver.h.
Referenced by computePotential(), MGPoissonSolver(), and ~MGPoissonSolver().
|
private |
number of vectors in recycle space
Definition at line 166 of file MGPoissonSolver.h.
Referenced by computePotential(), MGPoissonSolver(), and setupBelosList().
|
private |
Definition at line 153 of file MGPoissonSolver.h.
Referenced by computeMap(), and MGPoissonSolver().
|
private |
right hand side of our problem
Definition at line 172 of file MGPoissonSolver.h.
Referenced by computePotential(), ComputeStencil(), deletePtr(), and MGPoissonSolver().
|
private |
Definition at line 190 of file MGPoissonSolver.h.
Referenced by computePotential(), MGPoissonSolver(), and ~MGPoissonSolver().
|
private |
tolerance for the iterative solver
Definition at line 158 of file MGPoissonSolver.h.
Referenced by setupBelosList().
|
private |
Definition at line 143 of file MGPoissonSolver.h.
Referenced by computePotential(), and MGPoissonSolver().
|
private |
flag specifying if we are verbose
Definition at line 155 of file MGPoissonSolver.h.
Referenced by computePotential(), MGPoissonSolver(), and setupBelosList().