58 Info<<
"Patch " <<
name() <<
" calculated average normal "
66 if (
magSqr(n_ - nf[facei]) > small)
71 <<
"Wedge patch '" <<
name() <<
"' is not planar." <<
nl
72 <<
"At local face at "
74 <<
" the normal " << nf[facei]
75 <<
" differs from the average normal " << n_
76 <<
" by " <<
magSqr(n_ - nf[facei]) <<
nl
77 <<
"Either correct the patch or split it into planar parts"
89 centreNormal_ /=
mag(centreNormal_);
91 cosAngle_ = centreNormal_ & n_;
93 const scalar cnCmptSum =
94 centreNormal_.
x() + centreNormal_.
y() + centreNormal_.
z();
96 if (
mag(cnCmptSum) < (1 - small))
100 <<
" centre plane does not align with a coordinate plane by "
101 << 1 -
mag(cnCmptSum)
105 axis_ = centreNormal_ ^ n_;
106 scalar magAxis =
mag(axis_);
111 <<
"wedge " <<
name()
112 <<
" plane aligns with a coordinate plane." <<
nl
113 <<
" The wedge plane should make a small angle (~2.5deg)"
114 " with the coordinate plane" <<
nl
115 <<
" and the pair of wedge planes should be symmetric"
116 <<
" about the coordinate plane." <<
nl
117 <<
" Normal of wedge plane is " << n_
118 <<
" , implied coordinate plane direction is " << centreNormal_
125 cellT_ = faceT_ & faceT_;
139 const word& patchType
144 centreNormal_(
vector::rootMax),
158 const word& patchType
163 centreNormal_(
vector::rootMax),
179 centreNormal_(pp.centreNormal_),
181 cosAngle_(pp.cosAngle_),
196 polyPatch(pp, bm, index, newSize, newStart),
198 centreNormal_(pp.centreNormal_),
200 cosAngle_(pp.cosAngle_),
#define forAll(list, i)
Loop across all elements in list.
Macros for easy insertion into run-time selection tables.
const Field< PointType > & faceNormals() const
Return face normals for patch.
const Field< PointType > & faceCentres() const
Return face centres for patch.
Buffers for inter-processor communications streams (UOPstream, UIPstream).
label size() const
Return the number of elements in the UList.
static const Form rootMax
A list of keyword definitions, which are a keyword followed by any number of values (e....
const word & name() const
Return name.
A patch is a list of labels that address the faces in the global face list.
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 string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
#define WarningInFunction
Report a warning using Foam::Warning.
errorManipArg< error, int > exit(error &err, const int errNo=1)
tensor rotationTensor(const vector &n1, const vector &n2)
Rotational transformation tensor from unit vector n1 to n2.
dimensionedScalar sign(const dimensionedScalar &ds)
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)
Ostream & endl(Ostream &os)
Add newline and flush stream.
word name(const bool)
Return a word representation of a bool.
Vector< scalar > vector
A scalar version of the templated Vector.
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
dimensioned< scalar > mag(const dimensioned< Type > &)
defineTypeNameAndDebug(combustionModel, 0)
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
Type gAverage(const FieldField< Field, Type > &f)
dimensioned< scalar > magSqr(const dimensioned< Type > &)