![]() |
![]() |
#include <MagneticField/Interpolation/src/VectorFieldInterpolation.h>
Public Member Functions | |
void | defineCellPoint000 (double X1, double X2, double X3, double F1, double F2, double F3) |
provide the interpolation algorithm with 8 points, where the field is known (in) | |
void | defineCellPoint001 (double X1, double X2, double X3, double F1, double F2, double F3) |
void | defineCellPoint010 (double X1, double X2, double X3, double F1, double F2, double F3) |
void | defineCellPoint011 (double X1, double X2, double X3, double F1, double F2, double F3) |
void | defineCellPoint100 (double X1, double X2, double X3, double F1, double F2, double F3) |
void | defineCellPoint101 (double X1, double X2, double X3, double F1, double F2, double F3) |
void | defineCellPoint110 (double X1, double X2, double X3, double F1, double F2, double F3) |
void | defineCellPoint111 (double X1, double X2, double X3, double F1, double F2, double F3) |
void | putSCoordGetVField (double X1, double X2, double X3, double &F1, double &F2, double &F3) |
receive the interpolated field (out) at any point in space (in) | |
VectorFieldInterpolation () | |
~VectorFieldInterpolation () | |
Private Attributes | |
double | CellPoint000 [6] |
double | CellPoint001 [6] |
double | CellPoint010 [6] |
double | CellPoint011 [6] |
double | CellPoint100 [6] |
double | CellPoint101 [6] |
double | CellPoint110 [6] |
double | CellPoint111 [6] |
double | SC [3] |
double | VF [3] |
Modifications: droll: change from float to double $date : 08/09/2003 18:35:10 CET $ droll: rename methods according to CMS coding rules $date : 22/09/2003 11:15:38 CET $
Definition at line 57 of file VectorFieldInterpolation.h.
VectorFieldInterpolation::VectorFieldInterpolation | ( | ) | [inline] |
VectorFieldInterpolation::~VectorFieldInterpolation | ( | ) | [inline] |
void VectorFieldInterpolation::defineCellPoint000 | ( | double | X1, | |
double | X2, | |||
double | X3, | |||
double | F1, | |||
double | F2, | |||
double | F3 | |||
) |
provide the interpolation algorithm with 8 points, where the field is known (in)
Definition at line 5 of file VectorFieldInterpolation.cc.
References CellPoint000.
Referenced by MagneticFieldGrid::interpolateAtPoint().
00005 { 00006 CellPoint000[0] = X1; 00007 CellPoint000[1] = X2; 00008 CellPoint000[2] = X3; 00009 CellPoint000[3] = F1; 00010 CellPoint000[4] = F2; 00011 CellPoint000[5] = F3; 00012 return; 00013 }
void VectorFieldInterpolation::defineCellPoint001 | ( | double | X1, | |
double | X2, | |||
double | X3, | |||
double | F1, | |||
double | F2, | |||
double | F3 | |||
) |
Definition at line 49 of file VectorFieldInterpolation.cc.
References CellPoint001.
Referenced by MagneticFieldGrid::interpolateAtPoint().
00049 { 00050 CellPoint001[0] = X1; 00051 CellPoint001[1] = X2; 00052 CellPoint001[2] = X3; 00053 CellPoint001[3] = F1; 00054 CellPoint001[4] = F2; 00055 CellPoint001[5] = F3; 00056 return; 00057 }
void VectorFieldInterpolation::defineCellPoint010 | ( | double | X1, | |
double | X2, | |||
double | X3, | |||
double | F1, | |||
double | F2, | |||
double | F3 | |||
) |
Definition at line 27 of file VectorFieldInterpolation.cc.
References CellPoint010.
Referenced by MagneticFieldGrid::interpolateAtPoint().
00027 { 00028 CellPoint010[0] = X1; 00029 CellPoint010[1] = X2; 00030 CellPoint010[2] = X3; 00031 CellPoint010[3] = F1; 00032 CellPoint010[4] = F2; 00033 CellPoint010[5] = F3; 00034 return; 00035 }
void VectorFieldInterpolation::defineCellPoint011 | ( | double | X1, | |
double | X2, | |||
double | X3, | |||
double | F1, | |||
double | F2, | |||
double | F3 | |||
) |
Definition at line 71 of file VectorFieldInterpolation.cc.
References CellPoint011.
Referenced by MagneticFieldGrid::interpolateAtPoint().
00071 { 00072 CellPoint011[0] = X1; 00073 CellPoint011[1] = X2; 00074 CellPoint011[2] = X3; 00075 CellPoint011[3] = F1; 00076 CellPoint011[4] = F2; 00077 CellPoint011[5] = F3; 00078 return; 00079 }
void VectorFieldInterpolation::defineCellPoint100 | ( | double | X1, | |
double | X2, | |||
double | X3, | |||
double | F1, | |||
double | F2, | |||
double | F3 | |||
) |
Definition at line 16 of file VectorFieldInterpolation.cc.
References CellPoint100.
Referenced by MagneticFieldGrid::interpolateAtPoint().
00016 { 00017 CellPoint100[0] = X1; 00018 CellPoint100[1] = X2; 00019 CellPoint100[2] = X3; 00020 CellPoint100[3] = F1; 00021 CellPoint100[4] = F2; 00022 CellPoint100[5] = F3; 00023 return; 00024 }
void VectorFieldInterpolation::defineCellPoint101 | ( | double | X1, | |
double | X2, | |||
double | X3, | |||
double | F1, | |||
double | F2, | |||
double | F3 | |||
) |
Definition at line 60 of file VectorFieldInterpolation.cc.
References CellPoint101.
Referenced by MagneticFieldGrid::interpolateAtPoint().
00060 { 00061 CellPoint101[0] = X1; 00062 CellPoint101[1] = X2; 00063 CellPoint101[2] = X3; 00064 CellPoint101[3] = F1; 00065 CellPoint101[4] = F2; 00066 CellPoint101[5] = F3; 00067 return; 00068 }
void VectorFieldInterpolation::defineCellPoint110 | ( | double | X1, | |
double | X2, | |||
double | X3, | |||
double | F1, | |||
double | F2, | |||
double | F3 | |||
) |
Definition at line 38 of file VectorFieldInterpolation.cc.
References CellPoint110.
Referenced by MagneticFieldGrid::interpolateAtPoint().
00038 { 00039 CellPoint110[0] = X1; 00040 CellPoint110[1] = X2; 00041 CellPoint110[2] = X3; 00042 CellPoint110[3] = F1; 00043 CellPoint110[4] = F2; 00044 CellPoint110[5] = F3; 00045 return; 00046 }
void VectorFieldInterpolation::defineCellPoint111 | ( | double | X1, | |
double | X2, | |||
double | X3, | |||
double | F1, | |||
double | F2, | |||
double | F3 | |||
) |
Definition at line 82 of file VectorFieldInterpolation.cc.
References CellPoint111.
Referenced by MagneticFieldGrid::interpolateAtPoint().
00082 { 00083 CellPoint111[0] = X1; 00084 CellPoint111[1] = X2; 00085 CellPoint111[2] = X3; 00086 CellPoint111[3] = F1; 00087 CellPoint111[4] = F2; 00088 CellPoint111[5] = F3; 00089 return; 00090 }
void VectorFieldInterpolation::putSCoordGetVField | ( | double | X1, | |
double | X2, | |||
double | X3, | |||
double & | F1, | |||
double & | F2, | |||
double & | F3 | |||
) |
receive the interpolated field (out) at any point in space (in)
Definition at line 93 of file VectorFieldInterpolation.cc.
References CellPoint000, CellPoint001, CellPoint010, CellPoint011, CellPoint100, CellPoint101, CellPoint110, CellPoint111, i, SC, and VF.
Referenced by MagneticFieldGrid::interpolateAtPoint().
00093 { 00094 SC[0] = X1; 00095 SC[1] = X2; 00096 SC[2] = X3; 00097 00098 // values describing 4 help points after interpolation step of variables X1 00099 // 5 dimensions: 2 space dimensions + 3 field dimensions 00100 // X2' , X3' , F1' , F2' , F3' 00101 double HelpPoint00[5]; // {0.0 , 0.0 , 0.0 , 0.0 , 0.0}; 00102 double HelpPoint10[5]; 00103 double HelpPoint01[5]; 00104 double HelpPoint11[5]; 00105 00106 // values describing 2 help points after interpolation step of variables X2' 00107 // 4 dimensions: 1 space dimensions + 3 field dimensions 00108 // X3" , F1" , F2" , F3" 00109 double HelpPoint0[4]; // {0.0 , 0.0 , 0.0 , 0.0}; 00110 double HelpPoint1[4]; 00111 00112 00113 // 1. iteration ***** 00114 // prepare interpolation between CellPoint000 and CellPoint100 00115 double DeltaX100X000 = CellPoint100[0] - CellPoint000[0]; 00116 double DeltaSC0X000overDeltaX100X000 = 0.; 00117 if (DeltaX100X000 != 0.) DeltaSC0X000overDeltaX100X000 = (SC[0] - CellPoint000[0]) / DeltaX100X000; 00118 00119 // prepare interpolation between CellPoint010 and CellPoint110 00120 double DeltaX110X010 = CellPoint110[0] - CellPoint010[0]; 00121 double DeltaSC0X010overDeltaX110X010 = 0.; 00122 if (DeltaX110X010 != 0.) DeltaSC0X010overDeltaX110X010 = (SC[0] - CellPoint010[0]) / DeltaX110X010; 00123 00124 // prepare interpolation between CellPoint001 and CellPoint101 00125 double DeltaX101X001 = CellPoint101[0] - CellPoint001[0]; 00126 double DeltaSC0X001overDeltaX101X001 = 0.; 00127 if (DeltaX101X001 != 0.) DeltaSC0X001overDeltaX101X001 = (SC[0] - CellPoint001[0]) / DeltaX101X001; 00128 00129 // prepare interpolation between CellPoint011 and CellPoint111 00130 double DeltaX111X011 = CellPoint111[0] - CellPoint011[0]; 00131 double DeltaSC0X011overDeltaX111X011 = 0.; 00132 if (DeltaX111X011 != 0.) DeltaSC0X011overDeltaX111X011 = (SC[0] - CellPoint011[0]) / DeltaX111X011; 00133 00134 for (int i=0; i<5; ++i){ 00135 int ip = i+1; 00136 00137 // interpolate between CellPoint000 and CellPoint100 00138 HelpPoint00[i] = CellPoint000[ip] + DeltaSC0X000overDeltaX100X000 * (CellPoint100[ip] - CellPoint000[ip]); 00139 00140 // interpolate between CellPoint010 and CellPoint110 00141 HelpPoint10[i] = CellPoint010[ip] + DeltaSC0X010overDeltaX110X010 * (CellPoint110[ip] - CellPoint010[ip]); 00142 00143 // interpolate between CellPoint001 and CellPoint101 00144 HelpPoint01[i] = CellPoint001[ip] + DeltaSC0X001overDeltaX101X001 * (CellPoint101[ip] - CellPoint001[ip]); 00145 00146 // interpolate between CellPoint011 and CellPoint111 00147 HelpPoint11[i] = CellPoint011[ip] + DeltaSC0X011overDeltaX111X011 * (CellPoint111[ip] - CellPoint011[ip]); 00148 } 00149 00150 // 2. iteration ***** 00151 // prepare interpolation between HelpPoint00 and HelpPoint10 00152 double DeltaX10X00 = HelpPoint10[0] - HelpPoint00[0]; 00153 double DeltaSC1X00overDeltaX10X00 = 0.; 00154 if (DeltaX10X00 != 0.) DeltaSC1X00overDeltaX10X00 = (SC[1] - HelpPoint00[0]) / DeltaX10X00; 00155 // prepare interpolation between HelpPoint01 and HelpPoint11 00156 double DeltaX11X01 = HelpPoint11[0] - HelpPoint01[0]; 00157 double DeltaSC1X01overDeltaX11X01 = 0.; 00158 if (DeltaX11X01 != 0.) DeltaSC1X01overDeltaX11X01 = (SC[1] - HelpPoint01[0]) / DeltaX11X01; 00159 00160 for (int i=0; i<4; ++i){ 00161 int ip = i+1; 00162 00163 // interpolate between HelpPoint00 and HelpPoint10 00164 HelpPoint0[i] = HelpPoint00[ip] + DeltaSC1X00overDeltaX10X00 * (HelpPoint10[ip] - HelpPoint00[ip]); 00165 00166 // interpolate between HelpPoint01 and HelpPoint11 00167 HelpPoint1[i] = HelpPoint01[ip] + DeltaSC1X01overDeltaX11X01 * (HelpPoint11[ip] - HelpPoint01[ip]); 00168 } 00169 00170 // 3. iteration ***** 00171 // prepare interpolation between HelpPoint0 and HelpPoint1 00172 double DeltaX1X0 = HelpPoint1[0] - HelpPoint0[0]; 00173 double DeltaSC2X0overDeltaX1X0 = 0.; 00174 if (DeltaX1X0 != 0.) DeltaSC2X0overDeltaX1X0 = (SC[2] - HelpPoint0[0]) / DeltaX1X0; 00175 00176 for (int i=0; i<3; ++i){ 00177 int ip = i+1; 00178 00179 // interpolate between HelpPoint0 and HelpPoint1 00180 VF[i] = HelpPoint0[ip] + DeltaSC2X0overDeltaX1X0 * (HelpPoint1[ip] - HelpPoint0[ip]); 00181 } 00182 00183 F1 = VF[0]; 00184 F2 = VF[1]; 00185 F3 = VF[2]; 00186 00187 return; 00188 }
double VectorFieldInterpolation::CellPoint000[6] [private] |
Definition at line 72 of file VectorFieldInterpolation.h.
Referenced by defineCellPoint000(), and putSCoordGetVField().
double VectorFieldInterpolation::CellPoint001[6] [private] |
Definition at line 76 of file VectorFieldInterpolation.h.
Referenced by defineCellPoint001(), and putSCoordGetVField().
double VectorFieldInterpolation::CellPoint010[6] [private] |
Definition at line 74 of file VectorFieldInterpolation.h.
Referenced by defineCellPoint010(), and putSCoordGetVField().
double VectorFieldInterpolation::CellPoint011[6] [private] |
Definition at line 78 of file VectorFieldInterpolation.h.
Referenced by defineCellPoint011(), and putSCoordGetVField().
double VectorFieldInterpolation::CellPoint100[6] [private] |
Definition at line 73 of file VectorFieldInterpolation.h.
Referenced by defineCellPoint100(), and putSCoordGetVField().
double VectorFieldInterpolation::CellPoint101[6] [private] |
Definition at line 77 of file VectorFieldInterpolation.h.
Referenced by defineCellPoint101(), and putSCoordGetVField().
double VectorFieldInterpolation::CellPoint110[6] [private] |
Definition at line 75 of file VectorFieldInterpolation.h.
Referenced by defineCellPoint110(), and putSCoordGetVField().
double VectorFieldInterpolation::CellPoint111[6] [private] |
Definition at line 79 of file VectorFieldInterpolation.h.
Referenced by defineCellPoint111(), and putSCoordGetVField().
double VectorFieldInterpolation::SC[3] [private] |
double VectorFieldInterpolation::VF[3] [private] |