Skip to content
Snippets Groups Projects
Commit 80ea7490 authored by R D Schaffer's avatar R D Schaffer
Browse files

move to new initialization of field when creating BFieldCache object as a test...

move to new initialization of field when creating BFieldCache object as a test for optimizing the speed of the bfield calculations
parent b36463a6
No related branches found
No related tags found
No related merge requests found
......@@ -76,25 +76,23 @@ BFieldMesh<T>::getCache(double z,
// store the B field at the 8 corners
const int im0 = iz * m_zoff + ir * m_roff + iphi; // index of the first corner
if (!m_doNew) {
std::array<BFieldVector<T>, 8> field = {
m_field[im0],
m_field[im0 + 1],
m_field[im0 + m_roff],
m_field[im0 + m_roff + 1],
m_field[im0 + m_zoff],
m_field[im0 + m_zoff + 1],
m_field[im0 + m_zoff + m_roff],
m_field[im0 + m_zoff + m_roff + 1]
};
// ** The following field initialization is commented out, and replaced by subsequent matrix
// ** initialization as optimization test
cache.setField(field, scaleFactor);
// std::array<BFieldVector<T>, 8> field = {
// m_field[im0],
// m_field[im0 + 1],
// m_field[im0 + m_roff],
// m_field[im0 + m_roff + 1],
// m_field[im0 + m_zoff],
// m_field[im0 + m_zoff + 1],
// m_field[im0 + m_zoff + m_roff],
// m_field[im0 + m_zoff + m_roff + 1]
// };
}
else {
// cache.printField();
// cache.setField(field, scaleFactor);
const double sf = scaleFactor;
......@@ -126,12 +124,6 @@ BFieldMesh<T>::getCache(double z,
};
cache.setField(field1);
// cache.printField();
}
// store the B scale
cache.setBscale(m_scale);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment