37 static LoggerPtr logger(Logger::getLogger(
"pz.academicmesh"));
64 for (
int i=0; i<8; i++) {
66 for (
int c=0; c<3; c++) {
79 for (int64_t nod=0; nod<nnodes; nod++) {
80 gmesh.
NodeVec()[nod].GetCoordinates(xbefore);
81 for (
int i=0; i<3; i++) {
82 xbefore[i] = 2.*xbefore[i]-1.;
85 gmesh.
NodeVec()[nod].SetCoord(xafter);
120 for (int64_t i=0; i<=nelem; i++) {
121 for (int64_t j=0; j<=nelem; j++) {
122 for (int64_t k=0; k<=nelem; k++) {
127 gmesh->
NodeVec()[i*(nelem+1)*(nelem+1)+j*(nelem+1)+k].Initialize(x, *gmesh);
142 for (int64_t i=0; i<nelem; i++) {
143 for (int64_t j=0; j<nelem; j++) {
144 for (int64_t k=0; k<nelem; k++) {
146 nodes[0] = k*(nelem+1)*(nelem+1)+j*(nelem+1)+i;
147 nodes[1] = k*(nelem+1)*(nelem+1)+j*(nelem+1)+i+1;
148 nodes[2] = k*(nelem+1)*(nelem+1)+(j+1)*(nelem+1)+i+1;
149 nodes[3] = k*(nelem+1)*(nelem+1)+(j+1)*(nelem+1)+i;
150 nodes[4] = (k+1)*(nelem+1)*(nelem+1)+j*(nelem+1)+i;
151 nodes[5] = (k+1)*(nelem+1)*(nelem+1)+j*(nelem+1)+i+1;
152 nodes[6] = (k+1)*(nelem+1)*(nelem+1)+(j+1)*(nelem+1)+i+1;
153 nodes[7] = (k+1)*(nelem+1)*(nelem+1)+(j+1)*(nelem+1)+i;
155 if(logger->isDebugEnabled())
157 std::stringstream sout;
158 sout <<
"Pyramid and tetrahedral nodes " << nodes;
162 for (
int el=0; el<2; el++)
165 for (
int il=0; il<5; il++) {
166 elnodes[il] = nodes[pyramid[el][il]];
171 for (
int il=0; il<4; il++) {
172 elnodes[il] = nodes[tetraedra[el][il]];
199 int64_t n_nodes = gmesh->
NNodes();
211 for (
int k = 0; k < n; k++) {
212 for (
int j = 0; j < n; j++) {
213 for (
int i = 0; i < n; i++) {
215 int stride = j*s + k*s*s;
216 indexes[0] = i + stride;
217 indexes[1] = i + 1 + stride;
218 indexes[2] = i + s + stride;
219 indexes[3] = i + 1 + s + stride;
220 for (
int l = 0; l < 4; l++) {
221 indexes[l+4] = indexes[l]+s*s;
224 bool is_even_Q = (i+j+k)%2==0;
228 for (
int inode=0; inode<8; inode++) {
229 nodes[inode] = gmesh->
NodeVec()[indexes[perm[inode]]].Id();
234 gmesh->
NodeVec()[nodes[0]].GetCoordinates(x);
235 for (
int i = 0; i < 3; i++) {
240 gmesh->
NodeVec()[n_nodes].Initialize(x, *gmesh);
241 int center_id = gmesh->
NodeVec()[n_nodes].Id();
248 el_nodes[0] = nodes[0];
249 el_nodes[1] = nodes[1];
250 el_nodes[2] = nodes[2];
251 el_nodes[3] = nodes[3];
252 el_nodes[4] = center_id;
255 el_nodes[0] = nodes[0];
256 el_nodes[1] = nodes[3];
257 el_nodes[2] = nodes[7];
258 el_nodes[3] = nodes[4];
259 el_nodes[4] = center_id;
262 el_nodes[0] = nodes[0];
263 el_nodes[1] = nodes[1];
264 el_nodes[2] = nodes[5];
265 el_nodes[3] = nodes[4];
266 el_nodes[4] = center_id;
269 el_nodes[0] = nodes[1];
270 el_nodes[1] = nodes[2];
271 el_nodes[2] = nodes[6];
272 el_nodes[3] = nodes[5];
273 el_nodes[4] = center_id;
276 el_nodes[0] = nodes[3];
277 el_nodes[1] = nodes[2];
278 el_nodes[2] = nodes[6];
279 el_nodes[3] = nodes[7];
280 el_nodes[4] = center_id;
283 el_nodes[0] = nodes[4];
284 el_nodes[1] = nodes[5];
285 el_nodes[2] = nodes[6];
286 el_nodes[3] = nodes[7];
287 el_nodes[4] = center_id;
294 for (
int inode=0; inode<8; inode++) {
295 el_nodes[inode] = gmesh->
NodeVec()[indexes[perm[inode]]].Id();
321 for (int64_t i=0; i<nelem; i++) {
322 for (int64_t j=0; j<nelem; j++) {
323 for (int64_t k=0; k<nelem; k++) {
325 nodes[0] = k*(nelem+1)*(nelem+1)+j*(nelem+1)+i;
326 nodes[1] = k*(nelem+1)*(nelem+1)+j*(nelem+1)+i+1;
327 nodes[2] = k*(nelem+1)*(nelem+1)+(j+1)*(nelem+1)+i+1;
328 nodes[3] = k*(nelem+1)*(nelem+1)+(j+1)*(nelem+1)+i;
329 nodes[4] = (k+1)*(nelem+1)*(nelem+1)+j*(nelem+1)+i;
330 nodes[5] = (k+1)*(nelem+1)*(nelem+1)+j*(nelem+1)+i+1;
331 nodes[6] = (k+1)*(nelem+1)*(nelem+1)+(j+1)*(nelem+1)+i+1;
332 nodes[7] = (k+1)*(nelem+1)*(nelem+1)+(j+1)*(nelem+1)+i;
334 if(logger->isDebugEnabled())
336 std::stringstream sout;
337 sout <<
"Tetrahedral nodes " << nodes;
341 for (
int el=0; el<6; el++)
345 for (
int il=0; il<4; il++) {
346 elnodes[il] = nodes[tetraedra_2[el][il]];
370 for (int64_t k=0; k<nelem; k++) {
371 for (int64_t j=0; j<nelem; j++) {
372 for (int64_t i=0; i<nelem; i++) {
374 nodes[0] = k*(nelem+1)*(nelem+1)+j*(nelem+1)+i;
375 nodes[1] = k*(nelem+1)*(nelem+1)+j*(nelem+1)+i+1;
376 nodes[2] = k*(nelem+1)*(nelem+1)+(j+1)*(nelem+1)+i+1;
377 nodes[3] = k*(nelem+1)*(nelem+1)+(j+1)*(nelem+1)+i;
378 nodes[4] = (k+1)*(nelem+1)*(nelem+1)+j*(nelem+1)+i;
379 nodes[5] = (k+1)*(nelem+1)*(nelem+1)+j*(nelem+1)+i+1;
380 nodes[6] = (k+1)*(nelem+1)*(nelem+1)+(j+1)*(nelem+1)+i+1;
381 nodes[7] = (k+1)*(nelem+1)*(nelem+1)+(j+1)*(nelem+1)+i;
383 if (logger->isDebugEnabled())
385 std::stringstream sout;
386 sout <<
"Cube nodes " << nodes;
407 for(int64_t el=0; el<nel; el++) {
409 int nsides = gel->
NSides();
410 for(
int is=0; is<nsides; is++) {
423 gelside.
Jacobian(xi, jac, axes, detjac, jacinv);
427 normal[0] =
fabs(axes(0,1)*axes(1,2)-axes(0,2)*axes(1,1));
428 normal[1] =
fabs(-axes(0,0)*axes(1,2)+axes(0,2)*axes(1,0));
429 normal[2] =
fabs(axes(0,0)*axes(1,1)-axes(0,1)*axes(1,0));
431 REAL xmin = 1., xmax = 0.;
433 for(
int i=0; i<3; i++) {
434 if(xmin > x[i]) xmin = x[i];
438 if(normal[i] > tol) {
445 if(xmin > tol && xmax < 1.-tol) {
456 for(int64_t el=0; el<nel; el++) {
458 int nsides = gel->
NSides();
459 for(
int is=0; is<nsides; is++) {
472 gelside.
Jacobian(xi, jac, axes, detjac, jacinv);
476 normal[0] = axes(0,1)*axes(1,2)-axes(0,2)*axes(1,1);
477 normal[1] = -axes(0,0)*axes(1,2)+axes(0,2)*axes(1,0);
478 normal[2] = axes(0,0)*axes(1,1)-axes(0,1)*axes(1,0);
480 REAL xmin = 1., xmax = 0.;
483 for (
int i=0; i<3; i++) {
484 if (
fabs(normal[i] - 1.) < tol) {
488 if (
fabs(normal[i] + 1.) < tol) {
530 for(int64_t el=0; el<nel; el++) {
532 int nsides = gel->
NSides();
533 for(
int is=0; is<nsides; is++) {
545 gelside.
Jacobian(xi, jac, axes, detjac, jacinv);
549 REAL coordmin = 0., coordmax = 0.;
551 int nxbot = 0, nybot = 0, nzbot = 0, nxtop = 0, nytop = 0, nztop = 0;
552 for (
int i = 0; i < nnodes; i++) {
555 gmesh->
NodeVec()[nodeindex].GetCoordinates(coord);
556 const REAL diffxbot =
fabs(coord[0]);
557 const REAL diffybot =
fabs(coord[1]);
558 const REAL diffzbot =
fabs(coord[2]);
559 const REAL diffxtop =
fabs(coord[0]-1.);
560 const REAL diffytop =
fabs(coord[1]-1.);
561 const REAL diffztop =
fabs(coord[2]-1.);
608 if (numbcsfound != 1) {
TPZAcademicGeoMesh()
sets up parameters to create de hexahedral regular mesh
expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ fabs
Contains TPZAnalysis class which implements the sequence of actions to perform a finite element analy...
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 a vector class which allows to use external storage provided by the user. Utility.
TPZGeoMesh * RedBlackPyramidalAndHexagonalMesh()
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...
virtual void resize(const int64_t newsize)
int64_t NElements() const
Number of elements of the mesh.
Utility class which represents an element with its side. The Geometric approximation classes Geometry...
Contains declaration of TPZGeoElBC class, it is a structure to help the construction of geometric ele...
int64_t NElements() const
Access method to query the number of elements of the vector.
TPZGeoElSide Neighbour() const
virtual int NSides() const =0
Returns the number of connectivities of the element.
void CenterPoint(TPZVec< REAL > ¢er) const
return the coordinates of the center in master element space (associated with the side) ...
void SetDimension(int dim)
Set Dimension.
Contains the TPZMatPoisson3d class.
TPZManVector< int, 6 > fBCNumbers
indices of the boundary conditions
Contains TPZShapeLinear class which implements the shape functions of a linear one-dimensional elemen...
bool fShouldDeform
whether the mesh should be deformed or not
TPZGeoMesh * HexahedralMesh()
static int tetraedra[2][4]
Contains the TPZBndCond class which implements a boundary condition for TPZMaterial objects...
void Resize(const int newsize)
Increase the size of the chunk vector.
expr_ dx(i) *cos(expr_.val())
Defines the behaviour of all geometric elements. GeometryTPZGeoEl is the common denominator for all g...
#define DebugStop()
Returns a message to user put a breakpoint in.
int64_t NNodes() const
Number of nodes of the mesh.
#define LOGPZ_DEBUG(A, B)
Define log for debug info.
void X(TPZVec< REAL > &loc, TPZVec< REAL > &result) const
X coordinate of a point loc of the side.
TPZAdmChunkVector< TPZGeoNode > & NodeVec()
int fMaterialId
material index for volume elements
Contains the TPZGenGrid class which implements the generation of a multilayered geometric grid (two-d...
Contains declaration of TPZCheckMesh class which verifies the consistency of the datastructure of a T...
Contains the TPZExtendGridDimension class which generates a three dimensional mesh as an extension of...
int64_t fNumberElements
number of elements in any direction
TPZGeoMesh * PyramidalAndTetrahedralMesh()
Structure to help the construction of geometric elements along side of a given geometric element...
void BuildConnectivity()
Build the connectivity of the grid.
int AddBoundaryElementsByCoord(TPZGeoMesh *gmesh)
This class implements a geometric mesh for the pz environment. Geometry.
int Dimension() const
the dimension associated with the element/side
void Jacobian(TPZVec< REAL > ¶m, TPZFMatrix< REAL > &jacobian, TPZFMatrix< REAL > &axes, REAL &detjac, TPZFMatrix< REAL > &jacinv) const
Jacobian associated with the side of the element.
static int tetraedra_2[6][4]
Contains TPZStepSolver class which defines step solvers class.
void GenerateNodes(TPZGeoMesh *gmesh)
put the geometric nodes in the geometric mesh
void DeformGMesh(TPZGeoMesh &gmesh)
Deform the geometric mesh according to the coordinates of fDeformed.
TPZGeoMesh * TetrahedralMesh()
int AddBoundaryElements(TPZGeoMesh *gmesh)
void CheckConsistency(TPZGeoMesh *gmesh)
verify if the faces without neighbour should be orthogonal to the main planes
Contains the TPZVTKGeoMesh class which implements the graphical mesh to VTK environment to geometric ...
void push_back(const T object)
int64_t SideNodeIndex(int nodenum) const
Returns the index of the nodenum node of side.
Non abstract class which implements full matrices with preallocated storage with (N+1) entries...
TPZAdmChunkVector< TPZGeoEl * > & ElementVec()
Methods for handling pzlists.