Data Structures | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | Friends
globalIndexAndTransform Class Reference

Determination and storage of the possible independent transforms introduced by coupledPolyPatches, as well as all of the possible permutations of these transforms generated by the presence of multiple coupledPolyPatches, i.e. more than one cyclic boundary. More...

Collaboration diagram for globalIndexAndTransform:
Collaboration graph
[legend]

Data Structures

class  less
 Less function class used in sorting encoded transforms and indices. More...
 

Public Member Functions

 ClassName ("globalIndexAndTransform")
 
 globalIndexAndTransform (const polyMesh &mesh)
 Construct from components. More...
 
 ~globalIndexAndTransform ()
 Destructor. More...
 
label encodeTransformIndex (const List< label > &permutationIndices) const
 Generate a transform index from the permutation indices of. More...
 
label addToTransformIndex (const label transformIndex, const label patchI, const bool isSendingSide=true, const scalar tol=SMALL) const
 Add patch transformation to transformIndex. Return new. More...
 
label mergeTransformIndex (const label transformIndex0, const label transformIndex1) const
 Combine two transformIndices. More...
 
label minimumTransformIndex (const label transformIndex0, const label transformIndex1) const
 Combine two transformIndices. More...
 
label subtractTransformIndex (const label transformIndex0, const label transformIndex1) const
 Subtract two transformIndices. More...
 
label nIndependentTransforms () const
 Return the number of independent transforms. More...
 
const List< vectorTensorTransform > & transforms () const
 Return access to the stored independent transforms. More...
 
const List< vectorTensorTransform > & transformPermutations () const
 Return access to the permuted transforms. More...
 
label nullTransformIndex () const
 Return the transformIndex (index in transformPermutations) More...
 
const List< Pair< label > > & patchTransformSign () const
 Return access to the per-patch transform-sign pairs. More...
 
const vectorTensorTransformtransform (label transformIndex) const
 Access the overall (permuted) transform corresponding. More...
 
labelList transformIndicesForPatches (const labelHashSet &patchIs) const
 Access the all of the indices of the transform. More...
 
pointField transformPatches (const labelHashSet &patchIs, const point &pt) const
 Apply all of the transform permutations. More...
 

Static Public Member Functions

static labelPair encode (const label index, const label transformIndex)
 Encode index and bare index as components on own processor. More...
 
static labelPair encode (const label procI, const label index, const label transformIndex)
 Encode index and bare index as components on given processor. More...
 
static label index (const labelPair &globalIAndTransform)
 Index carried by the object. More...
 
static label processor (const labelPair &globalIAndTransform)
 Which processor does this come from? More...
 
static label transformIndex (const labelPair &globalIAndTransform)
 Transform carried by the object. More...
 

Private Member Functions

void determineTransforms ()
 Determine all of the independent basic transforms of the. More...
 
void determineTransformPermutations ()
 Generate all of the transformation permutations. More...
 
void determinePatchTransformSign ()
 
label matchTransform (const List< vectorTensorTransform > &refTransforms, label &matchedRefTransformI, const vectorTensorTransform &testTransform, scalar tolerance, bool checkBothSigns) const
 Test a list of reference transforms to see if the test. More...
 
label encodeTransformIndex (const FixedList< Foam::label, 3 > &permutationIndices) const
 Encode transform index. Hardcoded to 3 independent transforms max. More...
 
FixedList< label, 3 > decodeTransformIndex (const label transformIndex) const
 Decode transform index. Hardcoded to 3 independent transforms max. More...
 
 globalIndexAndTransform (const globalIndexAndTransform &)
 Disallow default bitwise copy construct. More...
 
void operator= (const globalIndexAndTransform &)
 Disallow default bitwise assignment. More...
 

Private Attributes

const polyMeshmesh_
 Reference to mesh. More...
 
List< vectorTensorTransformtransforms_
 The possible independent (non-permuted) transforms of the. More...
 
List< vectorTensorTransformtransformPermutations_
 The permutations of the transforms, stored for lookup. More...
 
label nullTransformIndex_
 Index of identity transform. More...
 
