21 const int64_t nnode = 6;
23 const int64_t nelem = 8;
26 REAL initialcoord[nnode][3] = {{center[0]-radius,center[1],center[2]},{center[0],center[1]+radius,center[2]},{center[0],center[1],center[2]-radius},{center[0],center[1],center[2]+radius},{center[0],center[1]-radius,center[2]},{center[0]+radius,center[1],center[2]}};
27 int indices[nelem][nnode] = {{3,4,5},{3,5,1},{3,1,0},{3,0,4},{4,0,2},{4,2,5},{2,0,1},{5,2,1}};
37 for(node=0; node<nnode; node++) {
40 coord[0] = initialcoord[node][0];
41 coord[1] = initialcoord[node][1];
42 coord[2] = initialcoord[node][2];
47 for(el=0; el<nelem; el++) {
49 for(node=0; node<3; node++) nodind[node]=indices[el][node];
57 for(
int ii=0;ii<nUniformRefs;ii++) {
65 for(node=0;node<gmesh->
NNodes();node++) {
69 coordinates[i] -= center[i];
70 norm =
sqrt(coordinates[0]*coordinates[0] + coordinates[1]*coordinates[1] + coordinates[2]*coordinates[2]);
71 for(i=0;i<3;i++) coordinates[i] /= norm;
72 for(i=0;i<3;i++) coordinates[i] += center[i];
102 const int64_t nnode = 6;
104 const int64_t nelem = 8;
107 REAL initialcoord[nnode][3] = {{center[0]-radius,center[1],center[2]},{center[0],center[1]+radius,center[2]},{center[0],center[1],center[2]-radius},{center[0],center[1],center[2]+radius},{center[0],center[1]-radius,center[2]},{center[0]+radius,center[1],center[2]}};
108 int indices[nelem][nnode] = {{3,4,5},{3,5,1},{3,1,0},{3,0,4},{4,0,2},{4,2,5},{2,0,1},{5,2,1}};
118 for(node=0; node<nnode; node++) {
121 coord[0] = initialcoord[node][0];
122 coord[1] = initialcoord[node][1];
123 coord[2] = initialcoord[node][2];
128 for(el=0; el<nelem; el++) {
130 for(node=0; node<3; node++) nodind[node]=indices[el][node];
147 for(node=0;node<gmesh->
NNodes();node++) {
151 coordinates[i] -= center[i];
152 norm =
sqrt(coordinates[0]*coordinates[0] + coordinates[1]*coordinates[1] + coordinates[2]*coordinates[2]);
153 for(i=0;i<3;i++) coordinates[i] /= norm;
154 for(i=0;i<3;i++) coordinates[i] += center[i];
163 gel->
X(baryparam,barycenter);
166 dist = radius -
sqrt((barycenter[0]-center[0])*(barycenter[0]-center[0]) + (barycenter[1]-center[1])*(barycenter[1]-center[1]) + (barycenter[2]-center[2])*(barycenter[2]-center[2]));
197 for(
int Division=0; Division<nUniformRefs; Division++)
200 for(int64_t elem = 0; elem < nels; elem++)
205 if(dimelfordivision > 0 && gel->
Dimension() != dimelfordivision)
continue;
int AllocateNewElement()
Makes more room for new elements.
void SetCoord(const TPZVec< REAL > &x)
Sets all coordinates into the current node. It gets the dim values from x.
int MaterialId() const
Returns the material index of the element.
virtual TPZGeoEl * CreateGeoElement(MElementType type, TPZVec< int64_t > &cornerindexes, int matid, int64_t &index, int reftype=1)
Generic method for creating a geometric element. Putting this method centrally facilitates the modifi...
int64_t NElements() const
Number of elements of the mesh.
virtual void Divide(TPZVec< TPZGeoEl *> &pv)
Divides the element and puts the resulting elements in the vector.
virtual void CenterPoint(int side, TPZVec< REAL > &masscent) const =0
It returns the coordinates from the center of the side of the element in the element coordinate space...
Defines the behaviour of all geometric elements. GeometryTPZGeoEl is the common denominator for all g...
virtual void SetFatherIndex(int64_t fatherindex)
Sets the father element index This method is not called SetFather in order to avoid implicit conversi...
int64_t NNodes() const
Number of nodes of the mesh.
Free store vector implementation.
TPZAdmChunkVector< TPZGeoNode > & NodeVec()
expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ sqrt
Declaration of the generator of special grids class.
static void UniformRefinement(const int nUniformRefs, TPZGeoMesh *gmesh, const int dimelfordivision, bool allmaterial=true, const int matidtodivided=0)
Make uniform refinement of the geometric mesh. This method finishs making the new connectivities for ...
virtual int HasSubElement() const =0
Return 1 if the element has subelements.
void BuildConnectivity()
Build the connectivity of the grid.
void DeleteElement(TPZGeoEl *gel, int64_t index=-1)
Centralized method to delete elements.
virtual int Dimension() const =0
Returns the dimension of the element.
REAL dist(TPZVec< T1 > &vec1, TPZVec< T1 > &vec2)
Implements a geometric node in the pz environment. Geometry.
virtual void X(TPZVec< REAL > &qsi, TPZVec< REAL > &result) const =0
Return the coordinate in real space of the point coordinate in the master element space...
This class implements a geometric mesh for the pz environment. Geometry.
static TPZGeoMesh * GeneratePolygonalSphereFromOctahedron(TPZVec< REAL > ¢er, REAL radius, int nUniformRefs)
Static function to generate a polygonal mesh approximating a sphere from a octahedron mesh (polygonal...
void ResetConnectivities()
Reset all connectivities.
void GetCoordinates(TPZVec< REAL > &co)
Fill the coordinates of the node.
virtual void ResetSubElements()=0
Reset all subelements to NULL.
TPZAdmChunkVector< TPZGeoEl * > & ElementVec()
Methods for handling pzlists.