6 #ifndef TPZGEOPRISMEXTENDH 7 #define TPZGEOPRISMEXTENDH 21 static LoggerPtr loggernoderep2(Logger::getLogger(
"pz.geom.extend"));
33 template<
class TFather,
class Topology>
34 class GPr :
public TFather {
38 typedef typename TFather::TMem
FatMem;
39 typedef typename TFather::Top
FatTop;
50 for(i=0; i<TFather::NNodes; i++) fNodeIndexes[i] = nodeindexes[TFather::NNodes+i];
57 for(i=0; i<TFather::NNodes; i++) fNodeIndexes[i] = -1;
62 std::map<int64_t,int64_t> & gl2lcNdMap) : TFather(cp,gl2lcNdMap)
65 for(i = 0; i < TFather::NNodes; i++)
68 if (gl2lcNdMap.find(cp.
fNodeIndexes[i+TFather::NNodes]) == gl2lcNdMap.end())
70 std::stringstream sout;
71 sout <<
"ERROR in - " << __PRETTY_FUNCTION__
72 <<
" trying to clone a node " << i <<
" index " << cp.
fNodeIndexes[i]
73 <<
" wich is not mapped";
79 fNodeIndexes[i] = gl2lcNdMap [ cp.
fNodeIndexes[i+TFather::NNodes] ];
87 for(i=0; i<TFather::NNodes; i++) fNodeIndexes[i] = cp.
fNodeIndexes[i];
94 for(i=0; i<TFather::NNodes; i++) fNodeIndexes[i] = cp.
fNodeIndexes[i];
98 static std::string
TypeName() {
return "Pr:"+TFather::TypeName();}
117 template<
class TFather,
class Topology>
121 int spacedim = coord.
Rows();
124 TFather::Jacobian(coordupper,param,jacobianlower);
125 TFather::Jacobian(coordupper,param,jacobianupper);
126 REAL ksi = param[Top::Dimension-1];
127 jacobian.
Resize(spacedim,Top::Dimension);
131 for(i=0; i<spacedim; i++)
for(j=0; j<TFather::NNodes; j++)
133 coordlower(i,j) = coord.
GetVal(i,j);
134 coordupper(i,j) = coord.
GetVal(i,j+TFather::NNodes);
136 TFather::X(coordlower,param,xlower);
137 TFather::X(coordupper,param,xupper);
138 for(i=0; i<spacedim; i++)
140 for(j=0; j<Top::Dimension-1; j++)
142 jacobian(i,j) = jacobianlower(i,j)*(1.-ksi)/2.+jacobianupper(i,j)*(1.+ksi)/2.;
144 jacobian(i,j) = (xupper[i]-xlower[i])/2.;
148 template<
class TFather,
class Topology>
159 template<
class TFather,
class Topology>
163 int spacedim = coord.
Rows();
167 for(i=0; i<spacedim; i++)
for(j=0; j<TFather::NNodes; j++)
169 lower(i,j) = coord.
GetVal(i,j);
170 upper(i,j) = coord.
GetVal(i,j+TFather::NNodes);
172 TFather::X(lower,loc,resultlower);
173 TFather::X(upper,loc,resultupper);
174 REAL ksi = loc[Top::Dimension-1];
175 for(i=0; i<spacedim; i++)
177 result[i] = resultlower[i]*(1.-ksi)/2.+resultupper[i]*(1.+ksi)/2.;
181 template<
class TFather,
class Topology>
185 LoggerPtr logger(Logger::getLogger(
"pz.geom.pzgeoextend"));
187 TPZIntPoints *integ = Top::CreateSideIntegrationRule(Top::NSides-1,3);
192 for(ip=0; ip<np; ip++)
194 integ->
Point(ip,pos,w);
198 std::stringstream sout;
199 sout <<
"Testing Jacobian\n";
200 sout <<
"position " << pos <<
" jacobian " << jacobian;
206 Jacobian(coord,pos,jacobian,axes,detjac,jacinv);
208 std::stringstream sout;
209 sout <<
"Testing Jacobian\n";
210 sout <<
"position " << pos <<
" jacobian " << jacobian <<
211 " axes " << axes <<
" detjac " << detjac <<
" jacinv " << jacinv;
217 std::stringstream sout;
218 sout <<
"Testing X\n";
219 sout <<
"position " << pos <<
" x " << x;
GPr(const GPr< TFather, Topology > &cp)
Copy constructor.
GPr(const GPr< TFather, Topology > &cp, TPZGeoMesh &)
Copy constructor.
GPr(TPZVec< int64_t > &nodeindexes, TPZGeoMesh &mesh)
Constructor with list of nodes.
virtual int NPoints() const =0
Returns number of points for the cubature rule related.
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.
Geometric derivated class (template). Geometry.
void GramSchmidt(TPZFMatrix< TVar > &Orthog, TPZFMatrix< TVar > &TransfToOrthog)
This method implements a Gram Schimidt method. this = Orthog.TransfToOrthog.
int64_t fNodeIndexes[TFather::NNodes]
Templated vector implementation.
Defines enum MElementType and contains the implementation of MElementType_NNodes(...) functions.
Contains the Pr class(template) which defines the Prismatic extension of a topology.
Abstract class defining integration rules. Numerical Integration.
Defines the behaviour of all geometric elements. GeometryTPZGeoEl is the common denominator for all g...
Contains TPZMatrixclass which implements full matrix (using column major representation).
#define LOGPZ_DEBUG(A, B)
Define log for debug info.
int64_t Rows() const
Returns number of rows.
Contains the TPZNodeRep class which implements ... Clase intermediaria que guarda.
#define LOGPZ_ERROR(A, B)
Define log for errors (cout)
static void Diagnostic(TPZFMatrix< REAL > &coord)
This class implements a geometric mesh for the pz environment. Geometry.
static void X(const TPZFMatrix< REAL > &nodes, TPZVec< REAL > &loc, TPZVec< REAL > &result)
virtual int Dimension() const =0
Returns the dimension of the master element related for the cubature rule.
static std::string TypeName()
Returns the type name of the element.
int Resize(const int64_t newRows, const int64_t wCols) override
Redimension a matrix, but maintain your elements.
GPr(const GPr< TFather, Topology > &cp, std::map< int64_t, int64_t > &gl2lcNdMap)
Constructor with node map.
void DeterminantInverse(TVar &determinant, TPZFMatrix< TVar > &inverse)
Groups all classes which model the geometry.
static void Jacobian(const TPZFMatrix< REAL > &nodes, TPZVec< REAL > ¶m, TPZFMatrix< REAL > &jacobian, TPZFMatrix< REAL > &axes, REAL &detjac, TPZFMatrix< REAL > &jacinv)
const TVar & GetVal(const int64_t row, const int64_t col) const override
Get values without bounds checking This method is faster than "Get" if DEBUG is defined.
void Transpose(TPZMatrix< TVar > *const T) const override
It makes *T the transpose of current matrix.
Non abstract class which implements full matrices with preallocated storage with (N+1) entries...
virtual void Point(int i, TPZVec< REAL > &pos, REAL &w) const =0
Returns i-th point at master element and related weight.
static void Shape(TPZVec< REAL > &pt, TPZFMatrix< REAL > &phi, TPZFMatrix< REAL > &dphi)