NeoPZ
pzmultiphysicscompel.cpp
Go to the documentation of this file.
1 
6 #include "pzmultiphysicscompel.h"
7 
8 #include "pzcompel.h"
9 #include "pzgeoel.h"
10 #include "pztrnsform.h"
11 #include "TPZMaterial.h"
12 #include "tpzautopointer.h"
13 #include "pzgeopoint.h"
14 #include "pzgeoquad.h"
15 #include "pzgeotriangle.h"
16 #include "pzgeotetrahedra.h"
17 #include "pzgeoprism.h"
18 #include "TPZGeoCube.h"
19 #include "TPZGeoLinear.h"
20 #include "pzgeopyramid.h"
21 #include "TPZMaterial.h"
22 #include "pzelmat.h"
23 #include "pzconnect.h"
24 #include "pzmaterialdata.h"
25 #include "pzinterpolationspace.h"
26 #include "pzlog.h"
27 #include "pzcompelwithmem.h"
28 
29 #include "pzbndcond.h"
30 
31 #include <set>
32 
33 using namespace pzgeom;
34 
35 
36 #ifdef LOG4CXX
37 static LoggerPtr logger(Logger::getLogger("pz.mesh.tpzmultiphysiccompEl"));
38 #endif
39 
40 template <class TGeometry>
42 TPZMultiphysicsElement(), fElementVec(0){
43 }
44 
45 template <class TGeometry>
47 TPZMultiphysicsElement(mesh,copy),
49 {
50 #ifdef PZDEBUG
51  TPZMaterial * material = Material();
52  if(!material){
53  PZError << "Error at " << __PRETTY_FUNCTION__ << " this->Material() == NULL\n";
54  return;
55  }
56 #endif
57 
58 }
59 
60 template <class TGeometry>
63  std::map<int64_t,int64_t> & gl2lcConMap,
64  std::map<int64_t,int64_t> & gl2lcElMap) : TPZRegisterClassId(&TPZMultiphysicsCompEl::ClassId){
65 
66  DebugStop(); // if this is called, withmem should not work
67 }
68 
69 
70 template <class TGeometry>
72 TPZMultiphysicsElement(mesh, ref, index), fElementVec(0) {
73 }
74 
75 template<class TGeometry>
77  int nc = NConnects();
78  for (int ic=0; ic<nc; ic++) {
79  Connect(ic).RemoveDepend();
80  }
81 }
82 
83 template <class TGeometry>
85 {
86  int64_t nel;
87  int side, dim, dimmf;
88  nel=fElementVec.size();
89  trVec.Resize(nel);
90  TPZGeoEl *gelmf = Reference();
91  dimmf = gelmf->Dimension();
92  side = gelmf->NSides()-1;
93  TPZGeoEl *geoel;
94  for (int64_t i = 0; i<nel; i++) {
95  if (!fElementVec[i]) {
96  continue;
97  }
98  geoel = fElementVec[i].Element()->Reference();
99  dim = geoel->Dimension();
100  if (dim == dimmf) {
101  TPZTransform<> tr(dim);
102  TPZGeoElSide gelside(geoel,geoel->NSides()-1);
103  TPZGeoElSide gelmfside(gelmf,side);
104  if (gelside.NeighbourExists(gelmfside))
105  {
106  trVec[i] = tr;
107  gelmfside.SideTransform3(gelside, trVec[i]);
108  }
109  else
110  {
111  trVec[i] = gelmf->BuildTransform2(side, geoel, tr);
112  }
113  }
114  else
115  {
116  TPZTransform<> LocalTransf(dimmf);
117  TPZGeoElSide thisgeoside(gelmf,gelmf->NSides()-1);
118  TPZGeoElSide neighgeoside = fElementVec[i].Reference();
119  thisgeoside.SideTransform3(neighgeoside, LocalTransf);
120  TPZGeoElSide highdim(neighgeoside.Element(), neighgeoside.Element()->NSides()-1);
121  trVec[i] = neighgeoside.SideToSideTransform(highdim).Multiply(LocalTransf);
122 
123  }
124  }
125 }
126 
127 template <class TGeometry>
129 
130  if(cmeshVec.NElements() == 0) return;
131  TPZCompMesh *cmesh = cmeshVec[0];
132  TPZGeoMesh *gmesh = cmesh->Reference();
133  gmesh->ResetReference();
134  int64_t isub;
135  int64_t ncm = cmeshVec.NElements();
136  for (isub=0; isub<ncm; isub++) {
137  cmeshVec[isub]->LoadReferences();
138  }
139  int64_t ncel;
140  TPZStack<TPZCompElSide> sidevec;
141  for(int64_t i = 0; i< ncm; i++){
142  ncel = cmeshVec[i]->NElements();
143  for (int64_t j=0; j<ncel; j++) {
144  TPZCompEl * cel = cmeshVec[i]->ElementVec()[j];
145  if(cel){
146  TPZGeoEl *geoel = cel->Reference();
147 
148 #ifdef PZDEBUG
149  if (!geoel){
150  PZError << "Error at " << __PRETTY_FUNCTION__ << " Geometry element null!\n";
151  DebugStop();
152  }
153 #endif
154 
155  int ns = geoel->NSides();
156  TPZGeoElSide *geoside = new TPZGeoElSide(geoel,ns-1);
157  sidevec.Resize(0);
158  geoside->HigherLevelCompElementList2(sidevec, 1,1);
159  int64_t nel = sidevec.NElements();
160  if (nel==0){
161  //std::cout << "Incluindo elemento " << geoel->Index() << std::endl;
162  refIndexVec.insert(geoel->Index());
163  }
164  }
165  }
166  }
167 
168 
169 #ifdef LOG4CXX
170  {
171  std::stringstream sout;
172  sout << "Number of elements : " << refIndexVec.size() << std::endl;
173  sout <<"Reference index of elements : "<< std::endl;
174  std::set<int64_t>::iterator it;
175  for (it=refIndexVec.begin() ; it != refIndexVec.end(); it++ )
176  sout << " " << *it;
177  sout << std::endl;
178  LOGPZ_DEBUG(logger,sout.str())
179  }
180 #endif
181 
182 }
183 
184 /*{
185  //ComputeNodElCon();
186  out << "\n\t\tCOMPUTABLE GRID INFORMATIONS:\n\n";
187  out << "TITLE-> " << fName << "\n\n";
188 
189  out << "number of connects = " << NConnects() << std::endl;
190  out << "number of elements = " << NElements() << std::endl;
191  out << "number of materials = " << NMaterials() << std::endl;
192  // out << "number of nodal bound cond = " << NBCConnects() << endl;
193 
194  out << "\n\t Connect Information:\n\n";
195  int i, nelem = NConnects();
196  for(i=0; i<nelem; i++) {
197  if(fConnectVec[i].SequenceNumber() == -1) {
198  if(fConnectVec[i].HasDependency()) {
199  cout << "TPZCompMesh::Print inconsistency of connect\n";
200  cout << "Index " << i << ' ';
201  fConnectVec[i].Print(*this,std::cout);
202  }
203  continue;
204  }
205  out << "Index " << i << ' ';
206  fConnectVec[i].Print(*this,out);
207  }
208  out << "\n\t Computable Element Information:\n\n";
209  nelem = NElements();
210  for(i=0; i<nelem; i++) {
211  if(!fElementVec[i]) continue;
212  TPZCompEl *el = fElementVec[i];
213  out << "Index " << i << ' ';
214  el->Print(out);
215  if(!el->Reference()) continue;
216  out << "\tReference Index = " << el->Reference()->Index() << std::endl << std::endl;
217  }
218  out << "\n\tMaterial Information:\n\n";
219  std::map<int, TPZMaterial * >::const_iterator mit;
220  nelem = NMaterials();
221  for(mit=fMaterialVec.begin(); mit!= fMaterialVec.end(); mit++) {
222  TPZMaterial *mat = mit->second;
223  if (!mat) {
224  DebugStop();
225  }
226  mat->Print(out);
227  }
228 
229  }*/
230 
231 template <class TGeometry>
232 void TPZMultiphysicsCompEl<TGeometry>::Print(std::ostream & out) const {
233 
234  out << __PRETTY_FUNCTION__ << std::endl;
235  TPZCompEl::Print(out);
236  out << "Integration rule ";
237  GetIntegrationRule().Print(out);
238  if(this->Reference())
239  {
240  out << "\nCenter coordinate: ";
241  TPZVec< REAL > centerMaster( this->Reference()->Dimension(),0. );
242  TPZVec< REAL > centerEuclid( 3,0.);
243  this->Reference()->CenterPoint(this->Reference()->NSides()-1,centerMaster);
244  this->Reference()->X(centerMaster,centerEuclid);
245  out << centerEuclid << std::endl;
246  }
247  if(this->Material())
248  {
249  out << "Material id " << this->Material()->Id() << "\n";
250  }
251  else {
252  out << "No material\n";
253  }
254 
255  out << "Number of connects = " << NConnects();
256  out << "Connect indexes : ";
257  int nod;
258  for(nod=0; nod< NConnects(); nod++)
259  {
260  out << ConnectIndex(nod) << ' ' ;
261  }
262  if(this->Reference())
263  {
264  out << "Reference Index = " << this->Reference()->Index() << std::endl;
265  }
266  std::list<TPZOneShapeRestraint> restraints = this->GetShapeRestraints();
267  if(restraints.size())
268  {
269  out << "One shape restraints\n";
270  for (std::list<TPZOneShapeRestraint>::const_iterator it = restraints.begin(); it != restraints.end(); it++) {
271  it->Print(out);
272  }
273  }
274 
275  out << "\nComputational elements this multi-physics element: \n";
276  int64_t nmesh = fElementVec.size();
277  for(int64_t iel = 0; iel< nmesh; iel++ ){
278 
279  out << "\nComputational element belonging to the mesh " << iel+1 <<":\n";
280  TPZCompEl *cel = fElementVec[iel].Element();
281  if(!cel){
282  out << "\n There is not element to computational mesh " << iel+1 <<"\n";
283  continue;
284  }
285  cel->Print(out);
286  if(!cel->Reference()) continue;
287  out << "\tReference Index = " << cel->Reference()->Index();
288 
290  AffineTransform(tr);
291  out << "\n\tAffine transformation of the multiphysics element for this computational element:"<<"\n";
292  out << std::endl;
293  out <<"\t" << tr[iel];
294  }
295 }
296 
297 
298 template <class TGeometry>
300 
301  PZError << "Error at " << __PRETTY_FUNCTION__ << " method is not implementedl!\n";
302  DebugStop();
303  return 0;
304 }
305 
306 template <class TGeometry>
308  std::map<int64_t,int64_t> & gl2lcConMap,
309  std::map<int64_t,int64_t> & gl2lcElMap) const {
310  PZError << "Error at " << __PRETTY_FUNCTION__ << " method is not implementedl!\n";
311  DebugStop();
312  return 0;
313 }
314 
315 template <class TGeometry>
317  return fConnectIndexes.NElements();
318 }
319 
320 template <class TGeometry>
322  return fConnectIndexes[i];
323 }
324 
325 template <class TGeometry>
326 int64_t TPZMultiphysicsCompEl<TGeometry>::ConnectIndex(int elem, int connect) const {
327 
328  int first = 0;
329  for(int64_t el=0; el<elem; el++){
330  TPZCompEl *cel = fElementVec[el].Element();
331  if (cel && fActiveApproxSpace[el]) {
332  first+=cel->NConnects();
333  }
334  }
335  return fConnectIndexes[first+connect];
336 }
337 
338 
339 template <class TGeometry>
341  for(int el = 0; el < fElementVec.NElements(); el++)
342  {
343  if(fElementVec[el])
344  {
345  return fElementVec[el].Element()->Dimension();
346  }
347  }
348  return -1;
349 }
350 
351 
352 
353 template<class TGeometry>
355  TPZMaterial * material = this->Material();
356  if(!material){
357  PZError << "Error at " << __PRETTY_FUNCTION__ << " : no material for this element\n";
358  return;
359  }
360  if (!this->Reference()){
361  PZError << "Error at " << __PRETTY_FUNCTION__ << " : no reference element\n";
362  return;
363  }
364 
365  int64_t nref = fElementVec.size();
366  TPZVec<TPZMaterialData> datavec;
367  datavec.resize(nref);
368 
369 #ifdef PZDEBUG
370  if (nref != datavec.size()) {
371  PZError << "Error at " << __PRETTY_FUNCTION__ << " The number of materials can not be different from the size of the fElementVec !\n";
372  DebugStop();
373  }
374 #endif
375 
376  TPZVec<int> nshape(nref);
377  for (int64_t iref = 0; iref<nref; iref++)
378  {
379 
380  TPZInterpolationSpace *msp = dynamic_cast <TPZInterpolationSpace *>(fElementVec[iref].Element());
381  if(!msp) continue;
382  msp->InitMaterialData(datavec[iref]);
383  }
384 
385 
386  // TPZManVector<REAL, 3> intpoint(dim,0.);
387  // const int varsize = material->NSolutionVariables(variable);
388  // value.Resize(varsize);
389  value.Fill(0.);
390  //
391  // const TPZIntPoints &intrule = this->GetIntegrationRule();
392  // int npoints = intrule.NPoints(), ip, iv;
393  // TPZManVector<REAL> sol(varsize);
394  // for(ip=0;ip<npoints;ip++){
395  // intrule.Point(ip,intpoint,weight);
396  // sol.Fill(0.);
397  // this->Solution(intpoint, variable, sol);
398  // //Tiago: Next call is performed only for computing detcaj. The previous method (Solution) has already computed jacobian.
399  // // It means that the next call would not be necessary if I wrote the whole code here.
400  // this->Reference()->Jacobian(intpoint, data.jacobian, data.axes, data.detjac, data.jacinv);
401  // weight *= fabs(data.detjac);
402  // for(iv = 0; iv < varsize; iv++) {
403  //#if !BUILD_COMPLEX_PROJECTS
404  // DebugStop();
405  //#else
406  // value[iv] += sol[iv]*weight;
407  //#endif
408  // }//for iv
409  // }//for ip
410 }//method
411 
412 
413 template<class TGeometry>
415 {
416 
417  if (var >= 99) {
418  TPZCompEl::Solution(qsi, var, sol);
419  return;
420  }
421 
422  TPZMaterial * material = this->Material();
423  if(!material){
424  sol.Resize(0);
425  return;
426  }
427 
428  // TPZManVector<REAL,3> xi(qsi.size());
429  // Reference()->CenterPoint(Reference()->NSides()-1,xi);
430  // for (int i=0; i<xi.size(); i++) {
431  // qsi[i] += 0.001*(xi[i]-qsi[i]);
432  // }
433 
434 
436  AffineTransform(trvec);
437 
438  TPZManVector<REAL,3> myqsi(qsi);
439  myqsi.resize(qsi.size());
440 
441  int64_t nref = fElementVec.size();
443  datavec.resize(nref);
444 
445  for (int64_t iref = 0; iref<nref; iref++)
446  {
447 
448  TPZInterpolationSpace *msp = dynamic_cast <TPZInterpolationSpace *>(fElementVec[iref].Element());
449  if(!msp) continue;
450  msp->InitMaterialData(datavec[iref]);
451  material->FillDataRequirements(datavec[iref]);
452  trvec[iref].Apply(qsi, myqsi);
453  datavec[iref].p = msp->MaxOrder();
454 
455  TPZMaterialData::MShapeFunctionType shapetype = datavec[iref].fShapeType;
456  if(shapetype==datavec[iref].EVecandShape){
457  msp->ComputeRequiredData(datavec[iref], myqsi);
458 
459  }
460  else
461  {
462  msp->ComputeShape(myqsi,datavec[iref]);
463  }
464  msp->ComputeSolution(myqsi, datavec[iref]);
465 
466  datavec[iref].x.Resize(3);
467  msp->Reference()->X(myqsi, datavec[iref].x);
468  }
469 
470  material->Solution(datavec, var, sol);
471 }
472 
473 template <class TGeometry>
475  TPZSolVec &sol, TPZGradSolVec &dsol,TPZFMatrix<REAL> &axes){
476  PZError << "Error at " << __PRETTY_FUNCTION__ << " method is not implementedl!\n";
477  DebugStop();
478 }//method
479 
480 template <class TGeometry>
482  TPZVec<REAL> &normal,
483  TPZSolVec &leftsol, TPZGradSolVec &dleftsol,TPZFMatrix<REAL> &leftaxes,
484  TPZSolVec &rightsol, TPZGradSolVec &drightsol,TPZFMatrix<REAL> &rightaxes){
485  PZError << "Error at " << __PRETTY_FUNCTION__ << " method is not implementedl!\n";
486  DebugStop();
487 }
488 
489 template <class TGeometry>
491  const TPZFMatrix<REAL> &axes, TPZSolVec &sol, TPZGradSolVec &dsol){
492  PZError << "Error at " << __PRETTY_FUNCTION__ << " method is not implementedl!\n";
493  DebugStop();
494 }
495 
496 template <class TGeometry>
498  fConnectIndexes[inode] = index;
499 }
500 
501 template <class TGeometry>
503 {
504  ek.fMesh = Mesh();
505  ef.fMesh = Mesh();
508  const int ncon = this->NConnects();
509  int numeq = 0;
510  int ic;
511 
512  for(ic=0; ic<ncon; ic++)
513  {
514  int64_t neqThisConn = Connect(ic).NDof(*Mesh());
515  numeq += neqThisConn;
516  }
517 
518  int64_t nref = this->fElementVec.size();
519  int nstate = 0;
520  //nstate=1;
521  int numloadcases = 1;
522  for (int64_t iref=0; iref<nref; iref++) {
523 
524  TPZInterpolationSpace *msp = dynamic_cast <TPZInterpolationSpace *>(fElementVec[iref].Element());
525  if (! msp) {
526  continue;
527  }
528  TPZMaterial *mat = msp->Material();
529  nstate += mat->NStateVariables();
530  numloadcases = mat->NumLoadCases();
531 
532  }
533 
534  const int numstate = nstate;
535  ek.fMat.Redim(numeq,numeq);
536  ef.fMat.Redim(numeq,numloadcases);
537  ek.fBlock.SetNBlocks(ncon);
538  ef.fBlock.SetNBlocks(ncon);
539 
540  int i;
541  for(i=0; i<ncon; i++){
542  unsigned int ndof = Connect(i).NDof(*Mesh());
543 #ifdef PZDEBUG
544  TPZConnect &c = Connect(i);
545  if (c.NShape()*c.NState() != ndof) {
546  DebugStop();
547  }
548 #endif
549  ek.fBlock.Set(i,ndof);
550  ef.fBlock.Set(i,ndof);
551  }
552  ek.fConnect.Resize(ncon);
553  ef.fConnect.Resize(ncon);
554  for(i=0; i<ncon; i++){
555  (ek.fConnect)[i] = ConnectIndex(i);
556  (ef.fConnect)[i] = ConnectIndex(i);
557  }
560 }//void
561 
562 template <class TGeometry>
564 {
565  const int ncon = this->NConnects();
566  ef.fMesh = Mesh();
568  int numeq = 0;
569  int ic;
570 
571  for(ic=0; ic<ncon; ic++)
572  {
573  int64_t neqThisConn = Connect(ic).NDof(*Mesh());
574  numeq += neqThisConn;
575  }
576 
577  int64_t nref = this->fElementVec.size();
578  int nstate = 0;
579  //nstate=1;
580  int numloadcases = 1;
581  for (int64_t iref=0; iref<nref; iref++) {
582 
583  TPZInterpolationSpace *msp = dynamic_cast <TPZInterpolationSpace *>(fElementVec[iref].Element());
584  if (! msp) {
585  continue;
586  }
587  TPZMaterial *mat = msp->Material();
588  nstate += mat->NStateVariables();
589  numloadcases = mat->NumLoadCases();
590 
591  }
592 
593  const int numstate = nstate;
594  ef.fMat.Redim(numeq,numloadcases);
595  ef.fBlock.SetNBlocks(ncon);
596 
597  int i;
598  for(i=0; i<ncon; i++){
599  unsigned int ndof = Connect(i).NDof(*Mesh());
600 #ifdef PZDEBUG
601  TPZConnect &c = Connect(i);
602  if (c.NShape()*c.NState() != ndof) {
603  DebugStop();
604  }
605 #endif
606  ef.fBlock.Set(i,ndof);
607  }
608  ef.fConnect.Resize(ncon);
609  for(i=0; i<ncon; i++){
610  (ef.fConnect)[i] = ConnectIndex(i);
611  }
613 }//void
614 
615 template <class TGeometry>
617 {
618  int64_t nref = this->fElementVec.size();
619 
620 #ifdef PZDEBUG
621  if (nref != dataVec.size()) {
622  PZError << "Error at " << __PRETTY_FUNCTION__ << " The number of materials can not be different from the size of the fElementVec !\n";
623  DebugStop();
624  }
625 #endif
626  if(indices){
627  int64_t nindices = indices->size();
628  TPZVec<int> nshape(nindices);
629  for (int64_t iref = 0; iref <nindices; iref++) {
630  int64_t indiciref = indices->operator[](iref);
631  if(fElementVec[indiciref])
632  {
633  dataVec[indiciref].gelElId = fElementVec[indiciref].Element()->Reference()->Id();
634  }
635  TPZInterpolationSpace *msp = dynamic_cast <TPZInterpolationSpace *>(fElementVec[indiciref].Element());
636  if (!msp) {
637  continue;
638  }
639  // precisa comentar essa parte se for calcular os vetores no pontos de integracao.
640  msp->InitMaterialData(dataVec[indiciref]);
641  }
642  }else{
643  TPZVec<int> nshape(nref);
644  for (int64_t iref = 0; iref < nref; iref++)
645  {
646  if(fElementVec[iref])
647  {
648  dataVec[iref].gelElId = fElementVec[iref].Element()->Reference()->Id();
649  }
650  TPZInterpolationSpace *msp = dynamic_cast <TPZInterpolationSpace *>(fElementVec[iref].Element());
651  if (!msp) {
652  continue;
653  }
654  // precisa comentar essa parte se for calcular os vetores no pontos de integracao.
655  msp->InitMaterialData(dataVec[iref]);
656  }
657  }
658 
659  int n_active_approx_spaces = fActiveApproxSpace.size();
660  if (n_active_approx_spaces == 0) {
661  fActiveApproxSpace.Resize(nref, 1);
662  }
663 
664  for (int64_t iref = 0; iref < nref; iref++) {
665  dataVec[iref].fActiveApproxSpace = fActiveApproxSpace[iref];
666  }
667 
668  this->Material()->FillDataRequirements(dataVec);
669 
670 }
671 
672 template <class TGeometry>
674 {
675  TPZMaterial * material = Material();
676  if(!material){
677  PZError << "Error at " << __PRETTY_FUNCTION__ << " this->Material() == NULL\n";
678  ek.Reset();
679  ef.Reset();
680  return;
681  }
682 
684 
685  if (this->NConnects() == 0) return;//boundary discontinuous elements have this characteristic
686 
688  const int64_t nref = fElementVec.size();
689  datavec.resize(nref);
690  InitMaterialData(datavec);
691 
693  AffineTransform(trvec);
694 
695  int dim = Dimension();
697 
698  TPZManVector<REAL,4> intpointtemp(TGeometry::Dimension,0.);
699  REAL weight = 0.;
700 
701  TPZManVector<int,4> ordervec;
702  //ordervec.resize(nref);
703  for (int64_t iref=0; iref<nref; iref++)
704  {
705  TPZInterpolationSpace *msp = dynamic_cast <TPZInterpolationSpace *>(fElementVec[iref].Element());
706  int svec;
707  if(msp)
708  {
709  ordervec.Resize(ordervec.size()+1);
710  svec = ordervec.size();
711  }
712  else
713  {
714  continue;
715  }
716  datavec[iref].p = msp->MaxOrder();
717  ordervec[svec-1] = datavec[iref].p;
718  }
719  int order = material->IntegrationRuleOrder(ordervec);
720 
721  TPZGeoEl *ref = this->Reference();
722  intrule = ref->CreateSideIntegrationRule(ref->NSides()-1, order);
723 
724  TPZManVector<int,4> intorder(dim,order);
725  intrule->SetOrder(intorder);
726  int intrulepoints = intrule->NPoints();
727  if(intrulepoints > 1000) {
728  DebugStop();
729  }
730 
731  TPZFMatrix<REAL> jac, axe, jacInv;
732  REAL detJac;
733  for(int int_ind = 0; int_ind < intrulepoints; ++int_ind)
734  {
735  intrule->Point(int_ind,intpointtemp,weight);
736  ref->Jacobian(intpointtemp, jac, axe, detJac , jacInv);
737  weight *= fabs(detJac);
738  for (int i = 0; i < fElementVec.size(); i++) {
739  TPZInterpolationSpace *msp = dynamic_cast <TPZInterpolationSpace *>(fElementVec[i].Element());
740  if (!msp) {
741  continue;
742  }
743  datavec[i].intLocPtIndex = int_ind;
744  }
745 
746  this->ComputeRequiredData(intpointtemp,trvec,datavec);
747 
748  material->Contribute(datavec,weight,ek.fMat,ef.fMat);
749  }//loop over integration points
750 
751 }//CalcStiff
752 
753 template <class TGeometry>
755 {
756  TPZMaterial * material = Material();
757  if(!material){
758  PZError << "Error at " << __PRETTY_FUNCTION__ << " this->Material() == NULL\n";
759  ef.Reset();
760  return;
761  }
762 
764 
765  if (this->NConnects() == 0) return;//boundary discontinuous elements have this characteristic
766 
768  const int64_t nref = fElementVec.size();
769  datavec.resize(nref);
770  InitMaterialData(datavec);
771 
773  AffineTransform(trvec);
774 
775  int dim = Dimension();
777 
778  TPZManVector<REAL,3> intpoint(dim,0.), intpointtemp(dim,0.);
779  REAL weight = 0.;
780 
781  TPZManVector<int,3> ordervec;
782  //ordervec.resize(nref);
783  for (int64_t iref=0; iref<nref; iref++)
784  {
785  TPZInterpolationSpace *msp = dynamic_cast <TPZInterpolationSpace *>(fElementVec[iref].Element());
786  int svec;
787  if(msp)
788  {
789  ordervec.Resize(ordervec.size()+1);
790  svec = ordervec.size();
791  }
792  else
793  {
794  continue;
795  }
796  datavec[iref].p = msp->MaxOrder();
797  ordervec[svec-1] = datavec[iref].p;
798  }
799  int order = material->IntegrationRuleOrder(ordervec);
800 
801  TPZGeoEl *ref = this->Reference();
802  intrule = ref->CreateSideIntegrationRule(ref->NSides()-1, order);
803 
804  TPZManVector<int,3> intorder(dim,order);
805  intrule->SetOrder(intorder);
806  int intrulepoints = intrule->NPoints();
807  if(intrulepoints > 1000) {
808  DebugStop();
809  }
810 
811  TPZFMatrix<REAL> jac, axe, jacInv;
812  REAL detJac;
813  int nmeshes = datavec.size();
814  for(int int_ind = 0; int_ind < intrulepoints; ++int_ind)
815  {
816  intrule->Point(int_ind,intpointtemp,weight);
817  ref->Jacobian(intpointtemp, jac, axe, detJac , jacInv);
818  weight *= fabs(detJac);
819  for (int imesh = 0; imesh < nmeshes; imesh++) {
820  datavec[imesh].intLocPtIndex = int_ind;
821  }
822 
823 
824  this->ComputeRequiredData(intpointtemp,trvec,datavec);
825 
826  material->Contribute(datavec,weight,ef.fMat);
827  }//loop over integratin points
828 }//CalcStiff
829 
833 template <class TGeometry>
835 {
836  TPZManVector<STATE> result;
837  TPZMaterial * material = Material();
838  if(!material){
839  PZError << "Error at " << __PRETTY_FUNCTION__ << " this->Material() == NULL\n";
840  return result;
841  }
842 
843  if (this->NConnects() == 0) return result;//boundary discontinuous elements have this characteristic
844 
846 
848  const int64_t nref = fElementVec.size();
849  datavec.resize(nref);
850  thisnonconst->InitMaterialData(datavec);
851 
853  AffineTransform(trvec);
854 
855  int dim = Dimension();
857 
858  TPZManVector<REAL,3> intpoint(dim,0.), intpointtemp(dim,0.);
859  REAL weight = 0.;
860 
861  TPZManVector<int,3> ordervec;
862  //ordervec.resize(nref);
863  for (int64_t iref=0; iref<nref; iref++)
864  {
865  datavec[iref].fNeedsSol = true;
866  TPZInterpolationSpace *msp = dynamic_cast <TPZInterpolationSpace *>(fElementVec[iref].Element());
867  int svec;
868  if(msp)
869  {
870  ordervec.Resize(ordervec.size()+1);
871  svec = ordervec.size();
872  }
873  else
874  {
875  continue;
876  }
877  datavec[iref].p = msp->MaxOrder();
878  ordervec[svec-1] = datavec[iref].p;
879  }
880  int order = material->IntegrationRuleOrder(ordervec);
881 
882  TPZGeoEl *ref = this->Reference();
883  intrule = ref->CreateSideIntegrationRule(ref->NSides()-1, order);
884 
885  TPZManVector<int,3> intorder(dim,order);
886  intrule->SetOrder(intorder);
887  int intrulepoints = intrule->NPoints();
888  if(intrulepoints > 1000) {
889  DebugStop();
890  }
891  int nvar = material->NSolutionVariables(var);
892  TPZManVector<STATE> solout(var);
893  result.Resize(nvar, 0.);
894 
895  TPZFMatrix<REAL> jac, axe, jacInv;
896  REAL detJac;
897  for(int int_ind = 0; int_ind < intrulepoints; ++int_ind)
898  {
899  intrule->Point(int_ind,intpointtemp,weight);
900  ref->Jacobian(intpointtemp, jac, axe, detJac , jacInv);
901  weight *= fabs(detJac);
902  datavec[0].intLocPtIndex = int_ind;
903  datavec[1].intLocPtIndex = int_ind;
904 
905 
906  thisnonconst->ComputeRequiredData(intpointtemp,trvec,datavec);
907 
908  material->Solution(datavec, var, solout);
909 
910  for (int iv=0; iv<nvar; iv++) {
911  result[iv] += weight*solout[iv];
912  }
913 
914  }//loop over integratin points
915 
916  return result;
917 }
918 
919 
920 
921 template <class TGeometry>
923 {
924  int64_t ElemVecSize = fElementVec.size();
925  for (int64_t iref = 0; iref < ElemVecSize; iref++)
926  {
927  TPZInterpolationSpace *msp = dynamic_cast <TPZInterpolationSpace *>(fElementVec[iref].Element());
928  if (!msp) {
929  continue;
930  }
931 
932  TPZManVector<REAL,3> intpoint(msp->Reference()->Dimension(),0.);
933 
934  trvec[iref].Apply(intpointtemp, intpoint);
935 
936  msp->ComputeRequiredData(datavec[iref], intpoint);
937  }
938 }//ComputeRequiredData
939 
940 template <class TGeometry>
942 
943 #ifdef PZDEBUG
944  if (!this->Reference()) {
945  DebugStop();
946  }
947 #endif
948  int dim = this->Reference()->Dimension();
949  TPZManVector<int,3> ord(dim,int_order);
952  }else{
953  fIntRule.SetOrder(ord);
954  }
955 
956 }
957 
959 template <class TGeometry>
961 {
962  if (fElementVec.NElements() == 0) {
963  DebugStop(); // This case should be treated before
964  }
965 
966  TPZMaterial * material = Material();
967  if(!material){
968  PZError << "Error at " << __PRETTY_FUNCTION__ << " this->Material() == NULL\n";
969  DebugStop();
970  }
971 
972  const int64_t nref = fElementVec.size();
974  datavec.resize(nref);
975  this->InitMaterialData(datavec);
976  TPZGeoEl *gel = this->Reference();
977  int dim = gel->Dimension();
978  TPZManVector<REAL,3> intpoint(dim,0.), intpointtemp(dim,0.);
979  TPZManVector<int> ordervec;
980  //ordervec.resize(nref);
981  for (int64_t iref=0; iref<nref; iref++)
982  {
983  if(fActiveApproxSpace[iref] == 0){
984  continue;
985  }
986 
987  TPZInterpolationSpace *msp = dynamic_cast <TPZInterpolationSpace *>(fElementVec[iref].Element());
988  int svec;
989  if(msp)
990  {
991  ordervec.Resize(ordervec.size()+1);
992  svec = ordervec.size();
993  }
994  else
995  {
996  continue;
997  }
998  datavec[iref].p = msp->MaxOrder();
999  ordervec[svec-1] = datavec[iref].p;
1000  }
1001  int order = material->IntegrationRuleOrder(ordervec);
1002  TPZManVector<int,3> orderdim(dim,order);
1003  fIntRule.SetOrder(orderdim);
1004 
1005 }
1006 
1007 
1008 
1009 template <class TGeometry>
1011 {
1014  }
1015  return fIntRule;
1016 }
1017 
1018 template <class TGeometry>
1020 {
1023  }
1024  return fIntRule;
1025 }
1026 
1027 
1028 
1029 template <class TGeometry>
1031  TPZVec<REAL> &errors, bool store_errors )
1032 {
1033  errors.Fill(0.);
1034  TPZMaterial * material = this->Material();
1035  //TPZMaterial * matptr = material.operator->();
1036  if(!material){
1037  PZError << "TPZInterpolatedElement::EvaluateError : no material for this element\n";
1038  Print(PZError);
1039  return;
1040  }
1041  if(dynamic_cast<TPZBndCond *>(material)) {
1042  LOGPZ_INFO(logger,"Exiting EvaluateError - null error - boundary condition material.");
1043  return;
1044  }
1045  int problemdimension = Mesh()->Dimension();
1046  if(Reference()->Dimension() < problemdimension) return;
1047  TPZMaterial *mat = this->Material();
1048  int NErrors = mat->NEvalErrors();
1049  errors.Resize(NErrors);
1050  errors.Fill(0.);
1051 
1052  // Adjust the order of the integration rule
1053  //Cesar 2007-06-27 ==>> Begin
1054  //this->MaxOrder is usefull to evaluate polynomial function of the aproximation space.
1055  //fp can be any function and max order of the integration rule could produce best results
1056  int dim = Dimension();
1058  int maxIntOrder = intrule->GetMaxOrder();
1059  TPZManVector<int,3> prevorder(dim), maxorder(dim, maxIntOrder);
1060  //end
1061  intrule->GetOrder(prevorder);
1062  const int order_limit = 15;
1063  if(maxIntOrder > order_limit)
1064  {
1065  if (prevorder[0] > order_limit) {
1066  maxIntOrder = prevorder[0];
1067  }
1068  else
1069  {
1070  maxIntOrder = order_limit;
1071  }
1072  }
1073 
1074  intrule->SetOrder(maxorder);
1075 
1076  int ndof = material->NStateVariables();
1077  int nflux = material->NFluxes();
1078  TPZManVector<STATE,10> u_exact(ndof);
1079  TPZFNMatrix<3,STATE> du_exact(dim,ndof);
1080  TPZManVector<REAL,10> intpoint(problemdimension), values(NErrors);
1081  values.Fill(0.0);
1082  REAL weight;
1083  TPZManVector<STATE,9> flux_el(nflux,0.);
1084 
1085  if (this->NConnects() == 0) return;//boundary discontinuous elements have this characteristic
1086 
1088  const int64_t nref = fElementVec.size();
1089  datavec.resize(nref);
1090  InitMaterialData(datavec);
1091  int iactive = -1;
1092  for (unsigned int i = 0; i < nref; ++i) {
1093  if(datavec[i].fShapeType != TPZMaterialData::EEmpty)
1094  {
1095  datavec[i].fNeedsSol = true;
1096  iactive = i;
1097  }
1098  }
1099 
1100  if(iactive == -1) DebugStop();
1101 
1103  AffineTransform(trvec);
1104 
1105  int nintpoints = intrule->NPoints();
1106  TPZFNMatrix<9,REAL> jac, axe, jacInv;
1107  REAL detJac;
1108  TPZGeoEl *ref = this->Reference();
1109 
1110  for(int nint = 0; nint < nintpoints; nint++) {
1111 
1112  intrule->Point(nint,intpoint,weight);
1113 
1114 // ref->Jacobian(intpoint, jac, axe, detJac , jacInv);
1115  this->ComputeRequiredData(intpoint,trvec,datavec);
1116 
1117  weight *= fabs(datavec[iactive].detjac);
1118  // this->ComputeSolution(intpoint, data.phi, data.dphix, data.axes, data.sol, data.dsol);
1119  //this->ComputeSolution(intpoint, data);
1120  //contribuicoes dos erros
1121  if(fp) {
1122  fp(datavec[iactive].x,u_exact,du_exact);
1123  }
1124  material->Errors(datavec,u_exact,du_exact,values);
1125 
1126  for(int ier = 0; ier < NErrors; ier++)
1127  {
1128  errors[ier] += values[ier]*weight;
1129  }
1130 
1131  }//fim for : integration rule
1132  //Norma sobre o elemento
1133  for(int ier = 0; ier < NErrors; ier++){
1134  errors[ier] = sqrt(errors[ier]);
1135  }//for ier
1136 
1137  if(store_errors)
1138  {
1139  int64_t index = Index();
1140  TPZFMatrix<STATE> &elvals = Mesh()->ElementSolution();
1141  if (elvals.Cols() < NErrors) {
1142  std::cout << "The element solution of the mesh should be resized before EvaluateError\n";
1143  DebugStop();
1144  }
1145  for (int ier=0; ier <NErrors; ier++) {
1146  elvals(index,ier) = errors[ier];
1147  // std::cout<<"erro["<<ier <<"]= "<<errors[ier]<<std::endl;
1148  }
1149  }
1150 
1151 
1152  intrule->SetOrder(prevorder);
1153 }
1154 
1155 template <class TGeometry>
1157  TPZVec<STATE> &errors, bool store_errors)
1158 {
1159  int NErrors = this->Material()->NEvalErrors();
1160  errors.Resize(NErrors);
1161  errors.Fill(0.);
1162  TPZMaterial * material = this->Material();
1163  //TPZMaterial * matptr = material.operator->();
1164  if(!material){
1165  PZError << "TPZInterpolatedElement::EvaluateError : no material for this element\n";
1166  Print(PZError);
1167  return;
1168  }
1169  if(dynamic_cast<TPZBndCond *>(material)) {
1170  LOGPZ_INFO(logger,"Exiting EvaluateError - null error - boundary condition material.");
1171  return;
1172  }
1173  int problemdimension = Mesh()->Dimension();
1174  if(Reference()->Dimension() < problemdimension) return;
1175 
1176  // Adjust the order of the integration rule
1177  //Cesar 2007-06-27 ==>> Begin
1178  //this->MaxOrder is usefull to evaluate polynomial function of the aproximation space.
1179  //fp can be any function and max order of the integration rule could produce best results
1180  int dim = Dimension();
1182  int maxIntOrder = intrule->GetMaxOrder();
1183  TPZManVector<int,3> prevorder(dim);
1184  //end
1185  intrule->GetOrder(prevorder);
1186  const int order_limit = 8;
1187  if(maxIntOrder > order_limit)
1188  {
1189  if (prevorder[0] > order_limit) {
1190  maxIntOrder = prevorder[0];
1191  }
1192  else
1193  {
1194  maxIntOrder = order_limit;
1195  }
1196  }
1197  TPZManVector<int,3> maxorder(dim,maxIntOrder);
1198  intrule->SetOrder(maxorder);
1199 
1200  int ndof = material->NStateVariables();
1201  int nflux = material->NFluxes();
1202  TPZManVector<STATE,10> u_exact(ndof);
1203  TPZFNMatrix<9,STATE> du_exact(3,ndof);
1204  TPZManVector<REAL,10> intpoint(3), values(NErrors);
1205  values.Fill(0.0);
1206  REAL weight;
1207  TPZManVector<STATE,9> flux_el(nflux,0.);
1208 
1209  if (this->NConnects() == 0) return;//boundary discontinuous elements have this characteristic
1210 
1212  const int64_t nref = fElementVec.size();
1213  datavec.resize(nref);
1214  InitMaterialData(datavec);
1215  datavec[0].fNeedsSol = true;
1216  datavec[1].fNeedsSol = true;
1217 
1219  AffineTransform(trvec);
1220 
1221  int nintpoints = intrule->NPoints();
1222  TPZFNMatrix<9,REAL> jac, axe, jacInv;
1223  REAL detJac;
1224  TPZGeoEl *ref = this->Reference();
1225 
1226  for(int nint = 0; nint < nintpoints; nint++) {
1227 
1228  intrule->Point(nint,intpoint,weight);
1229 
1230  ref->Jacobian(intpoint, jac, axe, detJac , jacInv);
1231  this->ComputeRequiredData(intpoint,trvec,datavec);
1232 
1233  weight *= fabs(datavec[0].detjac);
1234  // this->ComputeSolution(intpoint, data.phi, data.dphix, data.axes, data.sol, data.dsol);
1235  //this->ComputeSolution(intpoint, data);
1236  //contribuicoes dos erros
1237  func.Execute(datavec[0].x,u_exact,du_exact);
1238  material->Errors(datavec,u_exact,du_exact,values);
1239 
1240  for(int ier = 0; ier < NErrors; ier++)
1241  {
1242  errors[ier] += values[ier]*weight;
1243  }
1244 
1245  }//fim for : integration rule
1246  //Norma sobre o elemento
1247  for(int ier = 0; ier < NErrors; ier++){
1248  errors[ier] = sqrt(errors[ier]);
1249  }//for ier
1250  if(store_errors)
1251  {
1252  int64_t index = Index();
1253  TPZFMatrix<STATE> &elvals = Mesh()->ElementSolution();
1254  if (elvals.Cols() < NErrors) {
1255  std::cout << "The element solution of the mesh should be resized before EvaluateError\n";
1256  DebugStop();
1257  }
1258  for (int ier=0; ier <NErrors; ier++) {
1259  elvals(index,ier) = errors[ier];
1260  }
1261  }
1262 
1263  intrule->SetOrder(prevorder);
1264 }
1266 template <class TGeometry>
1268  const int64_t nref = fElementVec.size();
1269  order.resize(nref);
1270  for (int64_t iref = 0; iref < nref; iref++) {
1271 
1272  TPZInterpolationSpace *msp = dynamic_cast<TPZInterpolationSpace *> (fElementVec[iref].Element());
1273  order[iref] = msp ? msp->MaxOrder() : 0;
1274  }
1275 
1276  // TPZMaterial * material = Material();
1277  // if(!material)
1278  // {
1279  // int matid = Reference()->MaterialId();
1280  // std::cout << "Matid " << matid << " for multiphysics element index " << Index() << " does not exist\n";
1281  // DebugStop();
1282  // }
1283  // int order = material->IntegrationRuleOrder(ordervec);
1284  // return order;
1285 }
1286 
1287 template<class TGeometry>
1289  return Hash("TPZMultiphysicsCompEl") ^ TPZMultiphysicsElement::ClassId() << 1 ^ TGeometry().ClassId() << 2;
1290 }
1291 
1292 #include "pzgraphel.h"
1293 #include "pzgraphelq2dd.h"
1294 #include "pzgraphelq3dd.h"
1295 #include "pzgraphel1d.h"
1296 #include "pzgraphel1dd.h"
1297 #include "pztrigraphd.h"
1298 #include "pztrigraph.h"
1299 #include "tpzgraphelt2dmapped.h"
1300 #include "tpzgraphelprismmapped.h"
1301 #include "tpzgraphelpyramidmapped.h"
1302 #include "tpzgraphelt3d.h"
1303 #include "pzgraphel.h"
1304 #include "pzbndcond.h"
1305 #include "pzgraphmesh.h"
1306 
1307 template<class TGeometry>
1309 {
1310 
1311 
1312  TPZGeoEl *ref = Reference();
1313  if (ref->Dimension() != dimension) {
1314  return;
1315  }
1316  TPZMaterial * material = Material();
1317 
1318  TPZBndCond * BDC = dynamic_cast<TPZBndCond * > (material);
1319 
1320  if (BDC) {
1321  return;
1322  }
1323  int matid = material->Id();
1324  int nsides = ref->NSides();
1325  bool to_postpro = grmesh.Material_Is_PostProcessed(matid);
1326  if(dimension == 2 && to_postpro){
1327  if(nsides == 9){
1328  new TPZGraphElQ2dd(this,&grmesh);
1329  return;
1330  }
1331  if(nsides == 7){
1332  new TPZGraphElT2dMapped(this,&grmesh);
1333  return;
1334  }
1335  }//2d
1336 
1337  if(dimension == 3 && to_postpro){
1338  if(nsides == 27){
1339  new TPZGraphElQ3dd(this,&grmesh);
1340  return;
1341  }//cube
1342  if(nsides == 21){
1343  new TPZGraphElPrismMapped(this,&grmesh);
1344  return;
1345  }//prism
1346  if(nsides == 15){
1347  new TPZGraphElT3d(this,&grmesh);
1348  return;
1349  }//tetra
1350  if(nsides == 19){
1351  new TPZGraphElPyramidMapped(this,&grmesh);
1352  return;
1353  }//pyram
1354  }//3d
1355 
1356  if(dimension == 1 && to_postpro){
1357  new TPZGraphEl1dd(this,&grmesh);
1358  }//1d
1359 }
1360 
1361 //---------------------------------------------------------------
1370 
1371 
1372 /*
1373  template class TPZCompElWithMem<TPZMultiphysicsCompEl<pzgeom::TPZGeoPoint> >;
1374  template class TPZCompElWithMem<TPZMultiphysicsCompEl<pzgeom::TPZGeoLinear> >;
1375  template class TPZCompElWithMem<TPZMultiphysicsCompEl<pzgeom::TPZGeoTriangle> >;
1376  template class TPZCompElWithMem<TPZMultiphysicsCompEl<pzgeom::TPZGeoQuad> >;
1377  template class TPZCompElWithMem<TPZMultiphysicsCompEl<pzgeom::TPZGeoCube> >;
1378  template class TPZCompElWithMem<TPZMultiphysicsCompEl<pzgeom::TPZGeoPrism> >;
1379  template class TPZCompElWithMem<TPZMultiphysicsCompEl<pzgeom::TPZGeoTetrahedra> >;
1380  template class TPZCompElWithMem<TPZMultiphysicsCompEl<pzgeom::TPZGeoPyramid> >;
1381  */
1382 
1383 
1385  return new TPZMultiphysicsCompEl<pzgeom::TPZGeoPoint>(mesh, gel, index);
1386 }
1387 
1389  return new TPZMultiphysicsCompEl<pzgeom::TPZGeoLinear>(mesh,gel,index);
1390 }
1391 
1393  return new TPZMultiphysicsCompEl<pzgeom::TPZGeoTriangle >(mesh,gel,index);
1394 }
1395 
1397  return new TPZMultiphysicsCompEl<pzgeom::TPZGeoQuad>(mesh,gel,index);
1398 }
1399 
1401  return new TPZMultiphysicsCompEl<pzgeom::TPZGeoCube >(mesh,gel,index);
1402 }
1403 
1405  return new TPZMultiphysicsCompEl<pzgeom::TPZGeoPrism>(mesh,gel,index);
1406 }
1407 
1409  return new TPZMultiphysicsCompEl<pzgeom::TPZGeoTetrahedra>(mesh,gel,index);
1410 }
1411 
1413  return new TPZMultiphysicsCompEl<pzgeom::TPZGeoPyramid >(mesh,gel,index);
1414 }
1415 
1416 //--------------------- WITH MEMORY ----------------------
1417 
1419  // if(!gel->Reference() && gel->NumInterfaces() == 0)
1421  // index = -1;
1422  // return NULL;
1423 }
1425  // if(!gel->Reference() && gel->NumInterfaces() == 0)
1427  // index = -1;
1428  // return NULL;
1429 }
1431  // if(!gel->Reference() && gel->NumInterfaces() == 0)
1433  // index = -1;
1434  // return NULL;
1435 }
1437  // if(!gel->Reference() && gel->NumInterfaces() == 0)
1439  // index = -1;
1440  // return NULL;
1441 }
1443  // if(!gel->Reference() && gel->NumInterfaces() == 0)
1445  // index = -1;
1446  // return NULL;
1447 }
1449  // if(!gel->Reference() && gel->NumInterfaces() == 0)
1451  // index = -1;
1452  // return NULL;
1453 }
1455  // if(!gel->Reference() && gel->NumInterfaces() == 0)
1457  // index = -1;
1458  // return NULL;
1459 }
1461  // if(!gel->Reference() && gel->NumInterfaces() == 0)
1463  // index = -1;
1464  // return NULL;
1465 }
bool Material_Is_PostProcessed(int matid)
Return a directive if the material id is being postprocessed.
virtual void Solution(TPZMaterialData &data, int var, TPZVec< STATE > &Solout)
Returns the solution associated with the var index based on the finite element approximation.
void HigherLevelCompElementList2(TPZStack< TPZCompElSide > &elsidevec, int onlyinterpolated, int removeduplicates)
Returns all connected computational elements which have level higher to the current element if onlyi...
TPZFMatrix< STATE > & ElementSolution()
Access method for the element solution vectors.
Definition: pzcmesh.h:225
virtual void GetOrder(TPZVec< int > &ord) const =0
Gets the order of the integration rule for each dimension of the master element.
TPZGeoMesh * Reference() const
Returns a pointer to the geometrical mesh associated.
Definition: pzcmesh.h:209
virtual void Execute(const TPZVec< REAL > &x, TPZVec< TVar > &f, TPZFMatrix< TVar > &df)
Performs function computation.
Definition: pzfunction.h:38
Represents a graphical mesh used for post processing purposes. Post processing.
Definition: pzgraphmesh.h:34
TPZManVector< TPZCompElSide,5 > fElementVec
List of pointers to computational elements.
Contains the TPZGraphElTd class which implements the graphical discontinuous triangular element...
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
Definition: tfadfunc.h:140
virtual int NPoints() const =0
Returns number of points for the cubature rule related.
TPZCompEl * CreateMultiphysicsQuadEl(TPZGeoEl *gel, TPZCompMesh &mesh, int64_t &index)
Creates computational quadrilateral element for Multiphysics approximate space.
virtual void SetConnectIndex(int inode, int64_t index) override
Set the index i to node inode.
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
virtual void Errors(TPZMaterialData &data, TPZVec< STATE > &u_exact, TPZFMatrix< STATE > &du_exact, TPZVec< REAL > &errors)
Definition: TPZMaterial.h:496
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.
To export a graphical one dimensional discontinuous element. Post processing.
Definition: pzgraphel1dd.h:22
virtual void InitMaterialData(TPZMaterialData &data)
Initialize a material data and its attributes based on element dimension, number of state variables a...
Implements a vector class which allows to use external storage provided by the user. Utility.
Definition: pzquad.h:16
void GetReferenceIndexVec(TPZManVector< TPZCompMesh *> cmeshVec, std::set< int64_t > &refIndexVec)
Method to obtain an reference index set of multiphysics computational elements.
TPZCompEl * CreateMultiphysicsCubeElWithMem(TPZGeoEl *gel, TPZCompMesh &mesh, int64_t &index)
Creates computational cube element for Multiphysics approximate space.
TPZCompEl * CreateMultiphysicsTriangleElWithMem(TPZGeoEl *gel, TPZCompMesh &mesh, int64_t &index)
Creates computational triangular element for Multiphysics approximate space.
TPZCompEl * CreateMultiphysicsLinearEl(TPZGeoEl *gel, TPZCompMesh &mesh, int64_t &index)
Creates computational linear element for Multiphysics approximate space.
virtual void resize(const int64_t newsize)
Definition: pzvec.h:213
TPZCompEl * CreateMultiphysicsCubeEl(TPZGeoEl *gel, TPZCompMesh &mesh, int64_t &index)
Creates computational cube element for Multiphysics approximate space.
Contains the declaration of the TPZCompElWithMem class, it is as TPZCompEl with enable material memor...
virtual void AffineTransform(TPZVec< TPZTransform<> > &trVec) const override
Compute the map of a paramenter point in the multiphysic element to a parameter point in the super el...
clarg::argInt dimension("-d", "Matrices dimension M x M", 1000)
TPZStack< int64_t > fConnect
Vector of pointers to TPZConnect objects.
Definition: pzelmat.h:39
TPZFNMatrix< 1000, STATE > fMat
Pointer to a blocked matrix object.
Definition: pzelmat.h:41
Contains declaration of TPZCompEl class which defines the interface of a computational element...
std::list< TPZOneShapeRestraint > fOneRestraints
list of one degree of freedom restraints
Definition: pzelmat.h:56
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...
Definition: pzgeoel.cpp:386
To export a graphical two-dimensional discontinuous element. Post processing.
Definition: pzgraphelq2dd.h:16
To export a graphical three dimensional discontinuous element. Post processing.
Definition: pzgraphelq3dd.h:20
Contains declaration of TPZInterpolationSpace class which implements the interface for interpolated c...
Contains the TPZGraphEl class which implements the graphical one-, two- and three-dimensional element...
virtual int NStateVariables() const =0
Returns the number of state variables associated with the material.
Utility class which represents an element with its side. The Geometric approximation classes Geometry...
Definition: pzgeoelside.h:83
Implements the graphical element for a pyramid using a map to the cube element. Post processing...
This class implements a simple vector storage scheme for a templated class T. Utility.
Definition: pzgeopoint.h:19
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
virtual void InitializeIntegrationRule() override
After adding the elements initialize the integration rule.
virtual int NSides() const =0
Returns the number of connectivities of the element.
virtual void Contribute(TPZMaterialData &data, REAL weight, TPZFMatrix< STATE > &ek, TPZFMatrix< STATE > &ef)=0
It computes a contribution to the stiffness matrix and load vector at one integration point...
TPZCompEl * CreateMultiphysicsTetraEl(TPZGeoEl *gel, TPZCompMesh &mesh, int64_t &index)
Creates computational tetrahedral element for Multiphysics approximate space.
TPZBlock< STATE > fBlock
Block structure associated with fMat.
Definition: pzelmat.h:43
virtual TPZCompEl * ClonePatchEl(TPZCompMesh &mesh, std::map< int64_t, int64_t > &gl2lcConMap, std::map< int64_t, int64_t > &gl2lcElMap) const override
Method for creating a copy of the element in a patch mesh.
Contains the TPZGraphEl1d class which implements the graphical one dimensional element.
virtual void Print(std::ostream &out) const
Prints information of the cubature rule.
Definition: pzquad.cpp:38
TPZCompEl * CreateMultiphysicsPyramElWithMem(TPZGeoEl *gel, TPZCompMesh &mesh, int64_t &index)
Creates computational pyramidal element for Multiphysics approximate space.
TPZTransform< REAL > SideToSideTransform(TPZGeoElSide &higherdimensionside)
Compute the transformation between the master element space of one side of an element to the master e...
TPZMultiphysicsCompEl()
Default constructor.
virtual void Solution(TPZVec< REAL > &qsi, int var, TPZVec< STATE > &sol) override
Post processing method which computes the solution for the var post processed variable.
virtual void Resize(const int64_t newsize, const T &object)
Resizes the vector object.
Definition: pzmanvector.h:426
It has the declaration of the TPZMultiphysicsCompEl class.
virtual int ClassId() const override
Define the class id associated with the class.
Definition: pzcompel.cpp:1129
Abstract class defining integration rules. Numerical Integration.
Definition: tpzintpoints.h:19
TPZManVector< int, 5 > fActiveApproxSpace
List of active approximation spaces.
This abstract class defines the behaviour which each derived class needs to implement.
Definition: TPZMaterial.h:39
Contains declaration of TPZElementMatrix struct which associates an element matrix with the coeficien...
virtual void CenterPoint(int side, TPZVec< REAL > &masscent) const =0
It returns the coordinates from the center of the side of the element in the element coordinate space...
virtual TPZIntPoints * CreateSideIntegrationRule(int side, int order)=0
Creates an integration rule for the topology of the corresponding side and able to integrate a polyno...
Contains the TPZBndCond class which implements a boundary condition for TPZMaterial objects...
virtual TPZMaterial * Material() const
Identify the material object associated with the element.
Definition: pzcompel.cpp:959
Implements a graphical element for a triangle mapped into de quadrilateral element. Post processing.
virtual void Print(std::ostream &out=std::cout) const override
Prints element data.
TPZCompEl * CreateMultiphysicsTetraElWithMem(TPZGeoEl *gel, TPZCompMesh &mesh, int64_t &index)
Creates computational tetrahedral element for Multiphysics approximate space.
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
virtual int IntegrationRuleOrder(int elPMaxOrder) const
Gets the order of the integration rule necessary to integrate an element with polinomial order p...
virtual int NEvalErrors()
Returns the number of norm errors. Default is 3: energy, L2 and H1.
Definition: TPZMaterial.h:524
#define LOGPZ_INFO(A, B)
Define log for informations.
Definition: pzlog.h:89
Contains the TPZGraphElT3d class which implements the graphical representation of a tetrahedra elemen...
Implements the graphical element for a prism using a degenerated cube element. Post processing...
virtual void ComputeShape(TPZVec< REAL > &intpoint, TPZVec< REAL > &X, TPZFMatrix< REAL > &jacobian, TPZFMatrix< REAL > &axes, REAL &detjac, TPZFMatrix< REAL > &jacinv, TPZFMatrix< REAL > &phi, TPZFMatrix< REAL > &dphi, TPZFMatrix< REAL > &dphidx)
Compute shape functions based on master element in the classical FEM manner.
Defines the behaviour of all geometric elements. GeometryTPZGeoEl is the common denominator for all g...
Definition: pzgeoel.h:43
Contains the TPZGraphElQ2dd class which implements the graphical two-dimensional discontinuous elemen...
Implements the graphical representation of a tetrahedra element. Post processing. ...
Definition: tpzgraphelt3d.h:16
int64_t Index() const
Returns the index of the element within the element vector of the mesh.
Definition: pzgeoel.h:730
Contains the TPZGeoTetrahedra class which implements the geometry of a tetrahedral element...
virtual int NFluxes()
Returns the number of components which form the flux function.
Definition: TPZMaterial.h:183
virtual void FillDataRequirements(TPZMaterialData &data)
Fill material data parameter with necessary requirements for the.
Definition: TPZMaterial.cpp:81
#define DebugStop()
Returns a message to user put a breakpoint in.
Definition: pzerror.h:20
virtual void SetOrder(TPZVec< int > &ord, int type=0)=0
Sets the order of the cubature rule.
Contains the TPZGraphElPrismMapped class which implements the graphical element for a prism using a d...
#define LOGPZ_DEBUG(A, B)
Define log for debug info.
Definition: pzlog.h:87
void InitializeElementMatrix(TPZElementMatrix &ek, TPZElementMatrix &ef)
Initialize element matrix in which is computed CalcStiff.
This class defines the boundary condition for TPZMaterial objects.
Definition: pzbndcond.h:29
TPZCompMesh * Mesh() const
Return a pointer to the grid of the element.
Definition: pzcompel.cpp:288
virtual int Dimension() const override
Dimension of the element.
Contains declaration of TPZConnect class which represents a set of shape functions associated with a ...
int Dimension() const
Returns the dimension of the simulation.
Definition: pzcmesh.h:148
void Jacobian(TPZVec< REAL > &qsi, TPZFMatrix< REAL > &jac, TPZFMatrix< REAL > &axes, REAL &detjac, TPZFMatrix< REAL > &jacinv) const
Compute a decomposition of the gradient of the mapping function, as a rotation matrix (Jacobian) and ...
Definition: pzgeoel.cpp:1144
unsigned int NShape() const
Definition: pzconnect.h:151
virtual ~TPZMultiphysicsCompEl()
Default destructor.
expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ sqrt
Definition: tfadfunc.h:120
virtual TPZVec< STATE > IntegrateSolution(int var) const override
Compute the integral of a variable.
Contains the TPZGraphElT class which implements the graphical triangular element. ...
This class implements the TPZCompEl structure to enable material memory feature. It should be instan...
Contains declaration of the TPZAutoPointer class which has Increment and Decrement actions are mutexe...
TPZCompMesh * fMesh
Definition: pzelmat.h:36
Contains the TPZGraphMesh class which represents a graphical mesh used for post processing purposes...
virtual void PolynomialOrder(TPZVec< int > &order) const override
virtual void CalcStiff(TPZElementMatrix &ek, TPZElementMatrix &ef) override
Computes the element stiffness matrix and right hand side.
Contains the TPZGraphElPyramidMapped class which implements the graphical element for a pyramid using...
TPZIntPoints * fIntegrationRule
Integration rule established by the user.
Definition: pzcompel.h:590
int64_t Index() const
Returns element index of the mesh fELementVec list.
Definition: pzcompel.h:821
Contains the TPZMaterialData class which implements an interface between TPZCompEl::CalcStiff and TPZ...
TPZCompEl * CreateMultiphysicsPointEl(TPZGeoEl *gel, TPZCompMesh &mesh, int64_t &index)
Creates computational point element for Multiphysics approximate space.
int SetNBlocks(const int num_of_blocks)
Sets number of blocks on diagonal matrix.
Definition: pzblock.cpp:91
virtual void ComputeSolution(TPZVec< REAL > &qsi, TPZMaterialData &data)
Definition: pzcompel.h:462
int Redim(const int64_t newRows, const int64_t newCols) override
Redimension a matrix and ZERO your elements.
Definition: pzfmatrix.h:616
virtual TPZConnect & Connect(int i) const
Returns a pointer to the ith node.
Definition: pzcompel.cpp:298
Contains the TPZGeoCube class which implements the geometry of hexahedra element. ...
virtual TPZCompEl * Clone(TPZCompMesh &mesh) const override
Method for creating a copy of the element.
unsigned char NState() const
Number of state variables associated with the connect.
Definition: pzconnect.h:146
int32_t Hash(std::string str)
Definition: TPZHash.cpp:10
Contains the TPZGeoPoint class which implements the geometry of a point element or 0-D element...
void InitMaterialData(TPZVec< TPZMaterialData > &dataVec, TPZVec< int64_t > *indices=0) override
Initialize a material data vector and its attributes based on element dimension, number of state vari...
This class associates an element matrix with the coeficients of its contribution in the global stiffn...
Definition: pzelmat.h:30
TPZCompEl * CreateMultiphysicsPrismEl(TPZGeoEl *gel, TPZCompMesh &mesh, int64_t &index)
Creates computational prismal element for Multiphysics approximate space.
virtual int ClassId() const override
Define the class id associated with the class.
Implements the interfaces for TPZCompElDisc, TPZInterfaceElement and TPZInterpolatedElement. Computational element.
virtual int NConnects() const =0
Returns the number of nodes of the element.
class to create a compute element multiphysics
virtual const TPZIntPoints & GetIntegrationRule() const override
Returns a reference to an integration rule suitable for integrating the interior of the element...
virtual void CalcResidual(TPZElementMatrix &ef) override
Computes the element stiffness matrix and right hand side.
virtual int Dimension() const =0
Returns the dimension of the element.
TPZGeoEl * Reference() const
Return a pointer to the corresponding geometric element if such exists, return 0 otherwise.
Definition: pzcompel.cpp:1137
virtual int NSolutionVariables(int var)
Returns the number of variables associated with the variable indexed by var.
virtual void X(TPZVec< REAL > &qsi, TPZVec< REAL > &result) const =0
Return the coordinate in real space of the point coordinate in the master element space...
This class implements a geometric mesh for the pz environment. Geometry.
Definition: pzgmesh.h:48
virtual int GetMaxOrder() const
Returns the minimum order to integrate polinomials exactly for all implemented cubature rules...
Definition: pzquad.cpp:30
virtual void ComputeRequiredData(TPZVec< REAL > &point, TPZVec< TPZTransform<> > &trvec, TPZVec< TPZMaterialData > &datavec)
Compute and fill data with requested attributes for each of the compels in fElementVec.
void Reset(TPZCompMesh *mesh=NULL, MType type=Unknown)
Reset the data structure.
Definition: pzelmat.h:59
virtual int64_t ConnectIndex(int i) const override
Returns the index of the ith connectivity of the element.
Implements computational mesh. Computational Mesh.
Definition: pzcmesh.h:47
virtual void CreateGraphicalElement(TPZGraphMesh &grmesh, int dimension) override
Creates corresponding graphical element(s) if the dimension matches graphical elements are used to ge...
TPZCompEl * CreateMultiphysicsPyramEl(TPZGeoEl *gel, TPZCompMesh &mesh, int64_t &index)
Creates computational pyramidal element for Multiphysics approximate space.
virtual void Print(std::ostream &out=std::cout) const
Prints element data.
Definition: pzcompel.cpp:322
TPZVec< int64_t > fConnectIndexes
Indexes of the connects of the element.
virtual void Solution(TPZVec< REAL > &qsi, int var, TPZVec< STATE > &sol)
Calculates the solution - sol - for the variable var at point qsi, where qsi is expressed in terms of...
Definition: pzcompel.cpp:421
Contains the TPZGraphElT2dMapped class which implements a graphical element for a triangle mapped int...
int NumLoadCases()
returns the number of load cases for this material object
Definition: TPZMaterial.h:186
int Id() const
Definition: TPZMaterial.h:170
void Fill(const T &copy, const int64_t from=0, const int64_t numelem=-1)
Will fill the elements of the vector with a copy object.
Definition: pzvec.h:460
virtual std::list< TPZOneShapeRestraint > GetShapeRestraints() const override
Return a list with the shape restraints.
virtual void EvaluateError(std::function< void(const TPZVec< REAL > &loc, TPZVec< STATE > &val, TPZFMatrix< STATE > &deriv)> func, TPZVec< REAL > &errors, bool store_error) override
Performs an error estimate on the elemen.
int64_t Cols() const
Returns number of cols.
Definition: pzmatrix.h:809
void RemoveDepend(int64_t myindex, int64_t dependindex)
Remove dependency between connects if exist.
Definition: pzconnect.cpp:178
virtual int MaxOrder()
Returns the max order of interpolation.
TPZCompEl * CreateMultiphysicsPointElWithMem(TPZGeoEl *gel, TPZCompMesh &mesh, int64_t &index)
Creates computational point element for Multiphysics approximate space.
Contains the TPZGeoPyramid class which implements the geometry of pyramid element.
Contains the TPZTransform<> class which implements an affine transformation between points in paramet...
virtual void ComputeSolution(TPZVec< REAL > &qsi, TPZSolVec &sol, TPZGradSolVec &dsol, TPZFMatrix< REAL > &axes) override
Computes solution and its derivatives in the local coordinate qsi.
int64_t NElements() const
Returns the number of elements of the vector.
Definition: pzvec.h:190
Contains the TPZGraphEl1dd class which implements the graphical one dimensional discontinuous element...
Implements an affine transformation between points in parameter space. Topology Utility.
Definition: pzmganalysis.h:14
def values
Definition: rdt.py:119
virtual TPZIntPoints * Clone() const =0
Make a clone of the related cubature rule.
Contains the TPZGeoPrism class which implements the geometry of a prism element.
virtual void ComputeRequiredData(TPZMaterialData &data, TPZVec< REAL > &qsi)
Compute and fill data with requested attributes.
TPZCompEl * CreateMultiphysicsLinearElWithMem(TPZGeoEl *gel, TPZCompMesh &mesh, int64_t &index)
Creates computational linear element for Multiphysics approximate space.
Groups all classes which model the geometry.
Definition: pzgeopoint.cpp:18
void ResetReference()
Resets all load references in elements and nodes.
Definition: pzgmesh.cpp:197
TPZCompEl * CreateMultiphysicsTriangleEl(TPZGeoEl *gel, TPZCompMesh &mesh, int64_t &index)
Creates computational triangular element for Multiphysics approximate space.
Defines the interface of a computational element. Computational Element.
Definition: pzcompel.h:59
virtual int NConnects() const override
Returns the number of nodes of the element.
Contains the TPZGraphElQ3dd class which implements the graphical three dimensional discontinuous elem...
TPZCompEl * CreateMultiphysicsQuadElWithMem(TPZGeoEl *gel, TPZCompMesh &mesh, int64_t &index)
Creates computational quadrilateral element for Multiphysics approximate space.
virtual void SetIntegrationRule(int int_order) override
virtual void Point(int i, TPZVec< REAL > &pos, REAL &w) const =0
Returns i-th point at master element and related weight.
#define PZError
Defines the output device to error messages and the DebugStop() function.
Definition: pzerror.h:15
TPZCompEl * CreateMultiphysicsPrismElWithMem(TPZGeoEl *gel, TPZCompMesh &mesh, int64_t &index)
Creates computational prismal element for Multiphysics approximate space.
TGeometry::IntruleType fIntRule
Integration rule associated with the element.
virtual void Integrate(int variable, TPZVec< STATE > &value) override
Post processing method which computes the solution for the var post processed variable.