Commit d7d4f1f1 authored by kraus's avatar kraus

current status

parent 0f557287
......@@ -465,13 +465,13 @@ void SpecificElementVisitor<ELEM>::visitBeamline(const Beamline &element) {
template<class ELEM>
void SpecificElementVisitor<ELEM>::visitFlaggedElmPtr(const FlaggedElmPtr &element) {
const ElementBase* wrappedElement = element.getElement();
const ElementBase::SP wrappedElement = element.getElement();
wrappedElement->accept(*this);
}
template<class ELEM>
void SpecificElementVisitor<ELEM>::visitAlignWrapper(const AlignWrapper &element) {
const ElementBase* wrappedElement = element.getElement();
const ElementBase::SP wrappedElement = element.getElement();
wrappedElement->accept(*this);
}
......@@ -539,4 +539,4 @@ typename SpecificElementVisitor<ELEM>::const_reference_t SpecificElementVisitor<
return allElementsOfTypeE.front();
}
#endif
#endif
\ No newline at end of file
......@@ -145,7 +145,7 @@ CollimatorPhysics::~CollimatorPhysics() {
}
std::string CollimatorPhysics::getName() {
return element_ref_m->getName();
return element_ref_m.lock()->getName();
}
/// The material of the collimator
......@@ -425,7 +425,7 @@ void CollimatorPhysics::addBackToBunch(PartBunchBase<double, 3> *bunch) {
if (nL == 0) return;
unsigned int numLocalParticles = bunch->getLocalNum();
const double elementLength = element_ref_m->getElementLength();
const double elementLength = element_ref_m.lock()->getElementLength();
for (size_t i = 0; i < nL; ++ i) {
Vector_t &R = locParts_m[i].Rincol;
......@@ -474,7 +474,7 @@ void CollimatorPhysics::copyFromBunch(PartBunchBase<double, 3> *bunch,
IpplTimings::startTimer(DegraderDestroyTimer_m);
double zmax = boundingSphere.first(2) + boundingSphere.second;
double zmin = boundingSphere.first(2) - boundingSphere.second;
if (zmax < 0.0 || zmin > element_ref_m->getElementLength()) {
if (zmax < 0.0 || zmin > element_ref_m.lock()->getElementLength()) {
IpplTimings::stopTimer(DegraderDestroyTimer_m);
return;
}
......@@ -542,7 +542,7 @@ void CollimatorPhysics::print(Inform &msg) {
OPALTimer::Timer time;
msg << level2
<< "--- CollimatorPhysics - Name " << element_ref_m->getName()
<< "--- CollimatorPhysics - Name " << element_ref_m.lock()->getName()
<< " Material " << material_m << "\n"
<< "Particle Statistics @ " << time.time() << "\n"
<< std::setw(21) << "entered: " << Util::toStringWithThousandSep(bunchToMatStat_m) << "\n"
......@@ -632,7 +632,7 @@ void CollimatorPhysics::push() {
// the particles. This will ensure that the momenta of all particles
// are reduced by approcimately the same amount in computeEnergyLoss.
void CollimatorPhysics::setTimeStepForLeavingParticles() {
const double elementLength = element_ref_m->getElementLength();
const double elementLength = element_ref_m.lock()->getElementLength();
for (size_t i = 0; i < locParts_m.size(); ++i) {
Vector_t &R = locParts_m[i].Rincol;
......
......@@ -146,8 +146,8 @@ void OpalCavity::fillRegisteredAttributes(const ElementBase &base, ValueFlag fla
void OpalCavity::update() {
OpalElement::update();
RFCavityRep *rfc =
dynamic_cast<RFCavityRep *>(getElement()->removeWrappers());
std::shared_ptr<RFCavityRep> rfc =
std::dynamic_pointer_cast<RFCavityRep>(getElement()->removeWrappers());
double length = Attributes::getReal(itsAttr[LENGTH]);
double peak = Attributes::getReal(itsAttr[VOLT]);
......
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