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