48 #ifndef Foam_leastSquaresEdgeInterpolation_H 49 #define Foam_leastSquaresEdgeInterpolation_H 123 return this->
mesh().edgeInterpolation::weights();
147 const GradFieldType& gradAf = tgradAf.
cref();
151 FieldType& Pi = tPi.ref();
155 const label nFaces = pointFaceAddr[i].
size();
157 FieldType Pij(nFaces);
160 for (label facei = 0; facei < nFaces; ++facei)
162 const label j = pointFaceAddr[i][facei];
168 Pij[facei] = af[j] + (dPC[facei] & gradAf[j]);
174 Pi[i] =
sum(Pij/magdPC)/
sum(scalar(1)/magdPC);
184 "interpolate(" + af.
name() +
')',
191 EdgeFieldType& interp = tinterp.ref();
192 FieldType& interpEdges = interp.primitiveFieldRef();
199 for (label edgei = 0; edgei < nInternalEdges; ++edgei)
205 Pi[faEdges[edgei].start()]
206 + Pi[faEdges[edgei].end()]
212 forAll(interp.boundaryField(), patchi)
214 interp.boundaryFieldRef()[patchi] = af.
boundaryField()[patchi];
Finite area mesh (used for 2-D non-Euclidian finite area method) defined using a patch of faces on a ...
Graphite solid properties.
void size(const label n)
Older name for setAddressableSize.
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &f1)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
TypeName("leastSquares")
Runtime type information.
List< edge > edgeList
List of edge.
const word & name() const noexcept
Return the object name.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Abstract base class for edge interpolation schemes.
const T & cref() const
Return const reference to the object or to the contents of a (non-null) managed pointer.
typeOfRank< typename pTraits< arg1 >::cmptType, direction(pTraits< arg1 >::rank)+direction(pTraits< arg2 >::rank) >::type type
tmp< GeometricField< Type, faePatchField, edgeMesh > > interpolate(const GeometricField< Type, faPatchField, areaMesh > &) const
Return the edge-interpolate of the given face field.
leastSquaresEdgeInterpolation(const faMesh &mesh)
Construct from mesh.
virtual const pointField & points() const
Return raw points.
#define forAll(list, i)
Loop across all elements in list.
Generic templated field type.
const objectRegistry & db() const noexcept
Return the local objectRegistry.
static tmp< T > New(Args &&... args)
Construct tmp with forwarding arguments.
Second-order gradient scheme using least-squares.
label nInternalEdges() const
Internal edges using 0,1 or 2 boundary points.
Least-squares edge interpolation scheme class, from face centers to points then from points to edges...
const Mesh & mesh() const noexcept
Return mesh.
tmp< edgeScalarField > weights(const GeometricField< Type, faPatchField, areaMesh > &) const
Return the interpolation weighting factors.
const fileName & instance() const noexcept
Read access to instance path component.
const edgeList & edges() const
Return mesh edges. Uses calcEdges.
const faMesh & mesh() const
Return mesh reference.
const labelListList & pointFaces() const
void clear() const noexcept
If object pointer points to valid object: delete object and set pointer to nullptr.
A class for managing temporary objects.
const Boundary & boundaryField() const noexcept
Return const-reference to the boundary field.
tmp< GeometricField< typename outerProduct< vector, Type >::type, faPatchField, areaMesh >> grad(const GeometricField< Type, faePatchField, edgeMesh > &ssf)
const dimensionSet & dimensions() const noexcept
Return dimensions.
static constexpr const zero Zero
Global zero (0)