24 cout <<
"ERROR: TrapezoidalCylindricalMFGrid: unexpected orientation: x: " << localXDir <<
" y: " << localYDir
29 inFile >> n1 >>
n2 >> n3;
30 double xref, yref, zref;
31 inFile >> xref >> yref >> zref;
32 double stepx, stepy, stepz;
33 inFile >> stepx >> stepy >> stepz;
35 double BasicDistance1[3][3];
36 double BasicDistance2[3][3];
37 bool easya, easyb, easyc;
39 inFile >> BasicDistance1[0][0] >> BasicDistance1[1][0] >> BasicDistance1[2][0];
40 inFile >> BasicDistance1[0][1] >> BasicDistance1[1][1] >> BasicDistance1[2][1];
41 inFile >> BasicDistance1[0][2] >> BasicDistance1[1][2] >> BasicDistance1[2][2];
42 inFile >> BasicDistance2[0][0] >> BasicDistance2[1][0] >> BasicDistance2[2][0];
43 inFile >> BasicDistance2[0][1] >> BasicDistance2[1][1] >> BasicDistance2[2][1];
44 inFile >> BasicDistance2[0][2] >> BasicDistance2[1][2] >> BasicDistance2[2][2];
45 inFile >> easya >> easyb >> easyc;
47 vector<BVector> fieldValues;
50 fieldValues.reserve(
nLines);
51 for (
int iLine = 0; iLine <
nLines; ++iLine) {
52 inFile >> Bx >> By >> Bz;
53 fieldValues.push_back(
BVector(Bx, By, Bz));
58 if (lastEntry !=
"complete") {
59 cout <<
"ERROR during file reading: file is not complete" << endl;
63 cout <<
"easya " << easya <<
" easyb " << easyb <<
" easyc " << easyc << endl;
66 if (!easyb || !easyc) {
67 throw MagGeometryError(
"TrapezoidalCartesianMFGrid only implemented for first coordinate");
71 cout <<
"Grid reference point in grid system: " << xref <<
"," << yref <<
"," << zref << endl;
72 cout <<
"steps " << stepx <<
"," << stepy <<
"," << stepz << endl;
73 cout <<
"ns " << n1 <<
"," <<
n2 <<
"," << n3 << endl;
75 for (
int i = 0;
i < 3; ++
i)
76 for (
int j = 0;
j < 3; ++
j) {
77 cout <<
"BasicDistance1[" <<
i <<
"][" <<
j <<
"] = " << BasicDistance1[
i][
j] <<
"BasicDistance2[" <<
i <<
"]["
78 <<
j <<
"] = " << BasicDistance2[
i][
j] << endl;
83 double a = stepx * (n1 - 1);
84 double b =
a + BasicDistance1[0][1] * (
n2 - 1) * (n1 - 1) + BasicDistance1[0][2] * (n3 - 1) * (n1 - 1);
86 double h = stepz * (n3 - 1);
87 double delta = -BasicDistance2[0][1] * (
n2 - 1) - BasicDistance2[0][2] * (n3 - 1);
90 cout <<
"Trapeze size (a,b,h) = " <<
a <<
"," <<
b <<
"," <<
h << endl;
97 cout <<
"Global origin " << grefp << endl;
98 cout <<
"Local origin " << lrefp << endl;
101 double baMinus1 = BasicDistance1[0][2] * (n3 - 1) / stepx;
102 if (
std::abs(baMinus1) > 0.000001) {
103 double b_over_a = 1 + baMinus1;
104 double a1 =
std::abs(baMinus1) > 0.000001 ?
delta / baMinus1 :
a / 2;
106 cout <<
"a1 = " << a1 << endl;
110 double x0 = lrefp.perp() + a1;
111 double y0 = lrefp.z() +
h / 2.;
119 Grid1D gridX(xrec, xrec + (
a +
b) / 2., n1);
120 Grid1D gridY(yref, yref + stepy * (
n2 - 1),
n2);
121 Grid1D gridZ(yrec, yrec +
h, n3);