Go to the documentation of this file.
43 label& matchedRefTransformI,
49 matchedRefTransformI = -1;
55 scalar maxVectorMag =
sqrt
64 mag(refTransform.
t() - testTransform.
t())
65 /(maxVectorMag + VSMALL)
74 scalar tensorDiff = 0;
76 if (refTransform.
hasR() || testTransform.
hasR())
79 mag(refTransform.
R() - testTransform.
R())
87 if (vectorDiff < 1 && tensorDiff < 1)
89 matchedRefTransformI = i;
99 mag(refTransform.
t() + testTransform.
t())
100 /(maxVectorMag + VSMALL)
105 if (refTransform.
hasR() || testTransform.
hasR())
108 mag(refTransform.
R() - testTransform.
R().
T())
113 if (vectorDiff < 1 && tensorDiff < 1)
115 matchedRefTransformI = i;
135 label dummyMatch = -1;
145 isA<coupledPolyPatch>(pp)
147 isA<cyclicPolyPatch>(pp)
149 refCast<const cyclicPolyPatch>(pp).
transform()
163 const vector& sepVec = sepVecs[sVI];
165 if (
mag(sepVec) > SMALL)
184 <<
"More than six unsigned transforms"
200 const tensor& transT = transTensors[tTI];
202 if (
mag(transT -
I) > SMALL)
221 <<
"More than six unsigned transforms"
252 forAll(allTransforms, procI)
255 allTransforms[procI];
257 forAll(procTransVecs, pSVI)
270 allTols[procI][pSVI],
281 <<
"More than three independent basic "
282 <<
"transforms detected:" <<
nl
299 <<
"More than three independent basic "
300 <<
"transforms detected:" <<
nl
302 <<
"This is not a space filling tiling and will probably"
303 <<
" give problems for e.g. lagrangian tracking or interpolation"
311 label nTransformPermutations =
pow(
label(3), transforms_.size());
313 transformPermutations_.setSize(nTransformPermutations);
315 forAll(transformPermutations_, tPI)
319 label transformIndex = tPI;
326 const label w = (transformIndex % 3) - 1;
345 labelList permutationIndices(nIndependentTransforms(), 0);
346 nullTransformIndex_ = encodeTransformIndex(permutationIndices);
356 label matchTransI = -1;
368 isA<coupledPolyPatch>(pp)
370 isA<cyclicPolyPatch>(pp)
372 refCast<const cyclicPolyPatch>(pp).
transform()
379 refCast<const coupledPolyPatch>(pp);
391 const vector& sepVec = sepVecs[sVI];
393 if (
mag(sepVec) > SMALL)
419 patchTransformSign_[patchI] =
435 const tensor& transT = transTensors[tTI];
437 if (
mag(transT -
I) > SMALL)
463 patchTransformSign_[patchI] =
484 transformPermutations_(),
485 patchTransformSign_()
487 determineTransforms();
489 determineTransformPermutations();
491 determinePatchTransformSign();
493 if (debug && transforms_.size() > 0)
497 Info<<
"Determined global transforms :" <<
endl;
498 Info<<
"\t\ttranslation\trotation" <<
endl;
501 Info<<
'\t' << i <<
'\t';
505 Info<< trafo.
t() <<
'\t' << trafo.
R();
509 Info<< trafo.
t() <<
'\t' <<
"---";
516 Info<<
"\tpatch\ttransform\tsign" <<
endl;
517 forAll(patchTransformSign_, patchI)
519 if (patchTransformSign_[patchI].first() != -1)
522 <<
'\t' << patchTransformSign_[patchI].first()
523 <<
'\t' << patchTransformSign_[patchI].second()
530 Info<<
"Permutations of transformations:" <<
endl
531 <<
"\t\ttranslation\trotation" <<
endl;
532 forAll(transformPermutations_, i)
534 Info<<
'\t' << i <<
'\t';
538 Info<< trafo.
t() <<
'\t' << trafo.
R();
542 Info<< trafo.
t() <<
'\t' <<
"---";
546 Info<<
"nullTransformIndex:" << nullTransformIndex() <<
endl
Templated 3D tensor derived from VectorSpace adding construction from 9 components,...
virtual const vectorField & separation() const
If the planes are separated the separation vector.
volScalarField w(IOobject("w", runTime.timeName(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE), mesh, dimensionedScalar("w", dimensionSet(0, 0, 0, 0, 0, 0, 0), 0.0))
#define forAll(list, i)
Loop across all elements in list.
static label nProcs(const label communicator=0)
Number of processes in parallel run.
virtual const tensorField & reverseT() const
Return neighbour-cell transformation tensor.
static void scatter(const List< commsStruct > &comms, T &Value, const int tag, const label comm)
Scatter data. Distribute without modification. Reverse of gather.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
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 > &)
dimensionedScalar sign(const dimensionedScalar &ds)
Mesh consisting of general polyhedral cells.
dimensionSet transform(const dimensionSet &)
virtual bool parallel() const
Are the cyclic planes parallel.
virtual bool separated() const
Are the planes separated.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
Pre-declare SubField and related Field type.
dimensionedSphericalTensor inv(const dimensionedSphericalTensor &dt)
A patch is a list of labels that address the faces in the global face list.
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
static const sphericalTensor I(1)
scalar matchTolerance() const
errorManipArg< error, int > exit(error &err, const int errNo=1)
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
static bool master(const label communicator=0)
Am I the master process.
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
static void gatherList(const List< commsStruct > &comms, List< T > &Values, const int tag, const label comm)
Gather data but keep individual values separate.
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)
defineTypeNameAndDebug(combustionModel, 0)
#define WarningInFunction
Report a warning using Foam::Warning.
dimensioned< scalar > magSqr(const dimensioned< Type > &)
Tensor< Cmpt > T() const
Transpose.