48#ifndef Foam_leastSquaresEdgeInterpolation_H
49#define Foam_leastSquaresEdgeInterpolation_H
127 return this->
mesh().edgeInterpolation::weights();
151 const GradFieldType& gradAf = tgradAf.
cref();
155 FieldType& Pi = tPi.ref();
159 const label nFaces = pointFaceAddr[i].
size();
161 FieldType Pij(nFaces);
164 for (label facei = 0; facei < nFaces; ++facei)
166 const label j = pointFaceAddr[i][facei];
169 dPC[facei] =
mesh.points()[i] -
C[j];
172 Pij[facei] = af[j] + (dPC[facei] & gradAf[j]);
178 Pi[i] =
sum(Pij/magdPC)/
sum(scalar(1)/magdPC);
188 "interpolate(" + af.
name() +
')',
195 EdgeFieldType& interp = tinterp.ref();
196 FieldType& interpEdges = interp.primitiveFieldRef();
200 const label nInternalEdges =
mesh.nInternalEdges();
203 for (label edgei = 0; edgei < nInternalEdges; ++edgei)
209 Pi[faEdges[edgei].start()]
210 + Pi[faEdges[edgei].end()]
216 forAll(interp.boundaryField(), patchi)
218 interp.boundaryFieldRef()[patchi] = af.
boundaryField()[patchi];
Graphite solid properties.
const Mesh & mesh() const noexcept
Return const reference to mesh.
const dimensionSet & dimensions() const noexcept
Return dimensions.
Generic templated field type that is much like a Foam::List except that it is expected to hold numeri...
Generic GeometricField class.
const Boundary & boundaryField() const noexcept
Return const-reference to the boundary field.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
const word & name() const noexcept
Return the object name.
const objectRegistry & db() const noexcept
Return the local objectRegistry.
const fileName & instance() const noexcept
Read access to instance path component.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
void size(const label n)
Older name for setAddressableSize.
Abstract base class for edge interpolation schemes.
edgeInterpolationScheme(const edgeInterpolationScheme &)=delete
No copy construct.
const faMesh & mesh() const
Return mesh reference.
Finite area mesh (used for 2-D non-Euclidian finite area method) defined using a patch of faces on a ...
tmp< GeometricField< typename outerProduct< vector, Type >::type, faPatchField, areaMesh > > grad(const GeometricField< Type, faPatchField, areaMesh > &, const word &name) const
Calculate and return the grad of the given field which may have been cached.
Second-order gradient scheme using least-squares.
TypeName("leastSquares")
Runtime type information.
leastSquaresEdgeInterpolation(const faMesh &mesh)
Construct from mesh.
tmp< edgeScalarField > weights(const GeometricField< Type, faPatchField, areaMesh > &) const
Return the interpolation weighting factors.
leastSquaresEdgeInterpolation(const leastSquaresEdgeInterpolation &)=delete
No copy construct.
tmp< GeometricField< Type, faePatchField, edgeMesh > > interpolate(const GeometricField< Type, faPatchField, areaMesh > &) const
Return the edge-interpolate of the given face field.
void operator=(const leastSquaresEdgeInterpolation &)=delete
No copy assignment.
leastSquaresEdgeInterpolation(const faMesh &mesh, const edgeScalarField &, Istream &)
Construct from faceFlux and Istream.
leastSquaresEdgeInterpolation(const faMesh &mesh, Istream &)
Construct from Istream.
typeOfRank< typenamepTraits< arg1 >::cmptType, direction(pTraits< arg1 >::rank)+direction(pTraits< arg2 >::rank)>::type type
A class for managing temporary objects.
const T & cref() const
Return const reference to the object or to the contents of a (non-null) managed pointer.
void clear() const noexcept
If object pointer points to valid object: delete object and set pointer to nullptr.
static tmp< T > New(Args &&... args)
Construct tmp with forwarding arguments.
List< edge > edgeList
List of edge.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
List< labelList > labelListList
List of labelList.
List< label > labelList
A List of labels.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
GeometricField< vector, faPatchField, areaMesh > areaVectorField
GeometricField< scalar, faePatchField, edgeMesh > edgeScalarField
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
Field< vector > vectorField
Specialisation of Field<T> for vector.
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &f1, const label comm)
static constexpr const zero Zero
Global zero (0).
#define forAll(list, i)
Loop across all elements in list.
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.