NeoPZ
Public Member Functions | Static Public Member Functions | List of all members
TPZRefPatternTools Class Reference

Defines tools of pattern. Refine. More...

#include <TPZRefPatternTools.h>

Public Member Functions

 TPZRefPatternTools ()
 
 ~TPZRefPatternTools ()
 

Static Public Member Functions

static void GetCompatibleRefPatterns (TPZGeoEl *gel, std::list< TPZAutoPointer< TPZRefPattern > > &refs)
 Search for refpatterns that could be used by a given element with respect to their neighbours. More...
 
static TPZAutoPointer< TPZRefPatternModelRefPattern (TPZGeoEl *gel, std::map< int, std::pair< TPZGeoEl *, std::map< int, int > > > &neighCorresp)
 Returns the refpattern that matches the sides refinement by neighbours. More...
 
static TPZAutoPointer< TPZRefPatternPerfectMatchRefPattern (TPZGeoEl *gel, TPZVec< int > &sidestorefine)
 Returns the refpattern that matches the sides refinement intensity and midnodes coordinates with respect to sidestorefine vector. More...
 
static TPZAutoPointer< TPZRefPatternPerfectMatchRefPattern (TPZGeoEl *gel)
 Returns the refpattern that matches the sides refinement intensity and midnodes coordinates with respect to sideNeighbours. More...
 
static TPZAutoPointer< TPZRefPatternGetRefPatternBasedOnRealMeshElements (TPZVec< TPZGeoEl *> &realMeshElementVec)
 
static void GenerateGMeshFromElementVec (const TPZVec< TPZGeoEl *> &elementVec, TPZGeoMesh &refGMesh)
 
static void ModifyElementsBasedOnRefpFound (TPZAutoPointer< TPZRefPattern > &refpFound, TPZAutoPointer< TPZRefPattern > &refp, TPZVec< TPZGeoEl *> &elementVec)
 
static TPZAutoPointer< TPZRefPatternDragModelPatNodes (TPZGeoEl *gel, TPZAutoPointer< TPZRefPattern > modelPat, std::map< int, std::pair< TPZGeoEl *, std::map< int, int > > > &neighCorresp)
 Return an refpattern based on a gived one (modelPat), whose midnodes was dragged to match with a geoel neighbourhood refinement. More...
 
static bool CompareTopologies (TPZAutoPointer< TPZRefPattern > refA, TPZAutoPointer< TPZRefPattern > refB, TPZTransform<> &fromAtoB, std::map< int, int > &pairNodes)
 Returns if the given refPatterns (refA and refB) are topologicaly compatibles. More...
 
static void PairMeshesCornerNodesMatchingCoordinates (TPZGeoMesh &meshA, TPZGeoMesh &meshB, TPZTransform<> &fromAtoB, std::map< int, int > &pairedNodes)
 This method pair CORNER nodes from refA->mesh.father to refB->mesh.father, using the givem transformation from refA->mesh to refB->mesh to match coordinates. More...
 
static void PairMeshesNodesMatchingCoordinates (TPZGeoMesh &meshA, TPZGeoMesh &meshB, TPZTransform<> &fromAtoB, std::map< int, int > &pairedNodes)
 This method pair nodes from refA->mesh to refB->mesh, using the givem transformation from refA->mesh to refB->mesh to match coordinates. More...
 
static std::string BuildRefPatternModelName (TPZRefPattern &refp)
 Returns the the name of refpattern model. More...
 
static std::string BuildRefPatternModelName (TPZAutoPointer< TPZRefPattern > refp)
 
static std::string BuildRefPatternModelName (TPZGeoEl *gel)
 
static bool SidesToRefine (TPZGeoEl *gel, TPZVec< int > &sidestoref)
 Returns if there is any neigbour already refined. More...
 
static void RefineDirectional (TPZGeoEl *gel, std::set< int > &matids)
 Refines the element if it touches an element with a material id included in matids. More...
 
static void RefineDirectional (TPZGeoEl *gel, std::set< int > &matids, int gelMat)
 
static void RefineDirectional (TPZGeoMesh *gmesh, std::set< int > &matids)
 
static void RefineDirectional (TPZGeoMesh *gmesh, std::set< int > &matids, int gelmat)
 
static void RefineUniformIfNeighMat (TPZGeoEl *gel, std::set< int > &matids)
 
static bool ConstJacobian (TPZGeoElSide gelside, REAL tol=1.e-6)
 Method to test if the jacobian of a TPZGeoElSide element is constant. More...
 
static void TransformationTest (TPZRefPattern *refp)
 Algorithm that evaluates the veracity of the hashings between sides of the elements children and corresponding sides of the father. More...
 
static void NodesHunter (TPZGeoMesh &gMesh, TPZVec< int > &NodesHunted, int IdIni, int IdFin, double Tol=1.E-1)
 NodesHunted vector is the sequential nodesIds that belongs (i.e.: "Tol" far) to InitialNode(IdIni)~FinalNode(IdFin) alignment of gMesh.NodeVec() More...
 
static void GetGelPermutations (TPZGeoEl *gel, TPZVec< TPZManVector< int, 8 > > &permutation)
 Fill the TPZVec "permutation" with the valid permutations of "gel". More...
 
static void GetElTypePermutations (MElementType elType, TPZVec< TPZManVector< int, 8 > > &permutation)
 Fill the TPZVec "permutation" with the valid permutations of a given element type. More...
 

Detailed Description

Defines tools of pattern. Refine.

Definition at line 28 of file TPZRefPatternTools.h.

Constructor & Destructor Documentation

◆ TPZRefPatternTools()

TPZRefPatternTools::TPZRefPatternTools ( )

Definition at line 18 of file TPZRefPatternTools.cpp.

◆ ~TPZRefPatternTools()

TPZRefPatternTools::~TPZRefPatternTools ( )

Definition at line 23 of file TPZRefPatternTools.cpp.

Member Function Documentation

◆ BuildRefPatternModelName() [1/3]

std::string TPZRefPatternTools::BuildRefPatternModelName ( TPZRefPattern refp)
static

Returns the the name of refpattern model.

To do this, it starts with the 3 initial characters of element nametype, followed by the quantity of midnodes for each side of element.

Definition at line 817 of file TPZRefPatternTools.cpp.

References TPZRefPattern::Element(), TPZRefPattern::fNonInitializedName, TPZGeoEl::NCornerNodes(), TPZRefPattern::NSideNodes(), TPZGeoEl::NSides(), and TPZGeoEl::TypeName().

Referenced by TPZRefPattern::BuildName().

◆ BuildRefPatternModelName() [2/3]

std::string TPZRefPatternTools::BuildRefPatternModelName ( TPZAutoPointer< TPZRefPattern refp)
static

◆ BuildRefPatternModelName() [3/3]

std::string TPZRefPatternTools::BuildRefPatternModelName ( TPZGeoEl gel)
static

◆ CompareTopologies()

bool TPZRefPatternTools::CompareTopologies ( TPZAutoPointer< TPZRefPattern refA,
TPZAutoPointer< TPZRefPattern refB,
TPZTransform<> &  fromAtoB,
std::map< int, int > &  pairNodes 
)
static

Returns if the given refPatterns (refA and refB) are topologicaly compatibles.

Note
If they are, pairNodes represents the correspondence between nodesIds from refAmesh to refBmesh.
Parameters
refA- input data: first refpattern to be compared
refB- input data: second refpattern to be compared
fromAtoB- input data: Linear Transformation from refA->RefPatternMesh to refB->RefPatternMesh() (its needed to pair Nodes correctly in permuted cases)
pairNodes- output data: correspondence between refA and refB nodes, in case they are topologicaly compatibles

Definition at line 540 of file TPZRefPatternTools.cpp.

References DebugStop, TPZGeoElSide::Dimension(), TPZGeoMesh::ElementVec(), GetGelPermutations(), TPZGeoMesh::NElements(), TPZVec< T >::NElements(), TPZGeoMesh::NNodes(), TPZGeoEl::NNodes(), TPZGeoEl::NodeIndex(), TPZGeoEl::NSides(), TPZRefPattern::NSubElements(), TPZRefPattern::RefPatternMesh(), TPZVec< T >::Resize(), TPZGeoElSide::SideNodeIndex(), TPZVec< T >::size(), TPZGeoEl::Type(), and TPZRefPattern::Type().

◆ ConstJacobian()

bool TPZRefPatternTools::ConstJacobian ( TPZGeoElSide  gelside,
REAL  tol = 1.e-6 
)
static

◆ DragModelPatNodes()

TPZAutoPointer< TPZRefPattern > TPZRefPatternTools::DragModelPatNodes ( TPZGeoEl gel,
TPZAutoPointer< TPZRefPattern modelPat,
std::map< int, std::pair< TPZGeoEl *, std::map< int, int > > > &  neighCorresp 
)
static

Return an refpattern based on a gived one (modelPat), whose midnodes was dragged to match with a geoel neighbourhood refinement.

Parameters
gel- input data: geometric element for which the model refpattern nodes will be dragged
modelPat- input data: Model RefPattern that is topologicaly compatible with neighbourhood
neighCorresp- input data: map that group (neighbour geoelement) and nodes correspondences between (neighbour->SideRefpattern) and (gel->SideRefpattern), indexed by (gel->Side)

Definition at line 466 of file TPZRefPatternTools.cpp.

References TPZTransform< T >::Apply(), TPZRefPattern::ComputePartition(), TPZRefPattern::ComputeTransforms(), TPZGeoElSide::Element(), TPZRefPatternDataBase::FindRefPattern(), TPZRefPattern::GenerateSideRefPatterns(), TPZGeoEl::GetRefPattern(), gRefDBase, TPZRefPattern::InsertPermuted(), TPZRefPatternDataBase::InsertRefPattern(), TPZGeoElSide::Neighbour(), TPZGeoElSide::NeighbourSideTransform(), TPZGeoEl::NNodes(), TPZGeoMesh::NodeVec(), TPZGeoEl::NSides(), TPZRefPattern::RefPatternMesh(), TPZGeoElSide::Side(), TPZRefPattern::SideRefPattern(), and TPZGeoEl::SideToSideTransform().

Referenced by PerfectMatchRefPattern().

◆ GenerateGMeshFromElementVec()

void TPZRefPatternTools::GenerateGMeshFromElementVec ( const TPZVec< TPZGeoEl *> &  elementVec,
TPZGeoMesh refGMesh 
)
static

◆ GetCompatibleRefPatterns()

void TPZRefPatternTools::GetCompatibleRefPatterns ( TPZGeoEl gel,
std::list< TPZAutoPointer< TPZRefPattern > > &  refs 
)
static

Search for refpatterns that could be used by a given element with respect to their neighbours.

Parameters
gel- input data: geometric element for which the list of compatible refpatterns will be filled
refs- output data: list of compatible refpatterns with respect to their neighbours

Definition at line 28 of file TPZRefPatternTools.cpp.

References DebugStop, TPZGeoElSide::Element(), TPZGeoEl::GetRefPattern(), gRefDBase, TPZGeoEl::HasSubElement(), TPZGeoEl::NCornerNodes(), TPZGeoElSide::Neighbour(), TPZGeoElSide::NeighbourSideTransform(), TPZGeoEl::NSides(), TPZGeoElSide::NSubElements(), TPZRefPatternDataBase::RefPatternList(), TPZGeoElSide::Side(), TPZRefPattern::SideRefPattern(), and TPZGeoEl::Type().

Referenced by TPZGeoElRefPattern< TGeo >::Divide(), and PerfectMatchRefPattern().

◆ GetElTypePermutations()

void TPZRefPatternTools::GetElTypePermutations ( MElementType  elType,
TPZVec< TPZManVector< int, 8 > > &  permutation 
)
static

Fill the TPZVec "permutation" with the valid permutations of a given element type.

Definition at line 1581 of file TPZRefPatternTools.cpp.

References DebugStop, ECube, EOned, EPiramide, EPrisma, EQuadrilateral, ETetraedro, and ETriangle.

◆ GetGelPermutations()

void TPZRefPatternTools::GetGelPermutations ( TPZGeoEl gel,
TPZVec< TPZManVector< int, 8 > > &  permutation 
)
static

Fill the TPZVec "permutation" with the valid permutations of "gel".

Note
Note: The permutations is with respect to Master Element nodes, NOT Gel nodes in a geomesh context (i.e.: NOT geomesh nodes ids)

Definition at line 1567 of file TPZRefPatternTools.cpp.

References TPZGeoEl::NodeIndex(), and TPZGeoEl::Type().

Referenced by CompareTopologies().

◆ GetRefPatternBasedOnRealMeshElements()

TPZAutoPointer< TPZRefPattern > TPZRefPatternTools::GetRefPatternBasedOnRealMeshElements ( TPZVec< TPZGeoEl *> &  realMeshElementVec)
static

This method receives an vector of real mesh elements (index0=FATHER , index1...=SONS) and returns the corresponding refinement pattern. ONCE THE REFPATTERN COULD PRESENT PERMUTATIONS OF SONS, THIS METHOD FIX THE TOPOLOGICAL SEQUENCE OF REAL MESH ELEMENTS. This implies the call BuildConnectivity() method after this whole operation (which should be done by the programmer).

Definition at line 258 of file TPZRefPatternTools.cpp.

References TPZRefPatternDataBase::FindRefPattern(), gRefDBase, and TPZRefPatternDataBase::InsertRefPattern().

◆ ModelRefPattern()

TPZAutoPointer< TPZRefPattern > TPZRefPatternTools::ModelRefPattern ( TPZGeoEl gel,
std::map< int, std::pair< TPZGeoEl *, std::map< int, int > > > &  neighCorresp 
)
static

Returns the refpattern that matches the sides refinement by neighbours.

Parameters
gel- input data: geometric element for which the model refpattern will be returned
neighCorresp- output data: map that group (neighbour geoelement)
and nodes correspondences between (neighbour->SideRefpattern) and (gel->SideRefpattern), indexed by (gel->Side)
Note
IF THERE IS NO NEIGHBOUR ALREADY REFINED, IT RETURNS NULL

Definition at line 98 of file TPZRefPatternTools.cpp.

References TPZGeoElSide::Dimension(), TPZGeoElSide::Element(), TPZGeoEl::GetRefPattern(), gRefDBase, TPZGeoElSide::Neighbour(), TPZGeoElSide::NeighbourSideTransform(), TPZGeoEl::NNodes(), TPZGeoEl::NSides(), TPZGeoElSide::NSubElements(), TPZRefPatternDataBase::RefPatternList(), TPZGeoElSide::Side(), TPZRefPattern::SideRefPattern(), TPZGeoEl::SideToSideTransform(), and TPZGeoEl::Type().

Referenced by PerfectMatchRefPattern().

◆ ModifyElementsBasedOnRefpFound()

void TPZRefPatternTools::ModifyElementsBasedOnRefpFound ( TPZAutoPointer< TPZRefPattern > &  refpFound,
TPZAutoPointer< TPZRefPattern > &  refp,
TPZVec< TPZGeoEl *> &  elementVec 
)
static

A partir de um padrao encontrado, corrige a sequencia topologica dos elementos originais

Definition at line 317 of file TPZRefPatternTools.cpp.

References DebugStop, TPZGeoMesh::ElementVec(), TPZGeoMesh::FindNode(), TPZGeoMesh::NElements(), TPZVec< T >::NElements(), TPZGeoMesh::NNodes(), TPZGeoMesh::NodeVec(), TPZRefPattern::RefPatternMesh(), and TPZVec< T >::size().

◆ NodesHunter()

void TPZRefPatternTools::NodesHunter ( TPZGeoMesh gMesh,
TPZVec< int > &  NodesHunted,
int  IdIni,
int  IdFin,
double  Tol = 1.E-1 
)
static

NodesHunted vector is the sequential nodesIds that belongs (i.e.: "Tol" far) to InitialNode(IdIni)~FinalNode(IdFin) alignment of gMesh.NodeVec()

Note
Obs.: InitialNode and FinalNode are also included!!!

Although this method considers coordinates in R3, Coord-Z must be constant for all nodes

i.e., nodes coordinates belong to XY parallel plane

Changing NodesCoords from Cartesian Notation to Vectorial Notation

with respect to IniNode coordinate

Changing VectorialNotation from Canonic Base to NewBase

Hunting Nodes

Definition at line 1473 of file TPZRefPatternTools.cpp.

References DebugStop, fabs, TPZFMatrix< TVar >::GetVal(), h, TPZChunkVector< T, EXP >::NElements(), TPZGeoMesh::NodeVec(), TPZFMatrix< TVar >::PutVal(), TPZManVector< T, NumExtAlloc >::Resize(), TPZVec< T >::Resize(), sqrt, and val().

◆ PairMeshesCornerNodesMatchingCoordinates()

void TPZRefPatternTools::PairMeshesCornerNodesMatchingCoordinates ( TPZGeoMesh meshA,
TPZGeoMesh meshB,
TPZTransform<> &  fromAtoB,
std::map< int, int > &  pairedNodes 
)
static

This method pair CORNER nodes from refA->mesh.father to refB->mesh.father, using the givem transformation from refA->mesh to refB->mesh to match coordinates.

Parameters
meshA- input data: mesh of first refpattern that will be considered its nodes coordinates
meshB- input data: mesh of second refpattern that will be considered its nodes coordinates
fromAtoB- input data: Linear Transformation from refA->mesh to refB->mesh (its needed to pair Nodes correctly in permuted cases)
pairedNodes- output data: correspondence between refA->mesh and refB->mesh nodes that matches its coordinates in fathers elements The output is the map pairNodes, thar represents the A_nodeId paired with B_nodeId.
Obs.: Be careful with the output interpretation! It contains the nodeIds, NOT the nodes positions in mesh.NodeVec()!!!

Definition at line 747 of file TPZRefPatternTools.cpp.

References TPZTransform< T >::Apply(), TPZGeoMesh::ElementVec(), fabs, and TPZGeoMesh::NodeVec().

◆ PairMeshesNodesMatchingCoordinates()

void TPZRefPatternTools::PairMeshesNodesMatchingCoordinates ( TPZGeoMesh meshA,
TPZGeoMesh meshB,
TPZTransform<> &  fromAtoB,
std::map< int, int > &  pairedNodes 
)
static

This method pair nodes from refA->mesh to refB->mesh, using the givem transformation from refA->mesh to refB->mesh to match coordinates.

Note
The output is the map pairNodes, thar represents the A_nodeId paired with B_nodeId.
Obs: Be careful with the output interpretation! It contains the nodeIds, NOT the nodes positions in mesh.NodeVec()!!!
Parameters
meshA- input data: mesh of first refpattern that will be considered its nodes coordinates
meshB- input data: mesh of second refpattern that will be considered its nodes coordinates
fromAtoB- input data: Linear Transformation from refA->mesh to refB->mesh (its needed to pair Nodes correctly in permuted cases)
pairedNodes- output data: correspondence between refA->mesh and refB->mesh nodes that matches its coordinates

Definition at line 782 of file TPZRefPatternTools.cpp.

References TPZTransform< T >::Apply(), fabs, TPZGeoMesh::NNodes(), and TPZGeoMesh::NodeVec().

◆ PerfectMatchRefPattern() [1/2]

TPZAutoPointer< TPZRefPattern > TPZRefPatternTools::PerfectMatchRefPattern ( TPZGeoEl gel,
TPZVec< int > &  sidestorefine 
)
static

Returns the refpattern that matches the sides refinement intensity and midnodes coordinates with respect to sidestorefine vector.

Note
This methos is used by RefineDirectional method!!!
Parameters
gel- input data: geometric element for which the perfect match refpattern will be returned
sidestorefine- input data: vector filled with sides refinement intensity

Definition at line 181 of file TPZRefPatternTools.cpp.

References DebugStop, TPZGeoEl::Dimension(), GetCompatibleRefPatterns(), TPZGeoEl::NCornerNodes(), TPZGeoEl::NSides(), and TPZRefPattern::NSubElements().

Referenced by TPZMHMeshControl::DivideSkeletonElements(), and RefineDirectional().

◆ PerfectMatchRefPattern() [2/2]

TPZAutoPointer< TPZRefPattern > TPZRefPatternTools::PerfectMatchRefPattern ( TPZGeoEl gel)
static

Returns the refpattern that matches the sides refinement intensity and midnodes coordinates with respect to sideNeighbours.

Parameters
gel- input data: geometric element for which the perfect match refpatterns will be returned
Note
IF THERE IS NO NEIGHBOUR ALREADY REFINED, IT RETURNS NULL

Definition at line 425 of file TPZRefPatternTools.cpp.

References DebugStop, DragModelPatNodes(), TPZGeoEl::Index(), TPZGeoEl::Mesh(), ModelRefPattern(), TPZVTKGeoMesh::PrintGMeshVTKneighbourhood(), and SidesToRefine().

◆ RefineDirectional() [1/4]

void TPZRefPatternTools::RefineDirectional ( TPZGeoEl gel,
std::set< int > &  matids 
)
static

◆ RefineDirectional() [2/4]

void TPZRefPatternTools::RefineDirectional ( TPZGeoEl gel,
std::set< int > &  matids,
int  gelMat 
)
static

◆ RefineDirectional() [3/4]

void TPZRefPatternTools::RefineDirectional ( TPZGeoMesh gmesh,
std::set< int > &  matids 
)
static

Definition at line 1153 of file TPZRefPatternTools.cpp.

References TPZGeoMesh::Element(), and TPZGeoMesh::NElements().

◆ RefineDirectional() [4/4]

void TPZRefPatternTools::RefineDirectional ( TPZGeoMesh gmesh,
std::set< int > &  matids,
int  gelmat 
)
static

Definition at line 1165 of file TPZRefPatternTools.cpp.

References TPZGeoMesh::Element(), and TPZGeoMesh::NElements().

◆ RefineUniformIfNeighMat()

void TPZRefPatternTools::RefineUniformIfNeighMat ( TPZGeoEl gel,
std::set< int > &  matids 
)
static

◆ SidesToRefine()

bool TPZRefPatternTools::SidesToRefine ( TPZGeoEl gel,
TPZVec< int > &  sidestoref 
)
static

Returns if there is any neigbour already refined.

Parameters
gel- input data: geometric element whose refinements of the neighbors will define the refinement of its sides
sidestoref- output data: vector whose positions mention the sides of gel, and its contents mention the intensity of refinement of the respective side

Definition at line 939 of file TPZRefPatternTools.cpp.

References DebugStop, TPZGeoElSide::Element(), TPZGeoElSide::Exists(), TPZGeoEl::GetRefPattern(), TPZGeoEl::HasSubElement(), TPZGeoEl::NCornerNodes(), TPZGeoElSide::Neighbour(), TPZVec< T >::NElements(), TPZGeoEl::NSides(), TPZGeoEl::NSideSubElements(), TPZRefPattern::Print(), TPZVec< T >::Resize(), TPZGeoElSide::Side(), TPZRefPattern::SideNodes(), and TPZRefPattern::SideRefPattern().

Referenced by BuildRefPatternModelName(), and PerfectMatchRefPattern().

◆ TransformationTest()

void TPZRefPatternTools::TransformationTest ( TPZRefPattern refp)
static

Algorithm that evaluates the veracity of the hashings between sides of the elements children and corresponding sides of the father.

A point p in the parametric space of the side of the sub-element is overcome and is calculated
it mentioned hashing getting pf point in the element father.
One calculates for p and pf the corresponding deformed point.
Itself the hashing is consistent the deformed point must the same be.

Definition at line 1367 of file TPZRefPatternTools.cpp.

References TPZTransform< T >::Apply(), TPZGeoEl::ComputeXInverse(), TPZGeoEl::CreateSideIntegrationRule(), DebugStop, TPZGeoEl::Dimension(), TPZRefPattern::Element(), TPZGeoEl::Id(), TPZRefPattern::IsFatherNeighbour(), TPZIntPoints::NPoints(), TPZGeoEl::NSides(), TPZRefPattern::NSubElements(), TPZIntPoints::Point(), PZError, TPZIntPoints::SetOrder(), TPZGeoEl::SideDimension(), TPZGeoEl::SideToSideTransform(), sqrt, TPZRefPattern::Transform(), TPZGeoEl::WhichSide(), TPZGeoEl::X(), and ZeroTolerance().


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