8 #include <__functional_base> 20 #include "log4cxx/helpers/objectptr.h" 21 #include "log4cxx/logger.h" 22 #include "log4cxx/propertyconfigurator.h" 57 static LoggerPtr logger(Logger::getLogger(
"pz.mesh.tpzcompmesh"));
58 static LoggerPtr aloclogger(Logger::getLogger(
"pz.allocate"));
65 fConnectVec(0),fMaterialVec(),
69 if (aloclogger->isDebugEnabled()) {
70 std::stringstream sout;
71 sout <<
"Allocate TPZCompMesh this = " << (
void *)
this;
105 if (aloclogger->isDebugEnabled()) {
106 std::stringstream sout;
107 sout <<
"Allocate TPZCompMesh this = " << (
void *)
this;
126 SetName(
"Computational mesh");
137 if (aloclogger->isDebugEnabled()) {
138 std::stringstream sout;
139 sout <<
"Delete TPZCompMesh this = " << (
void *)
this;
145 if (logger->isDebugEnabled()) {
146 std::stringstream sout;
173 for(i=0; i<nelem; i++){
183 for(i=0; i<nelem; i++){
192 for(i=0; i<nelem; i++){
201 for(i=0; i<nelem; i++){
210 for(i=0; i<nelem; i++) {
221 std::map<int, TPZMaterial *>::iterator it;
239 out <<
"\n\t\tCOMPUTABLE GRID INFORMATIONS:\n\n";
240 out <<
"TITLE-> " <<
fName <<
"\n\n";
242 out <<
"number of connects = " <<
NConnects() << std::endl;
243 out <<
"number of elements = " <<
NElements() << std::endl;
244 out <<
"number of materials = " <<
NMaterials() << std::endl;
245 out <<
"dimension of the mesh = " << this->
Dimension() << std::endl;
247 out <<
"\n\t Connect Information:\n\n";
249 for(i=0; i<nelem; i++) {
252 cout <<
" TPZCompMesh::Print inconsistency of connect\n";
253 cout <<
" Index " << i <<
' ';
258 out <<
" Index " << i <<
' ';
261 out <<
"\n\t Computable Element Information:\n\n";
263 for(i=0; i<nelem; i++) {
266 out <<
"\n Index " << i <<
' ';
271 out <<
"\tReference Index = " << el->
Reference()->
Index() << std::endl << std::endl;
274 out <<
"\n\t Material Information:\n\n";
275 std::map<int, TPZMaterial * >::const_iterator mit;
289 int matid = mat->
Id();
299 std::map<int, TPZMaterial * >::iterator mit;
303 result = mit->second;
338 int64_t neltocreate = 0;
340 for(int64_t i=0; i<nelem; i++) {
355 for(int64_t i = 0; i < ncont; i++){
372 int64_t ndisc = discontinuous.
NElements();
373 for(int64_t i = 0; i < ndisc; i++){
425 for(ic=0; ic<cols; ic++) {
426 for(ibl = 0;ibl<minblocks;ibl++) {
431 int64_t minsize = (oldsize < newsize) ? oldsize : newsize;
433 for(ieq=0; ieq<minsize; ieq++) {
434 fSolution(newposition+ieq,ic) = OldSolution(oldposition+ieq,ic);
443 int64_t nrow = mat.
Rows();
444 int64_t ncol = mat.
Cols();
462 for(i=0; i<nelem; i++) {
473 for (int64_t iel = 0; iel < nel; iel++) {
487 for(i=0; i<nelem; i++) {
501 int64_t ndepblocks = 0, nvalidblocks = 0, nremoved = 0, ncondensed = 0;
502 for (i=0;i<nconnects;i++)
515 for (i=0;i<nconnects;i++) {
519 PZError <<
"TPZCompMesh::CleanUpUnconnectedNodes node has dependency\n";
543 int64_t idepblocks = 0, iremovedblocks= 0, icondensed = 0;
546 for(i=0; i<nconnects; i++) {
552 permute[seq] = nvalidblocks+ndepblocks+iremovedblocks+ncondensed;
561 permute[seq] = nvalidblocks+ncondensed+idepblocks;
567 permute[seq] = nvalidblocks+icondensed;
573 for(i=1; i<nblocks; i++) down[i] += down[i-1];
574 for(i=0; i<nblocks; i++)
578 permute[i] = i-down[i];
584 if (logger->isDebugEnabled())
586 std::stringstream sout;
587 sout <<
"permute to put the free connects to the back\n";
590 sout <<
"original sequence numbers|nelconected\n";
592 for (int64_t el=0; el<nel; el++) {
600 for (i=0;i<nblocks;i++) sout << permute[i] <<
' ';
603 sout <<
"need = " << need << endl;
610 std::set<int64_t> check;
611 nconnects = permute.NElements();
612 for(i=0; i<nconnects; i++) check.insert(permute[i]);
613 if(static_cast<int>(check.size()) != nconnects)
615 cout << __PRETTY_FUNCTION__ <<
" The permutation vector is not a permutation!\n" << permute << endl;
622 if (logger->isDebugEnabled() && nblocks < 50)
626 std::stringstream sout;
627 sout <<
"after permute sequence numbers|nelconected\n";
629 for (int64_t el=0; el<nel; el++) {
640 for (int64_t i=0;i<nel;i++) {
654 for (int64_t el=0; el<nel; el++) {
657 if (seqnum > nblocks-nremoved) {
671 for(i=0; i<nelem; i++) {
683 for(i=0; i<nelem; i++) {
689 for (int64_t in=0; in<numnod; ++in) {
690 int64_t dfnindex = nodelist[in];
700 nelconnected.
Resize(nelem);
701 nelconnected.
Fill(0);
707 for(i=0; i<nelem; i++) {
713 for (int64_t in=0; in<numnod; ++in) {
714 int64_t dfnindex = nodelist[in];
715 nelconnected[dfnindex]++;
724 for(i=0; i<ncon; i++) {
736 if (blsize != dofsize) {
755 for(i=0; i<nelem; i++) {
763 int64_t ifirstnode = 0;
771 for(int64_t n=ifirstnode;n<nnod;n++) {
778 loweq = (loweq > leq) ? leq : loweq;
779 higheq = (higheq < heq) ? heq : higheq;
781 int64_t elbw = higheq - loweq;
782 bw = (bw < elbw) ? elbw : bw;
795 int maxSequenceNumberIndependentConnect = 0;
797 for (
int i = 0; i < connectVec.
NElements(); i++) {
798 if (connectVec[i].HasDependency() ){
799 int oldSize = depConInd.
size();
800 depConInd.
Resize( oldSize + 1 );
801 depConInd[oldSize] = i;
804 if (connectVec[i].SequenceNumber() > maxSequenceNumberIndependentConnect && !connectVec[i].IsCondensed())
806 maxSequenceNumberIndependentConnect = connectVec[i].SequenceNumber();
809 for (
int i = 0; i < depConInd.
size(); i++) {
810 if (connectVec[ depConInd[i] ].SequenceNumber() < maxSequenceNumberIndependentConnect ) {
812 std::cout<<
"A connect that has dependency has " 813 <<
"a sequency number smaller than an independent connect. " 814 <<
"have you tried this->CleanUpUnconnectedNodes() after " 815 <<
"building the computational mesh?"<<std::endl;
829 for(i=0; i<neq; i++) skyline[i] = i;
830 for(i=0; i<nelem; i++) {
839 int64_t ifirstnode = 0;
843 if (ifirstnode == nnod) {
851 for(n=ifirstnode;n<nnod;n++) {
862 loweq = (loweq > leq) ? leq : loweq;
863 higheq = (higheq < heq) ? heq : higheq;
867 for(n=ifirstnode;n<nnod;n++) {
873 for(l=leq;l<heq;l++) {
874 skyline[l] = skyline[l] < loweq ? skyline[l] : loweq;
893 PZError <<
"TPZCompMesh::BuildTransferMatrix, no material object found\n";
906 for(i=0; i<nelem; i++) {
909 if(!finecel)
continue;
910 if(finecel->
Dimension() != dim)
continue;
914 cout <<
"TPZCompMesh::BuildTransferMatrix is not implemented for super elements\n";
918 while(coarsegel && !coarsegel->
Reference()) {
919 coarsegel = coarsegel->
Father();
922 cout <<
"TPZCompMesh::BuildTransferMatrix corresponding coarse element not found\n";
923 finecel->
Print(cout);
928 if(!coarsel)
continue;
930 if(coarsel->
Mesh() != &coarsemesh) {
931 cout <<
"TPZCompMesh::BuildTransferMatrix is not implemented for transfers" 932 " between superelements\n";
954 PZError <<
"TPZCompMesh::BuildTransferMatrixDesc no material object found\n";
963 transfer.
SetBlocks(localblock,transferblock,nvar,ncon,coarncon);
971 for(i=0; i<nelem; i++) {
976 PZError <<
"TPZCompMesh::BuildTransferMatrixDesc mesh agglomerated" 977 <<
" with element of volume not agglomerated\n";
991 PZError <<
"TPZCompMesh::BuildTransferMatrixDesc index with null" 996 PZError <<
"TPZCompMesh::BuildTransferMatrixDesc index of not" 997 <<
" discontinous element\n";
1083 for(i=0; i<ncon; i++) {
1086 NIndependentConnects++;
1093 std::set<int> mat_ids;
1095 mat_ids.insert(item.first);
1105 elgraphindex.
Resize(nelem+1);
1106 elgraphindex[0] = 0;
1110 for(i=0; i<nelem; i++) {
1113 bool has_material_Q =
true;
1117 if(!el || !has_material_Q){
1118 elgraphindex[curel+1]=elgraph.
NElements();
1129 for(in=0; in<ncon; in++) {
1130 int ic = connectstack[in];
1140 elgraphindex[curel+1]=elgraph.
NElements();
1143 elgraphindex.
Resize(curel+1);
1150 PZError <<
"TPZCompMesh::Divide element not found index = " << index << endl;
1154 if(index != el->
Index()){
1155 PZError <<
"TPZCompMesh::Divide - element->Index() != index " << endl;
1161 el->
Divide(index,subindex,interpolate);
1166 const int64_t nelem = elements.
NElements();
1186 for(i=1;i<nelem;i++) {
1193 if(!father2 || father != father2) {
1201 cout <<
"TPZCompEl::Coarsen : incomplete list of elements sons\n";
1204 for(i=0; i<nelem; i++) {
1217 for(i=0; i<nelem; i++) {
1219 if (cel)
delete cel;
1250 LOGPZ_FATAL(logger,
"Computational element without reference");
1264 LOGPZ_FATAL(logger,
"New created element is not an interpolated element as requested.");
1268 LOGPZ_FATAL(logger,
"New created element is not referenced by geometric element");
1272 LOGPZ_FATAL(logger,
"New created element is not the same as referenced by geometric element");
1285 for(int64_t i = 0; i < n; i++){
1287 if (!disc)
continue;
1294 for(int64_t i = 0; i < n; i++){
1300 PZError << __PRETTY_FUNCTION__ <<
" - At this point no TPZInterfaceElement may exist.\n";
1307 for(int64_t i = 0; i < n; i++){
1309 if (!disc)
continue;
1328 if(logger->isDebugEnabled())
1330 std::stringstream sout;
1333 sout <<
"Index = " << submesh->
Index() <<
" ";
1335 sout <<
"Permutation " << permute;
1336 std::set<int64_t> permset;
1337 if (permute.size() != 0) {
1338 permset.insert(&permute[0],(&permute[permute.size()-1]+1));
1340 sout <<
" permute size " << permute.
size() <<
" no dist elements " << permset.size();
1345 int64_t permutenel = permute.
NElements();
1354 if(i < permutenel) {
1365 for(i=0; i<ncon; i++) {
1368 if(seqnum == -1)
continue;
1375 out <<
"\n\t\tCONNECT INDEX SOLUTION:\n\n";
1378 for(i=0; i<ncon; i++) {
1383 out <<
"free node" << endl;
1384 }
else if (seqnum < 0 ||
Block().
Size(seqnum)==0) {
1385 out <<
"non solution connect" << endl;
1388 for(int64_t j=0;j<
Block().
Size(seqnum);j++)
1401 true_error.
Fill(0.);
1409 if(!cel || cel->
Material()->
Id() < 0)
continue;
1412 int64_t nerrors = true_error.
NElements();
1413 errorSum.
Resize(nerrors,0.);
1414 for(int64_t ii = 0; ii < nerrors; ii++)
1415 errorSum[ii] += true_error[ii]*true_error[ii];
1419 for(int64_t ii = 0; ii < nerrors; ii++)
1420 errorSum[ii] =
sqrt(errorSum[ii]);
1430 for(el=0; el<nel; el++) {
1434 if(!elp || !dynamic_cast<TPZInterpolatedElement*>(elp) )
continue;
1444 for(is=nc; is<nsides; is++) {
1457 while(fatherside.
Exists()) {
1459 fatherside = fatherside.
Father2();
1463 if(fatherside.
Exists()) {
1465 if(logger->isDebugEnabled())
1467 std::stringstream sout;
1468 sout <<
"Dividing element " << el <<
" of type " << elp->
Reference()->
TypeName();
1478 if(is == nsides-1) {
1480 if(!elpint)
continue;
1488 int eqside = elvec[eq].Side();
1490 if(maxorder < eqel->PreferredSideOrder(eqside)) maxorder = eqel->
PreferredSideOrder(eqside);
1493 if(porder < maxorder) {
1495 if(logger->isDebugEnabled())
1497 std::stringstream sout;
1498 sout <<
"Refining element " << el <<
" to order " << maxorder;
1513 if (super !=
this)
return -1;
1518 if (super !=
this)
return -1;
1519 else return superind;
1535 cout <<
"TPZCompMesh::SetElementSolution size of the vector doesn't match\n";
1539 if(logger->isDebugEnabled())
1541 std::stringstream sout;
1543 for (int64_t ii=0; ii<sol.
size(); ii++) {
1547 sout <<
"Norma da solucao " << i <<
" norma " << norm;
1553 for(el=0; el<nel; el++) {
1562 for (i=0; i<nel; i++){
1568 grpatch.insert(gel);
1591 renum.NodeToElGraph(elgraph,elgraphindex,nodtoelgraph, nodtoelgraphindex);
1603 std::set<int64_t > elconmap;
1605 for (i= elgraphindex[elind]; i<elgraphindex[elind+1];i++){
1606 int64_t node = elgraph[i];
1607 for (j = nodtoelgraphindex[node]; j<nodtoelgraphindex[node+1]; j++){
1608 elconmap.insert(nodtoelgraph[j]);
1615 set<int64_t >::iterator iter = elconmap.begin();
1616 while(iter!=elconmap.end()){
1631 if (aloclogger->isDebugEnabled()) {
1632 std::stringstream sout;
1633 sout <<
"Allocate TPZCompMesh this = " << (
void *)
this;
1646 for(iel = 0; iel<nel; iel++)
fElementVec[iel] = 0;
1647 for(iel = 0; iel<nel; iel++) {
1649 if(cel && !dynamic_cast<TPZInterfaceElement* >(cel) )
1700 for(iel = 0; iel<nel; iel++)
fElementVec[iel] =
nullptr;
1701 for(iel = 0; iel<nel; iel++) {
1703 if(cel && !dynamic_cast<TPZInterfaceElement* >(cel) )
1708 for(iel = 0; iel<nel; iel++)
1711 if(cel && dynamic_cast<TPZInterfaceElement* >(cel) ) cel->
Clone(*
this);
1799 std::map<int, TPZMaterial * >::const_iterator mit;
1802 if(!dynamic_cast<TPZBndCond *> (mit->second)) mit->second->Clone(mesh.
fMaterialVec);
1805 if(dynamic_cast<TPZBndCond *> (mit->second)) mit->second->Clone(mesh.
fMaterialVec);
1813 if(nel == 0) cout <<
"\nTPZCompMesh::DeltaX no elements\n";
1814 REAL maxdist = 0.0,
dist=0.0;
1824 point0[j] = node0->
Coord(j);
1825 point1[j] = node1->
Coord(j);
1836 if(nel == 0) cout <<
"\nTPZCompMesh::MaximumRadiusOfMesh no elements\n";
1837 REAL maxdist = 0.0,
dist=0.0;
1852 if(nel == 0) cout <<
"\nTPZCompMesh::MaximumRadiusOfMesh no elements\n";
1853 REAL mindist =10000.0,
dist=0.0;
1857 int type = com->
Type();
1872 int64_t divider = nequations/resolution;
1873 if(divider*resolution != nequations) divider++;
1874 REAL factor = 1./(divider*divider);
1875 fillin.
Redim(resolution,resolution);
1880 renum.
ConvertGraph(graphel,graphelindex,graphnode,graphnodeindex);
1881 std::map<int64_t,TPZConnect *> seqtoconnect;
1883 for(ic=0; ic<ncon; ic++) {
1889 for(iseqnum = 0; iseqnum < graphnodeindex.
NElements()-1; iseqnum++) {
1890 if(!seqtoconnect.count(iseqnum))
continue;
1892 int64_t lastieq =
Block().
Size(iseqnum)+firstieq;
1893 int64_t firstnode = graphnodeindex[iseqnum];
1894 int64_t lastnode = graphnodeindex[iseqnum+1];
1897 for(ieq=firstieq; ieq<lastieq; ieq++) {
1898 int64_t rowp = ieq/divider;
1900 for(ieq2=firstieq; ieq2<lastieq; ieq2++) {
1901 int64_t rowp2 = ieq2/divider;
1902 fillin(rowp,rowp2) += factor;
1907 for(in=firstnode; in<lastnode; in++) {
1908 int64_t jseqnum = graphnode[in];
1910 int64_t lastjeq =
Block().
Size(jseqnum)+firstjeq;
1912 for(ieq=firstieq; ieq<lastieq; ieq++) {
1913 int64_t rowp = ieq/divider;
1915 for(jeq=firstjeq; jeq<lastjeq; jeq++) {
1916 int64_t colp = jeq/divider;
1917 fillin(rowp,colp) += factor;
1932 projectsol.
Redim(neq,1);
1936 PZError <<
"TPZCompMesh::BuildTransferMatrixDesc2 no material object found\n";
1942 #ifdef STATE_COMPLEX 1952 for(int64_t i=0; i<nelem; i++) {
1957 PZError <<
"TPZCompMesh::BuildTransferMatrixDesc2 mesh agglomerated" 1958 <<
" with element of volume not agglomerated\n";
1970 return Hash(
"TPZCompMesh");
1981 std::map<int, TPZMaterial*> internal_materials;
1982 std::map<int, TPZMaterial*> boundary_materials;
1984 if (dynamic_cast<TPZBndCond*>(mat_pair.second)){
1985 boundary_materials.insert(mat_pair);
1987 internal_materials.insert(mat_pair);
2053 const int64_t nelements = this->
NElements();
2054 celJumps.
Resize(nelements);
2060 for(int64_t i = 0; i < nelements; i++){
2074 LOGPZ_FATAL(logger,
"inconsistent data structure");
2078 LOGPZ_FATAL(logger,
"inconsistent data structure");
2083 STATE jumpNorm = 0.;
2084 for (int64_t is=0; is<numbersol; is++) {
2085 for(int64_t ij = 0; ij < facejump.
NElements(); ij++){
2086 jumpNorm += facejump[is][ij]*facejump[is][ij];
2089 jumpNorm =
sqrt(jumpNorm);
2091 celJumps[leftel] += jumpNorm;
2092 celJumps[rightel] += jumpNorm;
2095 for(int64_t i = 0; i < nelements; i++){
2096 if (!AllCels[i])
continue;
2098 if (!disc)
continue;
2100 const STATE celJumpError = celJumps[i];
2102 if (
abs(celJumpError) < eps){
2115 const int64_t nelem = this->
NElements();
2119 estimator.
Resize(nelem, 7);
2121 for(iel=0; iel < nelem; iel++) {
2126 errorL.Fill(0.); errorR.
Fill(0.);
2128 int64_t n = errorL.NElements();
2133 for(i = 0; i < errorL.NElements()-1; i++) {
2136 for(i = 0; i < errorR.
NElements()-1; i++){
2146 for(i = 0; i < locerror.
NElements()-1; i++){
2147 estimator(iel, i) += locerror[i];
2153 for(iel=0; iel < nelem; iel++) {
2154 if(
fabs(estimator(iel,5))>=0.0000001){
2155 estimator(iel,6) = estimator(iel,2)/estimator(iel,5) ;
2165 std::map<int,int> variableids;
2168 std::map<int,TPZMaterial *>::iterator itmap;
2170 if (matids.find(itmap->first) != matids.end()) {
2174 if (varindex == -1 && bndcond) {
2178 if (varindex == -1) {
2181 variableids[itmap->first] = varindex;
2184 if(nvars && nvars != nvarnew)
2193 for (int64_t el=0; el<nelem; el++) {
2202 if (locres.
size() == nvars) {
2203 for (
int iv = 0; iv<nvars; iv++) {
2204 result[iv] += locres[iv];
2207 else if(locres.
size())
2215 if (matids.find(matid) == matids.end()) {
2220 if (locres.
size() != nvars) {
2223 for (
int iv=0; iv<nvars; iv++)
2225 result[iv] += locres[iv];
2317 int64_t eqkeep = permutegather[eqsmall];
2318 for (int64_t eq = eqsmall; eq< eqlarge; eq++) {
2319 permutegather[eq] = permutegather[eq+1];
2321 permutegather[eqlarge] = eqkeep;
2322 for (int64_t eq = eqsmall; eq<= eqlarge; eq++) {
2323 permutescatter[permutegather[eq]] = eq;
2332 permutegather.
Resize(numinternalconnects,0);
2333 permutescatter.
Resize(numinternalconnects,0);
2334 for (int64_t i=0; i<numinternalconnects; i++) {
2335 permutegather[i] = i;
2336 permutescatter[i] = i;
2340 if (numconnects==0) {
2343 int minlagrange = 0;
2344 int maxlagrange = 0;
2345 for (int64_t ic=0; ic<numconnects; ic++) {
2355 for (
int ic=0; ic<numconnects; ic++) {
2359 minlagrange =
Min(lagrange, minlagrange);
2360 maxlagrange =
Max(lagrange,maxlagrange);
2364 for (
int lagr = minlagrange+1; lagr <= maxlagrange; lagr++)
2366 for (int64_t el = 0; el<nel ; el++) {
2377 if(logger->isDebugEnabled())
2379 std::stringstream sout;
2380 sout <<
"el " << el <<
" Before renumbering : ";
2381 for (
int ic=0; ic<nc; ic++) {
2392 int64_t maxseq = -1;
2393 for (
int ic=0; ic<nc ; ic++) {
2403 std::set<int64_t> seteq;
2404 for (
int ic=0; ic<nc; ic++) {
2419 std::set<int64_t>::reverse_iterator it;
2421 for (it = seteq.rbegin(); it != seteq.rend(); it++) {
2424 if (logger->isDebugEnabled()) {
2425 std::stringstream sout;
2426 sout <<
"Switch ceq = " << eq <<
" with maxeq = " << maxseq-count;
2432 switchEq(eq, maxseq-count, permutegather, permutescatter);
2437 for (int64_t i=0; i<numinternalconnects; i++) {
2438 if (permutescatter[permutegather[i]] != i) {
2439 std::cout <<
"permutegather " << permutegather << std::endl;
2440 std::cout <<
"permutescatter " << permutescatter << std::endl;
2446 for (
int ic=0; ic<nc ; ic++) {
2456 for (
int ic=0; ic<nc; ic++) {
2469 if(logger->isDebugEnabled())
2471 std::stringstream sout;
2472 sout <<
"el " << el <<
" After renumbering : ";
2473 for (
int ic=0; ic<nc; ic++) {
2487 if (logger->isDebugEnabled())
2489 std::stringstream sout;
2490 sout <<
"Saddle permute new permutation ";
2491 for (
int i = 0; i< permutescatter.
size(); i++) {
2492 int64_t jmax = i+10;
2493 if (jmax > permutescatter.
size()) {
2494 jmax = permutescatter.
size();
2496 for (int64_t j=i; j< jmax; j++) {
2497 sout << permutescatter[j] <<
' ';
2510 if (logger->isDebugEnabled()) {
2511 LOGPZ_DEBUG(logger,
"******************* AFTER PERMUTATION **************************")
2515 for (int64_t i=0L; i<numinternalconnects; i++) {
2516 permutegather[i] = i;
2517 permutescatter[i] = i;
2519 for (int64_t el = 0L; el<nel ; el++) {
2529 if(logger->isDebugEnabled())
2531 std::stringstream sout;
2532 sout <<
"el " << el <<
" Final numbering : ";
2533 for (
int ic=0; ic<nc; ic++) {
2545 int maxlagrange = c0.LagrangeMultiplier();
2546 for (
int ic=0; ic<nc; ic++) {
2550 minlagrange =
Min(lagrange, minlagrange);
2551 maxlagrange =
Max(lagrange,maxlagrange);
2553 for (
int lagr = minlagrange+1; lagr <= maxlagrange; lagr++) {
2555 int64_t maxseq = -1;
2556 for (
int ic=0; ic<nc ; ic++) {
2566 for (
int ic=0; ic<nc; ic++) {
2574 cel->
Print(std::cout);
2575 for (
int iic=0; iic<nc; iic++) {
2577 std::cout <<
"Destination seqnum " << permutegather[cel->
Connect(iic).
SequenceNumber()] << std::endl;
2592 permute.
Resize(numinternalconnects,0);
2593 for (int64_t i=0L; i<numinternalconnects; i++) {
2597 for (int64_t el = 0L; el<nel ; el++) {
2602 unsigned char minlagrange = 255, maxlagrange = 0;
2604 for (
int ic=0; ic<nc; ic++) {
2608 if (seqnum >= numinternalconnects) {
2612 if (lagrange < minlagrange) {
2613 minlagrange = lagrange;
2615 if (lagrange > maxlagrange) {
2616 maxlagrange = lagrange;
2619 for (
unsigned char lagrange = minlagrange+1; lagrange <= maxlagrange; lagrange++) {
2621 for (
int ic=0; ic<nc ; ic++) {
2628 if(maxeq < permute[origeq])
2630 maxeq = permute[origeq];
2637 std::set<int64_t> lagrangeseqnum;
2638 for (
int ic=nc-1; ic>=0 ; ic--) {
2642 if (ceqnum >= numinternalconnects) {
2645 int64_t ceq = permute[ceqnum];
2646 if (clagrange == lagrange && ceq < maxeq) {
2647 lagrangeseqnum.insert(ceqnum);
2650 std::set<int64_t>::reverse_iterator it;
2652 for (it = lagrangeseqnum.rbegin(); it != lagrangeseqnum.rend(); it++) {
2653 int64_t ceq = permute[*it];
2656 if(logger->isDebugEnabled())
2658 std::stringstream sout;
2659 sout <<
"Switch ceq = " << ceq <<
" with maxeq = " << maxeq-count;
2667 if(logger->isDebugEnabled())
2669 std::stringstream sout;
2670 sout <<
"Resequence for element " << el << std::endl;
2671 for (
int ic=0; ic<nc; ic++) {
2673 c.
Print(*
this,sout);
2675 sout <<
"New seqnum = " << permute[c.
SequenceNumber()] << std::endl;
2679 sout <<
"Connect with restraint, seqnum " << c.
SequenceNumber() << std::endl;
2688 if(logger->isDebugEnabled())
2690 for (int64_t el=0L; el<nel; el++) {
2696 std::stringstream sout;
2697 sout <<
"Resequence for element " << el << std::endl;
2698 for (
int ic=0; ic<nc; ic++) {
2700 c.
Print(*
this,sout);
2702 sout <<
"New seqnum = " << permute[c.
SequenceNumber()] << std::endl;
2710 if (logger->isDebugEnabled())
2712 std::stringstream sout;
2713 sout <<
"Saddle permute old permutation ";
2714 for (
int i = 0; i< permute.
size(); i++) {
2715 int64_t jmax = i+10;
2716 if (jmax > permute.
size()) {
2717 jmax = permute.
size();
2719 for (int64_t j=i; j< jmax; j++) {
2720 sout << permute[j] <<
' ';
2735 int64_t neq = permute.
size();
2737 if (lagrangeq < 0 || lagrangeq >= neq || maxeq < 0 || maxeq >= neq) {
2744 for (int64_t i=0; i<neq; i++) {
2748 int64_t lagrangeqindex = lagrangeq;
2751 if (accpermute[lagrangeqindex] > lagrangeq) {
2755 accpermute[lagrangeqindex] = maxeq;
2756 int64_t index = lagrangeqindex+1;
2757 while (index < neq && (accpermute[index] <= maxeq || accpermute[index] < index)) {
2758 accpermute[index] = accpermute[index]-1;
2761 for (int64_t i=0; i<neq; i++) {
2762 permute[i] = accpermute[input[i]];
2767 std::set<int64_t> acc;
2768 for (int64_t i=0; i<neq; i++) {
2769 acc.insert(permute[i]);
2771 if (acc.size() != neq) {
2772 std::cout <<
"input " << input << std::endl;
2773 std::cout <<
"accpermute " << accpermute << std::endl;
2774 std::cout <<
"permute " << permute << std::endl;
2785 for (int64_t el=0; el<nel ; el++) {
2797 int64_t pos1=0, pos2, comind;
2803 father = s1[pos1]->FatherMesh();
2811 father = s2[pos2]->FatherMesh();
2813 if (s1[pos1] != s2[pos2])
return 0;
2815 for (; pos1>=0 && pos2>=0; pos1--, pos2--) {
2816 if((s1[pos1])!=(s2[pos2])) {
2818 return (s1[comind]);
2821 return (pos1 >=0 ) ? (s1[pos1+1]) : s2[pos2+1];
2835 for(int64_t el = 0; el<nel; el++)
int64_t NElements() const
Number of computational elements allocated.
virtual TPZVec< STATE > IntegrateSolution(int var) const
Compute the integral of a variable.
TPZGeoMesh * Reference() const
Returns a pointer to the geometrical mesh associated.
void SetAllCreateFunctionsDiscontinuous()
Create discontinuous approximation spaces.
Contains TPZShapeTetra class which implements the shape functions of a tetrahedral element...
This class performs a series of consistency tests on geometric transformations between elements...
expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ fabs
void SetElementSolution(int64_t i, TPZVec< STATE > &sol)
Set a ith element solution, expanding the element-solution matrix if necessary.
virtual TPZCompMesh * FatherMesh() const
Get the father meshes stack.
void AdjustBoundaryElements()
Will refine the elements associated with a boundary condition till there are no elements constrained ...
void CreateInterfaces(bool BetweenContinuous=false)
Create interfaces between this and its neighbours.
virtual void BuildCornerConnectList(std::set< int64_t > &connectindexes) const =0
adds the connect indexes associated with base shape functions to the set
TPZCompMesh * Reference() const
Returns the currently loaded computational grid.
int Position(const int block_diagonal) const
Returns the position of first element block dependent on matrix diagonal.
void IncrementElConnected()
Increment fNElConnected.
void SetElementGraph(TPZVec< int64_t > &elgraph, TPZVec< int64_t > &elgraphindex)
This method declares the element graph to the object.
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.
void SetName(const std::string &nm)
Set the mesh name.
Contains declaration of TPZGeoElSide class which represents an element and its side, and TPZGeoElSideIndex class which represents an TPZGeoElSide index.
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.
Contains declaration of TPZGeoElRefLess class which implements the mapping between the master element...
TPZFMatrix< STATE > fSolution
Solution vector.
int MaterialId() const
Returns the material index 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...
TPZAdmChunkVector< TPZCompEl * > fElementVec
List of pointers to elements.
virtual void EvaluateError(std::function< void(const TPZVec< REAL > &loc, TPZVec< STATE > &val, TPZFMatrix< STATE > &deriv)> func, TPZVec< REAL > &errors, bool store_error)
Performs an error estimate on the elemen.
Implements renumbering for elements of a mesh. Utility.
void ConvertGraph(TPZVec< int64_t > &elgraph, TPZVec< int64_t > &elgraphindex, TPZManVector< int64_t > &nodegraph, TPZManVector< int64_t > &nodegraphindex)
Will convert an element graph defined by elgraph and elgraphindex into a node graph defined by nodegr...
Contains declaration of TPZGeoNode class which defines a geometrical node.
REAL Coord(int i) const
Returns i-th coordinate of the current node.
int64_t NEquations()
This computes the number of equations associated with non-restrained nodes.
void ConvertDiscontinuous2Continuous(REAL eps, int opt, int dim, TPZVec< STATE > &celJumps)
This method compute the jump solution of interface and convert discontinuous elements with jump less ...
int64_t NIndependentConnects()
Number of independent connect objects.
void ProjectSolution(TPZFMatrix< STATE > &projectsol)
void SaddlePermute()
Put the sequence number of the pressure connects after the seq number of the flux connects...
static REAL Distance(TPZVec< REAL > ¢el, TPZVec< REAL > ¢face)
Contains declaration of TPZCompEl class which defines the interface of a computational element...
Templated vector implementation.
void WritePointers(const TPZVec< TPZAutoPointer< T >> &vec)
Contains the declaration of the TPZElementGroup class, which implements an computational element whic...
int ClassId() const override
Returns the unique identifier for reading/writing objects to streams.
TPZGeoElSide Father2() const
returns the father/side pair which contains the set of points associated with this/side ...
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...
virtual int Dimension() const =0
Dimension of the element.
virtual int VariableIndex(const std::string &name)
Returns the variable index associated with the name.
void SetBlocks(TPZBlock< TVar > &row, TPZBlock< TVar > &col, int nvar, int nrowblocks, int ncolblocks)
This operation will reset the matrix to zero with no rows defined.
virtual int NCornerNodes() const =0
Returns the number of corner nodes of the element.
TPZVec< STATE > Integrate(const std::string &varname, const std::set< int > &matids)
Integrate the variable name over the mesh.
Contains the TPZRefQuad class which implements the uniform refinement of a geometric quadrilateral el...
Contains declaration of TPZInterpolationSpace class which implements the interface for interpolated c...
virtual void RemoveSideRestraintsII(MInsertMode mode)
Delete the restraints on the nodes of the connected elements if necessary.
virtual int Dimension() const =0
Returns the integrable dimension of the material.
virtual int NStateVariables() const =0
Returns the number of state variables associated with the material.
Contains the declaration of the TPZMultiphysicsElement class. This class is abstract.
Declarates the TPZBlock<REAL>class which implements block matrices.
Utility class which represents an element with its side. The Geometric approximation classes Geometry...
Class which groups elements to characterize dense matrices.
static int fatherside[8][21]
size_t NMaterials() const
Number of materials.
Defines enum MElementType and contains the implementation of MElementType_NNodes(...) functions.
TinyFad< 8, T > abs(const TinyFad< 8, T > &in)
clarg::argString input("-if", "input file", "cube1.txt")
This class implements a simple vector storage scheme for a templated class T. Utility.
int64_t NElements() const
Access method to query the number of elements of the vector.
REAL val(STATE &number)
Returns value of the variable.
Implements a chunk vector with free store administration. Utility.
void BuildTransferMatrix(TPZCompElDisc &coarsel, TPZTransfer< STATE > &transfer)
void ComputeFillIn(int64_t resolution, TPZFMatrix< REAL > &fillin)
This method will fill the matrix passed as parameter with a representation of the fillin of the globa...
virtual int NSides() const =0
Returns the number of connectivities of the element.
static TPZSavable * GetInstance(const int64_t &objId)
void ReadPointers(TPZVec< TPZAutoPointer< T >> &vec)
virtual int SideDimension(int side) const =0
Return the dimension of side.
virtual void BuildCornerConnectList(std::set< int64_t > &connectindexes) const
adds the connect indexes associated with base shape functions to the set
void Read(TPZStream &buf, void *context) override
Read the element data from a stream.
virtual void Resize(const int64_t newsize, const T &object)
Resizes the vector object.
void CleanUp()
Delete all the dynamically allocated data structures.
Contains the TPZTransfer class which implements a rectangular sparse block matrix.
void LoadReferences()
Map this grid in the geometric grid.
virtual void LoadElementReference()
Loads the geometric element reference.
void RemakeAllInterfaceElements()
Deletes all interfaces and rebuild them all.
void ComputeElGraph(TPZStack< int64_t > &elgraph, TPZVec< int64_t > &elgraphindex)
Computes the connectivity graph of the elements, as appropriate for the TPZRenumbering class...
Contains TPZShapeLinear class which implements the shape functions of a linear one-dimensional elemen...
Contains the TPZRefPyramid class which implements the uniform refinement of a geometric hexahedral el...
virtual void TransferMultiphysicsElementSolution()
#define LOGPZ_FATAL(A, B)
Define log for fatal errors (cout)
virtual void Print(std::ostream &out=std::cout)
Prints out the data associated with the material.
This abstract class defines the behaviour which each derived class needs to implement.
int Dim() const
Returns matrix dimension pointed by block.
void BuildTransferMatrix(TPZInterpolationSpace &coarsel, TPZTransform<> &t, TPZTransfer< STATE > &transfer)
Accumulates the transfer coefficients between the current element and the coarse element into the t...
virtual std::string TypeName() const
Returns the type of the element as a string.
Contains TPZShapeCube class which implements the shape functions of a hexaedral element.
void GetElementPatch(TPZVec< int64_t > nodtoelgraph, TPZVec< int64_t > nodtoelgraphindex, TPZStack< int64_t > &elgraph, TPZVec< int64_t > &elgraphindex, int64_t elind, TPZStack< int64_t > &patch)
Gives the element patch.
void BuildTransferMatrix(TPZCompMesh &coarsemesh, TPZTransfer< STATE > &transfer)
Builds the transfer matrix from the current grid to the coarse grid.
static TPZAutoPointer< TPZSavable > GetAutoPointer(const int64_t &objId)
Contains the TPZBndCond class which implements a boundary condition for TPZMaterial objects...
virtual TPZMaterial * Material() const
Identify the material object associated with the element.
unsigned char LagrangeMultiplier() const
Access method to return the indication whether the connect is associated with a pressure lagrange mul...
void HigherLevelElementList(TPZStack< TPZCompElSide > &elsidevec, int onlyinterpolated, int removeduplicates)
Returns all connected elements which have level higher to the current element.
TPZAutoPointer< TPZGeoMesh > fGMesh
Autopointer to the geometric mesh used in case the user has passed an autopointer.
virtual void AutoBuildContDisc(const TPZVec< TPZGeoEl *> &continuous, const TPZVec< TPZGeoEl *> &discontinuous)
Creates the computational elements, and the degree of freedom nodes.
TPZCompEl * CreateCompEl(TPZGeoEl *gel, int64_t &index)
Create a computational element based on the geometric element.
int Zero() override
Makes Zero all the elements.
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...
Contains the TPZRefPrism class which implements the uniform refinement of a geometric prism element...
TPZCompEl * Element(int64_t iel)
void LoadSolution(const TPZFMatrix< STATE > &sol)
Given the solution of the global system of equations, computes and stores the solution for the restri...
void Resize(const int newsize)
Increase the size of the chunk vector.
void Unwrap()
unwrap the condensed element from the computational element and delete the condensed element ...
virtual TPZCompEl * Clone(TPZCompMesh &mesh) const =0
Method for creating a copy of the element.
int fDefaultOrder
Default order for all elements of this mesh.
Contains declaration of TPZMesh class which defines a geometrical mesh and contains a corresponding l...
int64_t SequenceNumber() const
Returns the Sequence number of the connect object.
void GetRefPatches(std::set< TPZGeoEl *> &grpatch)
Gives all patches of the mesh.
virtual void ComputeErrorFace(int errorid, TPZVec< STATE > &errorL, TPZVec< STATE > &errorR)
ComputeError computes the element error estimator.
void Push(const T object)
Pushes a copy of the object on the stack.
void RemoveInterfaces()
Remove interfaces connected to this element.
virtual void Skyline(TPZVec< int64_t > &skyline)
This method computes the skyline of the system of equations.
void Reset()
Reset the data of the connect.
void EqualLevelElementList(TPZStack< TPZCompElSide > &elsidevec, int onlyinterpolated, int removeduplicates)
Returns all connected elements which have equal level to the current element This method will not put...
virtual void Divide(int64_t index, TPZVec< int64_t > &subindex, int interpolate=0)
Divide the computational element. If interpolate = 1, the solution is interpolated to the sub element...
virtual void LoadSolution()
Loads the solution within the internal data structure of the element.
virtual void Write(const bool val)
Defines the behaviour of all geometric elements. GeometryTPZGeoEl is the common denominator for all g...
const T & Max(const T &a, const T &b)
Returns the maximum value between a and b.
int64_t Index() const
Returns the index of the element within the element vector of the mesh.
virtual bool HasMaterial(const std::set< int > &materialids) const
Verifies if the material associated with the element is contained in the set.
Contains the TPZGeoTetrahedra class which implements the geometry of a tetrahedral element...
TPZCompMesh * Clone() const
Clone this mesh.
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 Read(TPZStream &buf, void *context) override
Read the element data from a stream.
Contains declaration of TPZInterfaceElement class which computes the contribution over an interface b...
virtual void ExpandSolution()
Adapt the solution vector to new block dimensions.
void SetSequenceNumber(int64_t i)
Set the sequence number for the global system of equations of the connect object. ...
#define LOGPZ_DEBUG(A, B)
Define log for debug info.
This class defines the boundary condition for TPZMaterial objects.
TPZCompMesh * Mesh() const
Return a pointer to the grid of the element.
Contains declaration of TPZConnect class which represents a set of shape functions associated with a ...
Free store vector implementation.
int Dimension() const
Returns the dimension of the simulation.
void Coarsen(TPZVec< int64_t > &elements, int64_t &index, bool CreateDiscontinuous=false)
Create a computational element father for the comp. elem. into elements.
virtual void ComputeNodElCon()
Compute the number of elements connected to each connect object.
int NumInterfaces()
Returns number of TPZInterfaceElement pointing to this.
void Divide(int64_t index, TPZVec< int64_t > &subindex, int interpolate=0)
Divide the element corresponding to index.
TPZMaterial * FindMaterial(int id)
Find the material with identity id.
virtual int64_t PutinSuperMesh(int64_t local, TPZCompMesh *super)
Put an local connection in the supermesh - Supermesh is one mesh who contains the analised submesh...
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.
int HasDependency() const
Returns whether exist dependecy information.
expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ sqrt
void GetNodeToElGraph(TPZVec< int64_t > &nodtoelgraph, TPZVec< int64_t > &nodtoelgraphinde, TPZStack< int64_t > &elgraph, TPZVec< int64_t > &elgraphindexx)
Gives the conects graphs.
TPZFMatrix< STATE > fElementSolution
Solution vectors organized by element.
virtual void ComputeError(int errorid, TPZVec< REAL > &error)
ComputeError computes the element error estimator.
void SetAllCreateFunctionsContinuous()
Create continuous approximation spaces.
const TPZBlock< STATE > & Block() const
Access the block structure of the solution vector.
void Read(TPZStream &buf, void *context) override
read objects from the stream
static int GetgOrder()
Set the default value of the interpolation order.
int64_t NConnects() const
Number of connects allocated including free nodes.
TPZCompMesh(TPZGeoMesh *gr=0)
Constructor from geometrical mesh.
Contains declaration of TPZCompelDisc class which implements a computational element for discontinuou...
TPZGeoMesh * fReference
Geometric grid to which this grid refers.
TPZAdmChunkVector< TPZConnect > & ConnectVec()
Return a reference to the connect pointers vector.
TPZFMatrix< STATE > fSolN
Solution at previous state.
Class which implements an element which condenses the internal connects.
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...
const T & Min(const T &a, const T &b)
Returns the minimum value between a and b.
Contains TPZShapePoint class which implements the shape function associated with a point...
virtual int PreferredSideOrder(int iside)=0
Returns the preferred order of the polynomial along side iside.
int SetNBlocks(const int num_of_blocks)
Sets number of blocks on diagonal matrix.
Contains declaration of TPZCompMesh class which is a repository for computational elements...
int Redim(const int64_t newRows, const int64_t newCols) override
Redimension a matrix and ZERO your elements.
TPZBlock< STATE > fBlock
Block structure to right construction of the stiffness matrix and load vector.
virtual TPZConnect & Connect(int i) const
Returns a pointer to the ith node.
void CompactDataStructure(CompactScheme type=CompactScheme::ALWAYS)
Sets the method to compact the data structure based on the.
int BandWidth()
This method computes the bandwidth of the system of equations.
Contains the TPZGeoCube class which implements the geometry of hexahedra element. ...
void InterpolateSolution(TPZInterpolationSpace &coarsel)
Interpolates the solution into the degrees of freedom nodes from the degrees of freedom nodes from th...
void SetDimModel(int dim)
Set de dimension of the domain of the problem.
unsigned char NState() const
Number of state variables associated with the connect.
void UpdatePreviousState(STATE mult=1.0)
int32_t Hash(std::string str)
Contains the TPZGeoPoint class which implements the geometry of a point element or 0-D element...
std::map< int,TPZMaterial *> & MaterialVec()
Returns a reference to the material pointers vector.
Computes the contribution over an interface between two discontinuous elements. Computational Element...
Contains TPZMatrix<TVar>class, root matrix class.
virtual int HasSubElement() const =0
Return 1 if the element has subelements.
Contains TPZShapePrism class which implements the shape functions of a prism element.
Implements the interfaces for TPZCompElDisc, TPZInterfaceElement and TPZInterpolatedElement. Computational element.
int NBlocks() const
Returns number of blocks on diagonal.
TPZBlock< STATE > fSolutionBlock
Block structure of the solution vector ????
virtual int NConnects() const =0
Returns the number of nodes of the element.
int NeighbourExists(int side, const TPZGeoElSide &gel)
Returns 1 if gel is a neighbour of the element along side.
Contains the TPZRefTriangle class which implements the uniform refinement of a geometric triangular e...
Contains declaration of TPZSubCompMesh class which implements a group of computational elements as a ...
static void switchEq(int64_t eqsmall, int64_t eqlarge, TPZVec< int64_t > &permutegather, TPZVec< int64_t > &permutescatter)
int InsertMaterialObject(TPZMaterial *mat)
Insert a material object in the datastructure.
REAL LesserEdgeOfEl()
Will return the smallest distance between two nodes of the reference element.
Contains the TPZRefTetrahedra class which implements the uniform refinement of a geometric tetrahedra...
virtual void CleanUpUnconnectedNodes()
Delete the nodes which have no elements connected to them.
virtual int Dimension() const =0
Returns the dimension of the element.
REAL dist(TPZVec< T1 > &vec1, TPZVec< T1 > &vec2)
void AssembleError(TPZFMatrix< REAL > &estimator, int errorid)
Assemble the vector with errors estimators.
virtual ~TPZCompMesh()
Simple Destructor.
int Dimension()
Get Dimension.
void Read(TPZStream &buf, void *context) override
read objects from the stream
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.
TPZCompEl * LeftElement() const
Returns the left element from the element interface.
virtual int NSolutionVariables(int var)
Returns the number of variables associated with the variable indexed by var.
TPZCompEl * SubElement(int64_t sub) const
Returns the "sub" subelement.
This class implements a geometric mesh for the pz environment. Geometry.
virtual REAL CompareMesh(int var, char *matname)
This method will initiate the comparison between the current computational mesh and the mesh which is...
void ResetElConnected()
Initialize with zero fNElConnected.
void ResetReference()
Reset the element referenced by the geometric element to NULL.
Implements computational mesh. Computational Mesh.
int Size(const int block_diagonal) const
Returns block dimension.
TPZAdmChunkVector< TPZCompEl * > & ElementVec()
Returns a reference to the element pointers vector.
void BuildTransferMatrixDesc(TPZCompMesh &transfermesh, TPZTransfer< STATE > &transfer)
To discontinuous elements.
virtual void Print(std::ostream &out=std::cout) const
Prints element data.
void PRefine(int order) override
Changes the interpolation order of a side. Updates all constraints and block sizes ...
int NElConnected() const
Returns fNElConnected.
void BuildMesh(TPZCompMesh &cmesh, const std::set< int > &MaterialIDs) const
Creates the computational elements, and the degree of freedom nodes.
void SetMatrix(TPZMatrix< TVar > *const other)
Changes pointer to other.
Contains declaration of TPZInterpolatedElement class which implements computational element of the in...
Contains the TPZRefLinear class which implements the uniform refinement of a geometric linear element...
void SetReference(TPZCompMesh *ref)
Sets the reference of the geometric grid to ref.
virtual TPZCompMesh * CommonMesh(TPZCompMesh *mesh)
Gives the commom father mesh of the specified mesh and the current submesh.
void EvaluateError(std::function< void(const TPZVec< REAL > &loc, TPZVec< STATE > &val, TPZFMatrix< STATE > &deriv)> fp, bool store_error, TPZVec< REAL > &errorSum)
Evaluates the error given the two vectors of the analised parameters.
void Fill(const T ©, const int64_t from=0, const int64_t numelem=-1)
Will fill the elements of the vector with a copy object.
TPZCompMesh & operator=(const TPZCompMesh ©)
copy the content of the mesh
TPZCreateApproximationSpace fCreate
The object which defines the type of space being created.
int64_t NIndexes() const
Returns the number of clustered subelements.
int64_t Cols() const
Returns number of cols.
virtual void SetDegree(int degree)
Assigns the degree of the element.
std::string fName
Grid name for model identification.
void SetFree(int index)
Indicate an element as free.
Contains TPZShapePiram class which implements the shape functions of a pyramid element.
int Resize(const int64_t newRows, const int64_t wCols) override
Redimension a matrix, but maintain your elements.
Contains declaration of the abstract TPZStream class. TPZStream defines the interface for saving and ...
Contains the TPZGeoPyramid class which implements the geometry of pyramid element.
void CopyMaterials(TPZCompMesh &mesh) const
Copies the materials of this mesh to the given mesh.
std::map< int, TPZMaterial *> fMaterialVec
Map of pointers to materials.
Defines the interface for saving and reading data. Persistency.
int64_t NElements() const
Returns the number of elements of the vector.
TPZCompEl * RightElement() const
Returns the right element from the element interface.
void ModifyPermute(TPZVec< int64_t > &permute, int64_t lagrangeq, int64_t maxeq)
Modify the permute vector swapping the lagrangeq with maxeq and shifting the intermediate equations...
Contains the TPZGeoPrism class which implements the geometry of a prism element.
clarg::argInt porder("-porder", "polinomial order", 1)
Contains declaration of TPZGeoElement class which implements a generic geometric element with a unifo...
This class implements a discontinuous element (for use with discontinuous Galerkin). Computational Element.
void Write(TPZStream &buf, int withclassid) const override
Writes this object to the TPZStream buffer. Include the classid if withclassid = true.
void InitializeBlock()
Resequence the block object, remove unconnected connect objects and reset the dimension of the soluti...
Implements rectangular matrix which extends a solution vector of the coarse mesh to a solution vector...
void Read(TPZStream &buf, void *context) override
read objects from the stream
REAL MaximumRadiusOfEl()
Will return the maximum distance between the nodes of the reference element.
void ProjectSolution(TPZFMatrix< STATE > &projectsol)
virtual void Print(std::ostream &out=std::cout)
Print all relevant data of the element to cout.
void EvaluateInterfaceJump(TPZSolVec &jump, int opt)
void Write(TPZStream &buf, int withclassid) const override
Writes this object to the TPZStream buffer. Include the classid if withclassid = true.
void ResetReference()
Resets all load references in elements and nodes.
void Print(const TPZCompMesh &mesh, std::ostream &out=std::cout)
Print the information for the connect element.
REAL MaximumRadiusOfMesh()
void ConnectSolution(std::ostream &out)
Print the solution by connect index.
Defines the interface of a computational element. Computational Element.
bool IsCondensed() const
Access method to return the indication whether the connect is condensed or not.
virtual REAL CompareElement(int var, char *matname)
This method computes the norm of the difference of a post processed variable with @ the same post pro...
Contains the declaration of the TPZCondensedCompEl class, which implements an computational element w...
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.
void TransferMultiphysicsSolution()
Transfer multiphysics mesh solution.
Contains TPZShapeQuad class which implements the shape functions of a quadrilateral element...
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.
Contains the TPZRefCube class which implements the uniform refinement of a geometric hexahedral eleme...
void Discontinuous2Continuous(int64_t disc_index, int64_t &new_index)
This method convert a discontinuous element with index disc_index in continuous element.
Contains the TPZRefPoint class which implements the uniform refinement of a geometric point element...
TPZFMatrix< STATE > & Solution()
Access the solution vector.
static void WritePointer(const TPZSavable *obj, TPZStream *stream)
virtual void AutoBuild()
Creates the computational elements, and the degree of freedom nodes.
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...
void Write(TPZStream &buf, int withclassid) const override
Save the element data to a stream.
Implements computational element based on an interpolation space. Computational Element.
void Write(TPZStream &buf, int withclassid) const override
Save the element data to a stream.
virtual MElementType Type() override
Type of the element.
TPZAdmChunkVector< TPZConnect > fConnectVec
List of pointers to nodes.
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.
TPZMaterial * Material() const
int Resequence(const int start=0)
Resequences blocks positioning.
Implements an agglomerated discontinuous element. Computational Element.
virtual void Print(std::ostream &out=std::cout) const override
Prints the relevant data of the element to the output stream.
virtual void Print(std::ostream &out=std::cout) const
Prints mesh data.
virtual void Read(bool &val)
virtual int64_t GetFromSuperMesh(int64_t superind, TPZCompMesh *super)
Get an external connection from the supermesh - Supermesh is one mesh who contains the analised subme...
TPZAdmChunkVector< TPZGeoEl * > & ElementVec()
Methods for handling pzlists.
void Write(TPZStream &buf, int withclassid) const override
Writes this object to the TPZStream buffer. Include the classid if withclassid = true.
void Permute(TPZVec< int64_t > &permute)
Permute the sequence number of the connect objects It is a permute gather operation.