18 static LoggerPtr logger(Logger::getLogger(
"pz.mesh.TPZCompElHDivBound2"));
21 template<
class TSHAPE>
24 TPZIntelGen<TSHAPE>(mesh,gel,index,1), fSideOrient(1){
35 if (logger->isDebugEnabled())
37 std::stringstream sout;
38 sout <<
"After creating boundary flux connect " << this->
fConnectIndexes[0] << std::endl;
80 if (logger->isDebugEnabled())
82 std::stringstream sout;
84 sout << std::endl<<
" Criando Connects: "<< std::endl;
94 sideorder = 2*sideorder;
95 if (sideorder > this->
fIntRule.GetMaxOrder()) sideorder = this->
fIntRule.GetMaxOrder();
102 if (logger->isDebugEnabled())
104 std::stringstream sout;
105 sout <<
"Finalizando criacao do elemento ";
113 template<class TSHAPE>
134 template<
class TSHAPE>
137 std::map<int64_t,int64_t> & gl2lcConMap,
138 std::map<int64_t,int64_t> & gl2lcElMap) :
145 for(i=0;i<TSHAPE::NSides;i++)
155 if (gl2lcConMap.find(glIdx) != gl2lcConMap.end())
157 lcIdx = gl2lcConMap[glIdx];
161 std::stringstream sout;
162 sout <<
"ERROR in : " << __PRETTY_FUNCTION__
163 <<
" trying to clone the connect index: " << glIdx
164 <<
" wich is not in mapped connect indexes!";
174 if(gl2lcElMap.find(neiIdx)==gl2lcElMap.end())
186 template<
class TSHAPE>
193 for(i=0;i<TSHAPE::NSides;i++) {
199 template<
class TSHAPE>
205 int side = TSHAPE::NSides-1;
215 int64_t ncel = celstack.
size();
216 for (int64_t el=0; el<ncel; el++) {
238 template<
class TSHAPE>
240 return TSHAPE::Type();
244 template<
class TSHAPE>
247 if (side != TSHAPE::NSides - 1) {
254 template<
class TSHAPE>
257 if (side != TSHAPE::NSides - 1) {
263 template<
class TSHAPE>
269 template<
class TSHAPE>
280 template<
class TSHAPE>
287 return TSHAPE::NShapeF(order);
292 template<
class TSHAPE>
295 if(side == TSHAPE::NSides-1)
302 template<
class TSHAPE>
305 if(side == TSHAPE::NSides-1 && node == 0)
316 template<
class TSHAPE>
319 ord.
Resize(TSHAPE::NSides-TSHAPE::NCornerNodes, 0);
321 for(i=0; i<ord.
size(); i++) {
327 template<
class TSHAPE>
329 if(side != TSHAPE::NSides-1)
331 PZError << __PRETTY_FUNCTION__ <<
" side " << side << std::endl;
339 template<
class TSHAPE>
342 if(connectaux<0 || connectaux > this->
NConnects()) {
343 PZError <<
"TPZCompElHDiv::SetSideOrder. Bad paramenter side " << side <<
" order " << order << std::endl;
345 std::stringstream sout;
346 sout << __PRETTY_FUNCTION__ <<
" Bad side or order " << side <<
" order " << order;
353 int64_t seqnum = c.SequenceNumber();
370 template<
class TSHAPE>
374 if (connect < 0 || connect >= this->
NConnects())
378 std::stringstream sout;
379 sout <<
"Connect index out of range connect " << connect <<
388 std::stringstream sout;
389 sout << __PRETTY_FUNCTION__ <<
" connect " << connect
390 <<
" is not initialized" << std::endl;
395 std::cout << sout.str() << std::endl;
407 template<
class TSHAPE>
414 if (logger->isDebugEnabled())
478 template<
class TSHAPE>
484 shapeindex.
Resize(nshape);
487 for(is=0 ; is<nsides; is++)
489 int side = sides[is];
491 int NShapeFace = TSHAPE::NConnectShapeF(side,sideorder);
493 for(ishapeface=0; ishapeface<NShapeFace; ishapeface++)
495 shapeindex[count++] = is;
499 #ifdef LOG4CXXTPZCompElHDivBound2 501 std::stringstream sout;
502 sout <<
"count = " << count <<
" nshape " << nshape;
503 sout << std::endl<<
"sides associated with the normals "<< sides <<
504 "\nnormal associated with each shape function : shape function indexes " << shapeindex;
512 template<class TSHAPE>
515 Index.
Resize(TSHAPE::NSides+1);
519 for(
int iside=0;iside<TSHAPE::NSides;iside++)
523 Index[iside+1] = Index[iside] + TSHAPE::NConnectShapeF(iside,order);
526 Index[iside+1] = Index[iside] + TSHAPE::NConnectShapeF(iside,order);
531 if (logger->isDebugEnabled())
533 std::stringstream sout;
534 sout <<
" FirsShapeIndex result " <<
Index;
542 template<class TSHAPE>
545 if(TSHAPE::SideDimension(side)!= TSHAPE::Dimension || point.
size() != TSHAPE::Dimension ){
551 for (
int ic=0; ic<nc; ic++) {
552 id[ic] = gel->
Node(ic).
Id();
562 int transformid = TSHAPE::GetTransformId(
id);
563 TSHAPE::GetSideHDivPermutation(transformid, permutegather);
572 gel->
Jacobian(point, jac, axes, detjac, jacinv);
577 for (
int side=0; side < TSHAPE::NSides; side++) {
578 int ifirst = FirstIndex[side];
579 int kfirst = FirstIndex[permutegather[side]];
580 int nshape = TSHAPE::NConnectShapeF(side,order);
581 for (
int i=0; i<nshape; i++) {
582 phi(ifirst+i,0) = philoc(kfirst+i,0)/detjac;
583 for (
int d=0; d< TSHAPE::Dimension; d++) {
584 dphi(d,ifirst+i) = dphiloc(d,kfirst+i)/detjac;
593 template<
class TSHAPE>
601 dphi.
Resize(TSHAPE::Dimension, nshape);
635 TPZManVector<int64_t,TSHAPE::NSides-1> id(TSHAPE::NSides-1,0);
638 int nnodes= ref->
NNodes();
639 for(
int i=0; i<nnodes; i++) {
645 std::stringstream sout;
646 sout<<
"---Id local---"<<
id<<std::endl;
665 std::stringstream sout;
666 sout<<
"---Id local Reordenado---"<<
id<<std::endl;
685 int nshapeneigh = neighel->
NSideShapeF(thisgeoside.Side());
686 phi.
Redim(nshapeneigh, 1);
687 dphi.
Redim(thisgeoside.Element()->Dimension(), nshapeneigh);
689 neighel->GetInterpolationOrder(ord);
711 std::stringstream sout;
713 sout<<
"---Phi Novo---"<<phi<<std::endl;
714 sout<<
"---Dphi Novo---"<<dphi<<std::endl;
720 template<class TSHAPE>
730 template<
class TSHAPE>
734 std::cout <<
"Method not implement call the architec." << std::endl;
740 template<
class TSHAPE>
748 template<
class TSHAPE>
756 template<
class TSHAPE>
759 out << __PRETTY_FUNCTION__ << std::endl;
760 out <<
"Side orientation " <<
fSideOrient << std::endl;
770 template<
class TSHAPE>
773 if(side == TSHAPE::NSides-1)
783 template<
class TSHAPE>
792 std::stringstream sout;
793 sout <<
"FirstIndex of shape functions " << FirstIndex;
800 ShapeAndVec.Resize(tamanho);
803 for(int64_t jvec=0;jvec< VectorSide.
NElements();jvec++)
805 int lside=VectorSide[jvec];
806 int64_t fshape1= FirstIndex[lside];
807 int64_t fshape2= FirstIndex[lside+1];
808 for (int64_t ishape=fshape1; ishape<fshape2; ishape++)
812 std::stringstream sout;
813 sout <<
" <vec,shape> " <<
"< "<<jvec <<
" * "<<ishape <<
"> "<<std::endl;
818 ShapeAndVec[count++]=std::pair<int,int64_t>(jvec,ishape);
824 std::stringstream sout;
825 sout <<
"VecShapeIndex " << ShapeAndVec;
832 template<class TSHAPE>
Implements computational element and a side. Computational Element.
int Set(const int index, const int dim, const int pos=-1)
Modifies existing block dimensions or creates a new block with given index.
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 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.
virtual void InitMaterialData(TPZMaterialData &data)
Initialize a material data and its attributes based on element dimension, number of state variables a...
virtual int NConnectShapeF(int connect, int order) const override
Returns the number of shapefunctions associated with a connect.
void ComputeShape(TPZVec< REAL > &intpoint, TPZMaterialData &data) override
Compute Shape for boundary of a hdiv computational element.
void Read(TPZStream &buf, void *context) override
Reads the element data from a stream.
TPZFNMatrix< 660, REAL > dphi
values of the derivative of the shape functions over the master element
TPZGeoElSide Reference() const
Reference to the geometric element.
groups all classes dedicated to the computation of shape functions
virtual MElementType Type() override
Return the type of the element.
TPZCompElHDivBound2()
Default constructor.
virtual void SetIntegrationRule(int ord) override
virtual int NCornerNodes() const =0
Returns the number of corner nodes of the element.
virtual int SideConnectLocId(int node, int side) const override
Returns the local node number of icon along is.
int AdjustPreferredSideOrder(int side, int order)
Adjusts the preferredSideOrder for faces.
virtual void Print(std::ostream &out=std::cout) const override
Prints the relevant data of the element to the output stream.
TPZCompEl * CreateRefHDivBoundQuadEl(TPZGeoEl *gel, TPZCompMesh &mesh, int64_t &index)
Creates computational quadrilateral element for HDiv approximate space.
bool IsInitialized() const
virtual int NStateVariables() const =0
Returns the number of state variables associated with the material.
MShapeFunctionType fShapeType
TPZCompElSide LowerLevelCompElementList2(int onlyinterpolated)
return the element/side pair which contains this/side and has a computational element associated ...
TPZFNMatrix< 9, REAL > jacinv
value of the inverse of the jacobian at the integration point
Utility class which represents an element with its side. The Geometric approximation classes Geometry...
Contains declaration of TPZCompElHDiv class which implements a generic computational element (HDiv sc...
virtual void SetSideOrient(int side, int sideorient) override
It set the normal orientation of the element by the side. Only side that has dimension equal to my di...
virtual void Read(TPZStream &buf, void *context) override
Reads the element data from a stream.
virtual int64_t CreateMidSideConnect(int side)
Verify the neighbours of the element and create a node along this side.
virtual int SideDimension(int side) const =0
Return the dimension of side.
TPZFNMatrix< 9, REAL > jacobian
value of the jacobian at the integration point
TPZFNMatrix< 220, REAL > phi
vector of shapefunctions (format is dependent on the value of shapetype)
Contains TPZShapeLinear class which implements the shape functions of a linear one-dimensional elemen...
int NShapeF() const override
Returns the total number of shapefunctions.
virtual int NSideConnects(int side) const override
Returns the number of dof nodes along side iside.
void Write(TPZStream &buf, int withclassid) const override
Saves the element data to a stream.
virtual void GetInterpolationOrder(TPZVec< int > &ord) override
Identifies the interpolation order on the interior of the element.
TPZOneShapeRestraint fRestraint
Restraint on a single shape function for pyramid implementation.
This abstract class defines the behaviour which each derived class needs to implement.
virtual TPZMaterial * Material() const
Identify the material object associated with the element.
void Shape(TPZVec< REAL > &pt, TPZFMatrix< REAL > &phi, TPZFMatrix< REAL > &dphi) override
Compute the shape function at the integration point.
virtual void SetConnectIndex(int i, int64_t connectindex) override
Sets the node pointer of node i to nod.
int64_t size() const
Returns the number of elements of the vector.
virtual void Resize(const int64_t newsize, const T &object)
Resizes the vector object reallocating the necessary storage, copying the existing objects to the new...
TPZCompEl * CreateRefHDivBoundLinearEl(TPZGeoEl *gel, TPZCompMesh &mesh, int64_t &index)
Creates computational linear element for HDiv approximate space.
unsigned char Order() const
Access function to return the order associated with the connect.
virtual int PreferredSideOrder(int iside) override
Returns the preferred order of the polynomial along side iside.
virtual void Write(const bool val)
int ClassId() const override
Returns the unique identifier for reading/writing objects to streams.
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.
virtual int SideConnectLocId(int icon, int is) const override=0
Returns the local node number of icon along is.
#define LOGPZ_DEBUG(A, B)
Define log for debug info.
TPZCompMesh * Mesh() const
Return a pointer to the grid of the element.
void SetAllCreateFunctionsHDiv()
TPZCompEl * CreateRefHDivBoundPointEl(TPZGeoEl *gel, TPZCompMesh &mesh, int64_t &index)
Creates computational point element for HDiv approximate space.
void Jacobian(TPZVec< REAL > &qsi, TPZFMatrix< REAL > &jac, TPZFMatrix< REAL > &axes, REAL &detjac, TPZFMatrix< REAL > &jacinv) const
Compute a decomposition of the gradient of the mapping function, as a rotation matrix (Jacobian) and ...
TPZCompEl * Reference() const
Return a pointer to the element referenced by the geometric element.
int64_t Rows() const
Returns number of rows.
void Shape(TPZVec< REAL > &pt, TPZVec< int > orders, TPZVec< TPZTransform< REAL > > &transvec, TPZFMatrix< REAL > &phi, TPZFMatrix< REAL > &dphi)
virtual int ConnectOrder(int connect) const override
virtual int EffectiveSideOrder(int side) const override
Returns the actual interpolation order of the polynomial along the side.
TPZFNMatrix< 9, REAL > axes
axes indicating the directions of the derivatives of the shapefunctions
virtual void Print(std::ostream &out) const override
Prints the relevant data of the element to the output stream.
const TPZBlock< STATE > & Block() const
Access the block structure of the solution vector.
Contains declaration of TPZCompelDisc class which implements a computational element for discontinuou...
TPZAdmChunkVector< TPZConnect > & ConnectVec()
Return a reference to the connect pointers vector.
int64_t Index() const
Returns element index of the mesh fELementVec list.
Contains the TPZMaterialData class which implements an interface between TPZCompEl::CalcStiff and TPZ...
Implements a generic computational element to HDiv scope. Computational Element.
Contains TPZShapePoint class which implements the shape function associated with a point...
#define LOGPZ_ERROR(A, B)
Define log for errors (cout)
void FirstShapeIndex(TPZVec< int64_t > &Index)
Returns the vector index of the first index shape associate to element.
int Redim(const int64_t newRows, const int64_t newCols) override
Redimension a matrix and ZERO your elements.
TPZGeoNode & Node(int i) const
Returns the ith node of the element.
virtual TPZConnect & Connect(int i) const
Returns a pointer to the ith node.
virtual int NNodes() const =0
Returns the number of nodes of the element.
void Print(std::ostream &out) const
TPZManVector< int64_t, TSHAPE::NSides > fConnectIndexes
Indexes of the connects associated with the elements.
virtual int GetSideOrient(int side) override
It returns the normal orientation of the reference element by the side. Only side that has dimension ...
int NSideShapeF(int side) const
Returns the number of shape functions on a side.
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.
virtual void SideShapeFunction(int side, TPZVec< REAL > &point, TPZFMatrix< REAL > &phi, TPZFMatrix< REAL > &dphi) override
Compute the values of the shape function of the side.
MElementType
Define the element types.
int Dimension() const
the dimension associated with the element/side
void ResetReference()
Reset the element referenced by the geometric element to NULL.
Contains declaration of TPZCompElHDivBound2 class which implements a generic computational element (H...
virtual void InitMaterialData(TPZMaterialData &data) override
Initialize a material data and its attributes based on element dimension, number of state variables a...
Template to generate computational elements. Computational Element.
Implements computational mesh. Computational Mesh.
TSHAPE::IntruleType fIntRule
Integration rule associated with the topology of the element.
TPZAdmChunkVector< TPZCompEl * > & ElementVec()
Returns a reference to the element pointers vector.
void SetReference(TPZCompEl *elp)
Make the current element reference to the computational element.
void ComputeShapeIndex(TPZVec< int > &sides, TPZVec< int64_t > &shapeindex)
Compute the correspondence between the normal vectors and the shape functions.
Contains the declaration of the shape function discontinuous.
int Side() const
Returns the side index.
int64_t Cols() const
Returns number of cols.
void RemoveDepend(int64_t myindex, int64_t dependindex)
Remove dependency between connects if exist.
int Resize(const int64_t newRows, const int64_t wCols) override
Redimension a matrix, but maintain your elements.
TPZRegisterClassId()=default
int Id() const
Returns the identity of the current node.
Defines the interface for saving and reading data. Persistency.
int64_t NElements() const
Returns the number of elements of the vector.
void HigherLevelCompElementList3(TPZStack< TPZCompElSide > &elsidevec, int onlymultiphysicelement, int removeduplicates)
Returns all connected computational elements which have level higher to the current element if onlym...
Contains declaration of TPZReferredCompEl class which generates computational elements.
virtual void Write(TPZStream &buf, int withclassid) const override
Saves the element data to a stream.
virtual void SetSideOrder(int side, int order) override
Sets the interpolation order of side to order.
int fPreferredOrder
Preferred polynomial order.
TPZCompEl * CreateRefHDivBoundTriangleEl(TPZGeoEl *gel, TPZCompMesh &mesh, int64_t &index)
Creates computational triangular element for HDiv approximate space.
Defines the interface of a computational element. Computational Element.
void IndexShapeToVec(TPZVec< int > &fVectorSide, TPZVec< std::pair< int, int64_t > > &IndexVecShape)
Returns a matrix index of the shape and vector associate to element.
Contains TPZShapeQuad class which implements the shape functions of a quadrilateral element...
virtual ~TPZCompElHDivBound2()
Default destructor.
REAL detjac
determinant of the jacobian
virtual int NConnects() const override
Returns the number of connect objects of the element.
Contains TPZShapeTriang class which implements the shape functions of a triangular element...
Implements computational element based on an interpolation space. Computational Element.
Implements an interface to register a class id and a restore function. Persistence.
#define PZError
Defines the output device to error messages and the DebugStop() function.
virtual void Read(bool &val)
Implements a generic computational element. Computational Element.