Go to the documentation of this file.
45 "coincidentFullMatch",
58 os <<
"v " << pt.
x() <<
' ' << pt.
y() <<
' ' << pt.
z() <<
endl;
90 os <<
"l " << vertI-1 <<
' ' << vertI <<
nl;
109 const face&
f = faces[i];
113 if (foamToObj.insert(
f[fp], vertI))
123 os <<
' ' << foamToObj[
f[fp]]+1;
125 os <<
' ' << foamToObj[
f[0]]+1 <<
nl;
144 anchors[faceI] =
points[faces[faceI][0]];
152 const face&
f = faces[faceI];
164 if (
f[fp1] ==
f[fp2])
189 anchors[faceI] =
points[faces[faceI][0]];
210 const point& cc = faceCentres[faceI];
212 const face&
f = faces[faceI];
216 scalar maxLenSqr = -GREAT;
219 scalar maxCmpt = -GREAT;
224 maxLenSqr =
max(maxLenSqr,
magSqr(pt - cc));
247 scalar minDistSqr = GREAT;
253 if (distSqr < minDistSqr)
255 minDistSqr = distSqr;
260 if (anchorFp == -1 ||
Foam::sqrt(minDistSqr) > tol)
271 if (distSqr == minDistSqr && fp != anchorFp)
274 <<
"Cannot determine unique anchor point on face "
277 <<
"Both at index " << anchorFp <<
" and " << fp
278 <<
" the vertices have the same distance "
280 <<
" to the anchor " << anchor
281 <<
". Continuing but results might be wrong."
305 Pout<<
"coupledPolyPatch::calcTransformTensors : " <<
name() <<
endl
306 <<
" transform:" << transformTypeNames[
transform] <<
nl
307 <<
" (half)size:" << Cf.size() <<
nl
308 <<
" absTol:" << absTol <<
nl
309 <<
" smallDist min:" <<
min(smallDist) <<
nl
310 <<
" smallDist max:" <<
max(smallDist) <<
nl
311 <<
" sum(mag(nf & nr)):" <<
sum(
mag(nf & nr)) <<
endl;
325 separation_.setSize(0);
328 collocated_.setSize(0);
353 separation_.setSize(0);
355 forwardT_.setSize(Cf.size());
356 reverseT_.setSize(Cf.size());
357 collocated_.setSize(Cf.size());
368 Pout<<
" sum(mag(forwardT_ - forwardT_[0])):"
369 <<
sum(
mag(forwardT_ - forwardT_[0]))
375 forwardT_.setSize(1);
376 reverseT_.setSize(1);
377 collocated_.setSize(1);
381 Pout<<
" difference in rotation less than"
382 <<
" local tolerance "
383 <<
error <<
". Assuming uniform rotation." <<
endl;
391 forwardT_.setSize(0);
392 reverseT_.setSize(0);
394 separation_ = Cr - Cf;
396 collocated_.setSize(separation_.size());
404 bool sameSeparation =
true;
405 bool doneWarning =
false;
407 forAll(separation_, facei)
409 scalar smallSqr =
sqr(smallDist[facei]);
411 collocated_[facei] = (
magSqr(separation_[facei]) < smallSqr);
414 if (
magSqr(separation_[facei] - separation_[0]) > smallSqr)
416 sameSeparation =
false;
418 if (!doneWarning && debug)
422 Pout<<
" separation " << separation_[facei]
424 <<
" differs from separation[0] " << separation_[0]
425 <<
" by more than local tolerance "
427 <<
". Assuming non-uniform separation." <<
endl;
439 Pout<<
" separation " <<
mag(separation_[0])
440 <<
" less than local tolerance " << smallDist[0]
441 <<
". Assuming zero separation." <<
endl;
444 separation_.setSize(0);
451 Pout<<
" separation " <<
mag(separation_[0])
452 <<
" more than local tolerance " << smallDist[0]
453 <<
". Assuming uniform separation." <<
endl;
456 separation_.setSize(1);
465 Pout<<
" separation_:" << separation_.size() <<
nl
466 <<
" forwardT size:" << forwardT_.size() <<
endl;
480 const word& patchType,
485 matchTolerance_(defaultMatchTol_),
496 const word& patchType
504 ? transformTypeNames.read(
dict.
lookup(
"transform"))
531 polyPatch(pp, bm, index, newSize, newStart),
546 polyPatch(pp, bm, index, mapAddressing, newStart),
567 os.
writeKeyword(
"transform") << transformTypeNames[transform_]
static pointField getAnchorPoints(const UList< face > &, const pointField &, const transformType)
Get a unique anchor point for all faces.
static const NamedEnum< transformType, 5 > transformTypeNames
A class for handling words, derived from string.
A class for handling file names.
#define forAll(list, i)
Loop across all elements in list.
void writeOBJ(Ostream &os, label &vertI, const tetPoints &tet)
virtual void write(Ostream &) const
Write the polyPatch data as a dictionary.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
Ostream & endl(Ostream &os)
Add newline and flush stream.
The coupledPolyPatch is an abstract base class for patches that couple regions of the computational d...
dimensioned< scalar > mag(const dimensioned< Type > &)
dimensionSet transform(const dimensionSet &)
void cmptMag(FieldField< Field, Type > &cf, const FieldField< Field, Type > &f)
void cmptMax(FieldField< Field, typename FieldField< Field, Type >::cmptType > &cf, const FieldField< Field, Type > &f)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
Pre-declare SubField and related Field type.
A patch is a list of labels that address the faces in the global face list.
static label getRotation(const pointField &points, const face &f, const point &anchor, const scalar tol)
Get the number of vertices face f needs to be rotated such that.
transformType transform_
Type of transformation.
virtual void write(Ostream &) const
Write the polyPatch data as a dictionary.
A list of keyword definitions, which are a keyword followed by any number of values (e....
const double e
Elementary charge.
static scalarField calcFaceTol(const UList< face > &faces, const pointField &points, const pointField &faceCentres)
Calculate typical tolerance per face. Is currently max distance.
List< bool > boolList
Bool container classes.
static const scalar defaultMatchTol_
Default matching tolerance.
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
dimensionedSymmTensor sqr(const dimensionedVector &dv)
const scalar matchTolerance_
Local matching tolerance.
prefixOSstream Pout(cout, "Pout")
virtual ~coupledPolyPatch()
Destructor.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
dimensionedScalar sqrt(const dimensionedScalar &ds)
Ostream & writeKeyword(const keyType &)
Write the keyword followed by an appropriate indentation.
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
void calcTransformTensors(const vectorField &Cf, const vectorField &Cr, const vectorField &nf, const vectorField &nr, const scalarField &smallDist, const scalar absTol, const transformType=UNKNOWN) const
Calculate the transformation tensors.
A List with indirect addressing.
A face is a list of labels corresponding to mesh vertices.
Various functions to operate on Lists.
void size(const label)
Override size to be inconsistent with allocated storage.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
tensor rotationTensor(const vector &n1, const vector &n2)
static void writeOBJ(Ostream &os, const point &pt)
Write point in OBJ format.
label size() const
Return the number of elements in the UList.
coupledPolyPatch(const word &name, const label size, const label start, const label index, const polyBoundaryMesh &bm, const word &patchType, const transformType transform)
Construct from components.
defineTypeNameAndDebug(combustionModel, 0)
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
#define WarningInFunction
Report a warning using Foam::Warning.
Class to handle errors and exceptions in a simple, consistent stream-based manner.
labelList pointLabels(nPoints, -1)
dimensioned< scalar > magSqr(const dimensioned< Type > &)
word name(const complex &)
Return a string representation of a complex.
Initialise the NamedEnum HashTable from the static list of names.