61 Info<<
"Patch " <<
name() <<
" calculated average normal "
69 if (
magSqr(n_ - nf[facei]) > SMALL)
74 <<
"Wedge patch '" <<
name() <<
"' is not planar." <<
nl
75 <<
"At local face at "
77 <<
" the normal " << nf[facei]
78 <<
" differs from the average normal " << n_
79 <<
" by " <<
magSqr(n_ - nf[facei]) <<
nl
80 <<
"Either correct the patch or split it into planar parts"
92 centreNormal_.normalise();
94 cosAngle_ = centreNormal_ & n_;
96 const scalar cnCmptSum =
97 centreNormal_.x() + centreNormal_.y() + centreNormal_.z();
99 if (
mag(cnCmptSum) < (1 - SMALL))
102 <<
"wedge " <<
name()
103 <<
" centre plane does not align with a coordinate plane by "
104 << 1 -
mag(cnCmptSum)
108 axis_ = centreNormal_ ^ n_;
109 scalar magAxis =
mag(axis_);
114 <<
"wedge " <<
name()
115 <<
" plane aligns with a coordinate plane." <<
nl
116 <<
" The wedge plane should make a small angle (~2.5deg)"
117 " with the coordinate plane" <<
nl
118 <<
" and the pair of wedge planes should be symmetric"
119 <<
" about the coordinate plane." <<
nl
120 <<
" Normal of wedge plane is " << n_
121 <<
" , implied coordinate plane direction is " << centreNormal_
128 cellT_ = faceT_ & faceT_;
141 const polyBoundaryMesh& bm,
142 const word& patchType
145 polyPatch(
name, size, start, index, bm, patchType),
147 centreNormal_(
vector::rootMax),
161 const word& patchType
166 centreNormal_(
vector::rootMax),
182 centreNormal_(
pp.centreNormal_),
184 cosAngle_(
pp.cosAngle_),
201 centreNormal_(
pp.centreNormal_),
203 cosAngle_(
pp.cosAngle_),
220 centreNormal_(
pp.centreNormal_),
222 cosAngle_(
pp.cosAngle_),
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
const Field< point_type > & faceNormals() const
const Field< point_type > & faceCentres() const
Buffers for inter-processor communications streams (UOPstream, UIPstream).
label size() const noexcept
static const Form rootMax
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
label index() const noexcept
The index of this patch in the boundaryMesh.
const word & name() const noexcept
The patch name.
A polyBoundaryMesh is a polyPatch list with registered IO, a reference to the associated polyMesh,...
A patch is a list of labels that address the faces in the global face list.
friend class polyBoundaryMesh
polyPatch(const word &name, const label size, const label start, const label index, const polyBoundaryMesh &bm, const word &patchType)
Construct from components.
label start() const noexcept
Return start label of this patch in the polyMesh face list.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
Wedge front and back plane patch.
virtual void calcGeometry(PstreamBuffers &)
Calculate the patch geometry.
wedgePolyPatch(const word &name, const label size, const label start, const label index, const polyBoundaryMesh &bm, const word &patchType)
Construct from components.
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
#define WarningInFunction
Report a warning using Foam::Warning.
Namespace for handling debugging switches.
Type gAverage(const FieldField< Field, Type > &f, const label comm)
The global arithmetic average of a FieldField.
bool returnReduceOr(const bool value, const int communicator=UPstream::worldComm)
Perform logical (or) MPI Allreduce on a copy. Uses UPstream::reduceOr.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
dimensionedScalar sign(const dimensionedScalar &ds)
tensor rotationTensor(const vector &n1, const vector &n2)
Rotational transformation tensor from vector n1 to n2.
messageStream Info
Information stream (stdout output on master, null elsewhere).
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
Field< vector > vectorField
Specialisation of Field<T> for vector.
static constexpr const zero Zero
Global zero (0).
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
errorManipArg< error, int > exit(error &err, const int errNo=1)
UList< label > labelUList
A UList of labels.
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
constexpr char nl
The newline '\n' character (0x0a).
#define forAll(list, i)
Loop across all elements in list.