#include <BFieldCond.h>
Definition at line 21 of file BFieldCond.h.
◆ BFieldCond()
BFieldCond::BFieldCond |
( |
bool |
finite, |
|
|
const double * |
p1, |
|
|
const double * |
p2, |
|
|
double |
curr |
|
) |
| |
|
inline |
Definition at line 25 of file BFieldCond.h.
30 ,
m_p1(Eigen::Map<const Eigen::Vector3d>(
p1))
31 ,
m_p2(Eigen::Map<const Eigen::Vector3d>(
p2))
◆ addBiotSavart()
Definition at line 21 of file BFieldCond.cxx.
26 static const double mu04pi = 1.0e-7;
27 static const double minvsq = 10. * 10.;
29 const Eigen::Map<const Eigen::Vector3d>
pos(
xyz);
30 Eigen::Map<Eigen::Vector3d>
B(B_in);
34 const Eigen::Vector3d
v =
m_u.cross(r1);
35 const double vsq =
std::max(
v.squaredNorm(), minvsq);
37 const double r1u =
r1.dot(
m_u);
39 const double r2u =
r2.dot(
m_u);
40 const double r1n =
r1.norm();
42 const double r2n =
r2.norm();
44 const double f0 = mu04pi *
m_curr * scaleFactor / vsq;
45 const double f1 = f0 * (
m_finite ? r1u / r1n - r2u / r2n : 2.0);
46 const double f2 = 2.0 *
f1 / vsq;
51 Eigen::Map<Eigen::Matrix<double, 3, 3, Eigen::RowMajor>> D(deriv);
53 D(0, 1) -=
f1 *
m_u(2);
54 D(0, 2) +=
f1 *
m_u(1);
55 D(1, 0) +=
f1 *
m_u(2);
56 D(1, 2) -=
f1 *
m_u(0);
57 D(2, 0) -=
f1 *
m_u(1);
58 D(2, 1) +=
f1 *
m_u(0);
61 Eigen::Vector3d
w =
f2 * (
m_u * r1u -
r1);
65 w += f0 * ((
m_u -
r1 * r1u / (r1n * r1n)) / r1n -
66 (
m_u -
r2 * r2u / (r2n * r2n)) / r2n);
69 D +=
v *
w.transpose();
◆ curr()
double BFieldCond::curr |
( |
| ) |
const |
|
inline |
◆ finite()
bool BFieldCond::finite |
( |
| ) |
const |
|
inline |
◆ p1()
double BFieldCond::p1 |
( |
int |
i | ) |
const |
|
inline |
◆ p2()
double BFieldCond::p2 |
( |
int |
i | ) |
const |
|
inline |
◆ scaleCurrent()
void BFieldCond::scaleCurrent |
( |
double |
factor | ) |
|
|
inline |
◆ m_curr
double BFieldCond::m_curr |
|
private |
◆ m_finite
bool BFieldCond::m_finite |
|
private |
◆ m_nomCurr
double BFieldCond::m_nomCurr |
|
private |
◆ m_p1
const Eigen::Vector3d BFieldCond::m_p1 |
|
private |
◆ m_p2
const Eigen::Vector3d BFieldCond::m_p2 |
|
private |
◆ m_u
const Eigen::Vector3d BFieldCond::m_u |
|
private |
The documentation for this class was generated from the following files: