Commit 4cb578eb authored by ext-calvo_p's avatar ext-calvo_p
Browse files

Review info messages and cleaning

parent 991d594d
......@@ -565,31 +565,31 @@ void ParallelCyclotronTracker::visitBeamBeam(const BeamBeam &) {
*/
void ParallelCyclotronTracker::visitCCollimator(const CCollimator &coll) {
*gmsg << "* --------- Collimator -----------------------------" << endl;
*gmsg << "* ------------------------------ Collimator ------------------------------" << endl;
CCollimator* elptr = dynamic_cast<CCollimator *>(coll.clone());
myElements.push_back(elptr);
double xstart = elptr->getXStart();
*gmsg << "* Xstart= " << xstart << " [mm]" << endl;
*gmsg << "* Xstart = " << xstart << " [mm]" << endl;
double xend = elptr->getXEnd();
*gmsg << "* Xend= " << xend << " [mm]" << endl;
*gmsg << "* Xend = " << xend << " [mm]" << endl;
double ystart = elptr->getYStart();
*gmsg << "* Ystart= " << ystart << " [mm]" << endl;
*gmsg << "* Ystart = " << ystart << " [mm]" << endl;
double yend = elptr->getYEnd();
*gmsg << "* Yend= " << yend << " [mm]" << endl;
*gmsg << "* Yend = " << yend << " [mm]" << endl;
double zstart = elptr->getZStart();
*gmsg << "* Zstart= " << zstart << " [mm]" << endl;
*gmsg << "* Zstart = " << zstart << " [mm]" << endl;
double zend = elptr->getZEnd();
*gmsg << "* Zend= " << zend << " [mm]" << endl;
*gmsg << "* Zend = " << zend << " [mm]" << endl;
double width = elptr->getWidth();
*gmsg << "* Width= " << width << " [mm]" << endl;
*gmsg << "* Width = " << width << " [mm]" << endl;
elptr->initialise(itsBunch_m);
......@@ -778,21 +778,23 @@ void ParallelCyclotronTracker::visitMultipoleTCurvedVarRadius(const MultipoleTCu
* @param prob
*/
void ParallelCyclotronTracker::visitProbe(const Probe &prob) {
*gmsg << "* ----------- Probe -------------------------------" << endl;
*gmsg << "* ------------------------------ Probe ------------------------------" << endl;
Probe *elptr = dynamic_cast<Probe *>(prob.clone());
myElements.push_back(elptr);
*gmsg << "* Name = " << elptr->getName() << endl;
double xstart = elptr->getXStart();
*gmsg << "XStart= " << xstart << " [mm]" << endl;
*gmsg << "* XStart = " << xstart << " [mm]" << endl;
double xend = elptr->getXEnd();
*gmsg << "XEnd= " << xend << " [mm]" << endl;
*gmsg << "* XEnd = " << xend << " [mm]" << endl;
double ystart = elptr->getYStart();
*gmsg << "YStart= " << ystart << " [mm]" << endl;
*gmsg << "* YStart = " << ystart << " [mm]" << endl;
double yend = elptr->getYEnd();
*gmsg << "YEnd= " << yend << " [mm]" << endl;
*gmsg << "* YEnd = " << yend << " [mm]" << endl;
// initialise, do nothing
elptr->initialise(itsBunch_m);
......@@ -864,7 +866,7 @@ void ParallelCyclotronTracker::visitVariableRFCavityFringeField
*/
void ParallelCyclotronTracker::visitRFCavity(const RFCavity &as) {
*gmsg << "* --------- RFCavity ------------------------------" << endl;
*gmsg << "* ------------------------------ RFCavity ------------------------------" << endl;
RFCavity *elptr = dynamic_cast<RFCavity *>(as.clone());
myElements.push_back(elptr);
......@@ -985,25 +987,25 @@ void ParallelCyclotronTracker::visitSeparator(const Separator &sep) {
*/
void ParallelCyclotronTracker::visitSeptum(const Septum &sept) {
*gmsg << endl << "* ----------------------------- Septum ------------------------------- *" << endl;
*gmsg << endl << "* ------------------------------ Septum ------------------------------- *" << endl;
Septum *elptr = dynamic_cast<Septum *>(sept.clone());
myElements.push_back(elptr);
double xstart = elptr->getXStart();
*gmsg << "XStart = " << xstart << " [mm]" << endl;
*gmsg << "* XStart = " << xstart << " [mm]" << endl;
double xend = elptr->getXEnd();
*gmsg << "XEnd = " << xend << " [mm]" << endl;
*gmsg << "* XEnd = " << xend << " [mm]" << endl;
double ystart = elptr->getYStart();
*gmsg << "YStart = " << ystart << " [mm]" << endl;
*gmsg << "* YStart = " << ystart << " [mm]" << endl;
double yend = elptr->getYEnd();
*gmsg << "YEnd = " << yend << " [mm]" << endl;
*gmsg << "* YEnd = " << yend << " [mm]" << endl;
double width = elptr->getWidth();
*gmsg << "Width = " << width << " [mm]" << endl;
*gmsg << "* Width = " << width << " [mm]" << endl;
// initialise, do nothing
......@@ -1065,29 +1067,34 @@ void ParallelCyclotronTracker::visitCyclotronValley(const CyclotronValley &cv) {
void ParallelCyclotronTracker::visitStripper(const Stripper &stripper) {
*gmsg << "* ---------Stripper------------------------------" << endl;
*gmsg << "* ------------------------------ Stripper ------------------------------" << endl;
Stripper *elptr = dynamic_cast<Stripper *>(stripper.clone());
myElements.push_back(elptr);
*gmsg << "* Name = " << elptr->getName() << endl;
double xstart = elptr->getXStart();
*gmsg << "XStart= " << xstart << " [mm]" << endl;
*gmsg << "* XStart = " << xstart << " [mm]" << endl;
double xend = elptr->getXEnd();
*gmsg << "XEnd= " << xend << " [mm]" << endl;
*gmsg << "* XEnd = " << xend << " [mm]" << endl;
double ystart = elptr->getYStart();
*gmsg << "YStart= " << ystart << " [mm]" << endl;
*gmsg << "* YStart = " << ystart << " [mm]" << endl;
double yend = elptr->getYEnd();
*gmsg << "YEnd= " << yend << " [mm]" << endl;
*gmsg << "* YEnd = " << yend << " [mm]" << endl;
double opcharge = elptr->getOPCharge();
*gmsg << "Charge of outcoming particle = +e * " << opcharge << endl;
*gmsg << "* Charge of outcoming particle = +e * " << opcharge << endl;
double opmass = elptr->getOPMass();
*gmsg << "* Mass of the outcoming particle = " << opmass << " [GeV/c^2]" << endl;
bool stop = elptr->getStop();
*gmsg << std::boolalpha << "* Particles stripped will be deleted after interaction -> " << stop << endl;
elptr->initialise(itsBunch_m);
double BcParameter[8] = {};
......@@ -2168,7 +2175,8 @@ bool ParallelCyclotronTracker::deleteParticle(bool flagNeedUpdate){
*gmsg << "At step " << step_m
<< ", lost " << globLostParticleNum << " particles "
<< "on stripper, collimator, septum, or out of cyclotron aperture"
<< "on stripper, collimator, septum, geometry, "
<< "out of cyclotron aperture or beam stripping"
<< endl;
if (totalnum[bunchCount] == 0) {
......
......@@ -341,39 +341,38 @@ double Cyclotron::getFMHighE() const { return fmHighE_m;}
bool Cyclotron::apply(const size_t &id, const double &t, Vector_t &E, Vector_t &B) {
bool flagNeedUpdate = false;
const double rpos = std::hypot(RefPartBunch_m->R[id](0), RefPartBunch_m->R[id](1));
const double zpos = RefPartBunch_m->R[id](2);
if (zpos > maxz_m || zpos < minz_m || rpos > maxr_m || rpos < minr_m){
flagNeedUpdate = true;
Inform gmsgALL("OPAL ", INFORM_ALL_NODES);
gmsgALL << level2 << getName()
<< ": particle " << id
<< " out of the global aperture of cyclotron!" << endl;
gmsgALL << level2 << getName()
<< ": Coords: "<< RefPartBunch_m->R[id] << endl;
} else{
flagNeedUpdate = apply(RefPartBunch_m->R[id], RefPartBunch_m->P[id], t, E, B);
if(flagNeedUpdate){
Inform gmsgALL("OPAL ", INFORM_ALL_NODES);
gmsgALL << level2 << getName()
<< ": particle "<< id
<< " out of the field map boundary!" << endl;
gmsgALL << level2 << getName()
<< ": Coords: "<< RefPartBunch_m->R[id] << endl;
}
}
bool flagNeedUpdate = false;
const double rpos = std::hypot(RefPartBunch_m->R[id](0), RefPartBunch_m->R[id](1));
const double zpos = RefPartBunch_m->R[id](2);
Inform gmsgALL("OPAL", INFORM_ALL_NODES);
if (zpos > maxz_m || zpos < minz_m || rpos > maxr_m || rpos < minr_m){
flagNeedUpdate = true;
gmsgALL << level4 << getName()
<< ": Particle " << id
<< " out of the global aperture of cyclotron!" << endl;
gmsgALL << level4 << getName()
<< ": Coords: "<< RefPartBunch_m->R[id] << endl;
} else{
flagNeedUpdate = apply(RefPartBunch_m->R[id], RefPartBunch_m->P[id], t, E, B);
if(flagNeedUpdate){
gmsgALL << level4 << getName()
<< ": Particle "<< id
<< " out of the field map boundary!" << endl;
gmsgALL << level4 << getName()
<< ": Coords: "<< RefPartBunch_m->R[id] << endl;
}
}
if (flagNeedUpdate) {
lossDs_m->addParticle(RefPartBunch_m->R[id], RefPartBunch_m->P[id],id);
RefPartBunch_m->Bin[id] = -1;
}
if (flagNeedUpdate) {
lossDs_m->addParticle(RefPartBunch_m->R[id], RefPartBunch_m->P[id],
id, t, 0, RefPartBunch_m->bunchNum[id]);
RefPartBunch_m->Bin[id] = -1;
}
return flagNeedUpdate;
return flagNeedUpdate;
}
bool Cyclotron::apply(const Vector_t &R, const Vector_t &P,
......
......@@ -93,6 +93,7 @@ bool Stripper::doCheck(PartBunchBase<double, 3> *bunch, const int turnnumber, co
size_t tempnum = bunch->getLocalNum();
int pflag = 0;
Inform gmsgALL("OPAL", INFORM_ALL_NODES);
for(unsigned int i = 0; i < tempnum; ++i) {
if(bunch->PType[i] != ParticleType::REGULAR) continue;
......@@ -113,7 +114,9 @@ bool Stripper::doCheck(PartBunchBase<double, 3> *bunch, const int turnnumber, co
flagNeedUpdate = true;
if (stop_m) {
bunch->Bin[i] = -1;
gmsgALL << level4 << getName() << ": Particle " << bunch->ID[i] << " is deleted by stripper " << getName() << endl;
} else {
gmsgALL << level4 << getName() << ": Particle " << bunch->ID[i] << " collide in stripper " << getName() << endl;
// change charge and mass of PartData when the reference particle hits the stripper.
if(bunch->ID[i] == 0)
bunch->setPType(ParticleType::STRIPPED);
......
......@@ -127,8 +127,7 @@ void FM3DH5Block::readMap() {
h5err = H5CloseFile(file);
assert (h5err != H5_ERR);
INFOMSG(level3 << typeset_msg("read in fieldmap '" + Filename_m + "'", "info") << "\n"
<< endl);
INFOMSG(level3 << typeset_msg("fieldmap '" + Filename_m + "' read", "info") << endl);
}
void FM3DH5Block::freeMap() {
......@@ -140,8 +139,7 @@ void FM3DH5Block::freeMap() {
FieldstrengthHy_m.clear();
FieldstrengthHz_m.clear();
INFOMSG(level3 << typeset_msg("freed fieldmap '" + Filename_m + "'", "info") << "\n"
<< endl);
INFOMSG(level3 << typeset_msg("freed fieldmap '" + Filename_m + "'", "info") << endl);
}
}
......
......@@ -2040,7 +2040,8 @@ BoundaryGeometry::writeGeomToVtk (std::string fn) {
Inform&
BoundaryGeometry::printInfo (Inform& os) const {
os << "* *************Boundary Geometry Info*********************************************** " << endl;
os << endl;
os << "* ************* B O U N D A R Y G E O M E T R Y *********************************** " << endl;
os << "* GEOMETRY " << getOpalName () << '\n'
<< "* FGEOM " << Attributes::getString (itsAttr[FGEOM]) << '\n'
<< "* TOPO " << Attributes::getString (itsAttr[TOPO]) << '\n'
......
......@@ -115,9 +115,6 @@ void ParticleMatterInteraction::update() {
void ParticleMatterInteraction::initParticleMatterInteractionHandler(ElementBase &element) {
*gmsg << "* ************* P A R T I C L E M A T E R I N T E R A C T I O N ****************** " << endl;
*gmsg << "* ParticleMatterInteraction::initParticleMatterInteractionHandler " << endl;
*gmsg << "* ********************************************************************************** " << endl;
std::string material = Util::toUpper(Attributes::getString(itsAttr[MATERIAL]));
bool enableRutherford = Attributes::getBool(itsAttr[ENABLERUTHERFORD]);
......@@ -143,6 +140,7 @@ void ParticleMatterInteraction::updateElement(ElementBase *element) {
void ParticleMatterInteraction::print(std::ostream &os) const {
os << "* ************* P A R T I C L E M A T T E R I N T E R A C T I O N ****************** " << std::endl;
os << "* PARTICLEMATTERINTERACTION " << getOpalName() << '\n'
<< "* TYPE " << Attributes::getString(itsAttr[TYPE]) << '\n'
<< "* MATERIAL " << Attributes::getString(itsAttr[MATERIAL]) << '\n';
os << "* ********************************************************************************** " << std::endl;
}
\ No newline at end of file
}
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