5 #ifndef PZGEOELREFLESS_H_H 6 #define PZGEOELREFLESS_H_H 18 static LoggerPtr loggerrefless(Logger::getLogger(
"pz.mesh.tpzgeoelrefless"));
36 for(i=0;i<TGeo::NSides;i++){
56 fGeo.Initialize(
this);
64 fGeo.Initialize(
this);
73 fGeo.Initialize(
this);
81 fGeo.Initialize(
this);
87 if(node<0 || node>=
fGeo.NNodes)
return -1;
88 return fGeo.fNodeIndexes[node];
97 for(i=0;i<TGeo::NNodes;i++) {
100 coord(j,i) = np->
Coord(j);
108 if(side<0 || side>(TGeo::NSides - 1) || node<0) {
109 PZError <<
"TPZGeoElRefLess::SideNodeIndex. Bad parameter side.\n";
112 return fGeo.fNodeIndexes[TGeo::SideNodeLocId(side,node)];
119 if(side<0 || side>(TGeo::NSides - 1) || node<0) {
120 PZError <<
"TPZGeoElRefLess::SideNodeIndex. Bad parameter side.\n";
123 return TGeo::SideNodeLocId(side,node);
130 PZError <<
"TPZGeoElRefLess<TGeo>::SetSubElement - Fodeu!\n";
131 else PZError <<
"TPZGeoElRefLess<TGeo>::SetSubElement - Por enquanto eu no faco nada!\n";
137 return TGeo::CreateSideIntegrationRule(side,order);
149 return TGeo::NCornerNodes;
161 return TGeo::SideNodeLocId(side,node);
167 return TGeo::RefElVolume();
173 return TGeo::NSideNodes(side);
181 if(side<0 || side>
NSides()-1) {
182 PZError <<
"TPZGeoElRefLess<TGeo>::MidSideNodeIndex. Bad parameter side = " << side << std::endl;
194 if (side < 0 || side >
NSides()){
195 PZError <<
"TPZGeoElRefLess<TGeo>::SideIsUndefined - bad side: " << side << std::endl;
228 int nsides = TGeo::NSides;
229 if(side<0 || side >= nsides){
230 std::cout <<
"\n ("<<TGeo::Type()<<
")::CreateBCGeoEl unexpected side = " << side <<
"\n";
233 if(
fGeo.Dimension == 3 && side == nsides-1){
234 std::cout <<
"\nCreateBCGeoEl not implemented for tridimensional sides \n";
240 TGeo::LowerDimensionSides(side,LowAllSides);
241 LowAllSides.
Push(side);
242 bool straight =
true;
243 if(
fGeo.IsLinearMapping(side) ==
false) straight =
false;
244 for(
int lowside = 0; lowside < LowAllSides.
NElements(); lowside++)
246 int lside = LowAllSides[lowside];
247 if(lside < TGeo::NNodes)
continue;
248 if(
fGeo.IsLinearMapping(lside) ==
false) straight =
false;
249 if(straight ==
false)
break;
251 if(straight ==
false)
260 int sidennodes = TGeo::NSideNodes(side);
262 for(
int inode = 0; inode < sidennodes; inode++){
272 int sidensides = TGeo::NContainedSides(side);
273 for(
int iside=0; iside < sidensides-1; iside++){
284 template <
class TGeo>
287 int sidennodes = TGeo::NSideNodes(side);
290 for(inode=0; inode<sidennodes; inode++){
322 if(i<0 || i>(TGeo::NNodes - 1)){
323 std::cout <<
"TPZGeoElRefLess::SetNodeIndex index error i = " << i << std::endl;
326 fGeo.fNodeIndexes[i] = nodeindex;
332 return TGeo::SideToSideTransform(sidefrom,sideto);
339 std::cout <<
"TPZGeoElRefLess::SubElement index error is= " << is << std::endl;
348 return TGeo::SideDimension(side);
354 return TGeo::Dimension;
360 std::cout <<
"TPZGeoElRefLess::HigherDimensionSides nao deve ser usado\n";
368 TGeo::HigherDimensionSides(side,highsides);
370 for(i=0;i<size;i++) {
380 TGeo::LowerDimensionSides(side,smallsides);
395 gradx.Resize(3,
fGeo.Dimension);
398 fGeo.GradX(cornerco,par,gradx);
410 fGeo.GradX(cornerco,par,gradx);
422 fGeo.X(cornerco,coordinate,result);
433 fGeo.X(cornerco,coordinate,result);
440 return fGeo.IsLinearMapping(side);
446 return fGeo.IsGeoBlendEl();
450 return fGeo.ResetBlendConnectivity(side,index);
457 if(
this == father)
return t;
459 if(side<0 || side>(TGeo::NSides-1) || !myfather){
460 PZError <<
"TPZGeoElRefLess::BuildTransform2 side out of range or father null\n";
467 if(fathloc.Element() == father)
return trans;
475 PZError <<
"TPZGeoElRefLess<TGeo>::GetTransform::Never should be called\n";
482 TGeo::CenterPoint(side,cent);
507 fGeo.Read(buf,context);
508 for (
unsigned int i = 0; i < TGeo::NSides; ++i) {
516 fGeo.Write(buf, withclassid);
517 for (
unsigned int i = 0; i < TGeo::NSides; ++i) {
526 const int n = TGeo::NSides;
527 for(i = 0; i < n; i++){
536 std::map<int64_t,int64_t> & gl2lcNdMap,
537 std::map<int64_t,int64_t> & gl2lcElMap ) :
541 const int n = TGeo::NSides;
543 for(i = 0; i < n; i++)
547 int side = neigh.Side();
549 while (gl2lcElMap.find(neighIdx)==gl2lcElMap.end())
551 neigh = neigh.Neighbour();
552 neighIdx = neigh.Element()->Index();
594 for (
int i = 0; i < TGeo::Dimension; i++) {
597 TGeo::ComputeHDivDirections(gradx, directions);
604 TPZFNMatrix<9,REAL> jac(TGeo::Dimension,TGeo::Dimension), jacinv(TGeo::Dimension,TGeo::Dimension), axes(TGeo::Dimension,3), gradx(3,TGeo::Dimension,0.);
606 this->
GradX(pt, gradx);
608 TGeo::ComputeHDivDirections(gradx, directions);
620 TPZFNMatrix<9,REAL> gradx(3,TGeo::Dimension,0.),gradxinv(TGeo::Dimension,TGeo::Dimension,0.);
622 this->
GradX(pt, gradx);
623 gradx.Resize(TGeo::Dimension,TGeo::Dimension);
628 for(
int i=0;i<TGeo::Dimension;i++){
629 qsiFad[i] =
Fad<REAL>(TGeo::Dimension,pt[i]);
631 for(
int j=0;j<TGeo::Dimension;j++){
632 qsiFad[i].fastAccessDx(j)=gradxinv(i,j);
637 this->
GradX(qsiFad, gradxFad);
639 TGeo::ComputeHDivDirections(gradxFad, directions);
723 if(dimension != sidedimension+1)
725 std::stringstream sout;
726 sout <<
"HDivPermutation called with wrong side parameter " << side;
734 const int64_t
nsidenodes = TGeo::NSideNodes(side);
770 permutegather[0] = 0;
777 if (loggerrefless->isDebugEnabled()) {
778 std::stringstream sout;
779 sout <<
"side = " << side <<
" transform id " << transformid <<
" permutegather " << permutegather;
785 #include
"TPZTopologyUtils.h" 787 template <class Geom>
789 return Geom::Top::NPermutations;
792 template <
class Geom>
794 return pztopology::GetPermutation<typename Geom::Top>(i,permutation);
virtual ~TPZGeoElRefLess()
static REAL cornerco[8][3]
virtual TPZGeoEl * CreateGeoElement(MElementType type, TPZVec< int64_t > &nodeindexes, int matid, int64_t &index) override
Creates a geometric element according to the type of the father element.
virtual int NSubElements() const override
Returns the number of subelements of the element independent of the fact hether the element has alrea...
virtual int64_t NodeIndex(int node) const override
Returns the index of the ith node the index is the location of the node in the nodevector of the mesh...
virtual void Read(TPZStream &str, void *context) override
read objects from the stream
virtual TPZTransform< REAL > GetTransform(int side, int son)=0
bool ResetBlendConnectivity(const int64_t &side, const int64_t &index) override
TPZGeoNode * NodePtr(int i) const
Returns a pointer to the ith node of the element.
virtual TPZTransform SideToSideTransform(int sidefrom, int sideto) override
compute the transformation between the master element space of one side of an element to the master e...
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.
Contains declaration of TPZGeoElRefLess class which implements the mapping between the master element...
Implements a vector class which allows to use external storage provided by the user. Utility.
virtual int NSideNodes(int side) const override
Returns the number of nodes for a particular side.
clarg::argBool bc("-bc", "binary checkpoints", false)
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...
Contains declaration of TPZGeoNode class which defines a geometrical node.
REAL Coord(int i) const
Returns i-th coordinate of the current node.
clarg::argInt dimension("-d", "Matrices dimension M x M", 1000)
virtual TPZTransform< REAL > BuildTransform2(int side, TPZGeoEl *father, TPZTransform< REAL > &t)
Returns the transformation which maps the parameter side of the element/side into the parameter spac...
static void GetSideHDivPermutation(int transformid, TPZVec< int > &permgather)
Identifies the permutation of the nodes needed to make neighbouring elements compatible in terms of o...
virtual void AllHigherDimensionSides(int side, int targetdimension, TPZStack< TPZGeoElSide > &elsides) override
TPZGeoElSideIndex fNeighbours[TGeo::NSides]
void Write(TPZStream &str, int withclassid) const override
Writes this object to the TPZStream buffer. Include the classid if withclassid = true.
virtual TPZTransform GetTransform(int side, int son) override
static void GetSideHDivPermutation(int transformationid, TPZVec< int > &permgather)
Identifies the permutation of the nodes needed to make neighbouring elements compatible in terms of o...
Utility class which represents an element with its side. The Geometric approximation classes Geometry...
Implements the mapping between the master element and deformed element. Geometry. ...
virtual void Initialize()
static int GetTransformId(TPZVec< int64_t > &id)
Method which identifies the transformation based on the IDs of the corner nodes.
TPZGeoMesh * Mesh() const
Returns the mesh to which the element belongs.
virtual int NSides() const =0
Returns the number of connectivities of the element.
virtual void LowerDimensionSides(int side, TPZStack< int > &smallsides) const override
virtual REAL RefElVolume() override
Volume of the master element.
virtual TPZGeoEl * CreateGeoBlendElement(MElementType type, TPZVec< int64_t > &nodeindexes, int matid, int64_t &index)
Creates a geometric element in same fashion of CreateGeoElement but here the elements are blend...
Abstract class defining integration rules. Numerical Integration.
void Read(TPZStream &str, void *context) override
read objects from the stream
Utility class which represents an element index with its side. Geometry.
virtual void HDivPermutation(int side, TPZVec< int > &permutegather) override
Compute the permutation for an HDiv side.
virtual TPZTransform BuildTransform2(int side, TPZGeoEl *father, TPZTransform<> &t) override
static int highsides[27][7]
For each side was stored the sides connected with it but of the higher dimension. ...
int64_t size() const
Returns the number of elements of the vector.
Contains declaration of TPZMesh class which defines a geometrical mesh and contains a corresponding l...
virtual void CenterPoint(int side, TPZVec< REAL > &masscent) const override
It returns the coordinates of the center of the side of the element.
void Push(const T object)
Pushes a copy of the object on the stack.
virtual int NSides() const override
Returns the number of connectivities of the element.
virtual int NSideSubElements(int side) const override
Returns the number of subelements of the same dimension of the element at the side.
virtual void GetSubElements2(int side, TPZStack< TPZGeoElSide > &subel) const override
This method will return a partition of the side of the current element as the union of sub elements/...
virtual bool IsGeoBlendEl() const override
static void AdjustTopDirections(int ConstrainedFace, TPZFMatrix< TVar > &gradx, TPZFMatrix< TVar > &directions)
Adjust the directions associated with the tip of the pyramid, considering that one of the faces is co...
TPZGeoElRefLess()
Contains the implementation of the TPZGeoElRefLess methods.
int WhichSubel() const
Returns the son number of the sub element gel.
Defines the behaviour of all geometric elements. GeometryTPZGeoEl is the common denominator for all g...
virtual int Dimension() const override
Returns the dimension of the element.
int64_t Index() const
Returns the index of the element within the element vector of the mesh.
virtual int SideNodeLocIndex(int side, int node) const override
Returns the local index of a node on a side.
#define DebugStop()
Returns a message to user put a breakpoint in.
virtual int FatherSide(int side, int son)
virtual int64_t SideNodeIndex(int side, int node) const override
Returns the index of the nodenum node of side.
#define LOGPZ_DEBUG(A, B)
Define log for debug info.
virtual void X(TPZVec< REAL > &coordinate, TPZVec< REAL > &result) const override
Returns the coordinate in real space of the point coordinate in the master element space...
virtual int SideDimension(int side) const override
Return the dimension of side.
virtual void SetSubElement(int id, TPZGeoEl *el) override
Sets the subelement of index i.
static void GetSideHDivPermutation(int transformationid, TPZVec< int > &permgather)
Identifies the permutation of the nodes needed to make neighbouring elements compatible in terms of o...
static int GetTransformId(TPZVec< int64_t > &id)
Method which identifies the transformation based on the IDs of the corner nodes.
void CornerCoordinates(TPZFMatrix< REAL > &coord) const
Gets the corner node coordinates in coord.
virtual int NNodes() const override
Returns the number of nodes of the element.
virtual int SideNodeLocId(int side, int node) const
Returns the local node number of the node "node" along side "side".
virtual int NCornerNodes() const override
Returns the number of corner nodes of the element.
void SetConnectivity(const TPZGeoElSide &neighbour) const
virtual TPZIntPoints * CreateSideIntegrationRule(int side, int order) override
Creates an integration rule for the topology of the corresponding side and able to integrate a polyno...
void GetPermutation(const int &i, TPZVec< int > &permutation) const override
#define LOGPZ_ERROR(A, B)
Define log for errors (cout)
static int nsidenodes[27]
Vector with the number of vertices contained in the closure of the side.
virtual void GradX(TPZVec< REAL > &coordinate, TPZFMatrix< REAL > &gradx) const override
Return the gradient of the transformation at the point.
Contains the TPZPyramid class which defines the topology of a pyramid element.
virtual int ClassId() const override
Define the class id associated with the class.
virtual bool IsLinearMapping() const
TPZGeoEl * Element() const
virtual void HDivDirections(TPZVec< REAL > &pt, TPZFMatrix< REAL > &directions, int ConstrainedFace=-1) override
virtual void HDivDirectionsMaster(TPZFMatrix< REAL > &directions) override
Implements a geometric node in the pz environment. Geometry.
virtual void BuildTransform(int side, TPZGeoEl *father, TPZTransform<> &t)
Accumulates the transformation of the jacobian which maps the current master element space into the s...
virtual TPZGeoEl * CreateBCGeoBlendEl(int side, int bc)
Method which creates a blend geometrical boundary condition element based on the current geometric el...
This class implements a geometric mesh for the pz environment. Geometry.
MElementType
Define the element types.
virtual TPZGeoElSide HigherDimensionSides(int side, int targetdimension)
virtual TPZGeoEl * SubElement(int is) const override
Returns a pointer to the subelement is.
static int sidedimension[27]
Vector of the dimension for each side.
virtual TPZGeoEl * CreateGeoElementMapped(MElementType type, TPZVec< int64_t > &nodeindexes, int matid, int64_t &index)
Generic method for creating a geometric element. Putting this method centrally facilitates the modifi...
void Write(TPZStream &buf, int withclassid) const override
Writes this object to the TPZStream buffer. Include the classid if withclassid = true.
static int GetTransformId(TPZVec< int64_t > &id)
Method which identifies the transformation based on the IDs of the corner nodes.
int Resize(const int64_t newRows, const int64_t wCols) override
Redimension a matrix, but maintain your elements.
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 Read(TPZStream &buf, void *context) override
read objects from the stream
TPZGeoEl * Father() const
Computes the normal vectors needed for forming HDiv vector valued shape functions.
virtual TPZGeoEl * CreateBCGeoEl(int side, int bc) override
Method which creates a computational boundary condition element based on the current geometric elemen...
virtual void MidSideNodeIndex(int side, int64_t &index) const override
Returns the midside node index along a side of the element.
void InsertConnectivity(TPZGeoElSide &neighbour)
This method inserts the element/side and all lowerdimension sides into the connectivity loop...
virtual void Write(TPZStream &str, int withclassid) const override
Writes this object to the TPZStream buffer. Include the classid if withclassid = true.
virtual int SideIsUndefined(int side) override
Returns 1 if the side has not been defined by buildconnectivity.
Non abstract class which implements full matrices with preallocated storage with (N+1) entries...
#define PZError
Defines the output device to error messages and the DebugStop() function.
virtual void SetNodeIndex(int i, int64_t nodeindex) override
Initializes the node i of the element.
virtual TPZGeoElSide Father2(int side) const override
Returns the father/side of the father which contains the side of the sub element. ...