NeoPZ
pzbuildmultiphysicsmesh.cpp
Go to the documentation of this file.
1  /*
2  * @file
3  * @brief Implementations to mesh multiphysics
4  */
5 
9 #include "TPZMaterial.h"
10 #include "pzanalysis.h"
11 #include "pzstack.h"
12 #include "TPZInterfaceEl.h"
13 #include "pzelementgroup.h"
14 #include "pzcondensedcompel.h"
15 #include "pzsubcmesh.h"
16 
17 #include "pzelchdivbound2.h"
18 #include "pzshapequad.h"
19 #include "pzshapelinear.h"
20 #include "pzshapetriang.h"
21 
22 #include "pzlog.h"
23 
24 #ifdef LOG4CXX
25 static LoggerPtr logger(Logger::getLogger("pz.mesh.tpzbuildmultiphysicsmesh"));
26 #endif
27 
28 
29 
30 
31 #include <iostream>
32 
34 }
35 
37 }
38 
39 
41 {
42  TPZGeoMesh *gmesh = MFMesh->Reference();
43  gmesh->ResetReference();
44  int64_t nMFEl = MFMesh->NElements();
45  int64_t nmesh = cmeshVec.size();
46  int64_t imesh;
47  for(imesh = 0; imesh<nmesh; imesh++)
48  {
49  cmeshVec[imesh]->LoadReferences();
50  int64_t iel;
51  for(iel=0; iel<nMFEl; iel++)
52  {
53  TPZCompEl * cel = MFMesh->ElementVec()[iel];
54  TPZMultiphysicsElement * mfcel = dynamic_cast<TPZMultiphysicsElement *> (cel);
56  if(mfcel)
57  {
58  int64_t found = 0;
59  TPZGeoEl * gel = mfcel->Reference();
60  TPZStack<TPZCompElSide> celstack;
61  TPZGeoElSide gelside(gel,gel->NSides()-1);
62  // if the geometric element has a reference, it is an obvious candidate
63  if (gel->Reference()) {
64  mfcel->AddElement(gel->Reference(), imesh);
65  continue;
66  }
67  else
68  {
69  TPZGeoEl *gelF = gel;
70  while(gelF->Father())
71  {
72  gelF = gelF->Father();
73  if (gelF->Reference()) {
74 #ifdef PZDEBUG
75  if (gelF->MaterialId() != gel->MaterialId()) {
76  DebugStop();
77  }
78 #endif
79  mfcel->AddElement(gelF->Reference(), imesh);
80  found = true;
81  break;
82  }
83  }
84  }
85  if (!found) {
86  mfcel->AddElement(0, imesh);
87  }
88  }
89  else if (mfint) {
90  //set up interface
91  }
92  else {
93  DebugStop();
94  }
95  }
96  gmesh->ResetReference();
97  }
98  for (int64_t el = 0; el < nMFEl; el++) {
99  TPZCompEl *cel = MFMesh->Element(el);
100  TPZMultiphysicsElement *mfcel = dynamic_cast<TPZMultiphysicsElement *>(cel);
101  if (!mfcel) {
102  continue;
103  }
104  mfcel->InitializeIntegrationRule();
105  }
106 }
107 
109 {
110  int64_t nmeshes = cmeshVec.size();
111  MFMesh->SetNMeshes(nmeshes);
112 
113  TPZVec<int64_t> FirstConnect(nmeshes,0);
114  int64_t nconnects = 0;
115  int64_t imesh;
116  for (imesh=0; imesh<nmeshes; imesh++)
117  {
118  FirstConnect[imesh] = nconnects;
119  nconnects += cmeshVec[imesh]->ConnectVec().NElements();
120  }
121  MFMesh->ConnectVec().Resize(nconnects);
122  MFMesh->Block().SetNBlocks(nconnects);
123  int64_t counter = 0;
124  int64_t seqnum = 0;
125  for (imesh=0; imesh<nmeshes; imesh++)
126  {
127  int64_t ic;
128  int64_t nc = cmeshVec[imesh]->ConnectVec().NElements();
129  for (ic=0; ic<nc; ic++)
130  {
131  TPZConnect &refcon = cmeshVec[imesh]->ConnectVec()[ic];
132  MFMesh->ConnectVec()[counter] = refcon;
133  if (refcon.SequenceNumber() >= 0) {
134  MFMesh->ConnectVec()[counter].SetSequenceNumber(seqnum);
135  MFMesh->ConnectVec()[counter].SetNState(refcon.NState());
136  MFMesh->ConnectVec()[counter].SetNShape(refcon.NShape());
137  MFMesh->ConnectVec()[counter].SetLagrangeMultiplier(refcon.LagrangeMultiplier());
138  int ndof = refcon.NDof(*cmeshVec[imesh]);
139  MFMesh->Block().Set(seqnum,ndof);
140  seqnum++;
141  }
142  counter++;
143  }
145  for (ic=0; ic<nc; ic++)
146  {
147  TPZConnect &cn = MFMesh->ConnectVec()[FirstConnect[imesh]+ic];
148  if (cn.HasDependency())
149  {
151  while (dep) {
152  dep->fDepConnectIndex = dep->fDepConnectIndex+FirstConnect[imesh];
153  dep = dep->fNext;
154  }
155  }
156  }
157  }
158  MFMesh->Block().SetNBlocks(seqnum);
159  MFMesh->ExpandSolution();
160  int64_t iel;
161  int64_t nelem = MFMesh->NElements();
162  for (iel = 0; iel < nelem; iel++)
163  {
164  TPZCompEl *celorig = MFMesh->ElementVec()[iel];
165  TPZMultiphysicsElement *cel = dynamic_cast<TPZMultiphysicsElement *> (celorig);
166  TPZMultiphysicsInterfaceElement *interfacee = dynamic_cast<TPZMultiphysicsInterfaceElement *> (celorig);
167  if (interfacee) {
168  continue;
169  }
170  if (!cel) {
171  continue;
172  }
173  TPZStack<int64_t> connectindexes;
174  int64_t imesh;
175  std::list<TPZOneShapeRestraint> oneshape;
176  for (imesh=0; imesh < nmeshes; imesh++) {
177  TPZCompEl *celref = cel->ReferredElement(imesh);
178  if (!celref) {
179  continue;
180  }
181  std::list<TPZOneShapeRestraint> celrest;
182  celrest = celref->GetShapeRestraints();
183  for (std::list<TPZOneShapeRestraint>::iterator it = celrest.begin(); it != celrest.end(); it++) {
184  TPZOneShapeRestraint rest = *it;
185  TPZOneShapeRestraint convertedrest(rest);
186  for(int face = 0; face < rest.fFaces.size(); face++)
187  {
188  int ic = rest.fFaces[face].first;
189  convertedrest.fFaces[face].first = ic+FirstConnect[imesh];
190  }
191  oneshape.push_back(convertedrest);
192  }
193  int64_t ncon = celref->NConnects();
194  int64_t ic;
195  for (ic=0; ic<ncon; ic++) {
196  connectindexes.Push(celref->ConnectIndex(ic)+FirstConnect[imesh]);
197  }
198  }
199  cel->SetConnectIndexes(connectindexes);
200  for (std::list<TPZOneShapeRestraint>::iterator it = oneshape.begin(); it != oneshape.end(); it++) {
201  cel->AddShapeRestraint(*it);
202  }
203  }
204 }
205 
207 {
208  int64_t nmeshes = MFMesh->GetNMeshes();
209  if(nmeshes<1) DebugStop();
210  nmeshes +=1;
211 
212  //adding connects from cmesh to MFMesh
213  int64_t nconnects_old = MFMesh->NConnects();
214  int64_t nconnects = nconnects_old + cmesh->NConnects();
215 
216  MFMesh->ConnectVec().Resize(nconnects);
217  MFMesh->Block().SetNBlocks(nconnects);
218 
219  int64_t counter = nconnects_old;
220  int64_t seqnum = nconnects_old;
221 
222  int64_t ic;
223  int64_t nc = cmesh->NConnects();
224  for (ic=0; ic<nc; ic++)
225  {
226  TPZConnect &refcon = cmesh->ConnectVec()[ic];
227  MFMesh->ConnectVec()[counter] = refcon;
228  if (refcon.SequenceNumber() >= 0)
229  {
230  MFMesh->ConnectVec()[counter].SetSequenceNumber(seqnum);
231  MFMesh->ConnectVec()[counter].SetNState(refcon.NState());
232  MFMesh->ConnectVec()[counter].SetNShape(refcon.NShape());
233  MFMesh->ConnectVec()[counter].SetLagrangeMultiplier(refcon.LagrangeMultiplier());
234  int ndof = refcon.NDof(*cmesh);
235  MFMesh->Block().Set(seqnum,ndof);
236  seqnum++;
237  }
238  counter++;
239  }
240 
242  for (ic=0; ic<nc; ic++)
243  {
244  TPZConnect &cn = MFMesh->ConnectVec()[nconnects_old + ic];
245  if (cn.HasDependency())
246  {
248  while (dep)
249  {
250  dep->fDepConnectIndex = dep->fDepConnectIndex + nconnects_old;
251  dep = dep->fNext;
252  }
253  }
254  }
255 
256  MFMesh->Block().SetNBlocks(seqnum);
257  MFMesh->ExpandSolution();
258  TPZCompEl *celorig = NULL;
259  TPZMultiphysicsElement *cel = NULL;
260  TPZCompEl *celref = NULL;
261  TPZMultiphysicsInterfaceElement *interface1 = NULL;
262 
263  int64_t iel;
264  TPZVec<int64_t> FirstConnect(nmeshes,0);
265  int64_t nelem = MFMesh->NElements();
266  for (iel = 0; iel < nelem; iel++)
267  {
268  celorig = MFMesh->ElementVec()[iel];
269  cel = dynamic_cast<TPZMultiphysicsElement *> (celorig);
270  if (!cel) {
271  continue;
272  }
273 
274  int64_t nfirstcon= 0;
275  int64_t imesh;
276  int nrefel = cel->NMeshes();
277  if(nrefel!=nmeshes) DebugStop();
278  for (imesh=0; imesh<nrefel; imesh++)
279  {
280  celref = cel->ReferredElement(imesh);
281  if (!celref) {
282  continue;
283  }
284  FirstConnect[imesh] = nfirstcon;
285  nfirstcon += celref->Mesh()->NConnects();
286  }
287  break;
288  }
289 
290  //Set connect index to multiphysics element
291  for (iel = 0; iel < nelem; iel++)
292  {
293  celorig = MFMesh->ElementVec()[iel];
294  cel = dynamic_cast<TPZMultiphysicsElement *> (celorig);
295  interface1 = dynamic_cast<TPZMultiphysicsInterfaceElement *> (celorig);
296  if (interface1) {
297  continue;
298  }
299  if (!cel) {
300  continue;
301  }
302  TPZStack<int64_t> connectindexes;
303 
304  int64_t imesh;
305  for (imesh=0; imesh < nmeshes; imesh++) {
306  celref = cel->ReferredElement(imesh);
307  if (!celref) {
308  continue;
309  }
310  int64_t ncon = celref->NConnects();
311  int64_t ic;
312  for (ic=0; ic<ncon; ic++) {
313  connectindexes.Push(celref->ConnectIndex(ic)+FirstConnect[imesh]);
314  }
315  }
316  cel->SetConnectIndexes(connectindexes);
317  }
318 }
319 
320 
322 {
323 
324  TPZVec<atomic_index> indexes;
325  ComputeAtomicIndexes(MFMesh, indexes);
326  int64_t nconnect = indexes.size();
327  TPZBlock<STATE> &blockMF = MFMesh->Block();
328  for(int64_t connect = 0; connect < nconnect; connect++)
329  {
330  TPZCompMesh *atomic_mesh = indexes[connect].first;
331  if(!atomic_mesh) continue;
332  TPZBlock<STATE> &block = atomic_mesh->Block();
333  TPZConnect &con = atomic_mesh->ConnectVec()[indexes[connect].second];
334  int64_t seqnum = con.SequenceNumber();
335  if(seqnum<0) DebugStop();
336  int blsize = block.Size(seqnum);
337  TPZConnect &conMF = MFMesh->ConnectVec()[connect];
338  int64_t seqnumMF = conMF.SequenceNumber();
339  if(seqnumMF < 0) DebugStop();
340  for (int idf=0; idf<blsize; idf++) {
341  blockMF.Put(seqnumMF, idf, 0, block.Get(seqnum, idf, 0));
342  }
343  }
344 
345 
346 
347  // copy the solution of the submesh to father mesh
348  TPZSubCompMesh *msub = dynamic_cast<TPZSubCompMesh*>(MFMesh);
349  if(msub){
350  TPZCompMesh * fathermesh = msub->FatherMesh();
351 
352  TPZCompEl *compel = dynamic_cast<TPZCompEl*>(msub);
353  int nconnect = compel->NConnects();
354 
355  for(int ic=0; ic<nconnect ; ic++){
356 
357  int64_t fatherconIndex = compel->ConnectIndex(ic);
358  int64_t submeshIndex = msub->InternalIndex(fatherconIndex);
359  if(fatherconIndex == -1) DebugStop();
360  //acessing the block on father mesh
361  TPZBlock<STATE> &blockfather = fathermesh->Block();
362 
363  TPZConnect &confather = fathermesh->ConnectVec()[fatherconIndex];
364  int64_t seqnumfather = confather.SequenceNumber();
365  int nblock = blockfather.Size(seqnumfather);
366  //acessing the block on submesh
367  TPZBlock<STATE> &blocksub = msub->Block();
368  TPZConnect &consub = msub->ConnectVec()[submeshIndex];
369  int64_t seqnumsub = consub.SequenceNumber();
370 
371  if(seqnumfather < 0) DebugStop();
372  for(int idf=0 ; idf<nblock; idf++){
373  int posfather = blockfather.Position(seqnumfather);
374  STATE valsub = blocksub.Get(seqnumsub, idf,0);
375  fathermesh->Solution()(posfather + idf) = valsub;
376  }
377 
378 
379  }
380 
381  }
382 
383 
384 
385 
386 
387 
388 
389  int64_t nel = MFMesh->NElements();
390  for (int64_t el = 0; el<nel; el++) {
391  TPZCompEl *cel = MFMesh->Element(el);
392  TPZSubCompMesh *sub = dynamic_cast<TPZSubCompMesh *>(cel);
393  if(sub)
394  {
395  TransferFromMeshes(cmeshVec, sub);
396  }
397  }
398 }
399 
401 {
402 
403  TPZVec<atomic_index> indexes;
404  ComputeAtomicIndexes(MFMesh, indexes);
405  int64_t nconnect = indexes.size();
406  TPZBlock<STATE> &blockMF = MFMesh->Block();
407  for(int64_t connect = 0; connect < nconnect; connect++)
408  {
409  TPZCompMesh *atomic_mesh = indexes[connect].first;
410  if(!atomic_mesh) continue;
411  TPZBlock<STATE> &block = atomic_mesh->Block();
412  int64_t atomicindexconnect = indexes[connect].second;
413  TPZConnect &con = atomic_mesh->ConnectVec()[atomicindexconnect];
414  int64_t seqnum = con.SequenceNumber();
415  if(seqnum<0) DebugStop();
416  int blsize = block.Size(seqnum);
417  TPZConnect &conMF = MFMesh->ConnectVec()[connect];
418  int64_t seqnumMF = conMF.SequenceNumber();
419  if(seqnumMF < 0) DebugStop();
420  for (int idf=0; idf<blsize; idf++) {
421  STATE val = blockMF.Get(seqnumMF, idf, 0);
422  int64_t pos = block.Position(seqnum);
423  atomic_mesh->Solution()(pos+idf) = val;
424  }
425  }
426 
427  int64_t nel = MFMesh->NElements();
428  for (int64_t el = 0; el<nel; el++) {
429  TPZCompEl *cel = MFMesh->Element(el);
430  TPZSubCompMesh *sub = dynamic_cast<TPZSubCompMesh *>(cel);
431  if(sub)
432  {
433  TransferFromMultiPhysics(cmeshVec, sub);
434  }
435  }
436 }
437 
438 
439 void TPZBuildMultiphysicsMesh::BuildHybridMesh(TPZCompMesh *cmesh, std::set<int> &MaterialIDs, std::set<int> &BCMaterialIds, int LagrangeMat, int InterfaceMat)
440 {
442  int meshdim = cmesh->Dimension();
443 
445  cmesh->ApproxSpace().BuildMesh(*cmesh, MaterialIDs);
446 
447  cmesh->LoadReferences();
448 
449  cmesh->ApproxSpace().CreateDisconnectedElements(false);
450  cmesh->ApproxSpace().BuildMesh(*cmesh, BCMaterialIds);
451 
452 //#ifdef LOG4CXX
453 // {
454 // std::stringstream sout;
455 // cmesh->Reference()->Print(sout);
456 // LOGPZ_DEBUG(logger,sout.str())
457 // }
458 //#endif
459 
462 
463  int64_t nelem = cmesh->Reference()->NElements();
464 
465  //2- Generate geometric elements (with dimension (meshdim-1)) between the previous elements.
466  for (int64_t i=0; i<nelem; ++i) {
467  TPZGeoEl *gel = elvec[i];
468  // skip all elements which are not volumetric
469  if (!gel || gel->Dimension() != meshdim || !gel->Reference()) {
470  continue;
471  }
472  int matid = gel->MaterialId();
473  if(MaterialIDs.find(matid) == MaterialIDs.end())
474  {
475  continue;
476  }
477  // over the dimension-1 sides
478  int nsides = gel->NSides();
479  int is;
480  for (is=0; is<nsides; ++is) {
481  int sidedim = gel->SideDimension(is);
482  if (sidedim != meshdim-1) {
483  continue;
484  }
485  // check if there is a smaller element connected to this element
486  TPZStack<TPZCompElSide> celsides;
487  celsides.Resize(0);
488  TPZGeoElSide gelside(gel,is);
489  gelside.HigherLevelCompElementList2(celsides, 0, 0);
490  //int ncelsid = celsides.NElements();
491 
492  // we only treat elements which look at equal or larger sizes
493  if(celsides.NElements()) continue;
494 
495  // check the neighboring
496  TPZCompElSide celside;
497  celside = gelside.LowerLevelCompElementList2(0);
498  if (celside && celside.Element()->Reference()->Dimension() != meshdim)
499  {
500  // there a larger sided boundary element --- strange lets see what happened
501  DebugStop();
502  }
503  TPZStack<TPZCompElSide> equallevel;
504  gelside.EqualLevelCompElementList(equallevel, 1, 0);
505  if (equallevel.size() > 1) {
506  // at this point there should only be maximum one neighbour along this type of side
507  DebugStop();
508  }
509  TPZStack<TPZGeoElSide> allneigh;
510  allneigh.Resize(0);
511  gelside.AllNeighbours(allneigh);
512  //int nneig = allneigh.NElements();
513  // this would mean the lagrange element was already created along this side
514  if(allneigh.NElements()>1) continue;
515 
516  // create only lagrange interfaces between internal sides
517  int neighmat = allneigh[0].Element()->MaterialId();
518  if (MaterialIDs.find(neighmat) == MaterialIDs.end() ) {
519  continue;
520  }
521  //if (nneig && allneigh[0].Element()->Dimension() != meshdim) continue;//joao, comentar essa linha permite criar elementos 1D(Lagrange) entre elemento de contorno e um elemento 2D
522 
523  gel->CreateBCGeoEl(is, LagrangeMat);
524  }
525  }
526 
527  cmesh->Reference()->ResetReference();
530 
531 
532  std::set<int> lagrangematids;
533  lagrangematids.insert(LagrangeMat);
534  cmesh->AutoBuild(lagrangematids);
535 
536 
537 
538  cmesh->LoadReferences();
539 
540 #ifdef LOG4CXX
541  {
542  std::stringstream sout;
543  cmesh->Reference()->Print(sout);
544  LOGPZ_DEBUG(logger,sout.str())
545  }
546 #endif
547 
548 
549 // std::ofstream arg2("gmeshB.txt");
550 // cmesh->Reference()->Print(arg2);
551 
552 
553  //4- Create the interface elements between the lagrange elements and other elements
554  nelem = elvec.NElements();
555  for (int64_t i=0; i<nelem; ++i) {
556  TPZGeoEl *gel = elvec[i];
557  if (!gel || gel->Dimension() != meshdim-1 || !gel->Reference()) {
558  continue;
559  }
560  int matid = gel->MaterialId();
561  if(matid != LagrangeMat){
562  continue;
563  }
564  //over the dimension-1 sides
565  int nsides = gel->NSides();
566  if(nsides!=3)
567  {
568  DebugStop();// como estamos no caso 2D todas as arestas são 1D
569  }
570  int is = nsides-1;
571  int sidedim = gel->SideDimension(is);
572  if (sidedim != meshdim-1) {
573  DebugStop();
574  }
575  //check if there is a smaller element connected to this element
576  TPZStack<TPZCompElSide> celsides;
577  TPZGeoElSide gelside(gel,is);
578  gelside.EqualLevelCompElementList(celsides, 0, 0);
579  if(celsides.size() < 1){
580  DebugStop();
581  }
582  TPZCompElSide cels = gelside.LowerLevelCompElementList2(0);
583  if(cels)
584  {
585  celsides.Push(cels);
586  }
587  int64_t nelsides = celsides.NElements();
588  if(nelsides != 2)
589  {
590  DebugStop();
591  }
592  for (int64_t lp=0; lp<nelsides; ++lp) {
593  TPZCompElSide left = celsides[lp];
594  TPZCompElSide right(gel->Reference(),is);
595 
596  TPZGeoEl *gelright=right.Reference().Element();
597  TPZGeoEl *gelleft = left.Reference().Element();
598  int matidleft = gelleft->MaterialId();// sempre é LagrangeMat
599  int matidright = gelright->MaterialId();
601  const int interfacematid = cmesh->Reference()->InterfaceMaterial(matidleft, matidright );
602 
603  // there is no need to create a lagrange multiplier between an interior element and boundary element
604  if(interfacematid == 0)
605  {
606  DebugStop();
607  }
608 
609  TPZGeoEl *interfaceEl = gel->CreateBCGeoEl(is, interfacematid);
610  int64_t index;
611  new TPZInterfaceElement(*cmesh,interfaceEl,index,left,right);
612 
613  }
614  }
615 
616 // std::ofstream arg3("gmeshC.txt");
617 // cmesh->Reference()->Print(arg3);
618 
619  cmesh->InitializeBlock();
620  cmesh->AdjustBoundaryElements();
621  cmesh->CleanUpUnconnectedNodes();
622 
623 
624  //Set the connect as a Lagrange multiplier
625  int64_t nel = cmesh->NElements();
626  for(int64_t i=0; i<nel; i++){
627  TPZCompEl *cel = cmesh->ElementVec()[i];
628  if(!cel || !cel->Material())
629  continue;
630 
631  int mid = cel->Material()->Id();
632 
633  if(mid==LagrangeMat){
634 
635  int nsides = cel->Reference()->NSides();
636 
637  for(int i = 0; i<nsides; i++){
638  TPZConnect &newnod = cel->Connect(i);
639  newnod.SetLagrangeMultiplier(2);
640  }
641  }
642  }
643 }
644 
645 #include "TPZCompElDisc.h"
646 void TPZBuildMultiphysicsMesh::UniformRefineCompMesh(TPZCompMesh *cMesh, int ndiv, bool isLagrMult)
647 {
648 
649  // delete the interface elements
651  int64_t nel = elvec.NElements();
652  for(int64_t el=0; el < nel; el++){
653  TPZCompEl * compEl = elvec[el];
654  if(!compEl) continue;
655 
656  if(compEl->IsInterface()){
657  compEl->Reference()->ResetReference();
658  delete compEl;
659  }
660  }
661 
662  // divide all elements
663  TPZVec<int64_t > subindex(0);
664  for (int iref = 0; iref < ndiv; iref++) {
666  int64_t nel = elvec.NElements();
667  for(int64_t el=0; el < nel; el++){
668  TPZCompEl * compEl = elvec[el];
669  if(!compEl) continue;
670  int ind = compEl->Index();
671  if(compEl->Dimension() >0/* cMesh->Dimension()*/){
672  compEl->Divide(ind, subindex, 0);
673  }
674  }
675  }
676 
677  cMesh->AdjustBoundaryElements();
678  cMesh->CleanUpUnconnectedNodes();
679 
680 
681  //When the mesh is an L2 space used as lagrange multiplier
682  if(isLagrMult==true)
683  {
684  int64_t ncon = cMesh->NConnects();
685  for(int64_t i=0; i<ncon; i++)
686  {
687  TPZConnect &newnod = cMesh->ConnectVec()[i];
688  newnod.SetLagrangeMultiplier(1);
689  }
690 
691  int64_t nel = cMesh->NElements();
692  for(int64_t i=0; i<nel; i++){
693  TPZCompEl *cel = cMesh->ElementVec()[i];
694  if(!cel) continue;
695  TPZCompElDisc *celdisc = dynamic_cast<TPZCompElDisc *>(cel);
696  celdisc->SetConstC(1.);
697  celdisc->SetCenterPoint(0, 0.);
698  celdisc->SetCenterPoint(1, 0.);
699  celdisc->SetCenterPoint(2, 0.);
700  celdisc->SetTrueUseQsiEta();
701  }
702 
703  }
704 }
705 
706 void TPZBuildMultiphysicsMesh::UniformRefineCompEl(TPZCompMesh *cMesh, int64_t indexEl, bool isLagrMult){
707 
708  TPZVec<int64_t> subindex;
709  int64_t nel = cMesh->ElementVec().NElements();
710  for(int64_t el=0; el < nel; el++){
711  TPZCompEl * compEl = cMesh->ElementVec()[el];
712  if(!compEl) continue;
713  int64_t ind = compEl->Index();
714  if(ind==indexEl){
715  //-------------------------------------------
716  TPZStack<TPZCompElSide> neighequal;
717  for(int side = compEl->Reference()->NSides()-2; side > compEl->Reference()->NCornerNodes()-1; side--)
718  {
719  TPZVec<int64_t> subindexneigh;
720  int64_t indneigh;
721  neighequal.Resize(0);
722  TPZCompElSide celside(compEl,side);
723  celside.EqualLevelElementList(neighequal, 0, 0);
724 
725  int nneighs = neighequal.size();
726  if(nneighs != 0)
727  {
728  for(int i =0; i<nneighs; i++)
729  {
730  TPZInterpolationSpace * InterpEl = dynamic_cast<TPZInterpolationSpace *>(neighequal[i].Element());
731  if(!InterpEl || InterpEl->Dimension() == compEl->Dimension()) continue;
732  indneigh = InterpEl->Index();
733  InterpEl->Divide(indneigh, subindexneigh, 1);
734  }
735  }
736  }
737  //-------------------------------------------
738  compEl->Divide(indexEl, subindex, 1);
739  break;
740  }
741  }
742 
743  cMesh->AdjustBoundaryElements();
744  cMesh->CleanUpUnconnectedNodes();
745 
746 
747  //When is using one mesh with L2 space for pressure
748  if(isLagrMult==true)
749  {
750  int64_t ncon = cMesh->NConnects();
751  for(int64_t i=0; i<ncon; i++)
752  {
753  TPZConnect &newnod = cMesh->ConnectVec()[i];
754  newnod.SetLagrangeMultiplier(1);
755  }
756 
757  int64_t nel = cMesh->NElements();
758  for(int64_t i=0; i<nel; i++){
759  TPZCompEl *cel = cMesh->ElementVec()[i];
760  if(!cel) continue;
761  TPZCompElDisc *celdisc = dynamic_cast<TPZCompElDisc *>(cel);
762  celdisc->SetConstC(1.);
763  celdisc->SetCenterPoint(0, 0.);
764  celdisc->SetCenterPoint(1, 0.);
765  celdisc->SetCenterPoint(2, 0.);
766  celdisc->SetTrueUseQsiEta();
767  }
768  }
769 }
770 
771 
775 void TPZBuildMultiphysicsMesh::ShowShape(TPZVec<TPZCompMesh *> &cmeshVec, TPZCompMesh *MFMesh, TPZAnalysis &analysis, const std::string &filename, TPZVec<int64_t> &equationindices)
776 {
777  TPZStack<std::string> scalnames,vecnames;
778  scalnames.Push("State");
779  analysis.DefineGraphMesh(analysis.Mesh()->Dimension(), scalnames, vecnames, filename);
780  int porder = analysis.Mesh()->GetDefaultOrder();
781 
782  int neq = equationindices.size();
783  TPZFMatrix<STATE> solkeep(analysis.Solution());
784  analysis.Solution().Zero();
785  for (int ieq = 0; ieq < neq; ieq++) {
786  analysis.Solution()(equationindices[ieq],0) = 1.;
787  analysis.LoadSolution();
788  TransferFromMultiPhysics(cmeshVec, MFMesh);
789  analysis.PostProcess(porder);
790  analysis.Solution().Zero();
791  }
792  analysis.Solution() = solkeep;
793  analysis.LoadSolution();
794 
795 }
796 
797 
799 {
800  TPZCompMesh *multiMesh = mfcel->Mesh();
801  TPZInterpolationSpace *hdivel = dynamic_cast<TPZInterpolationSpace *> (mfcel->Element(0));
802  TPZCompEl *cel = dynamic_cast<TPZCompEl *>(mfcel->Element(1));
803  MElementType celType = cel->Type();
804 
805  TPZGeoEl *gel = mfcel->Reference();
806 
807  int dimMesh = mfcel->Mesh()->Dimension();
808  if (!hdivel || !cel || gel->Dimension() != dimMesh) {
809  DebugStop();
810  }
811 
812  //wrap element
814  wrapEl.push_back(mfcel);
815 
816  for (int side = 0; side < gel->NSides(); side++)
817  {
818  if (gel->SideDimension(side) != gel->Dimension()-1) {
819  continue;
820  }
821  TPZGeoEl *gelbound = gel->CreateBCGeoEl(side, matskeleton);
822  TPZInterpolationSpace *intel = dynamic_cast<TPZInterpolationSpace *>(hdivel);
823  int loccon = intel->SideConnectLocId(0,side);
824 
825  //Impose that the skeleton element has the same polynomial order to the element of side.
826  TPZConnect &conside = intel->Connect(loccon);
827  int sideorder = conside.Order();
828  intel->Mesh()->SetDefaultOrder(sideorder);
829 
830  int64_t index;
831  TPZInterpolationSpace *bound;
832  MElementType elType = gel->Type(side);
833  switch(elType)
834  {
835  case(EOned)://line
836  {
837  bound = new TPZCompElHDivBound2<pzshape::TPZShapeLinear>(* intel->Mesh(),gelbound,index);
838  int sideorient = intel->GetSideOrient(side);
840  hdivbound->SetSideOrient(pzshape::TPZShapeLinear::NSides-1,sideorient);
841  break;
842  }
843  case(ETriangle)://triangle
844  {
845  bound = new TPZCompElHDivBound2<pzshape::TPZShapeTriang>(* intel->Mesh(),gelbound,index);
846  int sideorient = intel->GetSideOrient(side);
848  hdivbound->SetSideOrient(pzshape::TPZShapeTriang::NSides-1,sideorient);
849  break;
850  }
851  case(EQuadrilateral)://quadrilateral
852  {
853  bound = new TPZCompElHDivBound2<pzshape::TPZShapeQuad>(* intel->Mesh(),gelbound,index);
854  int sideorient = intel->GetSideOrient(side);
856  hdivbound->SetSideOrient(pzshape::TPZShapeQuad::NSides-1,sideorient);
857  break;
858  }
859 
860  default:
861  {
862  bound=0;
863  std::cout << "ElementType not found!";
864  DebugStop();
865  break;
866  }
867  }
868 
869  int64_t sideconnectindex = intel->ConnectIndex(loccon);
870 
871  TPZConnect &co = bound->Connect(0);
872  if(co.HasDependency()){
873  if(bound->NConnects()!=1) DebugStop();
874  //int64_t cindex_bound = bound->ConnectIndex(0);
875  co.RemoveDepend();
876  }
877  bound->SetConnectIndex(0, sideconnectindex);
878  //bound->Print(std::cout);
879 
880  TPZCompEl *newMFBound = multiMesh->CreateCompEl(gelbound, index);
881  TPZMultiphysicsElement *locMF = dynamic_cast<TPZMultiphysicsElement *>(newMFBound);
882 
883  locMF->AddElement(bound, 0);
884  //locMF->Print(std::cout);
885 
886  if(celType==EDiscontinuous){
887  TPZCompElDisc *discel = dynamic_cast<TPZCompElDisc *>(mfcel->Element(1));
888  locMF->AddElement(TPZCompElSide(discel,side), 1);
889  }else{
890  TPZInterpolationSpace *contcel = dynamic_cast<TPZInterpolationSpace *>(mfcel->Element(1));
891  locMF->AddElement(TPZCompElSide(contcel,side), 1);
892  }
893 
894  wrapEl.push_back(locMF);
895  }
896 
897  ListGroupEl.push_back(wrapEl);
898 }
899 
900 static void FillAtomic(TPZCompEl *cel, TPZVec<atomic_index> &indexes);
901 
903 {
904  int ncon = mphys->NConnects();
905  int count = 0;
906  int nmeshes = mphys->NMeshes();
907  for (int imesh = 0; imesh<nmeshes; imesh++) {
908  if(mphys->IsActiveApproxSpaces(imesh) == false) continue;
909  TPZCompEl *cel = mphys->Element(imesh);
910  if(!cel) continue;
911  TPZCompMesh *atomic_mesh = cel->Mesh();
912  int nc = cel->NConnects();
913  for (int ic=0; ic<nc; ic++) {
914  int64_t atomic_conindex = cel->ConnectIndex(ic);
915  int64_t conindex = mphys->ConnectIndex(count);
916  indexes[conindex] = atomic_index(atomic_mesh,atomic_conindex);
917  count++;
918  }
919  }
920  if(count != ncon) DebugStop();
921 }
922 
923 static void FillAtomic(TPZElementGroup *elgr, TPZVec<atomic_index> &indexes)
924 {
925  TPZVec<TPZCompEl *> elvec = elgr->GetElGroup();
926  for (int el=0; el<elvec.size(); el++) {
927  TPZCompEl *cel = elvec[el];
928  FillAtomic(cel, indexes);
929  }
930 }
931 
933 {
934  TPZCompEl *cel = cond->ReferenceCompEl();
935  FillAtomic(cel, indexes);
936 }
937 
938 static void FillAtomic(TPZCompEl *cel, TPZVec<atomic_index> &indexes)
939 {
940  TPZMultiphysicsElement *mphys = dynamic_cast<TPZMultiphysicsElement *>(cel);
941  TPZElementGroup *elgr = dynamic_cast<TPZElementGroup *>(cel);
942  TPZCondensedCompEl *condense = dynamic_cast<TPZCondensedCompEl *>(cel);
943  if(mphys)
944  {
945  FillAtomic(mphys, indexes);
946  }
947  if(elgr)
948  {
949  FillAtomic(elgr, indexes);
950  }
951  if(condense)
952  {
953  FillAtomic(condense, indexes);
954  }
955 }
956 
962 {
963  int64_t ncon = mesh->NConnects();
964  int64_t nel = mesh->NElements();
965  atomic_index def(0,-1);
966  indexes.Resize(ncon, def);
967  for (int64_t el = 0; el<nel; el++) {
968  TPZCompEl *cel = mesh->Element(el);
969  if(cel)
970  {
971  FillAtomic(cel, indexes);
972  }
973  }
974 }
int64_t NElements() const
Number of computational elements allocated.
Definition: pzcmesh.h:169
void HigherLevelCompElementList2(TPZStack< TPZCompElSide > &elsidevec, int onlyinterpolated, int removeduplicates)
Returns all connected computational elements which have level higher to the current element if onlyi...
TPZGeoMesh * Reference() const
Returns a pointer to the geometrical mesh associated.
Definition: pzcmesh.h:209
void AdjustBoundaryElements()
Will refine the elements associated with a boundary condition till there are no elements constrained ...
Definition: pzcmesh.cpp:1423
Contains TPZAnalysis class which implements the sequence of actions to perform a finite element analy...
virtual int GetSideOrient(int side)
It returns the normal orientation of the reference element by the side. Only side that has dimension ...
TPZStack< TPZCompEl *, 5 > GetElGroup()
int Position(const int block_diagonal) const
Returns the position of first element block dependent on matrix diagonal.
Definition: pzblock.h:177
void SetAllCreateFunctionsContinuous()
Definition: pzcmesh.h:508
filename
Definition: stats.py:82
Implements computational element and a side. Computational Element.
Definition: pzcompel.h:632
int Set(const int index, const int dim, const int pos=-1)
Modifies existing block dimensions or creates a new block with given index.
Definition: pzblock.cpp:104
Represents a set of shape functions associated with a computational element/side. Computational Eleme...
Definition: pzconnect.h:30
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.
Definition: pzcompel.cpp:195
virtual void InitializeIntegrationRule() override=0
After adding the elements initialize the integration rule.
std::pair< TPZCompMesh *, int64_t > atomic_index
This class has methods to build the mesh multiphysics.
virtual void SetConnectIndex(int inode, int64_t index)=0
Set the index i to node inode.
int MaterialId() const
Returns the material index of the element.
Definition: pzgeoel.h:250
static void AddElements(TPZVec< TPZCompMesh *> &cmeshVec, TPZCompMesh *MFMesh)
Creating multiphysic elements into mphysics computational mesh. Method to add elements in the mesh mu...
virtual TPZCompEl * Element(int64_t elindex)=0
virtual void AddShapeRestraint(TPZOneShapeRestraint restraint) override
Add a shape restraint (meant to fit the pyramid to restraint.
TPZGeoElSide Reference() const
Reference to the geometric element.
Definition: pzcompel.cpp:748
virtual void AddElement(TPZCompEl *cel, int64_t mesh)=0
Contains the declaration of the TPZElementGroup class, which implements an computational element whic...
virtual int Dimension() const =0
Dimension of the element.
virtual int NCornerNodes() const =0
Returns the number of corner nodes of the element.
static void TransferFromMultiPhysics(TPZVec< TPZCompMesh *> &cmeshVec, TPZCompMesh *MFMesh)
Transfer information from a specific mesh multiphysics for the current specific set of meshes...
void SetLagrangeMultiplier(unsigned char mult)
Set the connect as a pressure connect or not.
Definition: pzconnect.h:236
virtual int64_t NMeshes()=0
TPZCompMesh * Mesh() const
Returns the pointer to the computational mesh.
Definition: pzanalysis.h:180
int64_t NElements() const
Number of elements of the mesh.
Definition: pzgmesh.h:129
Definition of the retraint associated with the top of the pyramid.
TPZCompEl * ReferenceCompEl()
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...
Definition: pzgeoelside.h:83
Class which groups elements to characterize dense matrices.
const TVar & Get(const int block_row, const int block_col, const int r, const int c) const
Gets a element from matrix verifying.
Definition: pzblock.cpp:191
virtual void SetSideOrient(int side, int sideorient) override
It set the normal orientation of the element by the side. Only side that has dimension equal to my di...
virtual void DefineGraphMesh(int dimension, const TPZVec< std::string > &scalnames, const TPZVec< std::string > &vecnames, const std::string &plotfile)
Define GrapMesh as V3D, DX, MV or VTK depending on extension of the file.
Definition: pzanalysis.cpp:952
int64_t NElements() const
Access method to query the number of elements of the vector.
REAL val(STATE &number)
Returns value of the variable.
Definition: pzartdiff.h:23
int NDof(TPZCompMesh &mesh)
Number of degrees of freedom associated with the object.
Definition: pzconnect.cpp:317
Implements a chunk vector with free store administration. Utility.
Definition: TPZStream.h:39
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.
virtual int SideDimension(int side) const =0
Return the dimension of side.
void EqualLevelCompElementList(TPZStack< TPZCompElSide > &elsidevec, int onlyinterpolated, int removeduplicates)
Returns all connected computational elements which have equal level to the current element...
virtual void Resize(const int64_t newsize, const T &object)
Resizes the vector object.
Definition: pzmanvector.h:426
void LoadReferences()
Map this grid in the geometric grid.
Definition: pzcmesh.cpp:482
Contains TPZShapeLinear class which implements the shape functions of a linear one-dimensional elemen...
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)
void SetDefaultOrder(int order)
Definition: pzcmesh.h:403
virtual int IsInterface()
Definition: pzcompel.h:159
TPZFMatrix< STATE > & Solution()
Returns the solution matrix.
Definition: pzanalysis.h:177
static void AppendConnects(TPZCompMesh *cmesh, TPZCompMesh *MFMesh)
virtual TPZMaterial * Material() const
Identify the material object associated with the element.
Definition: pzcompel.cpp:959
unsigned char LagrangeMultiplier() const
Access method to return the indication whether the connect is associated with a pressure lagrange mul...
Definition: pzconnect.h:230
virtual TPZCompMesh * FatherMesh() const override
Returns the current submesh father mesh.
Definition: pzsubcmesh.cpp:260
TPZCompEl * CreateCompEl(TPZGeoEl *gel, int64_t &index)
Create a computational element based on the geometric element.
Definition: pzcmesh.h:462
int Zero() override
Makes Zero all the elements.
Definition: pzfmatrix.h:651
int64_t size() const
Returns the number of elements of the vector.
Definition: pzvec.h:196
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...
Definition: pzvec.h:373
TPZCompEl * Element(int64_t iel)
Definition: pzcmesh.h:185
void Resize(const int newsize)
Increase the size of the chunk vector.
Definition: pzadmchunk.h:280
unsigned char Order() const
Access function to return the order associated with the connect.
Definition: pzconnect.h:217
TPZCreateApproximationSpace & ApproxSpace()
Definition: pzcmesh.h:498
int64_t SequenceNumber() const
Returns the Sequence number of the connect object.
Definition: pzconnect.h:158
Implements the sequence of actions to perform a finite element analysis. Analysis.
Definition: pzanalysis.h:32
void Push(const T object)
Pushes a copy of the object on the stack.
Definition: pzstack.h:80
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...
Definition: pzcompel.cpp:771
int64_t fDepConnectIndex
Definition: pzconnect.h:69
void AllNeighbours(TPZStack< TPZGeoElSide > &allneigh)
Returns the set of neighbours which can directly be accessed by the datastructure.
Definition: pzgeoelside.h:333
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...
Definition: pzcompel.cpp:410
virtual void LoadSolution()
Load the solution into the computable grid.
Definition: pzanalysis.cpp:441
virtual void Print(std::ostream &out=std::cout) const
Print the information of the grid to an ostream.
Definition: pzgmesh.cpp:130
Structure to reference dependency.
Definition: pzconnect.h:67
static void TransferFromMeshes(TPZVec< TPZCompMesh *> &cmeshVec, TPZCompMesh *MFMesh)
Transfer information from a specific set of meshes for the current mesh multiphysics.
Defines the behaviour of all geometric elements. GeometryTPZGeoEl is the common denominator for all g...
Definition: pzgeoel.h:43
Implements a group of computational elements as a mesh and an element. Computational Mesh...
Definition: pzsubcmesh.h:36
#define DebugStop()
Returns a message to user put a breakpoint in.
Definition: pzerror.h:20
Contains declaration of TPZInterfaceElement class which computes the contribution over an interface b...
virtual void ExpandSolution()
Adapt the solution vector to new block dimensions.
Definition: pzcmesh.cpp:396
#define LOGPZ_DEBUG(A, B)
Define log for debug info.
Definition: pzlog.h:87
TPZCompMesh * Mesh() const
Return a pointer to the grid of the element.
Definition: pzcompel.cpp:288
int Dimension() const
Returns the dimension of the simulation.
Definition: pzcmesh.h:148
Contains the declaration of the TPZBuildmultiphysicsMesh class.
virtual TPZCompEl * ReferredElement(int64_t mesh)=0
Contains the declaration of multiphysic interface class.
virtual MElementType Type() const =0
Returns the element type acording to pzeltype.h.
int64_t InternalIndex(int64_t IndexinFather)
return the index in the subcompmesh of a connect with index within the father
TPZCompEl * Reference() const
Return a pointer to the element referenced by the geometric element.
Definition: pzgeoel.h:750
virtual void AutoBuild(const std::set< int > *MaterialIDs)
Creates the computational elements, and the degree of freedom nodes.
Definition: pzcmesh.cpp:308
unsigned int NShape() const
Definition: pzconnect.h:151
int HasDependency() const
Returns whether exist dependecy information.
Definition: pzconnect.h:292
virtual TPZGeoEl * CreateBCGeoEl(int side, int bc)=0
Method which creates a geometric element on the side of an existing element.
void SetAllCreateFunctionsContinuous()
Create continuous approximation spaces.
const TPZBlock< STATE > & Block() const
Access the block structure of the solution vector.
Definition: pzcmesh.h:213
void SetNMeshes(int64_t nmeshes)
Definition: pzcmesh.h:445
TPZDepend * fNext
Definition: pzconnect.h:71
int64_t NConnects() const
Number of connects allocated including free nodes.
Definition: pzcmesh.h:163
Contains declaration of TPZCompelDisc class which implements a computational element for discontinuou...
REAL co[8][3]
Coordinates of the eight nodes.
TPZAdmChunkVector< TPZConnect > & ConnectVec()
Return a reference to the connect pointers vector.
Definition: pzcmesh.h:198
Class which implements an element which condenses the internal connects.
int64_t Index() const
Returns element index of the mesh fELementVec list.
Definition: pzcompel.h:821
Implements a generic computational element to HDiv scope. Computational Element.
int SetNBlocks(const int num_of_blocks)
Sets number of blocks on diagonal matrix.
Definition: pzblock.cpp:91
virtual void PostProcess(int resolution)
Draw solution over mesh for all dimensions.
virtual TPZConnect & Connect(int i) const
Returns a pointer to the ith node.
Definition: pzcompel.cpp:298
unsigned char NState() const
Number of state variables associated with the connect.
Definition: pzconnect.h:146
static void UniformRefineCompMesh(TPZCompMesh *cMesh, int ndiv, bool isLagrMult=true)
Uniform refinement of the computational mesh.
A simple stack.
virtual void SetConnectIndexes(TPZVec< int64_t > &indexes)=0
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...
Implements the interfaces for TPZCompElDisc, TPZInterfaceElement and TPZInterpolatedElement. Computational element.
virtual int NConnects() const =0
Returns the number of nodes of the element.
TPZGeoEl * Element() const
Definition: pzgeoelside.h:162
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.
Definition: pzcompel.h:432
static int idf[6]
virtual int SideConnectLocId(int icon, int is) const =0
Returns the local node number of icon along is.
virtual void CleanUpUnconnectedNodes()
Delete the nodes which have no elements connected to them.
Definition: pzcmesh.cpp:498
virtual int Dimension() const =0
Returns the dimension of the element.
TPZCompEl * Element() const
Gives a pointer to the reference computational element.
Definition: pzcompel.h:675
static void UniformRefineCompEl(TPZCompMesh *cMesh, int64_t indexEl, bool isLagrMult)
Uniform refinement of the computational element.
int Put(const int block_row, const int block_col, const int r, const int c, const TVar &value)
Puts a element to matrix verifying.
Definition: pzblock.cpp:217
TPZGeoEl * Reference() const
Return a pointer to the corresponding geometric element if such exists, return 0 otherwise.
Definition: pzcompel.cpp:1137
static void BuildHybridMesh(TPZCompMesh *cmesh, std::set< int > &MaterialIDs, std::set< int > &BCMaterialIds, int LagrangeMat, int InterfaceMat)
Creating computational mesh with interface elements.
This class implements a geometric mesh for the pz environment. Geometry.
Definition: pzgmesh.h:48
MElementType
Define the element types.
Definition: pzeltype.h:52
void ResetReference()
Reset the element referenced by the geometric element to NULL.
Definition: pzgeoel.h:431
Computes the contribution over an interface between two discontinuous elements. Computational Element...
TPZDepend * FirstDepend()
Definition: pzconnect.h:296
Contains declaration of TPZCompElHDivBound2 class which implements a generic computational element (H...
Implements computational mesh. Computational Mesh.
Definition: pzcmesh.h:47
int Size(const int block_diagonal) const
Returns block dimension.
Definition: pzblock.h:171
TPZAdmChunkVector< TPZCompEl * > & ElementVec()
Returns a reference to the element pointers vector.
Definition: pzcmesh.h:183
void SetConstC(REAL c)
void BuildMesh(TPZCompMesh &cmesh, const std::set< int > &MaterialIDs) const
Creates the computational elements, and the degree of freedom nodes.
int Id() const
Definition: TPZMaterial.h:170
void RemoveDepend(int64_t myindex, int64_t dependindex)
Remove dependency between connects if exist.
Definition: pzconnect.cpp:178
pthread_cond_t cond
Definition: numatst.cpp:318
int InterfaceMaterial(int leftmaterial, int rightmaterial)
Returns the interface material associated to left and right element materials. If no interface materi...
Definition: pzgmesh.cpp:1548
int64_t NElements() const
Returns the number of elements of the vector.
Definition: pzvec.h:190
static void ShowShape(TPZVec< TPZCompMesh *> &cmeshVec, TPZCompMesh *MFMesh, TPZAnalysis &analysis, const std::string &filename, TPZVec< int64_t > &equationindices)
Show shape functions associated with connects of a multiphysics mesh.
void SetCenterPoint(int i, REAL x)
static void AddWrap(TPZMultiphysicsElement *mfcel, int matskeleton, TPZStack< TPZStack< TPZMultiphysicsElement *, 7 > > &ListGroupEl)
Create skeleton elements of the wrap of me.
clarg::argInt porder("-porder", "polinomial order", 1)
static void ComputeAtomicIndexes(TPZCompMesh *mesh, TPZVec< atomic_index > &indexes)
void SetTrueUseQsiEta()
This class implements a discontinuous element (for use with discontinuous Galerkin). Computational Element.
Definition: TPZCompElDisc.h:35
virtual bool IsActiveApproxSpaces(int space_index)
void InitializeBlock()
Resequence the block object, remove unconnected connect objects and reset the dimension of the soluti...
Definition: pzcmesh.cpp:391
Definition: pzeltype.h:55
void ResetReference()
Resets all load references in elements and nodes.
Definition: pzgmesh.cpp:197
Defines the interface of a computational element. Computational Element.
Definition: pzcompel.h:59
Contains the declaration of the TPZCondensedCompEl class, which implements an computational element w...
void push_back(const T object)
Definition: pzstack.h:48
TPZGeoEl * Father() const
Computes the normal vectors needed for forming HDiv vector valued shape functions.
Definition: pzgeoel.cpp:2574
int GetDefaultOrder()
Definition: pzcmesh.h:398
Contains TPZShapeQuad class which implements the shape functions of a quadrilateral element...
TPZFMatrix< STATE > & Solution()
Access the solution vector.
Definition: pzcmesh.h:219
Contains TPZShapeTriang class which implements the shape functions of a triangular element...
int64_t GetNMeshes()
Definition: pzcmesh.h:449
TPZAdmChunkVector< TPZGeoEl * > & ElementVec()
Methods for handling pzlists.
Definition: pzgmesh.h:138
static void FillAtomic(TPZCompEl *cel, TPZVec< atomic_index > &indexes)