32 static LoggerPtr logger(Logger::getLogger(
"pz.mhmeshcontrol"));
49 int64_t nc = geotomhm.
size();
50 for (int64_t c=0; c<nc; c++) {
54 if (logger->isDebugEnabled()) {
55 std::stringstream sout;
56 sout <<
"Coarse element indexes ";
72 if (partitionindex.
size() != partitionindex.
size()) {
79 int64_t nc = partitionindex.
size();
80 for (int64_t c=0; c<nc; c++) {
84 if (logger->isDebugEnabled()) {
85 std::stringstream sout;
86 sout <<
"Coarse element indexes ";
102 std::map<int64_t, std::pair<int64_t, int64_t>> skeleton;
107 for (int64_t iel = 0; iel < nel; iel++) {
116 if(neighbour.Element()->Dimension() != dim)
DebugStop();
117 int partition = partitionindex[neighbour.Element()->Index()];
118 int64_t neighindex = neighbour.Element()->Index();
119 auto val = std::pair<int64_t,int64_t>(partition,gel->
Index());
125 int nsides = gel->
NSides();
127 for (
int iside = 0; iside < nsides; iside++) {
132 if (gelside.
Dimension() != dim - 1)
continue;
139 int64_t thisId = gel->
Index();
143 auto hasSkeletonNeighbour = [&]() ->
bool {
145 while (neighbour != gelside) {
155 int64_t thisGroup = partitionindex[thisId];
156 int64_t neighGroup = partitionindex[neighId];
158 if (thisGroup != neighGroup) {
159 if (!hasSkeletonNeighbour()) {
161 std::pair<int64_t, int64_t> adjacentGroupIndexes(thisGroup, neighGroup);
163 if(bc_index == neighGroup)
184 if (logger->isDebugEnabled()) {
185 std::stringstream sout;
186 sout <<
"Coarse element indexes ";
235 for (int64_t el = 0; el<nel ; el++) {
244 for (int64_t el = 0; el<nel ; el++) {
260 int64_t ncoarse = coarseindices.
size();
263 for (int64_t el=0; el<nel; el++) {
266 for (int64_t el=0; el<ncoarse; el++) {
276 for (int64_t el=0; el<nel; el++) {
284 int64_t index = father->
Index();
289 father = father->
Father();
294 if (logger->isDebugEnabled()) {
295 std::stringstream sout;
297 sout <<
"Recognized domains ";
299 sout << it->first <<
' ';
322 for(int64_t iel = 0; iel<nel; iel++)
343 fInterfaces[leftind]=std::make_pair(rightind, leftind);
348 fInterfaces[rightind]=std::make_pair(leftind, rightind);
351 fInterfaces[iel] = std::make_pair(leftind, rightind);
366 if (logger->isDebugEnabled()) {
367 std::stringstream sout;
368 std::map<int64_t, std::pair<int64_t,int64_t> >::iterator it =
fInterfaces.begin();
372 sout <<
"Interface index " << it->first <<
" Left Element " << it->second.first <<
"/" << leftdim
373 <<
" Right Element " << it->second.second <<
"/" << rightdim << std::endl;
376 sout <<
"Geometric mesh after creating the skeleton\n";
386 std::map<int64_t, std::pair<int64_t,int64_t> >::iterator it;
387 for (
int divide=0; divide<ndivide; divide++)
389 std::map<int64_t, std::pair<int64_t,int64_t> > mapdivided;
391 int64_t elindex = it->first;
402 for (
int is=0; is<
nsub; is++) {
407 mapdivided[subels[is]->Index()] = it->second;
409 if(elindex == it->second.second)
411 mapdivided[subels[is]->Index()].second = subels[is]->Index();
421 std::cout<<
"WrapMatId created \n";
430 std::map<int64_t, std::pair<int64_t,int64_t> >::iterator it;
431 bool hasdivided =
true;
436 std::map<int64_t, std::pair<int64_t,int64_t> > mapdivided;
438 int64_t elindex = it->first;
449 mapdivided[it->first] = it->second;
456 for (
int is=0; is<
nsub; is++) {
461 mapdivided[subels[is]->Index()] = it->second;
464 if(elindex == it->second.second)
466 mapdivided[subels[is]->Index()].second = subels[is]->Index();
482 std::set<int> matids, bcids;
485 for (int64_t el=0; el<nel; el++) {
494 matids.insert(materialid);
496 for (
int is=0; is<ns; is++) {
502 while (neighbour != gelside) {
515 std::set<int>::iterator it = matids.begin();
517 while (it != matids.end()) {
532 while (it != bcids.end()) {
545 for (int64_t el=0; el<nel; el++) {
556 for (
int is=0; is<ns; is++) {
562 while (neighbour != gelside) {
565 if (bcids.find(matid) != bcids.end()) {
600 if (logger->isDebugEnabled()) {
601 std::stringstream sout;
602 sout <<
"*********** BEFORE SUBSTRUCTURING *************\n";
605 for (int64_t el=0; el<nel; el++) {
608 sout <<
"el index " << el <<
" subdomain " <<
WhichSubdomain(cel) << std::endl;
616 if(usersubstructure==
true){
641 bool LagrangeCreated =
false;
642 for (int64_t el=0; el< nel; el++)
655 if (!LagrangeCreated)
657 LagrangeCreated =
true;
660 int nshape(1), nvar(1), order(1);
661 int lagrangelevel = 0;
697 std::map<int64_t, std::pair<int64_t,int64_t> >::iterator it =
fInterfaces.begin();
699 int64_t elindex = it->first;
710 int Side = gel->
NSides()-1;
713 for (
int ic=0; ic<nc; ic++) {
714 int lagrangelevel = 0;
726 if (elindex == it->second.second) {
733 if (it->second.first < it->second.second) {
754 std::map<int64_t, std::pair<int64_t,int64_t> >::iterator it;
758 int64_t elindex = it->first;
760 int64_t leftelindex = it->second.first;
761 int64_t rightelindex = it->second.second;
763 int matid = 0, matidleft = 0, matidright = 0;
766 if (leftelindex < rightelindex || rightelindex == elindex)
777 if (rightelindex == elindex) {
787 while(neighbour != gelside)
796 if (neighbour == gelside) {
800 gelstack.
Push(neighbour);
801 while (gelstack.
size())
811 while (neighbour != smallGeoElSide)
836 if (logger->isDebugEnabled()) {
837 std::stringstream sout;
838 sout <<
"New interface left " << smallGeoElSide.
Element()->
Index() <<
" right " << gel->
Index() <<
" matid " << matid;
857 while (gel && gel->
Index() != father) {
873 out << __PRETTY_FUNCTION__ <<
" Number of coarse elements " << nelgroups << std::endl;
885 std::set<int64_t> celindices;
886 std::multimap<int64_t,int64_t> interfaces;
888 for (int64_t el=0; el<nel; el++) {
894 int64_t gelindex = gel->
Index();
897 celindices.insert(el);
906 interfaces.insert(std::make_pair(left->
Index(),el));
910 out <<
"Diagnostics for subdomain formed by element seed " << elindex << std::endl;
911 out <<
"Number of computational elements contained in the group " << celindices.size() << std::endl;
912 out <<
"Comp Element indices ";
913 for (std::set<int64_t>::iterator i=celindices.begin(); i != celindices.end(); i++) {
917 out <<
"Number of boundary interfaces " << interfaces.size() << std::endl;
918 for (std::multimap<int64_t, int64_t>::iterator i = interfaces.begin(); i != interfaces.end(); i++) {
919 int64_t el = i->second;
928 out <<
"Number of elements on the sides of elseed " << boundaries.
size() << std::endl;
929 for (int64_t i=0; i<boundaries.
size(); i++) {
930 out <<
"Comp Element index " << boundaries[i].Element()->Index() <<
" side " << boundaries[i].Side() << std::endl;
932 out <<
"Geom Element indices ";
933 for (std::set<int64_t>::iterator i=celindices.begin(); i != celindices.end(); i++) {
937 out <<
"Number of boundary interfaces " << interfaces.size() << std::endl;
938 for (std::multimap<int64_t, int64_t>::iterator i = interfaces.begin(); i != interfaces.end(); i++) {
939 int64_t el = i->second;
948 out <<
"Number of elements on the sides of elseed " << boundaries.
size() << std::endl;
949 for (int64_t i=0; i<boundaries.
size(); i++) {
950 out <<
"Geom Element index " << boundaries[i].Element()->Reference()->Index() <<
" side " << boundaries[i].Side() << std::endl;
961 for (
int is=0; is<ns; is++) {
971 if (!father || father.
Dimension() != dim-1) {
976 result.
Push(celside);
985 std::set<int> notincluded;
990 for (int64_t el=0; el<nel; el++) {
996 if (notincluded.find(matid) != notincluded.end()) {
1010 std::set<int> notincluded;
1015 for (int64_t el=0; el<nel; el++) {
1025 if (notincluded.find(matid) != notincluded.end()) {
1035 int64_t nst = celstack.
size();
1036 for (int64_t i=0; i<nst; i++) {
1039 if (gs == gelside) {
1053 out <<
"Output for the structure of the boundary elements\n";
1054 std::set<int> MHMmatids;
1060 out <<
"\nCOMPUTATIONAL ELEMENT INFORMATION\n";
1063 for (int64_t el=0; el<nelem; el++) {
1077 if (MHMmatids.find(matid) != MHMmatids.end()) {
1082 gelside.EqualLevelCompElementList(celstack, 0, 0);
1083 out <<
"Comp Boundary Element Index " << el <<
" matid " << matid << std::endl;
1084 for (int64_t i=0; i< celstack.NElements(); i++) {
1089 if (MHMmatids.find(matid) != MHMmatids.end()) {
1097 out <<
"Comp Interface leftel index " << left->
Index() <<
" rightel index " << right->
Index() << std::endl;
1103 out <<
"\nGEOMETRIC ELEMENT INFORMATION\n";
1104 for (int64_t el=0; el<nelem; el++) {
1118 if (MHMmatids.find(matid) != MHMmatids.end()) {
1123 gelside.EqualLevelCompElementList(celstack, 0, 0);
1124 out <<
"Geom Boundary Element Index " << gel->
Index() <<
" matid " << matid << std::endl;
1125 for (int64_t i=0; i< celstack.NElements(); i++) {
1130 if (MHMmatids.find(matid) != MHMmatids.end()) {
1162 std::set<int> matids;
1168 for (int64_t el=0; el<nel; el++) {
1177 matids.insert(materialid);
1182 std::set<int>::iterator it = matids.begin();
1184 while (it != matids.end()) {
1197 for (int64_t el=0; el<nel; el++) {
1211 static int count = 0;
1215 std::cout <<
"Number of shape functions of discontinuous element " << c.
NShape() << std::endl;
1229 for (int64_t el=0; el<nel; el++) {
1237 if (logger->isDebugEnabled()) {
1238 std::stringstream sout;
1263 for (int64_t el=0; el<nel; el++) {
1293 for (int64_t el=0; el<nel; el++) {
1296 int nsides = gel->
NSides();
1303 int nstack = celstack.
size();
1304 for (
int ist=0; ist<nstack; ist++) {
1305 TPZCompEl *celmult = celstack[ist].Element();
1313 for (int64_t el=0; el<nel; el++) {
1316 int nsides = gel->
NSides();
1323 int nstack = celstack.
size();
1324 for (
int ist=0; ist<nstack; ist++) {
1325 TPZCompEl *celmult = celstack[ist].Element();
1332 for (int64_t el=0; el<nel; el++) {
1341 int nmeshes = multel->
NMeshes();
1342 for (
int im=nmeshes; im<3; im++) {
1356 for (int64_t el=0; el<nel; el++) {
1382 for (int64_t el=0; el<nel; el++)
1386 int64_t cindex = npressconnect+nlagrangeconnect+pressureconnect;
1392 if (logger->isDebugEnabled()) {
1393 std::stringstream sout;
1405 std::map<int64_t, int64_t > connectdest;
1407 std::map<int64_t, TPZSubCompMesh *> submeshes;
1414 submeshes[it->first] = submesh;
1417 for (std::map<int64_t, TPZSubCompMesh *>::iterator it = submeshes.begin(); it != submeshes.end(); it++) {
1425 for (int64_t el=0; el<nel; el++)
1429 if (dynamic_cast<TPZSubCompMesh *>(cel)) {
1437 if (submeshes.find(domain) == submeshes.end()) {
1440 submeshes[domain]->TransferElement(
fCMesh.operator->(), cel->
Index());
1442 if (logger->isDebugEnabled()) {
1443 std::stringstream sout;
1444 sout <<
"Transferring element index " << cel->
Index() <<
" geometric index ";
1447 sout << gel->
Index();
1456 std::map<int64_t, TPZSubCompMesh *>::iterator itsub = submeshes.begin();
1457 while (itsub != submeshes.end()) {
1460 std::set<int64_t> internals;
1462 for (
int ic=0; ic<nc; ic++) {
1469 bool makeinternal =
false;
1472 makeinternal =
true;
1474 else if (lagrange < 3) {
1475 makeinternal =
true;
1480 internals.insert(
internal);
1486 std::cout <<
"For subdomain " << itsub->first <<
" connect index " << connectindex <<
" left external as lagrange multiplier\n";
1498 itsub = submeshes.begin();
1499 while (itsub != submeshes.end()) {
1502 int preconditioned = 0;
1504 if (logger->isDebugEnabled()) {
1505 std::stringstream sout;
1506 sout <<
"Newly created submesh for element " << *it <<
"\n";
1507 submesh->
Print(sout);
1526 out <<
"******************* GEOMETRIC MESH *****************\n";
1534 out <<
"******************* PRESSURE MESH *****************\n";
1542 out <<
"******************* COMPUTATIONAL MESH *****************\n";
1549 out <<
"******************* LAGRANGE MULTIPLIER MESH *****************\n";
1556 out <<
"******************* CONSTANTE PRESSURE MESH *****************\n";
1574 out <<
"Geometric element indices of the coarse mesh ";
1576 out << it->first <<
" " << it->second <<
" ";
1581 out <<
"Skeleton element indices with associated left and right coarse element indices\n";
1583 std::map<int64_t, std::pair<int64_t,int64_t> >::iterator it;
1585 out <<
"skel index " << it->first <<
" Left Right indices " << it->second.first <<
" " << it->second.second << std::endl;
1595 out <<
"Subdomain indices of the connects\n";
1598 out <<
"Mesh address " << (
void *) it->first;
1600 for (int64_t i=0; i<cvec.size(); i++) {
1604 out <<
"(" << i <<
"->" << cvec[i] <<
") ";
1620 TPZFNMatrix<1,STATE> xk(
fNState,
fNState,0.),xb(
fNState,
fNState,0.),xc(
fNState,
fNState,0.),xf(
fNState,1,0.);
1648 int LagrangeMatIdLeft = 50;
1649 int LagrangeMatIdRight = 51;
1697 std::map<int64_t, std::pair<int64_t,int64_t> >::iterator it;
1700 int64_t elindex = it->first;
1702 if (it->first == it->second.second) {
1714 skeletoncomp[elindex] = cel;
1718 int64_t elindex = it->first;
1720 if (elindex == it->second.second) {
1724 TPZCompEl *celskeleton = skeletoncomp[elindex];
1730 int64_t index1,index2;
1737 GelVec[1] = gbc1.CreatedElement();
1745 GelVec[1]->ResetReference();
1750 GelVec[2]->ResetReference();
1769 int64_t elindex = it->first;
1771 if (elindex == it->second.second) {
1788 TPZCompEl *celskeleton = 0, *celsecondskeleton = 0;
1792 while (neighbour != gelside) {
1802 if (!celpressure || !celskeleton || !celsecondskeleton) {
1806 std::map<int64_t, std::list<TPZInterfaceElement *> > interfaces;
1811 std::stringstream sout;
1812 sout <<
"For skeleton element gelindex " << gel->
Index() <<
" area " << gel->
SideArea(gel->
NSides()-1) <<
" we found interfaces\n";
1813 for (std::map<int64_t, std::list<TPZInterfaceElement *> >::iterator it = interfaces.begin(); it != interfaces.end(); it++) {
1814 sout <<
"domain " << it->first << std::endl;
1815 for (std::list<TPZInterfaceElement *>::iterator it2 = it->second.begin(); it2 != it->second.end(); it2++) {
1818 sout <<
"intface gelindex " << (*it2)->Reference()->Index() <<
" celindex " << (*it2)->Index() <<
" area " << g->
SideArea(ns-1) << std::endl;
1826 for (std::map<int64_t, std::list<TPZInterfaceElement *> >::iterator it = interfaces.begin(); it != interfaces.end(); it++) {
1827 for (std::list<TPZInterfaceElement *>::iterator it2 = it->second.begin(); it2 != it->second.end(); it2++) {
1835 if (right.
Element() != celskeleton) {
1847 if (subdomain == -1) {
1854 std::stringstream sout;
1864 std::stringstream sout;
1865 sout <<
"For skeleton element gelindex " << gel->
Index() <<
" area " << gel->
SideArea(gel->
NSides()-1) <<
" we found interfaces\n";
1866 for (std::map<int64_t, std::list<TPZInterfaceElement *> >::iterator it = interfaces.begin(); it != interfaces.end(); it++) {
1867 sout <<
"domain " << it->first << std::endl;
1868 for (std::list<TPZInterfaceElement *>::iterator it2 = it->second.begin(); it2 != it->second.end(); it2++) {
1869 sout <<
"intface gelindex " << (*it2)->Reference()->Index() <<
" celindex " << (*it2)->Index() <<
" subdomain " <<
WhichSubdomain(*it2) << std::endl;
1883 int64_t index3, index4;
1887 intfaceright->SetLeftRightElements(rightflux, pressure);
1890 std::stringstream sout;
1891 sout <<
"Interfaces created by hybridization interface left subdomain el index " << intfaceleft->
Index() <<
" dom " <<
WhichSubdomain(intfaceleft) <<
1892 " el index " << intfaceright->Index() <<
" interface right subdomain " <<
WhichSubdomain(intfaceright);
1899 for (
int ic=0; ic<nc; ic++) {
1900 int lagrangelevel = 4;
1904 nc = celskeleton->NConnects();
1905 for (
int ic=0; ic<nc; ic++) {
1906 int lagrangelevel = 2;
1907 celskeleton->Connect(ic).SetLagrangeMultiplier(lagrangelevel);
1909 nc = celsecondskeleton->NConnects();
1910 for (
int ic=0; ic<nc; ic++) {
1911 int lagrangelevel = 2;
1912 celsecondskeleton->Connect(ic).SetLagrangeMultiplier(lagrangelevel);
1928 for (
int ic=0; ic<ncon; ic++) {
1933 int64_t index = gel->
Index();
1957 std::set<int64_t> domains;
1960 for (
int ic=0; ic<ncon; ic++)
1963 if (cvec[cindex] != -1) {
1964 domains.insert(cvec[cindex]);
1968 if (domains.size() > 1) {
1969 for (
int ic=0; ic<ncon; ic++) {
1971 std::cout << cindex <<
"|" << cvec[cindex] <<
" ";
1973 std::cout << std::endl;
1976 if (domains.size() ==0) {
1979 int64_t domain = *domains.begin();
1987 int nmeshes = meshvec.
size();
1988 int64_t totalconnects = 0;
1989 for (
int im=0; im<nmeshes; im++) {
1998 for (
int im=0; im<nmeshes; im++) {
2000 int64_t nc = cvec.
size();
2001 for (int64_t ic=0; ic<nc; ic++) {
2002 mfvec[count++] = cvec[ic];
2012 while (check && check != father) {
2015 if (check==father) {
2031 if (gelskeleton->
Dimension() != meshdim-1) {
2036 while (neighbour != gelside) {
2042 if(neighbour == gelside)
2044 std::cout <<
"For element " << gelskeleton->
Index() <<
" with mat id " << gelskeleton->
MaterialId() <<
" no skeleton found\n";
2045 neighbour = gelside.Neighbour();
2046 while(neighbour != gelside)
2048 std::cout <<
"Neighbour matid " << neighbour.Element()->MaterialId() << std::endl;
2049 neighbour = neighbour.Neighbour();
2055 wrapstack.
Push(skeletonwrap);
2056 while(wrapstack.
size())
2058 skeletonwrap = wrapstack.
Pop();
2060 while (neighbour != skeletonwrap)
2062 if (neighbour.Element()->Dimension() == meshdim && neighbour.Element()->Reference()) {
2065 ellist[leftright.first].push_back(neighbour.Reference());
2067 if (skeleton != leftright.second &&
fGeoToMHMDomain[neighbour.Element()->Index()] == leftright.second)
2069 ellist[leftright.second].push_back(neighbour.Reference());
2076 for (
int isub = 0; isub <
nsub; isub++) {
2079 wrapstack.
Push(subelside);
2084 if (ellist.size() == 0) {
2088 if (skeleton == leftright.second && ellist.size() != 1) {
2092 if(skeleton != leftright.second && ellist.size() != 2)
2102 std::map<int64_t, std::list<TPZCompElSide> > ellist;
2105 for (std::map<int64_t, std::list<TPZCompElSide> >::iterator it = ellist.begin(); it != ellist.end(); it++) {
2106 std::list<TPZCompElSide> &loclist = it->second;
2107 for (std::list<TPZCompElSide>::iterator it2 = loclist.begin(); it2 != loclist.end(); it2++) {
2111 while (neighbour != gelside) {
2116 intfaces[it->first].push_back(intface);
2122 if (neighbour == gelside) {
2137 for (int64_t el=0; el<nel; el++) {
2143 for (
int is=0; is<ns; is++) {
2149 while (neighbour != gelside) {
2165 for (int64_t el=0; el<nel; el++) {
2171 for (
int is=0; is<ns; is++) {
2177 while (neighbour != gelside) {
2193 for (int64_t el=0; el<nel; el++) {
2199 for (
int is=0; is<ns; is++) {
2215 int element_dimension = gelside.
Dimension();
2216 std::set<int> wrapmat;
2230 while (neighbour != gelside) {
2250 while (neighbour != gelside) {
2253 std::cout <<
"neighfather dimension " << neighfather.
Dimension() <<
" my dimension " << gelside.
Dimension() << std::endl;
2283 int hasDimNeighbour = 0;
2285 bool isBoundary =
false;
2286 while (neighbour != gelside) {
2291 hasDimNeighbour = 1;
2298 if (hasDimNeighbour) {
2303 else if(gelside.
Dimension() == meshdim-2)
2306 int hasBoundaryNeighbour = 0;
2307 while (neighbour != gelside) {
2313 hasBoundaryNeighbour = 1;
2317 if (hasBoundaryNeighbour) {
2351 while (neighbour != gelside) {
2379 wrapmat = wrapmaterial;
2383 else if(wrapmaterial != wrapmat)
2390 while (neighbour != gelside) {
2407 while (neighbour != gelside) {
2408 if(neighbour.Element()->HasSubElement() && neighbour.NSubElements() > 1)
2411 if (neighbour.Side() == neighbour.NSides()-1) {
2421 std::cout <<
"We expect elements to have refinement patterns\n";
2429 wrapelement->
Divide(subels);
2431 if(subels.
size() == 1)
2436 for (
int is=0; is<subels.
size(); is++) {
2441 neighbour = neighbour.Neighbour();
int64_t NElements() const
Number of computational elements allocated.
void CheckDivisionConsistency(TPZGeoElSide gelside)
void EqualorHigherCompElementList2(TPZStack< TPZCompElSide > &celside, int onlyinterpolated, int removeduplicates)
Will return all elements of equal or higher level than than the current element.
void AddElementBoundaries(int64_t elseed, int64_t compelindex, TPZStack< TPZCompElSide > &result)
put the element side which face the boundary on the stack
bool fLagrangeAveragePressure
flag to determine whether a lagrange multiplier is included to force zero average pressures in the su...
Material which implements a Lagrange Multiplier.
void ConnectedInterfaceElements(int64_t skeleton, std::pair< int64_t, int64_t > &leftright, std::map< int64_t, std::list< TPZInterfaceElement *> > &ellist)
identify interface elements connected to the skeleton elements
static void SetgOrder(int order)
Sets the value of the default interpolation order.
TPZAutoPointer< TPZCompMesh > fCMeshLagrange
computational mesh to represent the distributed flux in each subdomain
void SetAllCreateFunctionsContinuous()
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...
bool IsAncestor(TPZGeoEl *son, TPZGeoEl *father)
TPZAutoPointer< TPZCompMesh > fCMesh
computational MHM mesh being built by this class
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.
bool IsSibling(int64_t son, int64_t father)
verify if the element is a sibling of
Implements a vector class which allows to use external storage provided by the user. Utility.
void CreateSkeleton()
will create the elements on the skeleton
int MaterialId() const
Returns the material index of the element.
clarg::argBool bc("-bc", "binary checkpoints", false)
clarg::argInt nsub("-nsub", "number of substructs", 4)
int64_t NEquations()
This computes the number of equations associated with non-restrained nodes.
clarg::argInt dimension("-d", "Matrices dimension M x M", 1000)
void SaddlePermute()
Put the sequence number of the pressure connects after the seq number of the flux connects...
TPZGeoElSide StrictFather()
returns the father/side pair which contains this/side and is strictly larger than this/side ...
TPZGeoElSide Reference() const
Reference to the geometric element.
virtual void AddElement(TPZCompEl *cel, int64_t mesh)=0
int fSecondSkeletonMatId
material id associated with the skeleton elements
int fSkeletonMatId
material id associated with the skeleton elements
TPZGeoElSide Father2() const
returns the father/side pair which contains the set of points associated with this/side ...
TPZMHMeshControl & operator=(const TPZMHMeshControl &cp)
int64_t fGlobalSystemSize
number of equations when not condensing anything
void PrintBoundaryInfo(std::ostream &out)
print the indices of the boundary elements and interfaces
void BuildWrapMesh(int dim)
Create the wrap elements.
virtual void Print(std::ostream &out=std::cout) const override
Prints the submesh information on the specified device/file out.
void SetLagrangeMultiplier(unsigned char mult)
Set the connect as a pressure connect or not.
int64_t WhichSubdomain(TPZCompEl *cel)
returns to which subdomain a given element beint64_ts
std::set< int > fMaterialIds
materials used for modeling the differential equation
virtual int64_t NMeshes()=0
void SetLeftRightElements(TPZCompElSide &left, TPZCompElSide &right)
Set neighbors.
int64_t NElements() const
Number of elements of the mesh.
bool fHybridize
flag to indicate whether we create a hybridized mesh
void GetSubElements2(TPZStack< TPZGeoElSide > &subelements)
build the list of element/side pairs which compose the current set of points
Contains the TPZL2Projection class which implements an L2 projection to constant solution values...
Utility class which represents an element with its side. The Geometric approximation classes Geometry...
void DivideBoundarySkeletonElements()
divide the boundary skeleton elements
void DivideSkeletonElements(int ndivide)
divide the skeleton elements
int fpOrderInternal
interpolation order of the internal elements
void DefinePartition(TPZVec< int64_t > &partitionindex, std::map< int64_t, std::pair< int64_t, int64_t > > &skeleton)
Define the partitioning information of the MHM mesh.
int HasSubElement()
Return 1 if the element has subelements along side.
REAL val(STATE &number)
Returns value of the variable.
TPZGeoElSide Neighbour() const
int WrapMaterialId(TPZGeoElSide gelside)
Return the wrap material id (depends on being boundary, neighbour of skeleton or interior.
TPZGeoMesh * Mesh() const
Returns the mesh to which the element belongs.
void SetMaterial(TPZFMatrix< STATE > &xkin, TPZFMatrix< STATE > &xcin, TPZFMatrix< STATE > &xbin, TPZFMatrix< STATE > &xfin)
int fSkeletonWrapMatId
material index of the skeleton wrap
virtual int NSides() const =0
Returns the number of connectivities of the element.
std::map< TPZCompMesh *, TPZManVector< int64_t > > fConnectToSubDomainIdentifier
geometric index of the connects - subdomain where the connect will be internal
virtual void Divide(TPZVec< TPZGeoEl *> &pv)
Divides the element and puts the resulting elements in the vector.
void CreateInternalElements()
will create the internal elements, one coarse element at a time
void TransferToMultiphysics()
transform the computational mesh into a multiphysics mesh
virtual int SideDimension(int side) const =0
Return the dimension of side.
virtual void Resize(const int64_t newsize, const T &object)
Resizes the vector object.
void LoadReferences()
Map this grid in the geometric grid.
virtual void LoadElementReference()
Loads the geometric element reference.
virtual bool IsSkeletonMatid(int matid)
Return true if the material id is related to a skeleton.
void CreateDisconnectedElements(bool create)
Determine if the mesh will be created with disconnected elements After the mesh is created...
static void AddConnects(TPZVec< TPZCompMesh *> &cmeshVec, TPZCompMesh *MFMesh)
It has the declaration of the TPZMultiphysicsCompEl class.
TPZAutoPointer< TPZRefPattern > SideRefPattern(int side)
void SetDefaultOrder(int order)
TPZManVector< int64_t > fGeoToMHMDomain
vector of coarse domain index associated with each geometric element
int fPressureSkeletonMatId
material id associated with the skeleton elements in a hybrid context
This abstract class defines the behaviour which each derived class needs to implement.
static void CreateInterfaces(TPZCompMesh &cmesh, const std::set< int > &MaterialIDs)
Creates the interface elements.
virtual TPZGeoEl * SubElement(int is) const =0
Returns a pointer to the subelement is.
Contains the TPZBndCond class which implements a boundary condition for TPZMaterial objects...
unsigned char LagrangeMultiplier() const
Access method to return the indication whether the connect is associated with a pressure lagrange mul...
void SetAllCreateFunctionsHDiv(int meshdim)
Create an approximation space with HDiv elements.
TPZCompEl * CreateCompEl(TPZGeoEl *gel, int64_t &index)
Create a computational element based on the geometric element.
int64_t size() const
Returns the number of elements of the vector.
int fInternalWrapMatId
material index of the internal wrap
TPZCompEl * Element(int64_t iel)
void AddBoundaryInterfaceElements()
Add the boundary interface elements to the computational mesh.
int fLagrangeMatIdLeft
material id associated with the lagrange multiplier elements
TPZCreateApproximationSpace & ApproxSpace()
virtual void BuildComputationalMesh(bool usersubstructure)
Create all data structures for the computational mesh.
bool fSwitchLagrangeSign
flag to indicate whether the lagrange multipliers should switch signal
void Push(const T object)
Pushes a copy of the object on the stack.
int DecrementNumInterfaces()
Decrement number of TPZInterfaceElement pointing to this.
void PrintDiagnostics(std::ostream &out)
Print diagnostics.
void SetTotalOrderShape()
Set total order shape functions.
virtual void Print(std::ostream &out=std::cout) const
Print the information of the grid to an ostream.
virtual void InsertPeriferalMaterialObjects()
Insert material objects that do not perform any actual computation.
Defines the behaviour of all geometric elements. GeometryTPZGeoEl is the common denominator for all g...
void PrintSubdomain(int64_t elindex, std::ostream &out)
print the diagnostics for a subdomain
TPZGeoEl * Element(int64_t iel)
int64_t Index() const
Returns the index of the element within the element vector of the mesh.
int fBoundaryWrapMatId
material index of the boundary wrap
void SetAllCreateFunctionsDiscontinuous()
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.
void DivideWrap(TPZGeoEl *wrapelement)
Divide the wrap element while it has divided neighbours.
Contains declaration of TPZInterfaceElement class which computes the contribution over an interface b...
TPZCompElSide & LeftElementSide()
Returns left neighbor.
virtual void ExpandSolution()
Adapt the solution vector to new block dimensions.
#define LOGPZ_DEBUG(A, B)
Define log for debug info.
TPZCompMesh * Mesh() const
Return a pointer to the grid of the element.
void AddBoundaryElements()
Add the boundary elements to the computational mesh.
void DefinePartitionbyCoarseIndices(TPZVec< int64_t > &coarseindices)
Define the MHM partition by the coarse element indices.
int Dimension() const
Returns the dimension of the simulation.
Contains the declaration of the TPZBuildmultiphysicsMesh class.
void SetReference(TPZGeoMesh *gmesh)
Sets the geometric reference mesh.
virtual void ComputeNodElCon()
Compute the number of elements connected to each connect object.
void SetReference(int64_t referenceindex)
Contains the declaration of multiphysic interface class.
int NumInterfaces()
Returns number of TPZInterfaceElement pointing to this.
int64_t InternalIndex(int64_t IndexinFather)
return the index in the subcompmesh of a connect with index within the father
void CreateInterfaceElements()
will create the interface elements between the internal elements and the skeleton ...
TPZMaterial * FindMaterial(int id)
Find the material with identity id.
TPZCompEl * Reference() const
Return a pointer to the element referenced by the geometric element.
unsigned int NShape() const
int64_t Rows() const
Returns number of rows.
virtual TPZGeoEl * CreateBCGeoEl(int side, int bc)=0
Method which creates a geometric element on the side of an existing element.
TPZAutoPointer< TPZCompMesh > fCMeshConstantPressure
computational mesh to represent the constant states
TPZAutoPointer< TPZCompMesh > fPressureFineMesh
computational mesh to contain the pressure elements
void SetAllCreateFunctionsContinuous()
Create continuous approximation spaces.
std::map< int64_t, int64_t > fMHMtoSubCMesh
indices of the geometric elements which define the skeleton mesh and their corresponding subcmesh ind...
void Print(std::ostream &out)
print the data structure
TPZCompElSide & RightElementSide()
Returns right neighbor.
int64_t NConnects() const
Number of connects allocated including free nodes.
TPZAdmChunkVector< TPZConnect > & ConnectVec()
Return a reference to the connect pointers vector.
int64_t Index() const
Returns element index of the mesh fELementVec list.
TPZAutoPointer< TPZGeoMesh > fGMesh
geometric mesh used to create the computational mesh
Contains the TPZRefPattern class which defines the topology of the current refinement pattern to a me...
virtual TPZConnect & Connect(int i) const
Returns a pointer to the ith node.
int64_t ConnectIndex(int side=0) const override
Returns the connect index from the element.
void SetDimModel(int dim)
Set de dimension of the domain of the problem.
TPZGeoEl * CreatedElement()
Recovers pointer to the geometric element created.
virtual void CreateSkeletonElements()
will create dim-1 geometric elements on the interfaces between the coarse element indices ...
virtual void SetMultiplier(STATE mult)
void CreateLagrangeMultiplierMesh()
create the lagrange multiplier mesh, one element for each subdomain
std::map< int,TPZMaterial *> & MaterialVec()
Returns a reference to the material pointers vector.
void ConnectedCompElementList(TPZStack< TPZCompElSide > &elsidevec, int onlyinterpolated, int removeduplicates)
Returns all connected computational elements to the current element if onlyinterpolated == 1 only e...
virtual int64_t ConnectIndex(int i) const =0
Returns the index of the ith connectivity of the element.
Computes the contribution over an interface between two discontinuous elements. Computational Element...
virtual int HasSubElement() const =0
Return 1 if the element has subelements.
Implements the interfaces for TPZCompElDisc, TPZInterfaceElement and TPZInterpolatedElement. Computational element.
void ConnectedElements(int64_t skeleton, std::pair< int64_t, int64_t > &leftright, std::map< int64_t, std::list< TPZCompElSide > > &ellist)
identify connected elements to the skeleton elements
virtual void HybridizeSkeleton(int skeletonmatid, int pressurematid)
virtual int NConnects() const =0
Returns the number of nodes of the element.
TPZGeoEl * Element() const
Structure to help the construction of geometric elements along side of a given geometric element...
int fNState
number of state variables
void SetCreateLagrange(bool flag)
class oriented towards the creation of multiscale hybrid meshes - YES
virtual TPZBndCond * CreateBC(TPZMaterial *reference, int id, int typ, TPZFMatrix< STATE > &val1, TPZFMatrix< STATE > &val2)
Creates an object TPZBndCond derived of TPZMaterial.
virtual void SetSideOrient(int side, int sideorient)
It set the normal orientation of the element by the side. Only side that has dimension equal to my di...
Contains declaration of TPZSubCompMesh class which implements a group of computational elements as a ...
void SetSubdomain(TPZCompEl *cel, int64_t subdomain)
associates the connects of an element with a subdomain
int InsertMaterialObject(TPZMaterial *mat)
Insert a material object in the datastructure.
static void SetTotalOrderShape(TPZCompMesh *cmesh)
Set total order shape functions for all Discontinuous elements in cmesh.
T Pop()
Retrieve an object from the stack.
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.
Contains the TPZMat1dLin class which implements a one-dimensional linear problem. ...
TPZCompEl * CreateCompEl(TPZGeoEl *gel, TPZCompMesh &mesh, int64_t &index) const
Create a computational element using the function pointer for the topology.
int Dimension()
Get Dimension.
int64_t fGlobalSystemWithLocalCondensationSize
number of equations considering local condensation
TPZGeoEl * Reference() const
Return a pointer to the corresponding geometric element if such exists, return 0 otherwise.
TPZCompEl * LeftElement() const
Returns the left element from the element interface.
TPZCompElSide Reference() const
Returns a pointer to the elementside referenced by the geometric elementside.
virtual REAL SideArea(int side)
Returns the area from the face.
This class implements a geometric mesh for the pz environment. Geometry.
MProblemType fProblemType
Variable defining the type of problem.
virtual int64_t ConnectIndex(int i) const override
Returns the connection index i.
This class implements a stack object. Utility.
int Dimension() const
the dimension associated with the element/side
void ResetReference()
Reset the element referenced by the geometric element to NULL.
Computes the contribution over an interface between two discontinuous elements. Computational Element...
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.
int NElConnected() const
Returns fNElConnected.
TPZCompMesh * CriaMalhaTemporaria()
will create a computational mesh using the coarse element indexes and its interface elements ...
void SetMaterialId(int id)
Sets the material index of the element.
void CreateWrap(TPZGeoElSide gelside)
CreateWrapMesh of a given material id.
virtual void SetRefPattern(TPZAutoPointer< TPZRefPattern >)
Defines the refinement pattern. It's used only in TPZGeoElRefPattern objects.
int Side() const
Returns the side index.
TPZCompEl * RightElement() const
Returns the right element from the element interface.
int fpOrderSkeleton
interpolation order of the skeleton elements
void SetAnalysisSkyline(int numThreads, int preconditioned, TPZAutoPointer< TPZGuiInterface > guiInterface)
Condense the internal equations using a skyline symetric matrix the preconditioned argument indicates...
This class implements a discontinuous element (for use with discontinuous Galerkin). Computational Element.
int64_t fNumeq
number of equations of the global system
void JoinSubdomains(TPZVec< TPZCompMesh *> &meshvec, TPZCompMesh *multiphysicsmesh)
Subdomains are identified by computational mesh, this method will join.
void InitializeBlock()
Resequence the block object, remove unconnected connect objects and reset the dimension of the soluti...
Implements a one dimensional linear problem.
std::map< int64_t, std::pair< int64_t, int64_t > > fInterfaces
indices of the skeleton elements and their left/right partition indexes
void ResetReference()
Resets all load references in elements and nodes.
Defines the interface of a computational element. Computational Element.
void SetAllCreateFunctionsMultiphysicElem()
virtual int NSubElements() const =0
Returns the number of subelements of the element independent of the fact whether the element has alr...
TPZGeoEl * Father() const
Computes the normal vectors needed for forming HDiv vector valued shape functions.
int HasWrapNeighbour(TPZGeoElSide gelside)
Verify if the element side contains a wrap neighbour.
TPZFMatrix< STATE > & Solution()
Access the solution vector.
void SubStructure()
substructure the mesh
Non abstract class which implements full matrices with preallocated storage with (N+1) entries...
Implements an L2 projection to constant solution values.
virtual void Print(std::ostream &out=std::cout) const
Prints mesh data.
TPZAdmChunkVector< TPZGeoEl * > & ElementVec()
Methods for handling pzlists.
virtual ~TPZMHMeshControl()
virtual int NConnects() const override
Returns the number of connections.