46 virtual PetscErrorCode
interpolate(
const DM &da,
const Vec &vec, PetscReal &
v) = 0;
78 PetscErrorCode
init(
const MPI_Comm &
comm,
128 PetscErrorCode
interpolate(
const DM &da,
const Vec &vec, PetscReal &
v);
157 PetscErrorCode
interpolate(
const DM &da,
const Vec &vec, PetscReal &
v);
Class to perform a bilinear interpolation at a point in a 3D domain.
PetscErrorCode interpolate(const DM &da, const Vec &vec, PetscReal &v)
BiLinInterp(const MPI_Comm &comm, const type::RealVec1D &point, const type::Mesh &mesh, const type::Field &field)
Constructor. Initialize the linear interpolation object.
~BiLinInterp()=default
Default destructor.
Abstract Base Class of a linear interpolation object.
type::RealVec1D bl
Coordinates of the front-bottom-left neighbor.
PetscMPIInt commSize
Size of the MPI communicator.
type::RealVec1D target
Coordinates of the point to interpolate.
~LinInterpBase()
Destructor.
type::RealVec1D tr
Coordinates of the back-top-right neighbor.
MPI_Comm comm
MPI communicator.
PetscErrorCode getBoxCoords(const type::Mesh &mesh, const type::Field &field)
Get the coordinates of the neighbors.
PetscMPIInt commRank
Rank of the local process in the communicator.
PetscErrorCode init(const MPI_Comm &comm, const type::RealVec1D &point, const type::Mesh &mesh, const type::Field &field)
Initialize the linear interpolation object.
virtual PetscErrorCode interpolate(const DM &da, const Vec &vec, PetscReal &v)=0
Interpolate the value at the target point.
LinInterpBase()=default
Default constructor.
PetscErrorCode getBLGridlineIndices(const type::Mesh &mesh, const type::Field &field)
Get the gridline indices of the front-bottom-left neighbor.
type::IntVec1D idxDirs
Gridline indices of the front-bottom-left neighbor.
PetscErrorCode destroy()
Manually destroy data in the object.
Class to perform a trilinear interpolation at a point in a 3D domain.
PetscErrorCode interpolate(const DM &da, const Vec &vec, PetscReal &v)
~TriLinInterp()=default
Default destructor.
TriLinInterp(const MPI_Comm &comm, const type::RealVec1D &point, const type::Mesh &mesh, const type::Field &field)
Constructor. Initialize the linear interpolation object.
std::shared_ptr< mesh::MeshBase > Mesh
Type definition of Mesh.
std::shared_ptr< misc::LinInterpBase > LinInterp
Type definition of LinInterp.
PetscErrorCode createLinInterp(const MPI_Comm &comm, const type::RealVec1D &point, const type::Mesh &mesh, const type::Field &field, type::LinInterp &interp)
Factory function to create a linear interpolation object.
std::vector< PetscInt > IntVec1D
1D std::vector holding PetscInt.
std::vector< PetscReal > RealVec1D
1D std::vector holding PetscReal.
Prototype of mesh::MeshBase, type::Mesh, and factory function.
A toolbox for building flow solvers.
Definition of user-defined types for convenience.