Commit 5a467414 authored by frey_m's avatar frey_m

clean up

parent 980c41c8
......@@ -43,31 +43,20 @@
#include "AbstractObjects/OpalData.h"
#include "Utilities/Options.h"
// #include "Epetra_Operator.h"
// #include "EpetraExt_RowMatrixOut.h"
// #include "Epetra_Import.h"
#include <Tpetra_Import.hpp>
#include <BelosTpetraAdapter.hpp>
#ifdef DBG_STENCIL
#include "TpetraExt_MatrixMatrix.hpp"
#endif
#include "Teuchos_CommandLineProcessor.hpp"
#include "BelosLinearProblem.hpp"
#include "BelosRCGSolMgr.hpp"
// #include "BelosEpetraAdapter.hpp"
#include "BelosBlockCGSolMgr.hpp"
#include <MueLu_CreateTpetraPreconditioner.hpp>
// #include <MueLu_TpetraOperator.hpp>
// #include "ml_MultiLevelPreconditioner.h"
// #include "ml_MultiLevelOperator.h"
// #include "ml_epetra_utils.h"
// #include "Isorropia_Exception.hpp"
// #include "Isorropia_Epetra.hpp"
// #include "Isorropia_EpetraRedistributor.hpp"
// #include "Isorropia_EpetraPartitioner.hpp"
#include <algorithm>
......@@ -112,11 +101,6 @@ MGPoissonSolver::MGPoissonSolver ( PartBunch *beam,
else if (precmode == "REUSE") precmode_m = REUSE_PREC;
else if (precmode == "NO") precmode_m = NO;
tolerableIterationsCount_m = 2;
numIter_m = -1;
forcePreconditionerRecomputation_m = false;
hasParallelDecompositionChanged_m = true;
repartFreq_m = 1000;
useRCB_m = false;
if (Ippl::Info->getOutputLevel() > 3)
......@@ -279,7 +263,7 @@ void MGPoissonSolver::extrapolateLHS() {
// given a charge-density field rho and a set of mesh spacings hr,
// compute the electric field and put in eg by solving the Poisson's equation
// XXX: use matrix stencil in computation directly (no Epetra, define operators
// XXX: use matrix stencil in computation directly (no Tpetra, define operators
// on IPPL GRID)
void MGPoissonSolver::computePotential(Field_t &rho, Vector_t hr) {
......@@ -307,12 +291,12 @@ void MGPoissonSolver::computePotential(Field_t &rho, Vector_t hr) {
IpplTimings::stopTimer(FunctionTimer2_m);
INFOMSG(level3 << "* Done." << endl);
// Allocate the RHS with the new Epetra Map
// Allocate the RHS with the new Tpetra Map
if (Teuchos::is_null(RHS))
RHS = rcp(new TpetraVector_t(map_p));
RHS->putScalar(0.0);
// // get charge densities from IPPL field and store in Epetra vector (RHS)
// get charge densities from IPPL field and store in Tpetra vector (RHS)
if (verbose_m) {
Ippl::Comm->barrier();
msg << "* Node:" << Ippl::myNode() << ", Filling RHS..." << endl;
......@@ -367,7 +351,8 @@ void MGPoissonSolver::computePotential(Field_t &rho, Vector_t hr) {
INFOMSG(level3 << "* Done." << endl);
#ifdef DBG_STENCIL
EpetraExt::RowMatrixToMatlabFile("DiscrStencil.dat", *A);
Tpetra::MatrixMarket::Writer<TpetraCrsMatrix_t>::writeSparseFile(
"DiscrStencil.dat", A);
#endif
INFOMSG(level3 << "* Computing Preconditioner..." << endl);
......
......@@ -32,22 +32,9 @@
#include "PoissonSolver.h"
#include "IrregularDomain.h"
//////////////////////////////////////////////////////////////
#include "ml_include.h"
#include "mpi.h"
// #if !defined(HAVE_ML_EPETRA)
// #error Epetra support missing in Trilinos installation!
// #endif
#if !defined(HAVE_ML_TEUCHOS)
#error Teuchos support missing in Trilinos installation!
#endif
// #if !defined(HAVE_ML_AZTECOO)
// #error Aztecoo support missing in Trilinos installation!
// #endif
#include <Tpetra_Vector.hpp>
#include <Tpetra_CrsMatrix.hpp>
......@@ -122,9 +109,6 @@ public:
/// set a geometry
void setGeometry(std::vector<BoundaryGeometry *> geometries);
/// force Solver to recompute Epetra_Map
void recomputeMap() { hasParallelDecompositionChanged_m = true; }
double getXRangeMin(unsigned short /*level*/) { return bp_m->getXRangeMin(); }
double getXRangeMax(unsigned short /*level*/) { return bp_m->getXRangeMax(); }
double getYRangeMin(unsigned short /*level*/) { return bp_m->getYRangeMin(); }
......@@ -153,8 +137,6 @@ private:
/// flag notifying us that the geometry (discretization) has changed
bool hasGeometryChanged_m;
/// flag is set when OPAL changed decomposition of mesh
bool hasParallelDecompositionChanged_m;
int repartFreq_m;
/// flag specifying if problem is redistributed with RCB
bool useRCB_m;
......@@ -169,12 +151,6 @@ private:
int itsolver_m;
/// preconditioner mode
int precmode_m;
/// number of iterations in the solve of the previous time step
int numIter_m;
/// percentage the iteration count can increase before recomputing the preconditioner
int tolerableIterationsCount_m;
/// force the solver to recompute the preconditioner
bool forcePreconditionerRecomputation_m;
/// maximum number of blocks in Krylov space
int numBlocks_m;
/// number of vectors in recycle space
......@@ -200,13 +176,6 @@ private:
Teuchos::RCP<TpetraMultiVector_t> P_mp;
std::deque< TpetraVector_t > OldLHS;
/// Solver (Belos RCG)
// typedef double ST;
// typedef Epetra_Operator OP;
// typedef Epetra_MultiVector MV;
// typedef Belos::OperatorTraits<ST, MV, OP> OPT;
// typedef Belos::MultiVecTraits<ST, MV> MVT;
Teuchos::RCP<LinearProblem_t> problem_mp;
Teuchos::RCP<SolverManager_t> solver_mp;
......@@ -215,7 +184,7 @@ private:
Teuchos::RCP<StatusTest_t> convStatusTest;
/// parameter list for the ML solver
/// parameter list for the MueLu solver
Teuchos::ParameterList MueLuList_m;
/// parameter list for the iterative solver (Belos)
Teuchos::ParameterList belosList;
......@@ -249,21 +218,20 @@ private:
void deletePtr();
/// recomputes the Epetra_Map
/// recomputes the map
void computeMap(NDIndex<3> localId);
/// redistributes Map with RCB
/// \param localId local IPPL grid node indices
void redistributeWithRCB(NDIndex<3> localId);
/// converts IPPL grid to a 3D Epetra_Map
/// converts IPPL grid to a 3D map
/// \param localId local IPPL grid node indices
void IPPLToMap3D(NDIndex<3> localId);
/** returns a discretized stencil that has Neumann BC in z direction and
* Dirichlet BC on the surface of a specified geometry
* \param hr gridspacings in each direction
* \param Epetra_CrsMatrix holding the stencil
* \param RHS right hand side might be scaled
*/
void ComputeStencil(Vector_t hr, Teuchos::RCP<TpetraVector_t> RHS);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment