opal AT lists.psi.ch
Subject: The OPAL Discussion Forum
List archive
- From: "Adelmann Andreas (PSI)" <andreas.adelmann AT psi.ch>
- To: Chris Rogers <chris.rogers AT stfc.ac.uk>
- Cc: opal <opal AT lists.psi.ch>, "Bokor Jozef (PSI)" <Jozef.Bokor AT psi.ch>
- Subject: [Opal] Field Scale in RingDefinition
- Date: Tue, 3 Nov 2015 13:55:51 +0000
- Accept-language: en-US, de-CH
- List-archive: <https://lists.web.psi.ch/pipermail/opal/>
- List-id: The OPAL Discussion Forum <opal.lists.psi.ch>
Hi Chris, I want to add an attribute
FIELDSCALE
to the RingDefinition use it in apply
bool
Ring::apply(const
Vector_t &R,
const
Vector_t ¢roid,
const
double &t,
Vector_t &E,
Vector_t &B) {
B = Vector_t(0.0, 0.0, 0.0);
E = Vector_t(0.0, 0.0, 0.0);
std::vector<RingSection*>
sections = getSectionsAt(R);
bool
outOfBounds =
true;
// assume field maps don't set B, E to 0...
for (size_t
i = 0; i < sections.size(); ++i) {
Vector_t
B_temp(0.0, 0.0, 0.0);
Vector_t
E_temp(0.0, 0.0, 0.0);
outOfBounds &= sections[i]->getFieldValue(R, centroid, t, E_temp, B_temp);
B += (FIELDSCALE_m * B_temp);
E += (FIELDSCALE_m * E_temp);
}
// std::cerr << "Ring::apply " << sections.size() << " Pos: " << R << " B: " << B << std::endl;
return outOfBounds;
}
Are you ok with that?
Andreas
------
Dr. sc. math. Andreas (Andy) Adelmann
Staff Scientist
Paul Scherrer Institut WBBA/219 CH-5232 Villigen PSI
Phone Office: xx41 56 310 42 33 Fax: xx41 56 310 31 91
Phone Home: xx41 62 891 91 44
-------------------------------------------------------
Friday: ETH CAB H 85.1 +41 44 632 75 22
============================================
The more exotic, the more abstract the knowledge,
the more profound will be its consequences.
Leon Lederman
============================================
Dr. sc. math. Andreas (Andy) Adelmann
Staff Scientist
Paul Scherrer Institut WBBA/219 CH-5232 Villigen PSI
Phone Office: xx41 56 310 42 33 Fax: xx41 56 310 31 91
Phone Home: xx41 62 891 91 44
-------------------------------------------------------
Friday: ETH CAB H 85.1 +41 44 632 75 22
============================================
The more exotic, the more abstract the knowledge,
the more profound will be its consequences.
Leon Lederman
============================================
- [Opal] Field Scale in RingDefinition, Adelmann Andreas (PSI), 11/03/2015
Archive powered by MHonArc 2.6.19.