PetIBM 0.5.4
Toolbox and applications of the immersed-boundary method for distributed-memory architectures
petibm::misc::LinInterpBase Class Referenceabstract

Abstract Base Class of a linear interpolation object. More...

#include <lininterp.h>

Inheritance diagram for petibm::misc::LinInterpBase:
[legend]

Public Member Functions

 LinInterpBase ()=default
 Default constructor. More...
 
 ~LinInterpBase ()
 Destructor. More...
 
PetscErrorCode destroy ()
 Manually destroy data in the object. More...
 
virtual PetscErrorCode interpolate (const DM &da, const Vec &vec, PetscReal &v)=0
 Interpolate the value at the target point. More...
 

Protected Member Functions

PetscErrorCode init (const MPI_Comm &comm, const type::RealVec1D &point, const type::Mesh &mesh, const type::Field &field)
 Initialize the linear interpolation object. More...
 
PetscErrorCode getBLGridlineIndices (const type::Mesh &mesh, const type::Field &field)
 Get the gridline indices of the front-bottom-left neighbor. More...
 
PetscErrorCode getBoxCoords (const type::Mesh &mesh, const type::Field &field)
 Get the coordinates of the neighbors. More...
 

Protected Attributes

type::RealVec1D target
 Coordinates of the point to interpolate. More...
 
type::RealVec1D bl
 Coordinates of the front-bottom-left neighbor. More...
 
type::RealVec1D tr
 Coordinates of the back-top-right neighbor. More...
 
type::IntVec1D idxDirs
 Gridline indices of the front-bottom-left neighbor. More...
 
MPI_Comm comm
 MPI communicator. More...
 
PetscMPIInt commSize
 Size of the MPI communicator. More...
 
PetscMPIInt commRank
 Rank of the local process in the communicator. More...
 

Detailed Description

Abstract Base Class of a linear interpolation object.

See also
Miscellaneous functions, petibm::type::LinInterp, petibm::misc::createLinInterp

Definition at line 27 of file lininterp.h.

Constructor & Destructor Documentation

◆ LinInterpBase()

petibm::misc::LinInterpBase::LinInterpBase ( )
default

Default constructor.

◆ ~LinInterpBase()

petibm::misc::LinInterpBase::~LinInterpBase ( )

Destructor.

Definition at line 45 of file lininterp.cpp.

Member Function Documentation

◆ destroy()

PetscErrorCode petibm::misc::LinInterpBase::destroy ( )

Manually destroy data in the object.

Definition at line 59 of file lininterp.cpp.

◆ getBLGridlineIndices()

PetscErrorCode petibm::misc::LinInterpBase::getBLGridlineIndices ( const type::Mesh mesh,
const type::Field field 
)
protected

Get the gridline indices of the front-bottom-left neighbor.

Parameters
mesh[in] Cartesian mesh object
field[in] Index of the field to monitor
Returns
PetscErrorCode

Definition at line 94 of file lininterp.cpp.

◆ getBoxCoords()

PetscErrorCode petibm::misc::LinInterpBase::getBoxCoords ( const type::Mesh mesh,
const type::Field field 
)
protected

Get the coordinates of the neighbors.

Parameters
mesh[in] Cartesian mesh object
field[in] Index of the field to monitor
Returns
PetscErrorCode

Definition at line 112 of file lininterp.cpp.

◆ init()

PetscErrorCode petibm::misc::LinInterpBase::init ( const MPI_Comm &  comm,
const type::RealVec1D point,
const type::Mesh mesh,
const type::Field field 
)
protected

Initialize the linear interpolation object.

Parameters
comm[in] MPI communicator
point[in] Coordinates of the target point to interpolate
mesh[in] Cartesian mesh object
field[in] Index of the field to monitor
Returns
PetscErrorCode

Definition at line 70 of file lininterp.cpp.

◆ interpolate()

virtual PetscErrorCode petibm::misc::LinInterpBase::interpolate ( const DM &  da,
const Vec &  vec,
PetscReal &  v 
)
pure virtual

Interpolate the value at the target point.

Parameters
da[in] Parallel layout of the field to interpolate
vec[in] Vector with the field data
val[out] Interpolated value
Returns
PetscErrorCode

Implemented in petibm::misc::TriLinInterp, and petibm::misc::BiLinInterp.

Member Data Documentation

◆ bl

type::RealVec1D petibm::misc::LinInterpBase::bl
protected

Coordinates of the front-bottom-left neighbor.

Definition at line 53 of file lininterp.h.

◆ comm

MPI_Comm petibm::misc::LinInterpBase::comm
protected

MPI communicator.

Definition at line 62 of file lininterp.h.

◆ commRank

PetscMPIInt petibm::misc::LinInterpBase::commRank
protected

Rank of the local process in the communicator.

Definition at line 68 of file lininterp.h.

◆ commSize

PetscMPIInt petibm::misc::LinInterpBase::commSize
protected

Size of the MPI communicator.

Definition at line 65 of file lininterp.h.

◆ idxDirs

type::IntVec1D petibm::misc::LinInterpBase::idxDirs
protected

Gridline indices of the front-bottom-left neighbor.

Definition at line 59 of file lininterp.h.

◆ target

type::RealVec1D petibm::misc::LinInterpBase::target
protected

Coordinates of the point to interpolate.

Definition at line 50 of file lininterp.h.

◆ tr

type::RealVec1D petibm::misc::LinInterpBase::tr
protected

Coordinates of the back-top-right neighbor.

Definition at line 56 of file lininterp.h.


The documentation for this class was generated from the following files: