NeoPZ
TPZQuadSphere.cpp
Go to the documentation of this file.
1 //
2 // TPZQuadSphere.cpp
3 // PZ
4 //
5 // Created by Philippe Devloo on 3/21/14.
6 //
7 //
8 
9 #include "TPZQuadSphere.h"
10 #include "tpzgeomid.h"
11 #include "tpzgeoelmapped.h"
12 #include "tpzgeoelrefpattern.h"
13 #include "tpzgeoblend.h"
14 
15 #include "pzlog.h"
16 
17 #ifdef LOG4CXX
18 static log4cxx::LoggerPtr logger(Logger::getLogger("pz.geom.pzgeoquad"));
19 #endif
20 
22 
23 namespace pzgeom {
24 
25  // template<class GeomQuad>
26  // TPZGeoEl *TPZQuadSphere<GeomQuad>::CreateBCGeoEl(TPZGeoEl *orig, int side,int bc)
27  // {
28 
29  // int ns = orig->NSideNodes(side);
30  // TPZManVector<int64_t> nodeindices(ns);
31  // int in;
32  // for(in=0; in<ns; in++)
33  // {
34  // nodeindices[in] = orig->SideNodeIndex(side,in);
35  // }
36  // int64_t index;
37 
38  // TPZGeoMesh *mesh = orig->Mesh();
39  // MElementType type = orig->Type(side);
40 
41  // TPZGeoEl *newel = mesh->CreateGeoBlendElement(type, nodeindices, bc, index);
42  // TPZGeoElSide me(orig,side);
43  // TPZGeoElSide newelside(newel,newel->NSides()-1);
44 
45  // newelside.InsertConnectivity(me);
46  // newel->Initialize();
47 
48  // return newel;
49  // }
50 
51  template<class GeomQuad>
53  {
54  TPZManVector<REAL,3> center(lowercorner);
55  REAL radius = 1.;
56  center[0] += radius/2.;
57  center[1] += radius/2.;
58  center[2] += radius/2.;
59  for (int i=0; i<3; i++) {
60  sz[i] = 2.*radius;
61  }
62  REAL coords[4][3] = {
63  {-1,-1,-0.1},
64  { 1,-1,-0.1},
65  { 1, 1,-0.1},
66  {-1, 1,-0.1}
67  };
68  for (int i=0; i<4; i++) {
69  REAL norm = sqrt(coords[i][0]*coords[i][0]+coords[i][1]*coords[i][1]+coords[i][2]*coords[i][2]);
70  for(int j=0; j<3; j++) coords[i][j] *= radius/norm;
71  }
72  TPZManVector<int64_t,4> indices(4);
73  for (int i=0; i<4; i++) {
74  indices[i] = gmesh.NodeVec().AllocateNewElement();
75  TPZManVector<REAL,3> xco(3);
76  for (int j=0; j<3; j++) {
77  xco[j] = coords[i][j]+center[j];
78  }
79  gmesh.NodeVec()[indices[i]].Initialize(xco, gmesh);
80  }
82  gel->Geom().SetData(radius, center);
83  }
84 
85 // /**
86 // * Creates a geometric element according to the type of the father element
87 // */
88 // /** @brief Creates a geometric element according to the type of the father element */
89 // template<class GeomQuad>
90 // TPZGeoEl *TPZQuadSphere<GeomQuad>::CreateGeoElement(TPZGeoMesh &mesh, MElementType type,
91 // TPZVec<int64_t>& nodeindexes,
92 // int matid,
93 // int64_t& index)
94 
95 // {
96 // return CreateGeoElementMapped(mesh,type,nodeindexes,matid,index);
97 // }
98 
100  template<class GeomQuad>
102  {
103  return false;
104  }
105 
107  template<>
109  {
110  return true;
111  }
112 }
113 
115 
117 
119 
121 
123 
TPZFMatrix< REAL > TensorProd(TPZFMatrix< REAL > &mat1, TPZFMatrix< REAL > &mat2)
int AllocateNewElement()
Makes more room for new elements.
Definition: pzadmchunk.h:184
static void InsertExampleElement(TPZGeoMesh &gmesh, int matid, TPZVec< REAL > &lowercorner, TPZVec< REAL > &size)
Contains definitions to LOGPZ_DEBUG, LOGPZ_INFO, LOGPZ_WARN, LOGPZ_ERROR and LOGPZ_FATAL, and the implementation of the inline InitializePZLOG(string) function using log4cxx library or not. It must to be called out of "#ifdef LOG4CXX" scope.
Implements the mapping between the master element and deformed element. Geometry. ...
Contains declaration of TPZGeoElMapped class which implements a geometric element using its ancestral...
Implements a generic geometric element which is refined according to a generic refinement pattern...
Definition: pzgmesh.h:35
Contains the TPZGeoBlend class which implements a blending map from curved boundaries to the interior...
TPZAdmChunkVector< TPZGeoNode > & NodeVec()
Definition: pzgmesh.h:140
expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ sqrt
Definition: tfadfunc.h:120
Contains declaration of TPZGeoElRefPattern class which implements a generic geometric element which i...
This class implements a geometric mesh for the pz environment. Geometry.
Definition: pzgmesh.h:48
bool IsGeoBlendEl() const
declare geometry as blended element
Groups all classes which model the geometry.
Definition: pzgeopoint.cpp:18
Implements an interface to register a class id and a restore function. Persistence.
Definition: TPZSavable.h:150