BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
|
Linear interpolation over 4d array. More...
#include <BDSInterpolator4DLinear.hh>
Public Member Functions | |
BDSInterpolator4DLinear (BDSArray4DCoords *arrayIn) | |
![]() | |
BDSInterpolator4D (BDSArray4DCoords *arrayIn) | |
G4ThreeVector | GetInterpolatedValue (G4double x, G4double y, G4double z, G4double t) const |
Public interface to a 4D interpolator. Returns Geant4 type as that's what will be needed. | |
const BDSArray4DCoords * | Array () const |
virtual BDSExtent | Extent () const |
Extent of field. | |
virtual G4bool | TimeVarying () const |
![]() | |
BDSInterpolator (BDSArray4DCoords *arrayIn=nullptr) | |
virtual BDSExtent | Extent () const =0 |
Interface each derived class must provide. | |
virtual G4bool | TimeVarying () const =0 |
G4double | SmallestSpatialStep () const |
Protected Member Functions | |
virtual BDSFieldValue | GetInterpolatedValueT (G4double x, G4double y, G4double z, G4double t) const |
virtual BDSFieldValue | GetInterpolatedValueT (G4double x, G4double y, G4double z, G4double t) const =0 |
Private Member Functions | |
BDSInterpolator4DLinear ()=delete | |
Private default constructor to force use of provided one. | |
Additional Inherited Members | |
![]() | |
BDSArray4DCoords * | array |
The field data. | |
![]() | |
G4double | smallestSpatialStep |
Linear interpolation over 4d array.
Does not own array - so multiple interpolators could be used on same data.
This uses a quad-linear algorithm to interpolate a 3d array and return the value at any arbitrary point. If the point lies outside the array the default value for the templated parameter is returned (typically 0). Therefore, the field drops to 0 outside the specified region.
This is based on an extension of the trilinear algorithm described in BDSInterpolator3DLinear.hh.
Definition at line 45 of file BDSInterpolator4DLinear.hh.
|
explicit |
Definition at line 26 of file BDSInterpolator4DLinear.cc.
|
virtual |
Definition at line 30 of file BDSInterpolator4DLinear.cc.
|
protectedvirtual |
Each derived class should implement this function. Note T suffix (was templated) to distinguish it from GetInterpolatedValue which returns Geant4 types and is the main interface to should have the clean name.
Implements BDSInterpolator4D.
Definition at line 33 of file BDSInterpolator4DLinear.cc.
References BDSInterpolator4D::array, BDSArray4DCoords::ExtractSection2x2x2x2(), and BDS::Linear4D().