19#include "BDSArray3DCoords.hh"
29 G4double xMinIn, G4double xMaxIn,
30 G4double yMinIn, G4double yMaxIn,
31 G4double zMinIn, G4double zMaxIn,
44 std::set<BDSDimensionType> allDims = {BDSDimensionType::x,
48 allDims.erase(xDimensionIn);
49 allDims.erase(yDimensionIn);
50 allDims.erase(zDimensionIn);
51 std::vector<BDSDimensionType> allDimsV(allDims.begin(), allDims.end());
52 tDimension = allDimsV[0];
53 BuildDimensionIndex();
62 G4double& zFrac)
const
64 G4double xArrayCoords, yArrayCoords, zArrayCoords;
66 auto x1 = (G4int)std::floor(xArrayCoords);
67 auto y1 = (G4int)std::floor(yArrayCoords);
68 auto z1 = (G4int)std::floor(zArrayCoords);
70 xFrac = xArrayCoords - x1;
71 yFrac = yArrayCoords - y1;
72 zFrac = zArrayCoords - z1;
74 for (G4int i = 0; i < 2; i++)
76 for (G4int j = 0; j < 2; j++)
78 for (G4int k = 0; k < 2; k++)
79 {localData[i][j][k] =
GetConst(x1+i, y1+j, z1+k);}
90 G4double& zFrac)
const
92 G4double xArrayCoords, yArrayCoords, zArrayCoords;
94 auto x1 = (G4int)std::floor(xArrayCoords);
95 auto y1 = (G4int)std::floor(yArrayCoords);
96 auto z1 = (G4int)std::floor(zArrayCoords);
97 xFrac = xArrayCoords - x1;
98 yFrac = yArrayCoords - y1;
99 zFrac = zArrayCoords - z1;
101 for (G4int i = 0; i < 4; i++)
103 for (G4int j = 0; j < 4; j++)
105 for (G4int k = 0; k < 4; k++)
107 localData[i][j][k] =
GetConst(x1-1+i, y1-1+j, z1-1+k);
3D array with spatial mapping derived from BDSArray4DCoords.
BDSArray3DCoords()=delete
virtual void ExtractSection2x2x2(G4double x, G4double y, G4double z, BDSFieldValue(&localData)[2][2][2], G4double &xFrac, G4double &yFrac, G4double &zFrac) const
Extract 2x2x2 points lying around coordinate x.
virtual void ExtractSection4x4x4(G4double x, G4double y, G4double z, BDSFieldValue(&localData)[4][4][4], G4double &xFrac, G4double &yFrac, G4double &zFrac) const
Extract 4x4x4 points lying around coordinate x.
virtual BDSFieldValue ExtractNearest(G4double x, G4double y=0, G4double z=0, G4double t=0) const
Extract nearest field value from array. t ignored but required for overload.
Overlay of 4D array that provides uniform only spatial coordinate mapping.
virtual std::ostream & Print(std::ostream &out) const
virtual G4int NearestY(G4double y) const
Not much point in being both virtual and inline (in our use case) but has to be virtual.
virtual G4int NearestX(G4double x) const
Not much point in being both virtual and inline (in our use case) but has to be virtual.
virtual G4int NearestZ(G4double z) const
Not much point in being both virtual and inline (in our use case) but has to be virtual.
void ArrayCoordsFromXYZ(G4double &x, G4double &xArr, G4double &y, G4double &yArr, G4double &z, G4double &zArr) const
Utility version to forward to individual function.
virtual const BDSFieldValue & GetConst(G4int x, G4int y=0, G4int z=0, G4int t=0) const