Commit 0bcff536 authored by kraus's avatar kraus

fixing restart: can now (again) restart from any step in any H5Part file that...

fixing restart: can now (again) restart from any step in any H5Part file that was written for/with OPAL; SDDS file and load balance file are rewound to an s-position less or equal as in the H5file
parent afd40b48
......@@ -1353,10 +1353,9 @@ void RBend::Print(Inform &msg, double bendAngleX, double bendAngleY) {
}
void RBend::ReadFieldMap(Inform &msg) {
if(Options::info) {
msg << getName() << " using file ";
fieldmap_m->getInfo(&msg);
}
*Ippl::Info << getName() << " using file ";
fieldmap_m->getInfo(Ippl::Info);
Fieldmap::readMap(fileName_m);
fieldmap_m->Get1DProfile1EntranceParam(entranceParameter1_m,
entranceParameter2_m,
......@@ -1380,12 +1379,11 @@ bool RBend::Reinitialize() {
double bendAngleY = 0.0;
CalculateRefTrajectory(bendAngleX, bendAngleY);
Inform msg("RBend ");
msg << "Bend design energy changed to: "
<< designEnergy_m * 1.0e-6
<< " MeV"
<< endl;
Print(msg, bendAngleX, bendAngleY);
INFOMSG("Bend design energy changed to: "
<< designEnergy_m * 1.0e-6
<< " MeV"
<< endl);
Print(*Ippl::Info, bendAngleX, bendAngleY);
return false;
......
......@@ -461,8 +461,8 @@ void RFCavity::initialise(PartBunch *bunch, double &startField, double &endField
fmap->getFieldDimensions(zBegin, zEnd, rBegin, rEnd);
if(zEnd > zBegin) {
msg << getName() << " using file ";
fmap->getInfo(&msg);
*Ippl::Info << getName() << " using file ";
fmap->getInfo(Ippl::Info);
if(fabs((frequency - fmap->getFrequency()) / frequency) > 0.01) {
errormsg << "FREQUENCY IN INPUT FILE DIFFERENT THAN IN FIELD MAP '" << filename << "';\n"
<< frequency / two_pi * 1e-6 << " MHz <> "
......
......@@ -1320,10 +1320,9 @@ void SBend::Print(Inform &msg, double bendAngleX, double bendAngleY) {
}
void SBend::ReadFieldMap(Inform &msg) {
if(Options::info) {
msg << getName() << " using file ";
fieldmap_m->getInfo(&msg);
}
*Ippl::Info << getName() << " using file ";
fieldmap_m->getInfo(Ippl::Info);
Fieldmap::readMap(fileName_m);
fieldmap_m->Get1DProfile1EntranceParam(entranceParameter1_m,
entranceParameter2_m,
......@@ -1349,12 +1348,11 @@ bool SBend::Reinitialize() {
double bendAngleY = 0.0;
CalculateRefTrajectory(bendAngleX, bendAngleY);
Inform msg("SBend ");
msg << "Bend design energy changed to: "
<< designEnergy_m * 1.0e-6
<< " MeV"
<< endl;
Print(msg, bendAngleX, bendAngleY);
INFOMSG("Bend design energy changed to: "
<< designEnergy_m * 1.0e-6
<< " MeV"
<< endl);
Print(*Ippl::Info, bendAngleX, bendAngleY);
}
......
......@@ -204,11 +204,11 @@ void Solenoid::initialise(PartBunch *bunch, double &startField, double &endField
RefPartBunch_m = bunch;
msg << getName() << " using file ";
*Ippl::Info << getName() << " using file ";
myFieldmap_m = Fieldmap::getFieldmap(filename_m, fast_m);
if(myFieldmap_m != NULL) {
myFieldmap_m->getInfo(&msg);
myFieldmap_m->getInfo(Ippl::Info);
if(fabs(dx_m) > EPS_MISALIGNMENT || fabs(dy_m) > EPS_MISALIGNMENT || fabs(ds_m) > EPS_MISALIGNMENT) {
msg << "misaligned by dx = " << dx_m << ", dy = " << dy_m << ", dz = " << ds_m << endl;
}
......
......@@ -398,8 +398,8 @@ void TravelingWave::initialise(PartBunch *bunch, double &startField, double &end
CoreFieldmap_m->getFieldDimensions(zBegin, zEnd, rBegin, rEnd);
if(zEnd > zBegin) {
msg << getName() << " using file ";
CoreFieldmap_m->getInfo(&msg);
*Ippl::Info << getName() << " using file ";
CoreFieldmap_m->getInfo(Ippl::Info);
if(fabs((frequency_m - CoreFieldmap_m->getFrequency()) / frequency_m) > 0.01) {
errormsg << "FREQUENCY IN INPUT FILE DIFFERENT THAN IN FIELD MAP '" << CoreFilename_m + "';\n"
<< frequency_m / two_pi * 1e-6 << " MHz <> "
......
......@@ -638,7 +638,7 @@ void PartBunch::calcGammas() {
if(emittedBins >= 2) {
for(int i = 1; i < emittedBins; i++) {
if(binemitted_m[i - 1] != 0 && binemitted_m[i] != 0)
INFOMSG("dE= " << getM() * 1.0E-3 * (bingamma_m[i - 1] - bingamma_m[i]) << " [keV] of Bin " << i - 1 << " and " << i << endl);
INFOMSG("d(gamma)= " << 100.0 * std::abs(bingamma_m[i - 1] - bingamma_m[i]) / bingamma_m[i] << " [%] between bin " << i - 1 << " and " << i << endl);
}
}
}
......
......@@ -190,9 +190,8 @@ void FM1DProfile1::readMap() {
inputFile.close();
msg << typeset_msg("read in fieldmap '" + Filename_m + "'", "info")
<< "\n"
<< endl;
INFOMSG(typeset_msg("read in fieldmap '" + Filename_m + "'", "info")
<< "\n" << endl);
}
......
......@@ -190,8 +190,8 @@ void FM1DProfile2::readMap() {
delete[] leastSquareMatrix;
delete[] rightHandSide;
msg << typeset_msg("read in fieldmap '" + Filename_m + "'", "info") << "\n"
<< endl;
INFOMSG(typeset_msg("read in fieldmap '" + Filename_m + "'", "info") << "\n"
<< endl);
}
}
......
......@@ -151,8 +151,8 @@ void FM2DDynamic::readMap() {
FieldstrengthHt_m[i] *= mu_0 / Ezmax; // H -> B
}
msg << typeset_msg("read in fieldmap '" + Filename_m + "'", "info") << "\n"
<< endl;
INFOMSG(typeset_msg("read in fieldmap '" + Filename_m + "'", "info") << "\n"
<< endl);
}
}
......
......@@ -216,8 +216,8 @@ void FM2DDynamic_cspline::readMap() {
delete[] FieldstrengthEr;
delete[] FieldstrengthHt;
msg << typeset_msg("read in fieldmap '" + Filename_m + "'", "info") << "\n"
<< endl;
INFOMSG(typeset_msg("read in fieldmap '" + Filename_m + "'", "info") << "\n"
<< endl);
}
}
......
......@@ -175,8 +175,8 @@ void FM3DDynamic::readMap() {
FieldstrengthHy_m[i] /= Ezmax;
}
msg << typeset_msg("read in fieldmap '" + Filename_m + "'", "info") << "\n"
<< endl;
INFOMSG(typeset_msg("read in fieldmap '" + Filename_m + "'", "info") << "\n"
<< endl);
}
}
......
......@@ -203,8 +203,8 @@ void FM3DH5Block::readMap() {
// FieldstrengthHy_m[i] *= 1.0e6 * mu_0 / Ezmax;
// FieldstrengthHz_m[i] *= 1.0e6 * mu_0 / Ezmax;
// }
msg << typeset_msg("read in fieldmap '" + Filename_m + "'", "info") << "\n"
<< endl;
INFOMSG(typeset_msg("read in fieldmap '" + Filename_m + "'", "info") << "\n"
<< endl);
} else {
WARNMSG("could not read file '" << Filename_m << "'")
......
......@@ -170,8 +170,8 @@ void FM3DH5Block_nonscale::readMap() {
FieldstrengthHz_m[i] *= 1.0e6 * mu_0 ;
}
msg << typeset_msg("read in fieldmap '" + Filename_m + "'", "info") << "\n"
<< endl;
INFOMSG(typeset_msg("read in fieldmap '" + Filename_m + "'", "info") << "\n"
<< endl);
} else {
WARNMSG("could not read file '" << Filename_m << "'")
......
......@@ -165,8 +165,8 @@ void FM3DMagnetoStaticH5Block::readMap() {
delete[] Nz_read_start;
delete[] Nz_read_length;
msg << typeset_msg("read in fieldmap '" + Filename_m + "'", "info") << "\n"
<< endl;
INFOMSG(typeset_msg("read in fieldmap '" + Filename_m + "'", "info") << "\n"
<< endl);
} else {
WARNMSG("could not read file '" << Filename_m << "'" << endl);
......
......@@ -68,6 +68,7 @@
#include "Utilities/NumToStr.h"
#include "Utilities/OpalException.h"
#include "Structure/H5PartWrapperForPC.h"
#include "Structure/BoundaryGeometry.h"
#include "Utilities/OpalOptions.h"
......@@ -4049,8 +4050,41 @@ void ParallelCyclotronTracker::saveOneBunch() {
ptype_mb.create(npart_mb);
ptype_mb = itsBunch->PType;
std::map<std::string, double> additionalAttributes = {
std::make_pair("REFPR", 0.0),
std::make_pair("REFPT", 0.0),
std::make_pair("REFPZ", 0.0),
std::make_pair("REFR", 0.0),
std::make_pair("REFTHETA", 0.0),
std::make_pair("REFZ", 0.0),
std::make_pair("AZIMUTH", 0.0),
std::make_pair("ELEVATION", 0.0),
std::make_pair("B-ref_x", 0.0),
std::make_pair("B-ref_z", 0.0),
std::make_pair("B-ref_y", 0.0),
std::make_pair("E-ref_x", 0.0),
std::make_pair("E-ref_z", 0.0),
std::make_pair("E-ref_y", 0.0),
std::make_pair("B-head_x", 0.0),
std::make_pair("B-head_z", 0.0),
std::make_pair("B-head_y", 0.0),
std::make_pair("E-head_x", 0.0),
std::make_pair("E-head_z", 0.0),
std::make_pair("E-head_y", 0.0),
std::make_pair("B-tail_x", 0.0),
std::make_pair("B-tail_z", 0.0),
std::make_pair("B-tail_y", 0.0),
std::make_pair("E-tail_x", 0.0),
std::make_pair("E-tail_z", 0.0),
std::make_pair("E-tail_y", 0.0)};
std::string fn_appendix = "-onebunch";
itsDataSink->storeOneBunch(*itsBunch, fn_appendix);
std::string fileName = OpalData::getInstance()->getInputBasename() + fn_appendix + ".h5";
H5PartWrapperForPC h5wrapper(fileName);
h5wrapper.writeHeader();
h5wrapper.writeStep(*itsBunch, additionalAttributes);
h5wrapper.close();
}
......@@ -4094,34 +4128,62 @@ bool ParallelCyclotronTracker::readOneBunchFromFile(const size_t BinID) {
if(restartflag) {
*gmsg << "----------------Read beam from hdf5 file----------------" << endl;
const size_t LocalNum = itsBunch->getLocalNum();
size_t localNum = itsBunch->getLocalNum();
PartBunch tmpBunch(&itsReference);
std::string fn_appendix = "-onebunch";
itsDataSink->readOneBunch(*itsBunch, fn_appendix, BinID);
restartflag = false;
std::string fileName = OpalData::getInstance()->getInputBasename() + fn_appendix + ".h5";
H5PartWrapperForPC dataSource(fileName, H5_O_RDONLY);
long numParticles = dataSource.getNumParticles();
size_t numParticlesPerNode = numParticles / Ippl::getNodes();
size_t firstParticle = numParticlesPerNode * Ippl::myNode();
size_t lastParticle = firstParticle + numParticlesPerNode - 1;
if (Ippl::myNode() == Ippl::getNodes() - 1)
lastParticle = numParticles - 1;
numParticles = lastParticle - firstParticle + 1;
PAssert(numParticles >= 0);
const size_t NewLocalNum = itsBunch->getLocalNum();
dataSource.readStep(tmpBunch, firstParticle, lastParticle);
dataSource.close();
npart_mb = NewLocalNum - LocalNum;
tmpBunch.boundp();
// itsDataSink->readOneBunch(*itsBunch, fn_appendix, BinID);
restartflag = false;
npart_mb = tmpBunch.getLocalNum();
itsBunch->create(npart_mb);
r_mb.create(npart_mb);
p_mb.create(npart_mb);
m_mb.create(npart_mb);
q_mb.create(npart_mb);
ptype_mb.create(npart_mb);
for(size_t ii = 0; ii < npart_mb; ii++) {
r_mb[ii] = itsBunch->R[ii+LocalNum];
p_mb[ii] = itsBunch->P[ii+LocalNum];
m_mb[ii] = itsBunch->M[ii+LocalNum];
q_mb[ii] = itsBunch->Q[ii+LocalNum];
ptype_mb[ii] = itsBunch->PType[ii+LocalNum];
for(size_t ii = 0; ii < npart_mb; ++ ii, ++ localNum) {
itsBunch->R[localNum] = tmpBunch.R[ii];
itsBunch->P[localNum] = tmpBunch.P[ii];
itsBunch->M[localNum] = tmpBunch.M[ii];
itsBunch->Q[localNum] = tmpBunch.Q[ii];
itsBunch->PType[localNum] = 0;
itsBunch->Bin[localNum] = BinID;
r_mb[ii] = itsBunch->R[localNum];
p_mb[ii] = itsBunch->P[localNum];
m_mb[ii] = itsBunch->M[localNum];
q_mb[ii] = itsBunch->Q[localNum];
ptype_mb[ii] = itsBunch->PType[localNum];
}
} else
} else {
readOneBunch(BinID);
itsBunch->boundp();
itsBunch->boundp();
}
return true;
}
......
......@@ -191,9 +191,7 @@ void ParallelSliceTracker::handleAutoPhasing() {
if (Options::autoPhase == 0) return;
if(OpalData::getInstance()->inRestartRun()) {
itsDataSink_m->retriveCavityInformation(OpalData::getInstance()->getInputFn());
} else {
if(!OpalData::getInstance()->inRestartRun()) {
itsDataSink_m->storeCavityInformation();
}
......
......@@ -72,7 +72,6 @@
class PartData;
using namespace std;
using namespace OPALTimer;
ParallelTTracker::ParallelTTracker(const Beamline &beamline,
const PartData &reference,
......@@ -323,7 +322,7 @@ void ParallelTTracker::printRFPhases() {
const double RADDEG = 180.0 / Physics::pi;
const double globalTimeShift = OpalData::getInstance()->getGlobalPhaseShift();
msg << "\n-------------------------------------------------------------------------------------\n";
INFOMSG("\n-------------------------------------------------------------------------------------\n");
for (FieldList::iterator it = cl.begin(); it != cl.end(); ++it) {
std::shared_ptr<Component> element(it->getElement());
......@@ -339,14 +338,14 @@ void ParallelTTracker::printRFPhases() {
frequency = static_cast<RFCavity *>(element.get())->getFrequencym();
}
msg << (it == cl.begin()? "": "\n")
<< name
<< ": phi = phi_nom + phi_maxE + global phase shift = " << phase * RADDEG << " degree, "
<< "(global phase shift = " << -globalTimeShift *frequency *RADDEG << " degree) \n";
INFOMSG((it == cl.begin()? "": "\n")
<< name
<< ": phi = phi_nom + phi_maxE + global phase shift = " << phase * RADDEG << " degree, "
<< "(global phase shift = " << -globalTimeShift *frequency *RADDEG << " degree) \n");
}
msg << "-------------------------------------------------------------------------------------\n"
<< endl;
INFOMSG("-------------------------------------------------------------------------------------\n"
<< endl);
}
void ParallelTTracker::handleAutoPhasing() {
......@@ -354,9 +353,7 @@ void ParallelTTracker::handleAutoPhasing() {
if(Options::autoPhase == 0) return;
if(OpalData::getInstance()->inRestartRun()) {
itsDataSink_m->retriveCavityInformation(OpalData::getInstance()->getInputFn());
} else {
if(!OpalData::getInstance()->inRestartRun()) {
itsDataSink_m->storeCavityInformation();
}
......@@ -425,10 +422,10 @@ void ParallelTTracker::executeDefaultTracker() {
<< "max integration steps " << localTrackSteps_m.front() << ", next step= " << step << endl;
msg << "Using default (Boris-Buneman) integrator" << endl;
itsOpalBeamline_m.print(*Ippl::Info);
if (Options::info)
itsOpalBeamline_m.print(msg);
else
msg << "Silent track ... " << endl;
msg << "Silent track ... " << endl;
setupSUV(!(OpalData::getInstance()->inRestartRun() || (OpalData::getInstance()->hasBunchAllocated() && !Options::scan)));
......@@ -2007,11 +2004,12 @@ void ParallelTTracker::dumpStats(long long step, bool psDump, bool statDump) {
Inform msg("ParallelTTracker ");
if(numParticlesInSimulation_m == 0) {
msg << myt2.time() << " "
<< "Step " << setw(6) << itsBunch->getGlobalTrackStep() << "; "
<< " -- no emission yet -- "
<< "t= " << scientific << setprecision(3) << setw(10) << itsBunch->getT() << " [s]"
<< endl;
if (Options::info)
msg << myt2.time() << " "
<< "Step " << setw(6) << itsBunch->getGlobalTrackStep() << "; "
<< " -- no emission yet -- "
<< "t= " << scientific << setprecision(3) << setw(10) << itsBunch->getT() << " [s]"
<< endl;
return;
}
......@@ -2033,23 +2031,24 @@ void ParallelTTracker::dumpStats(long long step, bool psDump, bool statDump) {
size_t totalParticles_f = numParticlesInSimulation_m;
if(totalParticles_f <= minBinEmitted_m) {
msg << myt2.time() << " "
<< "Step " << setw(6) << itsBunch->getGlobalTrackStep() << "; "
<< "only " << setw(4) << totalParticles_f << " particles emitted; "
<< "t= " << scientific << setprecision(3) << setw(10) << itsBunch->getT() << " [s] "
<< "E=" << fixed << setprecision(3) << setw(9) << meanEnergy << meanEnergyUnit
<< endl;
if (Options::info)
msg << myt2.time() << " "
<< "Step " << setw(6) << itsBunch->getGlobalTrackStep() << "; "
<< "only " << setw(4) << totalParticles_f << " particles emitted; "
<< "t= " << scientific << setprecision(3) << setw(10) << itsBunch->getT() << " [s] "
<< "E=" << fixed << setprecision(3) << setw(9) << meanEnergy << meanEnergyUnit
<< endl;
} else if(std::isnan(sposRef) || std::isinf(sposRef)) {
throw OpalException("ParallelTTracker::dumpStats()",
"there seems to be something wrong with the position of the bunch!");
} else {
if (Options::info)
msg << myt2.time() << " "
<< "Step " << setw(6) << itsBunch->getGlobalTrackStep() << " "
<< "at " << fixed << setprecision(3) << setw(8) << sposPrint << sposUnit
<< "t= " << scientific << setprecision(3) << setw(10) << itsBunch->getT() << " [s] "
<< "E=" << fixed << setprecision(3) << setw(9) << meanEnergy << meanEnergyUnit
<< endl;
msg << myt2.time() << " "
<< "Step " << setw(6) << itsBunch->getGlobalTrackStep() << " "
<< "at " << fixed << setprecision(3) << setw(8) << sposPrint << sposUnit
<< "t= " << scientific << setprecision(3) << setw(10) << itsBunch->getT() << " [s] "
<< "E=" << fixed << setprecision(3) << setw(9) << meanEnergy << meanEnergyUnit
<< endl;
writePhaseSpace(step, sposRef, psDump, statDump);
}
......
......@@ -8,8 +8,6 @@ set (PACKAGE_VERSION \"1.3.99.1\")
configure_file(config.h.in ${CMAKE_CURRENT_SOURCE_DIR}/config.h)
#FIXME: get from Makefile.def (IPPL)
set (CMAKE_CXX_FLAGS
"${IPPL_CMAKE_CXX_FLAGS} -DUSEH5FEDV2 -DPARALLEL_IO ${CMAKE_CXX_FLAGS}"
)
......@@ -26,8 +24,6 @@ IF(ENABLE_AMR_SOLVER)
)
ENDIF(ENABLE_AMR_SOLVER)
#MESSAGE ("Compile OPAL with: ${CMAKE_CXX_FLAGS}")
set (OPAL_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR})
macro (add_sources)
file (RELATIVE_PATH _relPath "${OPAL_SRC_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}")
......
This diff is collapsed.
......@@ -47,6 +47,7 @@ class PartBins;
class EnvelopeBunch;
class BoundaryGeometry;
class LaserProfile;
class H5PartWrapper;
namespace DistrTypeT
{
......@@ -112,10 +113,10 @@ public:
bool scan);
void CreateOpalT(PartBunch &beam, size_t &numberOfParticles, bool scan);
void CreatePriPart(PartBunch *beam, BoundaryGeometry &bg);
void DoRestartOpalT(PartBunch &p, size_t Np, int restartStep);
void DoRestartOpalT(PartBunch &p, size_t Np, int restartStep, H5PartWrapper *h5wrapper);
void DoRestartOpalCycl(PartBunch &p, size_t Np, int restartStep,
const int specifiedNumBunch);
void DoRestartOpalE(EnvelopeBunch &p, size_t Np, int restartStep);
const int specifiedNumBunch, H5PartWrapper *h5wrapper);
void DoRestartOpalE(EnvelopeBunch &p, size_t Np, int restartStep, H5PartWrapper *h5wrapper);
size_t EmitParticles(PartBunch &beam, double eZ);
static Distribution *find(const std::string &name);
......
......@@ -350,43 +350,43 @@ void OpalBeamline::visit<Corrector>(const Corrector &element, BeamlineVisitor &,
template<> inline
void OpalBeamline::visit<BeamBeam>(const BeamBeam &element, BeamlineVisitor &, PartBunch *) {
Inform msg("OPAL ");
msg << element.getType() << " not implemented yet!" << endl;
msg << element.getTypeString() << " not implemented yet!" << endl;
}
template<> inline
void OpalBeamline::visit<Diagnostic>(const Diagnostic &element, BeamlineVisitor &, PartBunch *) {
Inform msg("OPAL ");
msg << element.getType() << " not implemented yet!" << endl;
msg << element.getTypeString() << " not implemented yet!" << endl;
}
template<> inline
void OpalBeamline::visit<Lambertson>(const Lambertson &element, BeamlineVisitor &, PartBunch *) {
Inform msg("OPAL ");
msg << element.getType() << " not implemented yet!" << endl;
msg << element.getTypeString() << " not implemented yet!" << endl;
}
template<> inline
void OpalBeamline::visit<Marker>(const Marker &element, BeamlineVisitor &, PartBunch *) {
if (Options::info)
WARNMSG(element.getType() << " not implemented yet!" << endl);
WARNMSG(element.getTypeString() << " not implemented yet!" << endl);
}
template<> inline
void OpalBeamline::visit<RFQuadrupole>(const RFQuadrupole &element, BeamlineVisitor &, PartBunch *) {
Inform msg("OPAL ");
msg << element.getType() << " not implemented yet!" << endl;
msg << element.getTypeString() << " not implemented yet!" << endl;
}
template<> inline
void OpalBeamline::visit<Separator>(const Separator &element, BeamlineVisitor &, PartBunch *) {
Inform msg("OPAL ");
msg << element.getType() << " not implemented yet!" << endl;
msg << element.getTypeString() << " not implemented yet!" << endl;
}
template<> inline
void OpalBeamline::visit<Septum>(const Septum &element, BeamlineVisitor &, PartBunch *) {
Inform msg("OPAL ");
msg << element.getType() << " not implemented yet!" << endl;
msg << element.getTypeString() << " not implemented yet!" << endl;
}
inline
......
......@@ -134,9 +134,10 @@ int main(int argc, char *argv[]) {
if(Ippl::myNode() == 0) {
if (!fs::exists("data")) {
boost::system::error_code error_code;
fs::create_directory("data", error_code);
std::cerr << error_code.message() << std::endl;
// use error code to prevent create_directory from throwing an exception
if (!fs::create_directory("data", error_code)) {
std::cerr << error_code.message() << std::endl;
// use error code to prevent create_directory from throwing an exception
}
}
}
Ippl::Comm->barrier();
......@@ -194,8 +195,10 @@ int main(int argc, char *argv[]) {
<< "Note: this is not mandatory for an OPAL simulation!\n" << endl;
}
if(argc > 1)
if(argc > 1) {
OPAL->storeInputFn(std::string(argv[1]));
OPAL->setRestartFileName(OPAL->getInputBasename() + std::string(".h5"));
}
if(argc > 3) {
if(argc > 5) {
......@@ -289,15 +292,15 @@ int main(int argc, char *argv[]) {
*gmsg << endl << "*** User error detected by function \""
<< ex.where() << "\"" << endl;
abort();
} catch(std::bad_alloc &) {
*gmsg << "Sorry, virtual memory exhausted." << endl;
abort();
} catch(std::exception const& e) {
} catch(std::exception const& e) {
*gmsg << "Exception: " << e.what() << "\n";
abort();
} catch(...) {
*gmsg << "Unexpected exception." << endl;
abort();
......@@ -309,4 +312,4 @@ void errorHandlerGSL(const char *reason,
int,
int) {
throw OpalException(file, reason);
}
}
\ No newline at end of file
......@@ -7,10 +7,14 @@ set (_SRCS
BoundaryGeometry.cpp
FieldSolver.cpp
DataSink.cpp
H5PartWrapper.cpp
H5PartWrapperForPC.cpp
H5PartWrapperForPS.cpp
H5PartWrapperForPT.cpp
)
include_directories (
${CMAKE_CURRENT_SOURCE_DIR}
)
add_sources(${_SRCS})
add_sources(${_SRCS})
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -34,7 +34,7 @@
class PartBunch;
class EnvelopeBunch;
class BoundaryGeometry;
class H5PartWrapper;
class DataSink {
public:
......@@ -44,57 +44,26 @@ public:
* opposed to a calculation restart).
*/
DataSink();
DataSink(H5PartWrapper *h5wrapper);
/** \brief Restart constructor.
*
* This constructor is called when a calculation is restarted using data from
* an existing H5 file.
*/