BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
BDSInterpolator2DCubic.cc
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#include "BDSArray2DCoords.hh"
19#include "BDSFieldValue.hh"
20#include "BDSInterpolator2DCubic.hh"
21#include "BDSInterpolatorRoutines.hh"
22
23#include "G4Types.hh"
24
26 BDSInterpolator2D(arrayIn)
27{;}
28
29BDSInterpolator2DCubic::~BDSInterpolator2DCubic()
30{;}
31
33{
34 BDSFieldValue localData[4][4];
35 G4double xFrac, yFrac;
36 array->ExtractSection4x4(x, y, localData, xFrac, yFrac);
37 return BDS::Cubic2D(localData, xFrac, yFrac);
38}
2D array with spatial mapping derived from BDSArray4DCoords.
virtual void ExtractSection4x4(G4double x, G4double y, BDSFieldValue(&localData)[4][4], G4double &xFrac, G4double &yFrac) const
Extract 4x4 points lying around coordinate x.
virtual BDSFieldValue GetInterpolatedValueT(G4double x, G4double y) const
BDSInterpolator2DCubic()=delete
Private default constructor to force use of provided one.
Interface for all 2D interpolators.
BDSArray2DCoords * array
The field data.
T Cubic2D(const T p[4][4], G4double x, G4double y)
Cubic interpolation in 2 dimensions.