BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
BDSInterpolator3D.hh
1/*
2Beam Delivery Simulation (BDSIM) Copyright (C) BDSIM Collaboration, 2001 - 2026.
3
4This file is part of BDSIM.
5
6BDSIM is free software: you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published
8by the Free Software Foundation version 3 of the License.
9
10BDSIM is distributed in the hope that it will be useful, but
11WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13GNU General Public License for more details.
14
15You should have received a copy of the GNU General Public License
16along with BDSIM. If not, see <http://www.gnu.org/licenses/>.
17*/
18#ifndef BDSINTERPOLATOR3D_H
19#define BDSINTERPOLATOR3D_H
20#include "BDSArray3DCoords.hh"
21#include "BDSDimensionType.hh"
22#include "BDSExtent.hh"
23#include "BDSFieldValue.hh"
24#include "BDSInterpolator.hh"
25
26#include "G4Types.hh"
27#include "G4ThreeVector.hh"
28
38{
39public:
40 BDSInterpolator3D() = delete;
41 explicit BDSInterpolator3D(BDSArray3DCoords* arrayIn);
42 virtual ~BDSInterpolator3D(){;}
43
45 G4ThreeVector GetInterpolatedValue(G4double x, G4double y, G4double z) const;
46
47 inline const BDSArray3DCoords* Array() const {return array;}
48
51
54
57
59 virtual BDSExtent Extent() const {return array->Extent();}
60
61 virtual G4bool TimeVarying() const {return array->TimeVarying();}
62
63protected:
67 virtual BDSFieldValue GetInterpolatedValueT(G4double x, G4double y, G4double z) const = 0;
68
71};
72
73#endif
3D array with spatial mapping derived from BDSArray4DCoords.
BDSDimensionType ThirdDimension() const
Accessor for each dimension label. e.g. array 'x' = spatial z.
BDSDimensionType SecondDimension() const
Accessor for each dimension label. e.g. array 'x' = spatial z.
virtual BDSExtent Extent() const
Return the SPATIAL (only) extent of this field without any offset. Ignores time.
virtual G4bool TimeVarying() const
BDSDimensionType FirstDimension() const
Accessor for each dimension label. e.g. array 'x' = spatial z.
Holder for +- extents in 3 dimensions.
Definition BDSExtent.hh:38
Interface for all 3D interpolators.
BDSDimensionType ThirdDimension() const
Accessor for the active dimension this represents (second).
G4ThreeVector GetInterpolatedValue(G4double x, G4double y, G4double z) const
Public interface to a 3D interpolator. Returns Geant4 type as that's what will be needed.
BDSDimensionType SecondDimension() const
Accessor for the active dimension this represents (second).
virtual BDSExtent Extent() const
Extent of field.
BDSArray3DCoords * array
The field data.
BDSDimensionType FirstDimension() const
Accessor for the active dimension this represents (first).
virtual BDSFieldValue GetInterpolatedValueT(G4double x, G4double y, G4double z) const =0
Interface for all interpolators containing basic extent of validity.