List< Pair< label > > patchTransformSign_
 Mapping from patch index to which transform it matches (or. More...
 

Static Private Attributes

static const label base_ = 32
 Number of spaces to reserve for transform encoding. More...
 

Friends

class globalPoints
 Declare friendship with the entry class for IO. More...
 

Detailed Description

Determination and storage of the possible independent transforms introduced by coupledPolyPatches, as well as all of the possible permutations of these transforms generated by the presence of multiple coupledPolyPatches, i.e. more than one cyclic boundary.

Also provides global index encoding and decoding for entity (i.e. cell) index, processor index and transform index (0 or positive integer) to a labelPair.

Source files

Definition at line 60 of file globalIndexAndTransform.H.

Constructor & Destructor Documentation

◆ globalIndexAndTransform() [1/2]

Disallow default bitwise copy construct.

◆ globalIndexAndTransform() [2/2]

globalIndexAndTransform ( const polyMesh mesh)

Construct from components.

Definition at line 478 of file globalIndexAndTransform.C.

References Foam::endl(), forAll, vectorTensorTransform::hasR(), Foam::Info, patches, vectorTensorTransform::R(), and vectorTensorTransform::t().

Here is the call graph for this function:

◆ ~globalIndexAndTransform()

Destructor.

Definition at line 554 of file globalIndexAndTransform.C.

Member Function Documentation

◆ determineTransforms()

void determineTransforms ( )
private

◆ determineTransformPermutations()

void determineTransformPermutations ( )
private

Generate all of the transformation permutations.

Definition at line 309 of file globalIndexAndTransform.C.

References Foam::constant::physicoChemical::b, forAll, Foam::inv(), Foam::pow(), Foam::transform(), and w().

Here is the call graph for this function:

◆ determinePatchTransformSign()

void determinePatchTransformSign ( )
private

Determine which patch uses which transform (if any) and which Sign to use

Definition at line 350 of file globalIndexAndTransform.C.

References forAll, Foam::I, Foam::mag(), coupledPolyPatch::matchTolerance(), coupledPolyPatch::NOORDERING, coupledPolyPatch::parallel(), patches, coupledPolyPatch::reverseT(), coupledPolyPatch::separated(), coupledPolyPatch::separation(), Foam::sign(), and Foam::transform().

Here is the call graph for this function:

◆ matchTransform()

Foam::label matchTransform ( const List< vectorTensorTransform > &  refTransforms,
label matchedRefTransformI,
const vectorTensorTransform testTransform,
scalar  tolerance,
bool  checkBothSigns 
) const
private

Test a list of reference transforms to see if the test.

transform matches one. Return +1 or -1 depending on the sign of the match, or 0 if none matches.

Definition at line 41 of file globalIndexAndTransform.C.

References forAll, vectorTensorTransform::hasR(), Foam::mag(), Foam::magSqr(), Foam::max(), vectorTensorTransform::R(), Foam::sqrt(), vectorTensorTransform::t(), and Tensor::T().

Referenced by globalIndexAndTransform::determineTransforms().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ encodeTransformIndex() [1/2]

Foam::label encodeTransformIndex ( const FixedList< Foam::label, 3 > &  permutationIndices) const
inlineprivate

Encode transform index. Hardcoded to 3 independent transforms max.

Definition at line 110 of file globalIndexAndTransformI.H.

Referenced by InteractionLists< typename CloudType::parcelType >::findExtendedProcBbsInRange().

Here is the caller graph for this function:

◆ decodeTransformIndex()

Foam::FixedList< Foam::label, 3 > decodeTransformIndex ( const label  transformIndex) const
inlineprivate

Decode transform index. Hardcoded to 3 independent transforms max.

Definition at line 138 of file globalIndexAndTransformI.H.

References Foam::abort(), Foam::FatalError, and FatalErrorInFunction.

Here is the call graph for this function:

◆ operator=()

void operator= ( const globalIndexAndTransform )
private

Disallow default bitwise assignment.

◆ ClassName()

ClassName ( "globalIndexAndTransform"  )

◆ encodeTransformIndex() [2/2]

Foam::label encodeTransformIndex ( const List< label > &  permutationIndices) const
inline

Generate a transform index from the permutation indices of.

the independent transforms. Permutations indices must only be -1, 0 or +1.

Definition at line 74 of file globalIndexAndTransformI.H.

References Foam::abort(), Foam::constant::physicoChemical::b, Foam::FatalError, FatalErrorInFunction, forAll, Foam::mag(), List::size(), and w().

Here is the call graph for this function:

◆ addToTransformIndex()

Foam::label addToTransformIndex ( const label  transformIndex,
const label  patchI,
const bool  isSendingSide = true,
const scalar  tol = SMALL 
) const
inline

Add patch transformation to transformIndex. Return new.

transformIndex. (by default the patch is the sending, not the receiving, patch)

Definition at line 176 of file globalIndexAndTransformI.H.

References Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, Pair::first(), vectorTensorTransform::hasR(), Foam::mag(), IOstream::name(), vectorTensorTransform::R(), R, Pair::second(), Foam::sign(), vectorTensorTransform::t(), and Foam::tr().

Here is the call graph for this function:

◆ mergeTransformIndex()

label mergeTransformIndex ( const label  transformIndex0,
const label  transformIndex1 
) const
inline

Combine two transformIndices.

◆ minimumTransformIndex()

Foam::label minimumTransformIndex ( const label  transformIndex0,
const label  transformIndex1 
) const
inline

Combine two transformIndices.

Definition at line 278 of file globalIndexAndTransformI.H.

References forAll.

◆ subtractTransformIndex()

Foam::label subtractTransformIndex ( const label  transformIndex0,
const label  transformIndex1 
) const
inline

Subtract two transformIndices.

Definition at line 322 of file globalIndexAndTransformI.H.

References forAll.

◆ encode() [1/2]

Foam::labelPair encode ( const label  index,
const label  transformIndex 
)
inlinestatic

◆ encode() [2/2]

Foam::labelPair encode ( const label  procI,
const label  index,
const label  transformIndex 
)
inlinestatic

Encode index and bare index as components on given processor.

Definition at line 350 of file globalIndexAndTransformI.H.

References Foam::abort(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, and Foam::labelMax.

Here is the call graph for this function:

◆ index()

Foam::label index ( const labelPair globalIAndTransform)
inlinestatic

◆ processor()

Foam::label processor ( const labelPair globalIAndTransform)
inlinestatic

Which processor does this come from?

Definition at line 392 of file globalIndexAndTransformI.H.

References Pair::second().

Referenced by globalMeshData::calcGlobalEdgeSlaves(), globalMeshData::calcGlobalPointEdges(), globalMeshData::calcPointConnectivity(), globalMeshData::findTransform(), and mapDistribute::mapDistribute().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ transformIndex()

Foam::label transformIndex ( const labelPair globalIAndTransform)
inlinestatic

◆ nIndependentTransforms()

Foam::label nIndependentTransforms ( ) const
inline

Return the number of independent transforms.

Definition at line 409 of file globalIndexAndTransformI.H.

References globalIndexAndTransform::transforms_.

Referenced by InteractionLists< typename CloudType::parcelType >::findExtendedProcBbsInRange().

Here is the caller graph for this function:

◆ transforms()

const Foam::List< Foam::vectorTensorTransform > & transforms ( ) const
inline

Return access to the stored independent transforms.

Definition at line 416 of file globalIndexAndTransformI.H.

◆ transformPermutations()

const Foam::List< Foam::vectorTensorTransform > & transformPermutations ( ) const
inline

Return access to the permuted transforms.

Definition at line 423 of file globalIndexAndTransformI.H.

Referenced by mapDistribute::applyInverseTransforms(), mapDistribute::applyTransforms(), and mapDistribute::mapDistribute().

Here is the caller graph for this function:

◆ nullTransformIndex()

Foam::label nullTransformIndex ( ) const
inline

Return the transformIndex (index in transformPermutations)

of the identity transform

Definition at line 429 of file globalIndexAndTransformI.H.

Referenced by globalMeshData::calcPointConnectivity().

Here is the caller graph for this function:

◆ patchTransformSign()

const Foam::List< Foam::Pair< Foam::label > > & patchTransformSign ( ) const
inline

Return access to the per-patch transform-sign pairs.

Definition at line 436 of file globalIndexAndTransformI.H.

◆ transform()

const Foam::vectorTensorTransform & transform ( label  transformIndex) const
inline

◆ transformIndicesForPatches()

Foam::labelList transformIndicesForPatches ( const labelHashSet patchIs) const
inline

Access the all of the indices of the transform.

permutations corresponding the transforms of the listed patch indices

Definition at line 452 of file globalIndexAndTransformI.H.

References Foam::constant::physicoChemical::b, HashTable::empty(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, Pair::first(), forAllConstIter(), Foam::mag(), Foam::pow(), Pair::second(), List::setSize(), Foam::sign(), and Foam::sum().

Here is the call graph for this function:

◆ transformPatches()

Foam::pointField transformPatches ( const labelHashSet patchIs,
const point pt 
) const
inline

Apply all of the transform permutations.

corresponding the transforms of the listed patch indices to the supplied point

Definition at line 627 of file globalIndexAndTransformI.H.

References forAll, and List::size().

Here is the call graph for this function:

Friends And Related Function Documentation

◆ globalPoints

friend class globalPoints
friend

Declare friendship with the entry class for IO.

Definition at line 163 of file globalIndexAndTransform.H.

Field Documentation

◆ mesh_

const polyMesh& mesh_
private

Reference to mesh.

Definition at line 84 of file globalIndexAndTransform.H.

Referenced by globalIndexAndTransform::determineTransforms().

◆ transforms_

List<vectorTensorTransform> transforms_
private

The possible independent (non-permuted) transforms of the.

geometry, i.e. for a geometry with two cyclics, this stores the two transforms, not the eight permutations. There may not be more than three transforms in the range of coupledPolyPatch geometries (separated XOR non-parallel) and symmetries (cuboid periodicity only) supported.

Definition at line 93 of file globalIndexAndTransform.H.

Referenced by globalIndexAndTransform::determineTransforms(), and globalIndexAndTransform::nIndependentTransforms().

◆ transformPermutations_

List<vectorTensorTransform> transformPermutations_
private

The permutations of the transforms, stored for lookup.

efficiency. If there are n transforms, then there are (3^n) permutations, including the no-transformation transform.

Definition at line 99 of file globalIndexAndTransform.H.

◆ nullTransformIndex_

label nullTransformIndex_
private

Index of identity transform.

Definition at line 102 of file globalIndexAndTransform.H.

◆ patchTransformSign_

List<Pair<label> > patchTransformSign_
private

Mapping from patch index to which transform it matches (or.

-1 for none) (.first()) and what sign to use for it, i.e. +/- 1 (.second()).

Definition at line 107 of file globalIndexAndTransform.H.

◆ base_

const label base_ = 32
staticprivate

Number of spaces to reserve for transform encoding.

Definition at line 113 of file globalIndexAndTransform.H.


The documentation for this class was generated from the following files: