NeoPZ
|
Implements the generation of a multilayered bi-dimensional geometric grid. Getting Data. More...
#include <pzgengrid.h>
Public Member Functions | |
TPZGenGrid (TPZVec< int > &nx, TPZVec< REAL > &x0, TPZVec< REAL > &x1, int numl=1, REAL rot=0.5) | |
Constructor of the rectangular domain. More... | |
virtual | ~TPZGenGrid () |
Default destructor. More... | |
void | SetData (TPZVec< int > &nx, TPZVec< REAL > &x0, TPZVec< REAL > &x1, MElementType eltype=EQuadrilateral, int numl=1, REAL rot=0.5) |
Change points and all data to generate geometric mesh. More... | |
void | SetZigZagPattern () |
Indicate whether the elements are generated in a zigzag pattern. More... | |
void | SetDistortion (REAL distortion) |
virtual short | Read (TPZGeoMesh *mesh, int matid=1) |
Add nodes and elements to the object mesh. More... | |
short | Read (TPZAutoPointer< TPZGeoMesh > &mesh, int matid=1) |
Add nodes and elements to the object mesh. More... | |
void | ComputeGeometricProgression (TPZVec< REAL > &minsizes, TPZVec< REAL > &progression) |
Compute the geometric progression such that the first elements have this size. More... | |
void | SetGeometricProgression (TPZVec< REAL > &progression) |
Sets the geometric progression of the mesh to be generated. More... | |
virtual void | SetBC (TPZGeoMesh *gr, int side, int bc) |
Generate boundary geometric elements associated with the side of the rectangular domain. More... | |
virtual void | SetBC (TPZGeoMesh *gr, TPZVec< REAL > &start, TPZVec< REAL > &end, int bc) |
Generate boundary geometric elements between node start and end going counter clockwise. More... | |
void | SetBC (TPZAutoPointer< TPZGeoMesh > gr, int side, int bc) |
Generate boundary geometric elements associated with the side of the rectangular domain. More... | |
void | SetBC (TPZAutoPointer< TPZGeoMesh > gr, TPZVec< REAL > &start, TPZVec< REAL > &end, int bc) |
Generate boundary geometric elements between node start and end going counter clockwise. More... | |
void | SetPointBC (TPZGeoMesh *gr, TPZVec< REAL > &x, int bc) |
Generate a boundary geometric element at the indicated node. More... | |
void | SetPointBC (TPZAutoPointer< TPZGeoMesh > gr, TPZVec< REAL > &x, int bc) |
Generate a boundary geometric element at the indicated node. More... | |
virtual void | Print (char *name=NULL, std::ostream &out=std::cout) |
Prints the data structure of the class. More... | |
virtual void | SetElementType (MElementType type) |
Set the element type. More... | |
int64_t | ElemId (int64_t iel, int64_t jel, int layer) |
Returns the element id for the element addressed by the parameters. More... | |
bool | ReadAndMergeGeoMesh (TPZGeoMesh *grid, TPZGeoMesh *grid2) |
Merges two geometrical mesh created for TPZGenGrid as separated. More... | |
bool | ReadAndMergeGeoMesh (TPZGeoMesh *grid, TPZGeoMesh *grid2, int matid) |
Merges two geometrical mesh created for TPZGenGrid as separated, creating the first mesh and the second mesh must to exist. More... | |
bool | MergeGeoMesh (TPZGeoMesh *grid, TPZGeoMesh *grid2, int matid=1) |
Merges two geometrical mesh created for TPZGenGrid as separated, both meshes must to exist. More... | |
void | SetRefpatternElements (bool refpat) |
Generate element of type refpattern or uniform refinement. More... | |
Static Public Member Functions | |
static REAL | GeometricProgression (REAL minsize, REAL size, int numdiv) |
Compute the geometric progression such that the first elements have this size. More... | |
static REAL | Distance (TPZVec< REAL > &x1, TPZVec< REAL > &x2) |
Computes the euclidean distance between two points, or the measure of the interval between two points. More... | |
Protected Member Functions | |
virtual void | Coord (int i, TPZVec< REAL > &coord) |
Computes the coordinates of the ith geometric node generated. More... | |
virtual int | GlobalI (int ix, int iy, int layer) |
Returns the geometric node id for the element addressed by the parameters. More... | |
void | ElementConnectivity (int64_t iel, TPZVec< int64_t > &nodes) |
compute the nodes of the ith Element More... | |
void | ElementConnectivityZigZag (int64_t iel, TPZVec< int64_t > &nodes) |
compute the nodes of the ith Element More... | |
virtual bool | GenerateNodes (TPZGeoMesh *grid) |
Creates the geometric nodes, it depends on fElementType, layer and fRotAngle. More... | |
virtual bool | GenerateElements (TPZGeoMesh *grid, int matid) |
Creates the geometric element: triangles or quadrilaterals. More... | |
virtual bool | GenerateElementsZigZag (TPZGeoMesh *grid, int matid) |
Creates the geometric element: triangles or quadrilaterals. More... | |
Protected Attributes | |
TPZManVector< int > | fNx |
Number of elements in both directions. More... | |
TPZManVector< REAL > | fX0 |
Coordinate of the lower left point. More... | |
TPZManVector< REAL > | fX1 |
coordinate of the upper right point More... | |
TPZManVector< REAL > | fDelx |
Size of the lower left element. More... | |
TPZManVector< REAL > | fGeometricProgression |
Geometric progression coeficients in the x and y direction. More... | |
int64_t | fNumNodes |
Number of nodes of the mesh. More... | |
MElementType | fElementType |
Variable which indicates the type of element that should be generated Only EQuadrilateral or ETriangle is supported. More... | |
int | fNumLayers |
Number of meshes which will be generated hinging along an axis. More... | |
REAL | fRotAngle |
Rotation angle between the layers. More... | |
bool | fZigZag |
variable to generate a zigzag grid More... | |
bool | fTrapeze |
REAL | fDistortion |
bool | fRefPattern |
Uniform or refpattern elements. More... | |
Implements the generation of a multilayered bi-dimensional geometric grid. Getting Data.
This class uses DEPRECATED objects, but can be easily updated
Definition at line 29 of file pzgengrid.h.
TPZGenGrid::TPZGenGrid | ( | TPZVec< int > & | nx, |
TPZVec< REAL > & | x0, | ||
TPZVec< REAL > & | x1, | ||
int | numl = 1 , |
||
REAL | rot = 0.5 |
||
) |
Constructor of the rectangular domain.
nx | numbers of partition intervals for x (nx[0]) and for y (nx[1]) |
x0 | lower left coordinate |
x1 | upper right coordinate |
numl | number of layers |
rot | rotation applied to the grid for the next layer |
Definition at line 33 of file pzgengrid.cpp.
References EQuadrilateral, fDelx, fElementType, fNumLayers, and fNumNodes.
|
virtual |
Default destructor.
Definition at line 41 of file pzgengrid.cpp.
void TPZGenGrid::ComputeGeometricProgression | ( | TPZVec< REAL > & | minsizes, |
TPZVec< REAL > & | progression | ||
) |
Compute the geometric progression such that the first elements have this size.
compute the geometric progression such that the first elements have this size
Definition at line 878 of file pzgengrid.cpp.
References DebugStop, fabs, fNx, fX0, fX1, and TPZVec< T >::Resize().
Referenced by SetDistortion().
|
protectedvirtual |
Computes the coordinates of the ith geometric node generated.
i | generated geometric node id |
coord | coordinates of the ith node |
Definition at line 545 of file pzgengrid.cpp.
References cos(), ENoType, EQuadrilateral, ETriangle, fDelx, fDistortion, fElementType, fGeometricProgression, fNx, fRotAngle, fX0, and sin.
Referenced by GenerateNodes(), and SetRefpatternElements().
Computes the euclidean distance between two points, or the measure of the interval between two points.
x1 | start point |
x2 | last point |
Definition at line 804 of file pzgengrid.cpp.
References sqrt.
Referenced by MergeGeoMesh(), ReadAndMergeGeoMesh(), and SetPointBC().
|
protected |
compute the nodes of the ith Element
Definition at line 625 of file pzgengrid.cpp.
References ENoType, EQuadrilateral, ETriangle, fElementType, fNx, and GlobalI().
Referenced by GenerateElements(), and SetRefpatternElements().
|
protected |
compute the nodes of the ith Element
Definition at line 651 of file pzgengrid.cpp.
References fNx, GlobalI(), and TPZVec< T >::resize().
Referenced by GenerateElementsZigZag(), and SetRefpatternElements().
int64_t TPZGenGrid::ElemId | ( | int64_t | iel, |
int64_t | jel, | ||
int | layer | ||
) |
Returns the element id for the element addressed by the parameters.
iel | ith division for x |
jel | jth division for y |
layer | number of layer for which the element belongs |
Definition at line 800 of file pzgengrid.cpp.
References ENoType, EQuadrilateral, fElementType, and fNx.
Referenced by SetPointBC().
|
protectedvirtual |
Creates the geometric element: triangles or quadrilaterals.
grid | Object mesh in which will be stored the created elements |
matid | Material id to associate all geometric elements |
Definition at line 457 of file pzgengrid.cpp.
References TPZGeoMesh::BuildConnectivity(), TPZGeoMesh::CreateGeoElement(), DebugStop, ElementConnectivity(), ENoType, EQuadrilateral, ETriangle, fElementType, fNumLayers, fNx, fRefPattern, fZigZag, GenerateElementsZigZag(), LOGPZ_DEBUG, TPZGeoMesh::NElements(), test::res, and TPZVec< T >::Resize().
Referenced by Read(), and SetRefpatternElements().
|
protectedvirtual |
Creates the geometric element: triangles or quadrilaterals.
grid | Object mesh in which will be stored the created elements |
matid | Material id to associate all geometric elements |
Definition at line 505 of file pzgengrid.cpp.
References TPZGeoMesh::BuildConnectivity(), TPZGeoMesh::CreateGeoElement(), DebugStop, ElementConnectivityZigZag(), EQuadrilateral, ETriangle, fElementType, fNumLayers, fNx, fRefPattern, LOGPZ_DEBUG, TPZGeoMesh::NElements(), TPZManVector< T, NumExtAlloc >::Resize(), and TPZVec< T >::size().
Referenced by GenerateElements(), and SetRefpatternElements().
|
protectedvirtual |
Creates the geometric nodes, it depends on fElementType, layer and fRotAngle.
grid | Object mesh in which will be stored the created nodes |
Definition at line 434 of file pzgengrid.cpp.
References Coord(), fNumNodes, LOGPZ_DEBUG, TPZGeoMesh::NNodes(), TPZGeoMesh::NodeVec(), and TPZAdmChunkVector< T, EXP >::Resize().
Referenced by Read(), and SetRefpatternElements().
|
static |
Compute the geometric progression such that the first elements have this size.
compute the geometric progression such that the first elements have this size
Definition at line 831 of file pzgengrid.cpp.
References DebugStop, and fabs.
Referenced by SetDistortion().
|
protectedvirtual |
Returns the geometric node id for the element addressed by the parameters.
ix | ith division for x |
iy | ith division for y |
layer | number of the layer for which the node belongs |
Definition at line 783 of file pzgengrid.cpp.
References ENoType, EQuadrilateral, ETriangle, fElementType, and fNx.
Referenced by ElementConnectivity(), ElementConnectivityZigZag(), and SetRefpatternElements().
bool TPZGenGrid::MergeGeoMesh | ( | TPZGeoMesh * | grid, |
TPZGeoMesh * | grid2, | ||
int | matid = 1 |
||
) |
Merges two geometrical mesh created for TPZGenGrid as separated, both meshes must to exist.
grid | Mesh over which will be increment the nodes and elements no duplicated of the second mesh |
grid2 | Mesh from get nodes and elements and put into grid if it is not duplicated |
Definition at line 282 of file pzgengrid.cpp.
References TPZAdmChunkVector< T, EXP >::AllocateNewElement(), TPZGeoMesh::BuildConnectivity(), TPZGeoMesh::CreateGeoElement(), TPZGeoMesh::CreateUniqueElementId(), DebugStop, Distance(), TPZGeoMesh::ElementVec(), EOned, EQuadrilateral, fRefPattern, TPZGeoNode::GetCoordinates(), TPZGeoEl::IsLinearMapping(), IsZero(), TPZGeoEl::MaterialId(), TPZGeoMesh::NElements(), TPZGeoMesh::NNodes(), TPZGeoEl::NNodes(), TPZGeoEl::NodeIndex(), TPZGeoMesh::NodeVec(), TPZGeoMesh::ResetConnectivities(), TPZManVector< T, NumExtAlloc >::Resize(), TPZVec< T >::Resize(), TPZGeoEl::SetNodeIndex(), TPZVec< T >::size(), and TPZGeoEl::Type().
Referenced by SetPointBC().
|
virtual |
Prints the data structure of the class.
name | Title of the structure data will be printed |
out | Output stream (ofstream of the output file data) |
Definition at line 698 of file pzgengrid.cpp.
References fElementType, fNx, fX0, and fX1.
Referenced by SetPointBC().
|
virtual |
Add nodes and elements to the object mesh.
mesh | Object mesh for which will be created the nodes and elements (depends on fTypeElement) |
matid | Material id to associate all geometric elements |
Definition at line 64 of file pzgengrid.cpp.
References TPZGeoMesh::BuildConnectivity(), GenerateElements(), GenerateNodes(), TPZGeoMesh::ResetConnectivities(), and TPZGeoMesh::SetDimension().
Referenced by TPZGenSubStruct::GenerateMesh(), MalhaGeom(), ReadAndMergeGeoMesh(), and SetDistortion().
short TPZGenGrid::Read | ( | TPZAutoPointer< TPZGeoMesh > & | mesh, |
int | matid = 1 |
||
) |
Add nodes and elements to the object mesh.
mesh | Object mesh for which will be created the nodes and elements (depends on fTypeElement) |
Definition at line 77 of file pzgengrid.cpp.
References TPZGeoMesh::BuildConnectivity(), DebugStop, GenerateElements(), GenerateNodes(), TPZGeoMesh::ResetConnectivities(), and TPZGeoMesh::SetDimension().
bool TPZGenGrid::ReadAndMergeGeoMesh | ( | TPZGeoMesh * | grid, |
TPZGeoMesh * | grid2 | ||
) |
Merges two geometrical mesh created for TPZGenGrid as separated.
grid | Mesh over which will be increment the nodes and elements no duplicated of the second mesh |
grid2 | Mesh from get nodes and elements and put into grid if it is not duplicated |
Definition at line 99 of file pzgengrid.cpp.
References TPZAdmChunkVector< T, EXP >::AllocateNewElement(), TPZGeoMesh::BuildConnectivity(), TPZGeoNode::Coord(), TPZGeoMesh::CreateGeoElement(), DebugStop, Distance(), TPZGeoMesh::ElementVec(), fRefPattern, TPZGeoNode::GetCoordinates(), TPZGeoNode::Id(), IsZero(), TPZGeoEl::MaterialId(), TPZGeoMesh::NElements(), TPZGeoMesh::NNodes(), TPZGeoEl::NNodes(), TPZGeoEl::NodeIndex(), TPZGeoMesh::NodeVec(), Read(), TPZGeoMesh::ResetConnectivities(), TPZVec< T >::Resize(), TPZGeoNode::SetCoord(), TPZGeoNode::SetNodeId(), TPZGeoEl::SetNodeIndex(), and TPZGeoEl::Type().
Referenced by SetPointBC().
bool TPZGenGrid::ReadAndMergeGeoMesh | ( | TPZGeoMesh * | grid, |
TPZGeoMesh * | grid2, | ||
int | matid | ||
) |
Merges two geometrical mesh created for TPZGenGrid as separated, creating the first mesh and the second mesh must to exist.
grid | Mesh over which will be increment the nodes and elements no duplicated of the second mesh |
grid2 | Mesh from get nodes and elements and put into grid if it is not duplicated |
Definition at line 190 of file pzgengrid.cpp.
References TPZAdmChunkVector< T, EXP >::AllocateNewElement(), TPZGeoMesh::BuildConnectivity(), TPZGeoNode::Coord(), TPZGeoMesh::CreateGeoElement(), DebugStop, Distance(), TPZGeoMesh::ElementVec(), fRefPattern, TPZGeoNode::GetCoordinates(), TPZGeoNode::Id(), IsZero(), TPZGeoEl::MaterialId(), TPZGeoMesh::NElements(), TPZGeoMesh::NNodes(), TPZGeoEl::NNodes(), TPZGeoEl::NodeIndex(), TPZGeoMesh::NodeVec(), Read(), TPZGeoMesh::ResetConnectivities(), TPZVec< T >::Resize(), TPZGeoNode::SetCoord(), TPZGeoNode::SetNodeId(), TPZGeoEl::SetNodeIndex(), and TPZGeoEl::Type().
|
virtual |
Generate boundary geometric elements associated with the side of the rectangular domain.
gr | object mesh |
side | boundary side of the rectangular domain which will be set the boundary condition |
bc | boundary condition id (material), generally negative |
Definition at line 706 of file pzgengrid.cpp.
References DebugStop, TPZGeoMesh::ElementVec(), ETriangle, fElementType, fNumLayers, fNx, fZigZag, TPZGeoEl::HasSubElement(), and TPZGeoMesh::NElements().
Referenced by MalhaGeom(), SetBC(), and SetDistortion().
|
virtual |
Generate boundary geometric elements between node start and end going counter clockwise.
gr | Object mesh which will be set the elements with the specified boundary condition |
start | First node (boundary coordinates) which will be identified with boundary id |
end | Last node (boundary coordinates) which will identified with boundary id |
bc | Boundary condition id (material), generally negative |
Definition at line 767 of file pzgengrid.cpp.
References TPZGeoMesh::FindNode(), TPZGeoMesh::GetBoundaryElements(), TPZGeoNode::Id(), TPZVec< T >::NElements(), and numel.
|
inline |
Generate boundary geometric elements associated with the side of the rectangular domain.
gr | object mesh |
side | boundary side of the rectangular domain which will be set the boundary condition |
bc | boundary condition id (material), generally negative |
Definition at line 117 of file pzgengrid.h.
|
inline |
Generate boundary geometric elements between node start and end going counter clockwise.
gr | Object mesh which will be set the elements with the specified boundary condition |
start | First node (boundary coordinates) which will be identified with boundary id |
end | Last node (boundary coordinates) which will identified with boundary id |
bc | Boundary condition id (material), generally negative |
Definition at line 129 of file pzgengrid.h.
References bc, SetBC(), and SetPointBC().
void TPZGenGrid::SetData | ( | TPZVec< int > & | nx, |
TPZVec< REAL > & | x0, | ||
TPZVec< REAL > & | x1, | ||
MElementType | eltype = EQuadrilateral , |
||
int | numl = 1 , |
||
REAL | rot = 0.5 |
||
) |
Change points and all data to generate geometric mesh.
Definition at line 44 of file pzgengrid.cpp.
References fDelx, fElementType, fNumLayers, fNumNodes, fNx, fRotAngle, fX0, fX1, TPZVec< T >::NElements(), and TPZManVector< T, NumExtAlloc >::Resize().
|
inline |
Definition at line 58 of file pzgengrid.h.
References bc, ComputeGeometricProgression(), fDistortion, fTrapeze, GeometricProgression(), Read(), SetBC(), and SetGeometricProgression().
|
virtual |
Set the element type.
type | Bi-dimensional element type |
Definition at line 812 of file pzgengrid.cpp.
References DebugStop, ENoType, EQuadrilateral, ETriangle, fDelx, fElementType, fNumLayers, fNumNodes, fNx, fX0, and fX1.
Referenced by SetPointBC().
void TPZGenGrid::SetGeometricProgression | ( | TPZVec< REAL > & | progression | ) |
Sets the geometric progression of the mesh to be generated.
set the geometric progression of the mesh to be generated
Definition at line 927 of file pzgengrid.cpp.
References fDelx, fGeometricProgression, fNx, fX0, and fX1.
Referenced by SetDistortion().
void TPZGenGrid::SetPointBC | ( | TPZGeoMesh * | gr, |
TPZVec< REAL > & | x, | ||
int | bc | ||
) |
Generate a boundary geometric element at the indicated node.
gr | Object mesh which will be set the elements with the specified boundary condition |
x | Node (boundary coordinates) which will identified with boundary id |
bc | Boundary condition id (material), generally negative |
Definition at line 942 of file pzgengrid.cpp.
References TPZGeoMesh::ElementVec(), TPZGeoMesh::FindNode(), gn, TPZGeoEl::NCornerNodes(), TPZChunkVector< T, EXP >::NElements(), and TPZGeoEl::NodePtr().
Referenced by SetBC(), and SetPointBC().
|
inline |
Generate a boundary geometric element at the indicated node.
gr | Object mesh which will be set the elements with the specified boundary condition |
x | Node (boundary coordinates) which will identified with boundary id |
bc | Boundary condition id (material), generally negative |
Definition at line 148 of file pzgengrid.h.
References bc, Distance(), ElemId(), MergeGeoMesh(), Print(), ReadAndMergeGeoMesh(), SetElementType(), and SetPointBC().
|
inline |
Generate element of type refpattern or uniform refinement.
Definition at line 202 of file pzgengrid.h.
References Coord(), ElementConnectivity(), ElementConnectivityZigZag(), fRefPattern, GenerateElements(), GenerateElementsZigZag(), GenerateNodes(), and GlobalI().
Referenced by MalhaGeom().
|
inline |
Indicate whether the elements are generated in a zigzag pattern.
Definition at line 53 of file pzgengrid.h.
References fZigZag.
|
protected |
Size of the lower left element.
Definition at line 256 of file pzgengrid.h.
Referenced by Coord(), SetData(), SetElementType(), SetGeometricProgression(), and TPZGenGrid().
|
protected |
Definition at line 277 of file pzgengrid.h.
Referenced by Coord(), and SetDistortion().
|
protected |
Variable which indicates the type of element that should be generated Only EQuadrilateral or ETriangle is supported.
Definition at line 265 of file pzgengrid.h.
Referenced by Coord(), ElementConnectivity(), ElemId(), GenerateElements(), GenerateElementsZigZag(), GlobalI(), Print(), SetBC(), SetData(), SetElementType(), and TPZGenGrid().
|
protected |
Geometric progression coeficients in the x and y direction.
Definition at line 258 of file pzgengrid.h.
Referenced by Coord(), and SetGeometricProgression().
|
protected |
Number of meshes which will be generated hinging along an axis.
Definition at line 268 of file pzgengrid.h.
Referenced by GenerateElements(), GenerateElementsZigZag(), SetBC(), SetData(), SetElementType(), and TPZGenGrid().
|
protected |
Number of nodes of the mesh.
Definition at line 260 of file pzgengrid.h.
Referenced by GenerateNodes(), SetData(), SetElementType(), and TPZGenGrid().
|
protected |
Number of elements in both directions.
Definition at line 250 of file pzgengrid.h.
Referenced by ComputeGeometricProgression(), Coord(), ElementConnectivity(), ElementConnectivityZigZag(), ElemId(), GenerateElements(), GenerateElementsZigZag(), GlobalI(), Print(), SetBC(), SetData(), SetElementType(), and SetGeometricProgression().
|
protected |
Uniform or refpattern elements.
Definition at line 280 of file pzgengrid.h.
Referenced by GenerateElements(), GenerateElementsZigZag(), MergeGeoMesh(), ReadAndMergeGeoMesh(), and SetRefpatternElements().
|
protected |
Rotation angle between the layers.
Definition at line 270 of file pzgengrid.h.
|
protected |
Definition at line 275 of file pzgengrid.h.
Referenced by SetDistortion().
|
protected |
Coordinate of the lower left point.
Definition at line 252 of file pzgengrid.h.
Referenced by ComputeGeometricProgression(), Coord(), Print(), SetData(), SetElementType(), and SetGeometricProgression().
|
protected |
coordinate of the upper right point
Definition at line 254 of file pzgengrid.h.
Referenced by ComputeGeometricProgression(), Print(), SetData(), SetElementType(), and SetGeometricProgression().
|
protected |
variable to generate a zigzag grid
Definition at line 273 of file pzgengrid.h.
Referenced by GenerateElements(), SetBC(), and SetZigZagPattern().