Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
pointToPointPlanarInterpolation Class Reference

Interpolates between two sets of unstructured points using 2D Delaunay triangulation. Used in e.g. timeVaryingMapped bcs. More...

Collaboration diagram for pointToPointPlanarInterpolation:
Collaboration graph
[legend]

Public Member Functions

 ClassName ("pointToPointPlanarInterpolation")
 
 pointToPointPlanarInterpolation (const pointField &sourcePoints, const pointField &destPoints, const scalar perturb, const bool nearestOnly=false)
 Construct from 3D locations. Determines local coordinate system. More...
 
 pointToPointPlanarInterpolation (const coordinateSystem &referenceCS, const pointField &sourcePoints, const pointField &destPoints, const scalar perturb)
 Construct from coordinate system and locations. More...
 
const coordinateSystemreferenceCS () const
 Return the coordinateSystem. More...
 
label sourceSize () const
 Number of source points. More...
 
const List< FixedList< label, 3 > > & nearestVertex () const
 
const List< FixedList< scalar, 3 > > & nearestVertexWeight () const
 Current interpolation factors to face centres of underlying. More...
 
template<class Type >
tmp< Field< Type > > interpolate (const Field< Type > &sourceFld) const
 Interpolate from field on source points to dest points. More...
 
template<class Type >
Foam::tmp< Foam::Field< Type > > interpolate (const Field< Type > &sourceFld) const
 

Static Public Member Functions

static wordList timeNames (const instantList &)
 Helper: extract words of times. More...
 
static bool findTime (const instantList &times, const label startSampleTime, const scalar timeVal, label &lo, label &hi)
 Helper: find time. Return true if succesful. More...
 

Private Member Functions

coordinateSystem calcCoordinateSystem (const pointField &) const
 Calculate a local coordinate system from set of points. More...
 
void calcWeights (const pointField &sourcePoints, const pointField &destPoints)
 Calculate addressing and weights. More...
 

Private Attributes

const scalar perturb_
 Perturbation factor. More...
 
const bool nearestOnly_
 Whether to use nearest point only (avoids triangulation, projection) More...
 
coordinateSystem referenceCS_
 Coordinate system. More...
 
label nPoints_
 Number of source points (for checking) More...
 
List< FixedList< label, 3 > > nearestVertex_
 Current interpolation addressing to face centres of underlying. More...
 
List< FixedList< scalar, 3 > > nearestVertexWeight_
 Current interpolation factors to face centres of underlying. More...
 

Detailed Description

Interpolates between two sets of unstructured points using 2D Delaunay triangulation. Used in e.g. timeVaryingMapped bcs.

Source files

Definition at line 51 of file pointToPointPlanarInterpolation.H.

Constructor & Destructor Documentation

◆ pointToPointPlanarInterpolation() [1/2]

pointToPointPlanarInterpolation ( const pointField sourcePoints,
const pointField destPoints,
const scalar  perturb,
const bool  nearestOnly = false 
)

Construct from 3D locations. Determines local coordinate system.

from sourcePoints and maps onto that. If nearestOnly skips any local coordinate system and triangulation and uses nearest vertex only

Definition at line 311 of file pointToPointPlanarInterpolation.C.

◆ pointToPointPlanarInterpolation() [2/2]

pointToPointPlanarInterpolation ( const coordinateSystem referenceCS,
const pointField sourcePoints,
const pointField destPoints,
const scalar  perturb 
)

Construct from coordinate system and locations.

Definition at line 328 of file pointToPointPlanarInterpolation.C.

Member Function Documentation

◆ calcCoordinateSystem()

Foam::coordinateSystem calcCoordinateSystem ( const pointField points) const
private

Calculate a local coordinate system from set of points.

Definition at line 48 of file pointToPointPlanarInterpolation.C.

References Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::Info, Foam::mag(), n, Foam::nl, and points.

Here is the call graph for this function:

◆ calcWeights()

void calcWeights ( const pointField sourcePoints,
const pointField destPoints 
)
private

◆ ClassName()

ClassName ( "pointToPointPlanarInterpolation"  )

◆ referenceCS()

const coordinateSystem& referenceCS ( ) const
inline

◆ sourceSize()

label sourceSize ( ) const
inline

Number of source points.

Definition at line 126 of file pointToPointPlanarInterpolation.H.

References pointToPointPlanarInterpolation::nPoints_.

◆ nearestVertex()

const List<FixedList<label, 3> >& nearestVertex ( ) const
inline

◆ nearestVertexWeight()

const List<FixedList<scalar, 3> >& nearestVertexWeight ( ) const
inline

Current interpolation factors to face centres of underlying.

patch

Definition at line 139 of file pointToPointPlanarInterpolation.H.

◆ timeNames()

Foam::wordList timeNames ( const instantList times)
static

Helper: extract words of times.

Definition at line 347 of file pointToPointPlanarInterpolation.C.

References forAll, and List::size().

Referenced by timeVaryingMappedFixedValueFvPatchField< Type >::checkTable().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ findTime()

bool findTime ( const instantList times,
const label  startSampleTime,
const scalar  timeVal,
label lo,
label hi 
)
static

Helper: find time. Return true if succesful.

Definition at line 362 of file pointToPointPlanarInterpolation.C.

References Foam::endl(), Foam::Pout, and List::size().

Here is the call graph for this function:

◆ interpolate() [1/2]

tmp<Field<Type> > interpolate ( const Field< Type > &  sourceFld) const

Interpolate from field on source points to dest points.

◆ interpolate() [2/2]

Foam::tmp<Foam::Field<Type> > interpolate ( const Field< Type > &  sourceFld) const

Definition at line 32 of file pointToPointPlanarInterpolationTemplates.C.

References Foam::exit(), Foam::FatalError, FatalErrorInFunction, fld(), forAll, and w().

Here is the call graph for this function:

Field Documentation

◆ perturb_

const scalar perturb_
private

Perturbation factor.

Definition at line 56 of file pointToPointPlanarInterpolation.H.

◆ nearestOnly_

const bool nearestOnly_
private

Whether to use nearest point only (avoids triangulation, projection)

Definition at line 59 of file pointToPointPlanarInterpolation.H.

◆ referenceCS_

coordinateSystem referenceCS_
private

Coordinate system.

Definition at line 62 of file pointToPointPlanarInterpolation.H.

Referenced by pointToPointPlanarInterpolation::referenceCS().

◆ nPoints_

label nPoints_
private

Number of source points (for checking)

Definition at line 65 of file pointToPointPlanarInterpolation.H.

Referenced by pointToPointPlanarInterpolation::sourceSize().

◆ nearestVertex_

List<FixedList<label, 3> > nearestVertex_
private

Current interpolation addressing to face centres of underlying.

patch

Definition at line 69 of file pointToPointPlanarInterpolation.H.

Referenced by pointToPointPlanarInterpolation::nearestVertex().

◆ nearestVertexWeight_

List<FixedList<scalar, 3> > nearestVertexWeight_
private

Current interpolation factors to face centres of underlying.

patch

Definition at line 73 of file pointToPointPlanarInterpolation.H.


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