Commit 1801d146 authored by Tuelin Kaman's avatar Tuelin Kaman
Browse files

1-store the geometry once, 2-control the amount of printed information in SAAMG

parent 690cedf9
......@@ -1002,7 +1002,9 @@ void ParallelCyclotronTracker::execute() {
*gmsg << "* -> " << ((*sindex)->first) << endl;
*gmsg << "* -----------------------------" << endl;
initializeBoundaryGeometry();
// don't initializeBoundaryGeometry()
// get BoundaryGeometry that is already initialized
bgf_m = OpalData::getInstance()->getGlobalGeometry();
// external field arrays for dumping
for(int k = 0; k < 2; k++)
......
......@@ -230,7 +230,7 @@ void OpalCyclotron::update() {
cycl->setSuperpose(superpose_str);
if(itsAttr[GEOMETRY] && obgeo_m == NULL) {
obgeo_m = (BoundaryGeometry::find(Attributes::getString(itsAttr[GEOMETRY])))->clone(getOpalName() + string("_geometry"));
obgeo_m = BoundaryGeometry::find(Attributes::getString(itsAttr[GEOMETRY]));
if(obgeo_m) {
cycl->setBoundaryGeometry(obgeo_m);
}
......
......@@ -47,7 +47,7 @@ MGPoissonSolver::MGPoissonSolver(PartBunch &beam,Mesh_t *mesh, FieldLayout_t *fl
hasParallelDecompositionChanged_m = true;
useRCB_m = false;
if(Ippl::Info->getOutputLevel() > 0)
if(Ippl::Info->getOutputLevel() > 1)
verbose_m = true;
else
verbose_m = false;
......
......@@ -295,11 +295,11 @@ protected:
//MLList.set("coarse: sweeps", 10);
//MLList.set("coarse: type", "Chebyshev");
// turn on all output
// Controls the amount of printed information.
// Ranges from 0 to 10 (0 is no output, and
// 10 is incredibly detailed output). Default: 0
if(verbose_m)
MLList_m.set("ML output", 101);
else
MLList_m.set("ML output", -1);
MLList_m.set("ML output", 10);
// heuristic for max coarse size depending on number of processors
int coarsest_size = std::max(Comm.NumProc() * 10, 1024);
......
......@@ -246,7 +246,7 @@ void FieldSolver::initSolver(PartBunch &b) {
std::vector<BoundaryGeometry *> geometries;
for(unsigned int i = 0; i <= geoms.length(); i++) {
if(geoms[i] == ',' || i == geoms.length()) {
BoundaryGeometry *geom = BoundaryGeometry::find(Attributes::getString(itsAttr[GEOMETRY]))->clone(getOpalName() + string("_geometry"));
BoundaryGeometry *geom = OpalData::getInstance()->getGlobalGeometry();
if(geom != 0) {
geometries.push_back(geom);
}
......@@ -254,7 +254,11 @@ void FieldSolver::initSolver(PartBunch &b) {
} else
tmp += geoms[i];
}
solver_m = new MGPoissonSolver(b, mesh_m, FL_m, geometries, Attributes::getString(itsAttr[ITSOLVER]), Attributes::getString(itsAttr[INTERPL]), Attributes::getReal(itsAttr[TOL]), (int)Attributes::getReal(itsAttr[MAXITERS]), Attributes::getString(itsAttr[PRECMODE]));
solver_m = new MGPoissonSolver(b, mesh_m, FL_m, geometries, Attributes::getString(itsAttr[ITSOLVER]),
Attributes::getString(itsAttr[INTERPL]),
Attributes::getReal(itsAttr[TOL]),
Attributes::getReal(itsAttr[MAXITERS]),
Attributes::getString(itsAttr[PRECMODE]));
itsBunch_m->set_meshEnlargement(Attributes::getReal(itsAttr[BBOXINCR]) / 100.0);
fsType_m = "SAAMG";
#else
......
......@@ -43,6 +43,7 @@
#include "Structure/FieldSolver.h"
#include "Structure/DataSink.h"
#include "Distribution/Distribution.h"
#include "Structure/BoundaryGeometry.h"
#ifdef HAVE_AMR_SOLVER
#define DIM 3
......@@ -72,6 +73,7 @@ namespace {
PARAMB, // The control parameter for "AUTO" mode of multi-bunch
BEAM, // The beam to track
FIELDSOLVER, // The field solver attached
BOUNDARYGEOMETRY, // The boundary geometry
DISTRIBUTION, // The particle distribution
DISTRIBUTIONS, // A list of particle distributions
MULTIPACTING, // MULTIPACTING flag
......@@ -103,6 +105,8 @@ TrackRun::TrackRun():
("BEAM", "Name of beam ", "BEAM");
itsAttr[FIELDSOLVER] = Attributes::makeString
("FIELDSOLVER", "Field solver to be used ", "FIELDSOLVER");
itsAttr[BOUNDARYGEOMETRY] = Attributes::makeString
("BOUNDARYGEOMETRY", "Boundary geometry to be used NONE (default)", "NONE");
itsAttr[DISTRIBUTION] = Attributes::makeString
("DISTRIBUTION", "Particle distribution to be used ", "DISTRIBUTION");
itsAttr[DISTRIBUTIONS] = Attributes::makeStringArray
......@@ -500,6 +504,15 @@ void TrackRun::execute() {
OpalData::getInstance()->setInOPALCyclMode();
Beam *beam = Beam::find(Attributes::getString(itsAttr[BEAM]));
if (Attributes::getString(itsAttr[BOUNDARYGEOMETRY]) != "NONE") {
// Ask the dictionary if BoundaryGeometry is allocated.
// If it is allocated use the allocated BoundaryGeometry
if (!OpalData::getInstance()->hasGlobalGeometry()) {
BoundaryGeometry *bg = BoundaryGeometry::find(Attributes::getString(itsAttr[BOUNDARYGEOMETRY]))->
clone(getOpalName() + string("_geometry"));
OpalData::getInstance()->setGlobalGeometry(bg);
}
}
fs = FieldSolver::find(Attributes::getString(itsAttr[FIELDSOLVER]));
fs->initCartesianFields();
Track::block->bunch->setSolver(fs);
......
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