44 if (edgeInterpolation::debug)
47 <<
"constructing edgeInterpolationScheme<Type>"
54 <<
"Discretisation scheme not specified" <<
nl <<
nl
55 <<
"Valid schemes are :" <<
nl
56 << MeshConstructorTablePtr_->sortedToc()
60 const word schemeName(schemeData);
62 auto* ctorPtr = MeshConstructorTable(schemeName);
71 *MeshConstructorTablePtr_
75 return ctorPtr(
mesh, schemeData);
88 if (edgeInterpolation::debug)
91 <<
"constructing edgeInterpolationScheme<Type>"
98 <<
"Discretisation scheme not specified"
100 <<
"Valid schemes are :" << endl
101 << MeshConstructorTablePtr_->sortedToc()
102 << exit(FatalIOError);
105 const word schemeName(schemeData);
107 auto* ctorPtr = MeshFluxConstructorTable(schemeName);
116 *MeshFluxConstructorTablePtr_
117 ) <<
exit(FatalIOError);
120 return ctorPtr(
mesh, faceFlux, schemeData);
142 if (edgeInterpolation::debug)
148 <<
" from areas to edges "
149 "without explicit correction"
170 "interpolate("+vf.
name()+
')',
182 for (label fi=0; fi<P.
size(); ++fi)
186 const tensor& Te = curT[0];
188 const tensor& TN = curT[2];
217 for (label i=0; i<size; ++i)
220 mesh.edgeTransformTensors()[start + i];
222 const tensor& Te = curT[0];
223 const tensor& TP = curT[1];
224 const tensor& TN = curT[2];
260 if (edgeInterpolation::debug)
266 <<
" from area to edges "
267 "without explicit correction"
271 const edgeScalarField& lambdas = tlambdas();
274 const scalarField&
lambda = lambdas.internalField();
277 const labelUList& P =
mesh.owner();
278 const labelUList&
N =
mesh.neighbour();
280 tmp<GeometricField<Type, faePatchField, edgeMesh>> tsf
282 new GeometricField<Type, faePatchField, edgeMesh>
286 "interpolate("+vf.
name()+
')',
294 GeometricField<Type, faePatchField, edgeMesh>& sf = tsf.
ref();
296 Field<Type>& sfi = sf.primitiveFieldRef();
298 for (label eI = 0; eI < P.size(); ++eI)
300 const tensorField& curT =
mesh.edgeTransformTensors()[eI];
302 const tensor& Te = curT[0];
303 const tensor& TP = curT[1];
304 const tensor& TN = curT[2];
310 lambda[eI]*transform(TP, vfi[P[eI]])
311 + (1 -
lambda[eI])*transform(TN, vfi[
N[eI]])
326 label size = vfb[
pi].patch().size();
327 label start = vfb[
pi].patch().start();
329 Field<Type> pOwnVf(vfb[
pi].patchInternalField());
330 Field<Type> pNgbVf(vfb[
pi].patchNeighbourField());
332 Field<Type>& pSf = sf.boundaryFieldRef()[
pi];
334 for (label i=0; i<size; ++i)
337 mesh.edgeTransformTensors()[start + i];
339 const tensor& Te = curT[0];
340 const tensor& TP = curT[1];
341 const tensor& TN = curT[2];
348 + (1 - pLambda[i])*
transform(TN, pNgbVf[i])
376 if (edgeInterpolation::debug)
382 <<
" from area to edges "
383 "without explicit correction"
387 const edgeScalarField& lambdas = tlambdas();
390 const scalarField&
lambda = lambdas.internalField();
393 const labelUList& P =
mesh.owner();
394 const labelUList&
N =
mesh.neighbour();
396 tmp<GeometricField<Type, faePatchField, edgeMesh>> tsf
398 new GeometricField<Type, faePatchField, edgeMesh>
402 "interpolate("+vf.
name()+
')',
410 GeometricField<Type, faePatchField, edgeMesh>& sf = tsf.ref();
412 Field<Type>& sfi = sf.primitiveFieldRef();
414 for (label eI = 0; eI < P.size(); ++eI)
416 sfi[eI] =
lambda[eI]*vfi[P[eI]] + (1 -
lambda[eI])*vfi[
N[eI]];
428 tsf.ref().boundaryFieldRef()[
pi] =
451 if (edgeInterpolation::debug)
457 <<
" from areas to edges"
461 tmp<GeometricField<Type, faePatchField, edgeMesh>> tsf =
466 tsf.ref() += correction(vf);
480 if (edgeInterpolation::debug)
486 <<
" from area to edges "
490 tmp<GeometricField<Type, faePatchField, edgeMesh>> tsf =
491 euclidianInterpolate(vf, weights(vf));
constexpr scalar pi(M_PI)
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.
Internal & ref(const bool updateAccessTime=true)
Same as internalFieldRef().
Internal::FieldType & primitiveFieldRef(const bool updateAccessTime=true)
Return a reference to the internal field values.
Boundary & boundaryFieldRef(const bool updateAccessTime=true)
Return a reference to the boundary field.
const Internal & internalField() const noexcept
Return a const-reference to the dimensioned internal field.
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.
bool eof() const noexcept
True if end of input seen.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Tensor< Cmpt > T() const
Return non-Hermitian transpose.
void size(const label n)
Older name for setAddressableSize.
label size() const noexcept
The number of entries in the list.
virtual bool corrected() const
Return true if this scheme uses an explicit correction.
static tmp< GeometricField< Type, faePatchField, edgeMesh > > interpolate(const GeometricField< Type, faPatchField, areaMesh > &, const tmp< edgeScalarField > &, const tmp< edgeScalarField > &)
Return the face-interpolate of the given cell field.
virtual tmp< edgeScalarField > weights(const GeometricField< Type, faPatchField, areaMesh > &) const =0
Return the interpolation weighting factors for the given field.
static tmp< edgeInterpolationScheme< Type > > New(const faMesh &mesh, Istream &schemeData)
Return new tmp interpolation scheme.
virtual tmp< GeometricField< Type, faePatchField, edgeMesh > > correction(const GeometricField< Type, faPatchField, areaMesh > &) const
Return the explicit correction to the face-interpolate.
virtual ~edgeInterpolationScheme()
const faMesh & mesh() const
Return mesh reference.
static tmp< GeometricField< Type, faePatchField, edgeMesh > > euclidianInterpolate(const GeometricField< Type, faPatchField, areaMesh > &, const tmp< edgeScalarField > &)
Return the euclidian edge-interpolate of the given area field.
Finite area mesh (used for 2-D non-Euclidian finite area method) defined using a patch of faces on a ...
Tensor of scalars, i.e. Tensor<scalar>.
A class for managing temporary objects.
void clear() const noexcept
If object pointer points to valid object: delete object and set pointer to nullptr.
T & ref() const
Return non-const reference to the contents of a non-null managed pointer.
A class for handling words, derived from Foam::string.
#define FatalIOErrorInLookup(ios, lookupTag, lookupName, lookupTable)
Report an error message using Foam::FatalIOError.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
#define InfoInFunction
Report an information message using Foam::Info.
refinementData transform(const tensor &, const refinementData val)
No-op rotational transform for base types.
faePatchField< scalar > faePatchScalarField
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Ostream & endl(Ostream &os)
Add newline and flush stream.
GeometricField< scalar, faePatchField, edgeMesh > edgeScalarField
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...
Field< tensor > tensorField
Specialisation of Field<T> for tensor.
errorManipArg< error, int > exit(error &err, const int errNo=1)
UList< label > labelUList
A UList of labels.
constexpr char nl
The newline '\n' character (0x0a).
dimensionedScalar lambda("lambda", dimTime/sqr(dimLength), laminarTransport)
#define forAll(list, i)
Loop across all elements in list.
const Vector< label > N(dict.get< Vector< label > >("N"))