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();
56 timeVarying = xDimensionIn == tt || yDimensionIn == tt || zDimensionIn == tt;
65 G4double& zFrac)
const
67 G4double xArrayCoords, yArrayCoords, zArrayCoords;
69 auto x1 = (G4int)std::floor(xArrayCoords);
70 auto y1 = (G4int)std::floor(yArrayCoords);
71 auto z1 = (G4int)std::floor(zArrayCoords);
73 xFrac = xArrayCoords - x1;
74 yFrac = yArrayCoords - y1;
75 zFrac = zArrayCoords - z1;
77 for (G4int i = 0; i < 2; i++)
79 for (G4int j = 0; j < 2; j++)
81 for (G4int k = 0; k < 2; k++)
82 {localData[i][j][k] =
GetConst(x1+i, y1+j, z1+k);}
93 G4double& zFrac)
const
95 G4double xArrayCoords, yArrayCoords, zArrayCoords;
97 auto x1 = (G4int)std::floor(xArrayCoords);
98 auto y1 = (G4int)std::floor(yArrayCoords);
99 auto z1 = (G4int)std::floor(zArrayCoords);
100 xFrac = xArrayCoords - x1;
101 yFrac = yArrayCoords - y1;
102 zFrac = zArrayCoords - z1;
104 for (G4int i = 0; i < 4; i++)
106 for (G4int j = 0; j < 4; j++)
108 for (G4int k = 0; k < 4; k++)
110 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