31 static LoggerPtr logger(Logger::getLogger(
"pz.analysis"));
40 #define RENUMBER TPZSloanRenumbering() 46 #define RENUMBER TPZSloanRenumbering() 57 for (int64_t el=0; el<nel; el++) {
73 for (is=14; is<18; is++) {
84 if (celstack.
size()) {
91 for (localel=0; localel<celstack.
size(); localel++) {
92 if (celstack[localel].Reference().Element()->Type() ==
ETetraedro || celstack[localel].Reference().Element()->Type() ==
ETriangle)
break;
94 if (celstack.
size()) {
99 if (localel < celstack.
size()) {
107 const int neighbourside = celstack[localel].Side();
108 if (restrainedface == neighbourside) {
117 if (is == 18 || is == 13) {
132 ExpandHDivPyramidRestraints(cmesh);
135 static int idf[6] = {2,1,1,2,0,0};
139 return ((side-14)+inc)%4+14;
145 if (nsidenodes != 3) {
148 for (
int i=0; i<3; i++) {
158 return idf[transformid];
168 for (
int fc=0; fc<4; fc++)
172 result.
fFaces[fc] = std::make_pair(nodeindex,
SideIdf(pir, face));
182 std::map<int64_t, TPZOneShapeRestraint> AllRestraints;
183 typedef std::list<TPZOneShapeRestraint>::iterator itlist;
188 for (int64_t iel=0; iel<nelem; iel++) {
190 std::list<TPZOneShapeRestraint> ellist;
192 for (itlist it = ellist.begin(); it != ellist.end(); it++) {
193 int64_t elindex = it->fFaces[0].first;
194 AllRestraints[elindex] = *it;
198 for (int64_t iel=0; iel<nelem; iel++) {
200 std::list<TPZOneShapeRestraint> ellist;
201 std::map<int64_t, TPZOneShapeRestraint> restraintmap;
202 std::set<int64_t> connectset;
206 for (itlist it = ellist.begin(); it != ellist.end(); it++) {
209 restraintmap[it->fFaces[0].first] = *it;
210 for (
int i=1; i<4; i++) {
211 connectset.insert(it->fFaces[i].first);
214 while (connectset.size()) {
215 int64_t cindex = *connectset.begin();
216 connectset.erase(cindex);
217 if (AllRestraints.find(cindex) != AllRestraints.end()) {
221 restraintmap[cindex] = restloc;
222 for (
int i=1; i<4; i++) {
223 int64_t locindex = restloc.
fFaces[i].first;
224 std::cout <<
"3 verifying connect index " << locindex <<
"\n";
225 if (restraintmap.find(locindex) != restraintmap.end()) {
226 std::cout <<
"********************* CIRCULAR RESTRAINT\n";
230 connectset.insert(locindex);
235 for (std::map<int64_t,TPZOneShapeRestraint>::iterator it = restraintmap.begin(); it != restraintmap.end(); it++) {
245 for (int64_t iel=0; iel<nel; iel++) {
260 Forcing.
Execute(topco, valvec);
261 STATE topval = valvec[0];
264 for (
int i=0; i<4; i++) {
265 cpressure->
Block()(seqnum,0,i,0) = topval;
267 for (
int i=0; i<4; i++) {
271 Forcing.
Execute(topco, valvec);
272 STATE nodeval = valvec[0];
274 cpressure->
Block()(seqnum,0,0,0) = nodeval-topval;
280 for (
int i=0; i<ncorner; i++) {
286 Forcing.
Execute(topco, valvec);
287 STATE nodeval = valvec[0];
289 cpressure->
Block()(seqnum,0,0,0) = nodeval;
301 for (int64_t el=0; el<nel; el++) {
302 if (elbasis.find(el) == elbasis.end()) {
313 std::set<int64_t> elgroup;
315 std::set<int64_t> connectlist;
317 std::cout <<
"cel " << cel->
Index() <<
" connects ";
318 for (std::set<int64_t>::iterator it=connectlist.begin(); it != connectlist.end(); it++) {
319 std::cout << *it <<
" ";
321 std::cout << std::endl;
323 for (
int is=0; is<ns; is++) {
324 std::cout <<
"side " << is << std::endl;
328 int64_t nelstack = celstack.
size();
329 for (int64_t elst=0; elst<nelstack; elst++) {
333 if (elbasis.find(celsidelement->
Index()) == elbasis.end()) {
336 std::set<int64_t> smallset;
338 std::cout <<
"neigh " << celsidelement->
Index() <<
" connects ";
339 for (std::set<int64_t>::iterator it=smallset.begin(); it != smallset.end(); it++) {
340 std::cout << *it <<
" ";
342 std::cout << std::endl;
343 if (std::includes(connectlist.begin(), connectlist.end(), smallset.begin(), smallset.end()))
345 std::cout <<
"Is included\n";
346 elgroup.insert(celsidelement->
Index());
347 elbasis.erase(celsidelement->
Index());
351 if (elgroup.size()) {
355 for (std::set<int64_t>::iterator it = elgroup.begin(); it != elgroup.end(); it++) {
358 grouped.insert(grindex);
374 std::set<int64_t> grouped;
375 for (int64_t el=0; el<nel; el++) {
376 if (grouped.find(el) != grouped.end()) {
387 std::set<int64_t> elgroup;
389 std::set<int64_t> connectlist;
392 for (
int is=0; is<ns; is++) {
396 int64_t nelstack = celstack.
size();
397 for (int64_t elst=0; elst<nelstack; elst++) {
400 if (grouped.find(celsidelement->
Index()) != grouped.end()) {
403 std::set<int64_t> smallset;
405 if (std::includes(connectlist.begin(), connectlist.end(), smallset.begin(), smallset.end()))
407 elgroup.insert(celsidelement->
Index());
411 if (elgroup.size()) {
415 for (std::set<int64_t>::iterator it = elgroup.begin(); it != elgroup.end(); it++) {
419 grouped.insert(grindex);
431 for(int64_t i=0; i<nelem; i++){
447 for(int64_t i=0; i<nelem; i++){
460 for (std::map<int64_t,std::set<int64_t> >::iterator it = elindices.begin(); it != elindices.end(); it++) {
463 indices[it->first] = index;
464 for (std::set<int64_t>::iterator itloc = it->second.begin(); itloc != it->second.end(); itloc++) {
469 for (std::map<int64_t,int64_t>::iterator it = indices.begin(); it != indices.end(); it++) {
475 if (KeepOneLagrangian)
477 int64_t nconnects = subcmesh->
NConnects();
478 for (int64_t ic=0; ic<nconnects; ic++) {
483 if(count == 1 && c.
NState() == 1)
487 else if(count == 2 && c.
NState() == 2)
491 else if(count == 3 && c.
NState() == 3)
511 for (std::set<int64_t>::iterator it = elindices.begin(); it != elindices.end(); it++) {
515 if (KeepOneLagrangian)
517 int64_t nconnects = subcmesh->
NConnects();
518 for (int64_t ic=0; ic<nconnects; ic++) {
537 for (int64_t el=0; el<nel; el++) {
543 if (KeepOneLagrangian) {
545 for (
int ic=0; ic<nc; ic++) {
550 if(count == 1 && c.
NState() == 1)
553 }
else if(count == 2 && c.
NState() == 2)
556 }
else if(count == 3 && c.
NState() == 3)
565 for (ic=0; ic<nc; ic++) {
572 bool cancondense = (ic != nc);
595 bool store_error =
false;
597 int64_t index = cel->
Index();
599 for (
int i=0; i<3; i++) {
601 square_errors[i] += errors[i]*errors[i];
609 int64_t nel = celstack.
size();
610 for (int64_t el=0; el<nel; el++) {
660 if(square_errors.
size() != 3)
672 std::cout <<
"ComputeDifferenceNorm nelem " << nel << std::endl;
675 for (int64_t el=0; el<nel; el++) {
682 if (nel >= 1000 && (el+1)%1000 == 0) {
685 if(el%(20*1000) == 0)
687 std::cout << square_errors << std::endl;
690 if(nel >= 1000) std::cout << std::endl;
699 for (int64_t el=0; el<nel; el++) {
712 for (
int i=0; i<ncon-1; i++) {
714 maxorder = maxorder < conorder ? conorder : maxorder;
716 int nsides = gel->
NSides();
727 if (c.
Order() != maxorder+hdivplusplus) {
746 for (int64_t el=0; el<nel; el++) {
756 int nsides = gel->
NSides();
759 int order = c.
Order();
765 pressorder[pintel->
Index()] = order;
768 nel = pressorder.size();
769 for (int64_t el=0; el<nel; el++) {
775 if (pressorder[el] == -1) {
778 pintel->
PRefine(pressorder[el]);
int64_t NElements() const
Number of computational elements allocated.
void HigherLevelCompElementList2(TPZStack< TPZCompElSide > &elsidevec, int onlyinterpolated, int removeduplicates)
Returns all connected computational elements which have level higher to the current element if onlyi...
TPZFMatrix< STATE > & ElementSolution()
Access method for the element solution vectors.
TPZGeoMesh * Reference() const
Returns a pointer to the geometrical mesh associated.
virtual void Execute(const TPZVec< REAL > &x, TPZVec< TVar > &f, TPZFMatrix< TVar > &df)
Performs function computation.
virtual void ResetShapeRestraints()
Return a list with the shape restraints.
Contains TPZShapeTetra class which implements the shape functions of a tetrahedral element...
TPZStack< TPZCompEl *, 5 > GetElGroup()
void IncrementElConnected()
Increment fNElConnected.
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 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 MElementType Type()
Return the type of the element.
void Unwrap()
put the elements in the element group back in the mesh and delete the element group ...
virtual void BuildConnectList(std::set< int64_t > &indepconnectlist, std::set< int64_t > &depconnectlist)
Builds the list of all connectivities related to the element including the connects pointed to by dep...
int RestrainedFace()
return the first one dof restraint
TPZGeoElSide Reference() const
Reference to the geometric element.
Contains the declaration of the TPZElementGroup class, which implements an computational element whic...
groups all classes dedicated to the computation of shape functions
virtual int NCornerNodes() const =0
Returns the number of corner nodes of the element.
Definition of the retraint associated with the top of the pyramid.
TPZCompEl * ReferenceCompEl()
virtual TPZGeoNode * SideNodePtr(int side, int nodenum) const
Returns the pointer to the nodenum node of side.
Contains the declaration of the TPZMultiphysicsElement class. This class is abstract.
TPZCompElSide LowerLevelCompElementList2(int onlyinterpolated)
return the element/side pair which contains this/side and has a computational element associated ...
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 TPZCompElHDiv class which implements a generic computational element (HDiv sc...
TPZGeoElSide Neighbour() const
virtual void EvaluateError(std::function< void(const TPZVec< REAL > &loc, TPZVec< STATE > &val, TPZFMatrix< STATE > &deriv)> func, TPZVec< REAL > &errors, bool store_error) override
Performs an error estimate on the elemen.
TPZManVector< std::pair< int64_t, int >, 4 > fFaces
Faces which are related. First item is the connect index, second item is the degree of freedom...
virtual int NSides() const =0
Returns the number of connectivities of the element.
void EqualLevelCompElementList(TPZStack< TPZCompElSide > &elsidevec, int onlyinterpolated, int removeduplicates)
Returns all connected computational elements which have equal level to the current element...
void LoadReferences()
Map this grid in the geometric grid.
unsigned char LagrangeMultiplier() const
Access method to return the indication whether the connect is associated with a pressure lagrange mul...
int64_t size() const
Returns the number of elements of the vector.
Contains the TPZBoostGraph class which implements an interface to the BGL for graph operations...
TPZCompEl * Element(int64_t iel)
void Unwrap()
unwrap the condensed element from the computational element and delete the condensed element ...
unsigned char Order() const
Access function to return the order associated with the connect.
int64_t SequenceNumber() const
Returns the Sequence number of the connect object.
Defines the behaviour of all geometric elements. GeometryTPZGeoEl is the common denominator for all g...
class which represents the solution and its derivative as a function
virtual void AddShapeRestraint(TPZOneShapeRestraint restraint) override
Add a shape restraint (meant to fit the pyramid to restraint.
Implements a group of computational elements as a mesh and an element. Computational Mesh...
#define DebugStop()
Returns a message to user put a breakpoint in.
virtual void ExpandSolution()
Adapt the solution vector to new block dimensions.
TPZCompMesh * Mesh() const
Return a pointer to the grid of the element.
int Dimension() const
Returns the dimension of the simulation.
virtual void ComputeNodElCon()
Compute the number of elements connected to each connect object.
virtual MElementType Type() const =0
Returns the element type acording to pzeltype.h.
TPZCompEl * Reference() const
Return a pointer to the element referenced by the geometric element.
int HasDependency() const
Returns whether exist dependecy information.
TPZManVector< int, 4 > fOrient
Orientation of each face.
const TPZBlock< STATE > & Block() const
Access the block structure of the solution vector.
virtual void AddShapeRestraint(TPZOneShapeRestraint restraint)
Add a shape restraint (meant to fit the pyramid to restraint.
TPZAdmChunkVector< TPZConnect > & ConnectVec()
Return a reference to the connect pointers vector.
Class which implements an element which condenses the internal connects.
int64_t Index() const
Returns element index of the mesh fELementVec list.
virtual int NConnects() const override=0
Returns the number of connect objects of the element.
virtual void AddShapeRestraint(TPZOneShapeRestraint restraint) override
Add a shape restraint (meant to fit the pyramid to restraint.
int Redim(const int64_t newRows, const int64_t newCols) override
Redimension a matrix and ZERO your elements.
static int nsidenodes[27]
Vector with the number of vertices contained in the closure of the side.
virtual TPZConnect & Connect(int i) const
Returns a pointer to the ith node.
unsigned char NState() const
Number of state variables associated with the connect.
virtual int NSideNodes(int side) const =0
Returns the number of nodes for a particular side.
int SideOrient(int face)
the orientation of the face
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 GetTransformId2dT(TPZVec< int64_t > &id)
Method which identifies the triangular transformation based on the IDs of the corner nodes...
void Forcing(const TPZVec< REAL > &pt, TPZVec< STATE > &disp)
Implements the interfaces for TPZCompElDisc, TPZInterfaceElement and TPZInterpolatedElement. Computational element.
virtual int NConnects() const =0
Returns the number of nodes of the element.
Contains declaration of TPZSubCompMesh class which implements a group of computational elements as a ...
virtual std::list< TPZOneShapeRestraint > GetShapeRestraints() const
Return a list with the shape restraints.
virtual void CleanUpUnconnectedNodes()
Delete the nodes which have no elements connected to them.
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.
virtual int NSideConnects(int iside) const override=0
Returns the number of dof nodes along side iside.
int64_t SideConnectIndex(int icon, int is) const
Returns the index of the c th connect object along side is.
virtual void MakeAllInternal() override
Makes all mesh connections internal mesh connections.
Implements computational mesh. Computational Mesh.
TPZAdmChunkVector< TPZCompEl * > & ElementVec()
Returns a reference to the element pointers vector.
virtual int64_t TransferElement(TPZCompMesh *mesh, int64_t elindex) override
Transfer the element elindex belonging to mesh to the current mesh and returns its index...
void PRefine(int order) override
Changes the interpolation order of a side. Updates all constraints and block sizes ...
int NElConnected() const
Returns fNElConnected.
Contains TPZShapePiram class which implements the shape functions of a pyramid element.
int Id() const
Returns the identity of the current node.
Contains the TPZSloan class.
void GetCoordinates(TPZVec< REAL > &co)
Fill the coordinates of the node.
void ResetReference()
Resets all load references in elements and nodes.
Defines the interface of a computational element. Computational Element.
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
Contains TPZShapeTriang class which implements the shape functions of a triangular element...
Contains TPZMetis class which implements the renumbering for elements of a mesh to minimize the band...
virtual void SetSideOrder(int side, int order)=0
Sets the interpolation order of side to order.
Implements computational element based on an interpolation space. Computational Element.
virtual void Print(std::ostream &out=std::cout) const
Prints mesh data.
virtual int NConnects() const override
Returns the number of connections.