mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Migrated pointToPointPlanarInterpolation updates from old development line
This commit is contained in:
@ -272,6 +272,10 @@ void Foam::pointToPointPlanarInterpolation::calcWeights
|
||||
<< endl;
|
||||
}
|
||||
|
||||
OBJstream str("stencil.obj");
|
||||
Pout<< "pointToPointPlanarInterpolation::calcWeights :"
|
||||
<< " Dumping stencil to " << str.name() << endl;
|
||||
|
||||
forAll(destPoints, i)
|
||||
{
|
||||
label v0 = nearestVertex_[i][0];
|
||||
@ -285,17 +289,21 @@ void Foam::pointToPointPlanarInterpolation::calcWeights
|
||||
<< " at:" << sourcePoints[v0]
|
||||
<< " weight:" << nearestVertexWeight_[i][0] << nl;
|
||||
|
||||
str.write(linePointRef(destPoints[i], sourcePoints[v0]));
|
||||
|
||||
if (v1 != -1)
|
||||
{
|
||||
Pout<< " " << v1
|
||||
<< " at:" << sourcePoints[v1]
|
||||
<< " weight:" << nearestVertexWeight_[i][1] << nl;
|
||||
str.write(linePointRef(destPoints[i], sourcePoints[v1]));
|
||||
}
|
||||
if (v2 != -1)
|
||||
{
|
||||
Pout<< " " << v2
|
||||
<< " at:" << sourcePoints[v2]
|
||||
<< " weight:" << nearestVertexWeight_[i][2] << nl;
|
||||
str.write(linePointRef(destPoints[i], sourcePoints[v2]));
|
||||
}
|
||||
|
||||
Pout<< endl;
|
||||
@ -317,7 +325,10 @@ Foam::pointToPointPlanarInterpolation::pointToPointPlanarInterpolation
|
||||
:
|
||||
perturb_(perturb),
|
||||
nearestOnly_(nearestOnly),
|
||||
referenceCS_(calcCoordinateSystem(sourcePoints)),
|
||||
referenceCS_
|
||||
(
|
||||
nearestOnly ? coordinateSystem() : calcCoordinateSystem(sourcePoints)
|
||||
),
|
||||
nPoints_(sourcePoints.size())
|
||||
{
|
||||
calcWeights(sourcePoints, destPoints);
|
||||
@ -341,6 +352,43 @@ Foam::pointToPointPlanarInterpolation::pointToPointPlanarInterpolation
|
||||
}
|
||||
|
||||
|
||||
Foam::pointToPointPlanarInterpolation::pointToPointPlanarInterpolation
|
||||
(
|
||||
const scalar perturb,
|
||||
const bool nearestOnly,
|
||||
const coordinateSystem& referenceCS,
|
||||
const label sourceSize,
|
||||
const List<FixedList<label, 3> >& nearestVertex,
|
||||
const List<FixedList<scalar, 3> >& nearestVertexWeight
|
||||
)
|
||||
:
|
||||
perturb_(perturb),
|
||||
nearestOnly_(nearestOnly),
|
||||
referenceCS_(referenceCS),
|
||||
nPoints_(sourceSize),
|
||||
nearestVertex_(nearestVertex),
|
||||
nearestVertexWeight_(nearestVertexWeight)
|
||||
{}
|
||||
|
||||
|
||||
Foam::autoPtr<Foam::pointToPointPlanarInterpolation>
|
||||
Foam::pointToPointPlanarInterpolation::clone() const
|
||||
{
|
||||
return autoPtr<pointToPointPlanarInterpolation>
|
||||
(
|
||||
new pointToPointPlanarInterpolation
|
||||
(
|
||||
perturb_,
|
||||
nearestOnly_,
|
||||
referenceCS_,
|
||||
nPoints_,
|
||||
nearestVertex_,
|
||||
nearestVertexWeight_
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::wordList Foam::pointToPointPlanarInterpolation::timeNames
|
||||
|
||||
@ -73,6 +73,7 @@ class pointToPointPlanarInterpolation
|
||||
// patch
|
||||
List<FixedList<scalar, 3>> nearestVertexWeight_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Calculate a local coordinate system from set of points
|
||||
@ -85,6 +86,7 @@ class pointToPointPlanarInterpolation
|
||||
const pointField& destPoints
|
||||
);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
// Declare name of the class and its debug switch
|
||||
@ -114,9 +116,35 @@ public:
|
||||
const scalar perturb
|
||||
);
|
||||
|
||||
//- Construct from components
|
||||
pointToPointPlanarInterpolation
|
||||
(
|
||||
const scalar perturb,
|
||||
const bool nearestOnly,
|
||||
const coordinateSystem& referenceCS,
|
||||
const label sourceSize,
|
||||
const List<FixedList<label, 3> >& nearestVertex,
|
||||
const List<FixedList<scalar, 3> >& nearestVertexWeight
|
||||
);
|
||||
|
||||
//- Construct and return a clone
|
||||
autoPtr<pointToPointPlanarInterpolation> clone() const;
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Perturbation factor (for triangulation)
|
||||
scalar perturb() const
|
||||
{
|
||||
return perturb_;
|
||||
}
|
||||
|
||||
//- Whether to use nearest point only (avoids triangulation, projection)
|
||||
bool nearestOnly() const
|
||||
{
|
||||
return nearestOnly_;
|
||||
}
|
||||
|
||||
//- Return the coordinateSystem
|
||||
const coordinateSystem& referenceCS() const
|
||||
{
|
||||
@ -158,7 +186,6 @@ public:
|
||||
//- Interpolate from field on source points to dest points
|
||||
template<class Type>
|
||||
tmp<Field<Type>> interpolate(const Field<Type>& sourceFld) const;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user