41 return a.first() >
b.first() ? a :
b;
73 isNbrPatchMesh_(false),
74 nPositionalErrors_(0),
75 maxPositionalErrorSqr_(-vGreat),
76 maxPositionalErrorReceivePosition_(
point::uniform(NaN))
95 ? nonConformalCyclicPatch_.nbrPatchIndex()
97 ].LagrangianPatch::mesh();
118 patchMesh.
sub(
mesh.receivePatchFacePtr_());
120 patchMesh.
sub(
mesh.receivePositionPtr_());
124 nonConformalCyclicPatch_.nbrPatch().origPatch();
142 fraction[i + patchMesh.
start()]
147 const scalar positionalErrorSqr =
158 fraction[i + patchMesh.
start()]
166 sqr(positionalErrorSqr)
170 nPositionalErrors_ ++;
172 if (positionalErrorSqr > maxPositionalErrorSqr_)
174 maxPositionalErrorSqr_ = positionalErrorSqr;
175 maxPositionalErrorReceivePosition_ = receivePosition[i];
185 isNbrPatchMesh_ =
true;
188 receivePatchFace = -1;
198 isNbrPatchMesh_ =
false;
201 const label nPositionalErrors =
204 if (nPositionalErrors != 0)
206 const label nTransfers =
214 maxPositionalErrorSqr_,
215 maxPositionalErrorReceivePosition_
220 maxPositionalErrorSqr_ = maxPositionalErrorInfo.
first();
221 maxPositionalErrorReceivePosition_ = maxPositionalErrorInfo.
second();
224 << nPositionalErrors <<
"/" << nTransfers <<
" elements "
225 <<
"transferring to patch "
226 << nonConformalCyclicPatch_.nbrPatch().name()
227 <<
" were not accurately located. The largest positional error "
228 <<
"was " <<
sqrt(maxPositionalErrorSqr_)
229 <<
" from " << maxPositionalErrorReceivePosition_ <<
"."
233 nPositionalErrors_ = 0;
234 maxPositionalErrorSqr_ = -vGreat;
#define forAll(list, i)
Loop across all elements in list.
Macros for easy insertion into run-time selection tables.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Boundary part of a Lagrangian mesh. Just a list of Lagrangian patches with some added convenience fun...
Class containing Lagrangian geometry and topology.
Base class for Lagrangian patches.
virtual void partition() const
Update for mesh changes.
Mesh that relates to a sub-section of a Lagrangian mesh. This is used to construct fields that relate...
SubList< Type > sub(const List< Type > &list) const
Return a sub-list corresponding to this sub-mesh.
label start() const
Return start.
Buffers for inter-processor communications streams (UOPstream, UIPstream).
Pre-declare related SubField type.
A 2-tuple for storing two objects of different types.
const Type2 & second() const
Return second.
const Type1 & first() const
Return first.
static Form uniform(const Cmpt &s)
Return a VectorSpace with all elements = s.
const polyMesh & mesh() const
Return reference to polyMesh.
virtual const labelList & faceOwner() const
Return face owner.
A patch is a list of labels that address the faces in the global face list.
const vectorField::subField faceAreas() const
Return face areas.
label start() const
Return start label of this patch in the polyMesh face list.
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
#define WarningInFunction
Report a warning using Foam::Warning.
point position(const polyMesh &mesh, const barycentric &coordinates, const label celli, const label facei, const label faceTrii, const scalar stepFraction)
Return the position given the coordinates and tet topology.
bool locate(const polyMesh &mesh, const point &position, barycentric &coordinates, label &celli, label &facei, label &faceTrii, const scalar stepFraction, const string &debugPrefix=NullObjectRef< string >())
Initialise the location at the given position. Returns whether or not a.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
addToRunTimeSelectionTable(polyPatch, mergedCyclicPolyPatch, word)
To & refCast(From &r)
Reference type cast template function.
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
defineTypeNameAndDebug(combustionModel, 0)
void sqr(LagrangianPatchField< typename outerProduct< Type, Type >::type > &f, const LagrangianPatchField< Type > &f1)
void magSqr(LagrangianPatchField< scalar > &f, const LagrangianPatchField< Type > &f1)
void sqrt(LagrangianPatchField< scalar > &f, const LagrangianPatchField< scalar > &f1)
const Type & operator()(const Type &a, const Type &b) const