NeoPZ
pzcompelwithmem.cpp
Go to the documentation of this file.
1 
6 #include "pzcompelwithmem.h"
7 #include "pzshapepoint.h"
8 #include "pzshapelinear.h"
9 #include "pzshapetriang.h"
10 #include "pzshapequad.h"
11 #include "pzshapecube.h"
12 #include "pzshapetetra.h"
13 #include "pzshapeprism.h"
14 #include "pzshapepiram.h"
15 
16 template<class TBASE>
18  SetFreeIntPtIndices();
19 }
20 
21 template <class TBASE>
23 
24  // This code was copied from TPZInterpolationSpace::CalcStiff with minor changes
25  // regarding integration point index evaluation.
26  // Inclusions were commented properly.
27 
28  if(fIntPtIndices.NElements())
29  {
30 #ifdef LOG4CXX
31  {
32  std::stringstream sout;
33  sout << __PRETTY_FUNCTION__ << " Attempting to add memory indices to an already configured TPZCompElWithMem";
34  LOGPZ_ERROR(CompElWMemlogger,sout.str().c_str());
35  }
36 #endif
37  return;
38  }
39 
40  TPZMaterial * material = TBASE::Material();
41  if(!material){
42  PZError << "Error at " << __PRETTY_FUNCTION__ << " this->Material() == NULL\n";
43  return;
44  }
45 
46  if (this->NumberOfCompElementsInsideThisCompEl() == 0) {
47  // This is suposed to happen if in the constructor of a multiphysics element. The CompEl vector is only initialized after the autobuild
48  return;
49  }
50 
51  const TPZIntPoints &intrule = TBASE::GetIntegrationRule();
52 
53 
54  int intrulepoints = intrule.NPoints();
55 
56  fIntPtIndices.Resize(intrulepoints);
57 
58  for(int int_ind = 0; int_ind < intrulepoints; ++int_ind){
59  fIntPtIndices[int_ind] = this->Material()->PushMemItem();
60  // Pushing a new entry in the material memory
61  } //Loop over integratin points generating a reference vector of memory
62  //entries in the related pzmatwithmem for further use.
63 
64 }
65 
66 #include "TPZInterfaceEl.h"
67 
68 template <>
70 
71  // This code was copied from TPZInterpolationSpace::CalcStiff with minor changes
72  // regarding integration point index evaluation.
73  // Inclusions were commented properly.
74 
75  if(fIntPtIndices.NElements())
76  {
77 #ifdef LOG4CXX
78  {
79  std::stringstream sout;
80  sout << __PRETTY_FUNCTION__ << " Attempting to add memory indices to an already configured TPZCompElWithMem";
81  LOGPZ_ERROR(CompElWMemlogger,sout.str().c_str());
82  }
83 #endif
84  return;
85  }
86 
88  if(!material){
89  PZError << "Error at " << __PRETTY_FUNCTION__ << " this->Material() == NULL\n";
90  return;
91  }
92  if (this->LeftElementSide().Element() == 0 || this->RightElementSide().Element() == 0) {
93  return;
94  }
95 
96  if (this->NumberOfCompElementsInsideThisCompEl() == 0) {
97  // This is suposed to happen if in the constructor of a multiphysics element. The CompEl vector is only initialized after the autobuild
98  return;
99  }
100 
102 
103 
104  int intrulepoints = intrule.NPoints();
105 
106  fIntPtIndices.Resize(intrulepoints);
107 
108  for(int int_ind = 0; int_ind < intrulepoints; ++int_ind){
109  fIntPtIndices[int_ind] = this->Material()->PushMemItem();
110  // Pushing a new entry in the material memory
111  } //Loop over integratin points generating a reference vector of memory
112  //entries in the related pzmatwithmem for further use.
113 
114 }
115 
124 
125 #include "pzgeopoint.h"
126 #include "pzgeoquad.h"
127 #include "pzgeotriangle.h"
128 #include "pzgeotetrahedra.h"
129 #include "pzgeoprism.h"
130 #include "TPZGeoCube.h"
131 #include "TPZGeoLinear.h"
132 #include "pzgeopyramid.h"
134 
135 
146 
147 
148 /*
149 template class TPZMultiphysicsCompEl<pzgeom::TPZGeoPoint>;
150 template class TPZMultiphysicsCompEl<pzgeom::TPZGeoLinear>;
151 template class TPZMultiphysicsCompEl<pzgeom::TPZGeoTriangle>;
152 template class TPZMultiphysicsCompEl<pzgeom::TPZGeoQuad>;
153 template class TPZMultiphysicsCompEl<pzgeom::TPZGeoCube>;
154 template class TPZMultiphysicsCompEl<pzgeom::TPZGeoPrism>;
155 template class TPZMultiphysicsCompEl<pzgeom::TPZGeoTetrahedra>;
156 template class TPZMultiphysicsCompEl<pzgeom::TPZGeoPyramid>;*/
Contains TPZShapeTetra class which implements the shape functions of a tetrahedral element...
virtual int NPoints() const =0
Returns number of points for the cubature rule related.
Contains the declaration of the TPZCompElWithMem class, it is as TPZCompEl with enable material memor...
virtual ~TPZCompElWithMem()
virtual void PrepareIntPtIndices() override
PrepareIntPtIndices initializes the material damage varibles memory in the proper material class...
Contains TPZShapeLinear class which implements the shape functions of a linear one-dimensional elemen...
Abstract class defining integration rules. Numerical Integration.
Definition: tpzintpoints.h:19
This abstract class defines the behaviour which each derived class needs to implement.
Definition: TPZMaterial.h:39
Contains TPZShapeCube class which implements the shape functions of a hexaedral element.
virtual TPZMaterial * Material() const
Identify the material object associated with the element.
Definition: pzcompel.cpp:959
Contains the TPZGeoTetrahedra class which implements the geometry of a tetrahedral element...
Contains declaration of TPZInterfaceElement class which computes the contribution over an interface b...
Contains the declaration of multiphysic interface class.
Contains TPZShapePoint class which implements the shape function associated with a point...
#define LOGPZ_ERROR(A, B)
Define log for errors (cout)
Definition: pzlog.h:93
Contains the TPZGeoCube class which implements the geometry of hexahedra element. ...
Contains the TPZGeoPoint class which implements the geometry of a point element or 0-D element...
Contains TPZShapePrism class which implements the shape functions of a prism element.
Contains TPZShapePiram class which implements the shape functions of a pyramid element.
Contains the TPZGeoPyramid class which implements the geometry of pyramid element.
virtual const TPZIntPoints & GetIntegrationRule() const
Definition: pzcompel.h:609
Contains the TPZGeoPrism class which implements the geometry of a prism element.
Contains TPZShapeQuad class which implements the shape functions of a quadrilateral element...
Contains TPZShapeTriang class which implements the shape functions of a triangular element...
Implements an interface to register a class id and a restore function. Persistence.
Definition: TPZSavable.h:150
#define PZError
Defines the output device to error messages and the DebugStop() function.
Definition: pzerror.h:15