39 static LoggerPtr logger(Logger::getLogger(
"pz.Cedric"));
68 for (
int i=0; i<8; i++) {
70 for (
int c=0; c<3; c++) {
83 for (int64_t nod=0; nod<nnodes; nod++) {
84 gmesh.
NodeVec()[nod].GetCoordinates(xbefore);
85 for (
int i=0; i<3; i++) {
86 xbefore[i] = 2.*xbefore[i]-1.;
89 gmesh.
NodeVec()[nod].SetCoord(xafter);
120 if (logger->isDebugEnabled())
122 std::stringstream sout;
139 out <<
"Interp_err nsubdivision " << nsubdivisions <<
" eltype " << geocase <<
" aborted\n";;
147 out <<
"Interp_err nsubdivision " << nsubdivisions <<
" nelem " << (cmesh->
NElements()-nelembc) <<
" eltype ";
159 out <<
" Tetraedra ";
162 out <<
" TetraedraRef ";
169 out <<
"POrder " << 1 <<
" Neq " << cmesh->
NEquations() ;
178 out <<
" ErrH1 " << errvec[0] <<
" ErrL2 " << errvec[1] <<
" ErrH1Semi " << errvec[2];
186 for (int64_t el=0; el<nelem; el++) {
195 for (
int ic=0; ic<ncorner; ic++) {
198 STATE
val = cmesh->
Block()(seqnum,0,0,0);
199 if (
fabs(val) > 1.e-6) {
202 std::cout <<
"Coordinate " << x <<
" solution " << val << std::endl;
227 for (int64_t el=0; el<nel; el++) {
232 for (
int ic=0; ic<ncorner; ic++) {
234 Exact(x, value, deriv);
237 cmesh->
Block()(seqnum,0,0,0) = value[0];
246 void TCedricTest::Run(
int nsubdivisions,
int geocase,
int POrder,
int MaterialId,std::ostream &out) {
271 if (logger->isDebugEnabled())
273 std::stringstream sout;
288 out <<
"Approx_err nsubdivision " << nsubdivisions <<
" eltype " << geocase <<
" aborted\n";;
301 if (logger->isDebugEnabled())
303 std::stringstream sout;
309 out <<
"Approx_err nsubdivision " << nsubdivisions <<
" nelem " << (cmesh->
NElements()-nelembc) <<
" eltype ";
318 out <<
" Tetraedra ";
321 out <<
" TetraedraRef ";
328 out <<
"POrder " << POrder <<
" Neq " << cmesh->
NEquations() ;
343 scalnames.
Push(
"Solution");
345 std::stringstream sout;
346 sout << std::setprecision(2) <<
"Laplace_P" << POrder <<
"_MESH" << geocase <<
"_Div" << nsubdivisions <<
".vtk";
351 static int printsol = 0;
364 out <<
" ErrH1 " << errvec[0] <<
" ErrL2 " << errvec[1] <<
" ErrH1Semi " << errvec[2];
387 for (
int i=0; i<3; i++) {
444 for (int64_t i=0; i<=nelem; i++) {
445 for (int64_t j=0; j<=nelem; j++) {
446 for (int64_t k=0; k<=nelem; k++) {
451 gmesh->
NodeVec()[i*(nelem+1)*(nelem+1)+j*(nelem+1)+k].Initialize(x, *gmesh);
462 for (int64_t i=0; i<nelem; i++) {
463 for (int64_t j=0; j<nelem; j++) {
464 for (int64_t k=0; k<nelem; k++) {
466 nodes[0] = k*(nelem+1)*(nelem+1)+j*(nelem+1)+i;
467 nodes[1] = k*(nelem+1)*(nelem+1)+j*(nelem+1)+i+1;
468 nodes[2] = k*(nelem+1)*(nelem+1)+(j+1)*(nelem+1)+i+1;
469 nodes[3] = k*(nelem+1)*(nelem+1)+(j+1)*(nelem+1)+i;
470 nodes[4] = (k+1)*(nelem+1)*(nelem+1)+j*(nelem+1)+i;
471 nodes[5] = (k+1)*(nelem+1)*(nelem+1)+j*(nelem+1)+i+1;
472 nodes[6] = (k+1)*(nelem+1)*(nelem+1)+(j+1)*(nelem+1)+i+1;
473 nodes[7] = (k+1)*(nelem+1)*(nelem+1)+(j+1)*(nelem+1)+i;
476 std::stringstream sout;
477 sout <<
"Pyramid and tetrahedral nodes " << nodes;
481 for (
int el=0; el<2; el++)
484 for (
int il=0; il<5; il++) {
485 elnodes[il] = nodes[pyramid[el][il]];
490 for (
int il=0; il<4; il++) {
491 elnodes[il] = nodes[tetraedra[el][il]];
507 for (int64_t i=0; i<nelem; i++) {
508 for (int64_t j=0; j<nelem; j++) {
509 for (int64_t k=0; k<nelem; k++) {
511 nodes[0] = k*(nelem+1)*(nelem+1)+j*(nelem+1)+i;
512 nodes[1] = k*(nelem+1)*(nelem+1)+j*(nelem+1)+i+1;
513 nodes[2] = k*(nelem+1)*(nelem+1)+(j+1)*(nelem+1)+i+1;
514 nodes[3] = k*(nelem+1)*(nelem+1)+(j+1)*(nelem+1)+i;
515 nodes[4] = (k+1)*(nelem+1)*(nelem+1)+j*(nelem+1)+i;
516 nodes[5] = (k+1)*(nelem+1)*(nelem+1)+j*(nelem+1)+i+1;
517 nodes[6] = (k+1)*(nelem+1)*(nelem+1)+(j+1)*(nelem+1)+i+1;
518 nodes[7] = (k+1)*(nelem+1)*(nelem+1)+(j+1)*(nelem+1)+i;
521 std::stringstream sout;
522 sout <<
"Tetrahedral nodes " << nodes;
526 for (
int el=0; el<6; el++)
530 for (
int il=0; il<4; il++) {
531 elnodes[il] = nodes[tetraedra_2[el][il]];
548 int nrefs = nelemdata/5;
554 REAL
co[nnode][3] = {
557 {InitialL,InitialL,0.},
560 {InitialL,0.,InitialL},
561 {InitialL,InitialL,InitialL},
562 {0.,InitialL,InitialL},
565 for(nod=0; nod<nnode; nod++) {
568 coord[0] = co[nod][0];
569 coord[1] = co[nod][1];
570 coord[2] = co[nod][2];
575 int nnodebyelement = 4;
577 for(el=0;el<nelem;el++)
578 indices[el].Resize(nnodebyelement);
606 for(el=0; el<nelem; el++) {
622 for (int64_t i=0; i<nelem; i++) {
623 for (int64_t j=0; j<nelem; j++) {
624 for (int64_t k=0; k<nelem; k++) {
626 nodes[0] = k*(nelem+1)*(nelem+1)+j*(nelem+1)+i;
627 nodes[1] = k*(nelem+1)*(nelem+1)+j*(nelem+1)+i+1;
628 nodes[2] = k*(nelem+1)*(nelem+1)+(j+1)*(nelem+1)+i+1;
629 nodes[3] = k*(nelem+1)*(nelem+1)+(j+1)*(nelem+1)+i;
630 nodes[4] = (k+1)*(nelem+1)*(nelem+1)+j*(nelem+1)+i;
631 nodes[5] = (k+1)*(nelem+1)*(nelem+1)+j*(nelem+1)+i+1;
632 nodes[6] = (k+1)*(nelem+1)*(nelem+1)+(j+1)*(nelem+1)+i+1;
633 nodes[7] = (k+1)*(nelem+1)*(nelem+1)+(j+1)*(nelem+1)+i;
635 if (logger->isDebugEnabled())
637 std::stringstream sout;
638 sout <<
"Cube nodes " << nodes;
655 for(int64_t el=0; el<nel; el++) {
657 int nsides = gel->
NSides();
658 for(
int is=0; is<nsides; is++) {
671 gelside.
Jacobian(xi, jac, axes, detjac, jacinv);
675 normal[0] =
fabs(axes(0,1)*axes(1,2)-axes(0,2)*axes(1,1));
676 normal[1] =
fabs(-axes(0,0)*axes(1,2)+axes(0,2)*axes(1,0));
677 normal[2] =
fabs(axes(0,0)*axes(1,1)-axes(0,1)*axes(1,0));
679 REAL xmin = 1., xmax = 0.;
681 for(
int i=0; i<3; i++) {
682 if(xmin > x[i]) xmin = x[i];
686 if(normal[i] > tol) {
693 if(xmin > tol && xmax < 1.-tol) {
715 bc->TPZMaterial::SetForcingFunction(force);
728 for (int64_t el = 0; el<nelem; el++) {
731 for (
int is=0; is<ns; is++) {
748 for (int64_t el = 0; el<nel; el++) {
751 if (!intel)
continue;
756 int nsides = gel->
NSides();
757 for (
int is = 0; is<nsides; is++) {
763 int nelside = elsidevec.
size();
764 for (
int neigh=0; neigh<nelside; neigh++) {
778 for (
int el = 0; el<nel; el++) {
792 for (int64_t el=0; el<nel; el++) {
801 for (int64_t el=0; el<nel; el++) {
int64_t NElements() const
Number of computational elements allocated.
TPZGeoMesh * HexahedralMesh(int64_t nelem, int MaterialId)
TPZGeoMesh * Reference() const
Returns a pointer to the geometrical mesh associated.
static void SetgOrder(int order)
Sets the value of the default interpolation order.
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
int AllocateNewElement()
Makes more room for new elements.
Contains TPZAnalysis class which implements the sequence of actions to perform a finite element analy...
Implements computational element and a side. Computational Element.
Represents a set of shape functions associated with a computational element/side. Computational Eleme...
TPZGeoNode * NodePtr(int i) const
Returns a pointer to the ith node of the element.
Contains the TPZParSkylineStructMatrix class which defines parallel structural matrix for skyline mat...
int AddBoundaryElements(TPZGeoMesh *gmesh)
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.
void SetStructuralMatrix(TPZAutoPointer< TPZStructMatrix > strmatrix)
Set structural matrix as auto pointer for analysis.
static REAL d2fx(REAL x, REAL x0, REAL eps)
static int tetraedra[2][4]
TPZGeoMesh * TetrahedralMesh(int64_t nelem, int MaterialId)
clarg::argBool bc("-bc", "binary checkpoints", false)
void Unwrap()
put the elements in the element group back in the mesh and delete the element group ...
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...
void CheckConsistency(TPZGeoMesh *mesh)
verify if the faces without neighbour should be orthogonal to the main planes
void LoadInterpolation(TPZCompMesh *cmesh)
virtual void resize(const int64_t newsize)
static void Exact(const TPZVec< REAL > &x, TPZVec< STATE > &func, TPZFMatrix< STATE > &deriv)
int64_t NEquations()
This computes the number of equations associated with non-restrained nodes.
TPZGeoElSide Reference() const
Reference to the geometric element.
Contains declaration of TPZCompEl class which defines the interface of a computational element...
virtual int PolynomialOrder()
Contains the declaration of the TPZElementGroup class, which implements an computational element whic...
Defines step solvers class. Solver.
void SetSolver(TPZMatrixSolver< STATE > &solver)
Set solver matrix.
virtual int NCornerNodes() const =0
Returns the number of corner nodes of the element.
void GenerateNodes(TPZGeoMesh *gmesh, int64_t nelem)
int64_t NElements() const
Number of elements of the mesh.
clarg::argInt nthreads("-nt", "Number of threads.", 8)
void DeformGMesh(TPZGeoMesh &gmesh)
Deform the geometric mesh according to the coordinates of fDeformed.
static TPZManVector< REAL, 3 > fEps
Utility class which represents an element with its side. The Geometric approximation classes Geometry...
Class which groups elements to characterize dense matrices.
Contains declaration of TPZGeoElBC class, it is a structure to help the construction of geometric ele...
virtual void DefineGraphMesh(int dimension, const TPZVec< std::string > &scalnames, const TPZVec< std::string > &vecnames, const std::string &plotfile)
Define GrapMesh as V3D, DX, MV or VTK depending on extension of the file.
int64_t NElements() const
Access method to query the number of elements of the vector.
REAL val(STATE &number)
Returns value of the variable.
TPZGeoElSide Neighbour() const
Implements a function. Utility.
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) ...
virtual int SideDimension(int side) const =0
Return the dimension of side.
Contains the TPZMatPoisson3d class.
void Run(int nsubdivisions, int geocase, int POrder, int MaterialId, std::ostream &out=std::cout)
Contains TPZShapeLinear class which implements the shape functions of a linear one-dimensional elemen...
void SetExact(std::function< void(const TPZVec< REAL > &loc, TPZVec< STATE > &result, TPZFMatrix< STATE > &deriv)> f)
Sets the pointer of the exact solution function.
TPZGeoMesh * PyramidalAndTetrahedralMesh(int64_t nelem, int MaterialId)
TPZFMatrix< STATE > & Solution()
Returns the solution matrix.
This abstract class defines the behaviour which each derived class needs to implement.
Contains the TPZBndCond class which implements a boundary condition for TPZMaterial objects...
virtual TPZMaterial * Material() const
Identify the material object associated with the element.
int Zero() override
Makes Zero all the elements.
TPZGeoMesh * TetrahedralMeshUsingRefinement(int64_t nelem, int MaterialId)
int64_t size() const
Returns the number of elements of the vector.
void UniformRefinement(const int nDiv, TPZGeoMesh *gmesh, const int dim, bool allmaterial=false, const int matidtodivided=1)
void Resize(const int newsize)
Increase the size of the chunk vector.
void Unwrap()
unwrap the condensed element from the computational element and delete the condensed element ...
void InterpolationError(int nsubdivisions, int geocase, int MaterialId, std::ostream &out)
int64_t SequenceNumber() const
Returns the Sequence number of the connect object.
Implements the sequence of actions to perform a finite element analysis. Analysis.
void Push(const T object)
Pushes a copy of the object on the stack.
virtual void Print(std::ostream &out=std::cout) const
Print the information of the grid to an ostream.
Defines the behaviour of all geometric elements. GeometryTPZGeoEl is the common denominator for all g...
virtual void Execute(const TPZVec< REAL > &x, TPZVec< STATE > &val, TPZFMatrix< STATE > &df)
Performs function computation.
Contains the TPZBandStructMatrix class which implements Banded Structural Matrices.
#define DebugStop()
Returns a message to user put a breakpoint in.
virtual void SetNumThreads(int n)
#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.
This class defines the boundary condition for TPZMaterial objects.
Contains the TPZElasticityMaterial class which implements a two dimensional elastic material in plane...
int Dimension() const
Returns the dimension of the simulation.
virtual void ComputeNodElCon()
Compute the number of elements connected to each connect object.
TPZAdmChunkVector< TPZGeoNode > & NodeVec()
TPZCompEl * Reference() const
Return a pointer to the element referenced by the geometric element.
virtual void AutoBuild(const std::set< int > *MaterialIDs)
Creates the computational elements, and the degree of freedom nodes.
static TPZManVector< REAL, 3 > fX0
Contains the TPZGenGrid class which implements the generation of a multilayered geometric grid (two-d...
virtual void Execute(const TPZVec< REAL > &x, TPZVec< STATE > &val)
Simpler version of Execute method which does not compute function derivatives.
const TPZBlock< STATE > & Block() const
Access the block structure of the solution vector.
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...
REAL co[8][3]
Coordinates of the eight nodes.
TPZAdmChunkVector< TPZConnect > & ConnectVec()
Return a reference to the connect pointers vector.
Class which implements an element which condenses the internal connects.
virtual void PostProcess(int resolution)
Draw solution over mesh for all dimensions.
virtual TPZConnect & Connect(int i) const
Returns a pointer to the ith node.
void SetDimModel(int dim)
Set de dimension of the domain of the problem.
virtual void Run(std::ostream &out=std::cout)
Calls the appropriate sequence of methods to build a solution or a time stepping sequence.
void ConnectedCompElementList(TPZStack< TPZCompElSide > &elsidevec, int onlyinterpolated, int removeduplicates)
Returns all connected computational elements to the current element if onlyinterpolated == 1 only e...
static int tetraedra_2[6][4]
Implements the interfaces for TPZCompElDisc, TPZInterfaceElement and TPZInterpolatedElement. Computational element.
TPZGeoEl * Element() const
Structure to help the construction of geometric elements along side of a given geometric element...
void BuildConnectivity()
Build the connectivity of the grid.
int InsertMaterialObject(TPZMaterial *mat)
Insert a material object in the datastructure.
virtual int Dimension() const =0
Returns the dimension of the element.
TPZCompEl * Element() const
Gives a pointer to the reference computational element.
TPZGeoEl * Reference() const
Return a pointer to the corresponding geometric element if such exists, return 0 otherwise.
Implements a geometric node in the pz environment. Geometry.
void CreateCondensedElements(TPZCompMesh *cmesh)
void UnwrapElements(TPZCompMesh *cmesh)
This class implements a geometric mesh for the pz environment. Geometry.
This class implements a stack object. Utility.
void SetForcingFunction(TPZAutoPointer< TPZFunction< STATE > > fp)
Sets a procedure as source function for the material.
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.
Implements computational mesh. Computational Mesh.
const T & get_value() const
TPZAdmChunkVector< TPZCompEl * > & ElementVec()
Returns a reference to the element pointers vector.
Contains declaration of TPZInterpolatedElement class which implements computational element of the in...
Contains TPZStepSolver class which defines step solvers class.
TPZCompMesh * GenerateCompMesh(TPZGeoMesh *gmesh)
void SetDirect(const DecomposeType decomp)
void GetCoordinates(TPZVec< REAL > &co)
Fill the coordinates of the node.
Is a structural matrix with parallel techniques included. Structural Matrix Frontal.
Defines the interface of a computational element. Computational Element.
Contains the TPZVTKGeoMesh class which implements the graphical mesh to VTK environment to geometric ...
virtual void PostProcessError(TPZVec< REAL > &, bool store_error=true, std::ostream &out=std::cout)
Compute the local error over all elements and global errors in several norms and print out without ca...
Contains the declaration of the TPZCondensedCompEl class, which implements an computational element w...
virtual void AddElement(TPZCompEl *cel)
add an element to the element group
static REAL fx(REAL x, REAL x0, REAL eps)
TPZFMatrix< STATE > & Solution()
Access the solution vector.
Contains the TPZParFrontStructMatrix class which is a structural matrix with parallel techniques incl...
Non abstract class which implements full matrices with preallocated storage with (N+1) entries...
virtual void Print(std::ostream &out=std::cout) const
Prints mesh data.
TPZAdmChunkVector< TPZGeoEl * > & ElementVec()
Methods for handling pzlists.
This class implements a reference counter mechanism to administer a dynamically allocated object...