NeoPZ
main.cpp
Go to the documentation of this file.
1 #ifdef HAVE_CONFIG_H
2 #include <pz_config.h>
3 #endif
4 
5 #include "pzvec.h"
6 #include "pzstack.h"
7 #include "pzfmatrix.h"
8 #include "pzfstrmatrix.h"
9 #include "pzlog.h"
10 
11 #include "pzgmesh.h"
12 #include "pzcmesh.h"
13 #include "pzcompel.h"
14 #include "TPZInterfaceEl.h"
15 #include "pzgeoelside.h"
16 #include "TPZGeoLinear.h"
17 #include "pzgeopoint.h"
18 
19 #include "TPZRefPattern.h"
20 #include "tpzgeoelrefpattern.h"
21 #include "tpzcompmeshreferred.h"
22 #include "tpzautopointer.h"
23 #include "pzbndcond.h"
24 #include "pzanalysis.h"
25 
27 #include "pzstepsolver.h"
28 #include "pzstrmatrix.h"
29 #include "pzfstrmatrix.h"
30 #include "TPZFrontNonSym.h"
31 #include "TPZFrontSym.h"
32 #include "TPBSpStructMatrix.h"
33 #include "TPZSpStructMatrix.h"
34 #include "pzbstrmatrix.h"
35 
36 #include "pzpoisson3d.h"
37 #include "pzhybridpoisson.h"
38 #include "pzpoisson3dreferred.h"
39 #include "pzelasmat.h"
40 #include "pzelasthybrid.h"
41 
43 #include "pzelementgroup.h"
44 #include "pzcondensedcompel.h"
45 
46 #include "pzlog.h"
47 
48 #include "TPZVTKGeoMesh.h"
49 
50 #include <iostream>
51 #include <string>
52 
53 #include <math.h>
54 #include <set>
55 
56 #ifdef USING_BLAS
57 #include "cblas.h"
58 #endif
59 
60 #include "run_stats_table.h"
61 
62 RunStatsTable total_rdt("-tot_rdt","Statistics for the whole application");
63 RunStatsTable cond_rdt("-cond_rdt","Statistics for the static condensation step");
64 RunStatsTable cond_ass_rdt("-cond_ass_rdt","Statistics for the assemble step during static condensation");
65 
66 clarg::argBool help("-h", "display the help message");
67 clarg::argBool cond_f("-cond", "perform static condensation");
68 clarg::argInt p_order("-p", "polynomial order",1);
69 clarg::argInt n_uref("-nuref", "Number of uniform refinements",1);
70 clarg::argInt n_threads("-nthreads", "Number of threads",1);
71 
72 #ifdef LOG4CXX
73 static LoggerPtr logger(Logger::getLogger("pz.multiphysics"));
74 #endif
75 
76 using namespace std;
77 
78 const int matInterno = 1;
79 const int lagrangemat = 2;
80 const int interfacemat = 3;
81 
82 const int dirichlet = 0;
83 //const int neumann = 1;
84 //const int mixed = 2;
85 
86 const int bc1 = -1;
87 const int bc2 = -2;
88 const int bc3 = -3;
89 const int bc4 = -4;
90 
91 REAL const Pi = 4.*atan(1.);
92 
93 TPZGeoMesh *MalhaGeom(int NRefUnif, REAL Lx, REAL Ly);
94 TPZCompMesh *MalhaComp(TPZGeoMesh * gmesh,int pOrder);
95 
96 //funcao f(x)
97 void Forcing(const TPZVec<REAL> &pt, TPZVec<STATE> &disp);
98 
99 //sol exata
100 void SolExata(const TPZVec<REAL> &pt, TPZVec<STATE> &disp,TPZFMatrix<STATE> &flux);
101 
102 void PosProcessSol(TPZAnalysis &an, std::string plotfile);
103 
104 void BuildElementGroups(TPZCompMesh *cmesh, int materialid, int interfacemat, int lagrangemat);
105 
106 void ResetMesh(TPZCompMesh *cmesh);
107 
108 
109 int main(int argc, char *argv[])
110 {
111  clarg::parse_arguments(argc, argv);
112 
113  if (help.get_value() == true) {
114  cout << "Usage: " << argv[0] << endl;
115  clarg::arguments_descriptions(cout, " ", "\n");
116  return 1;
117  }
118 
119 
120 #ifdef LOG4CXX
121  InitializePZLOG();
122 #endif
123 
124  REAL Lx=1.;
125  REAL Ly=1.;
126 
127  TPZGeoMesh * gmesh = MalhaGeom(n_uref.get_value(),Lx,Ly);
128 
129 #ifdef PZDEBUG
130  std::cout << "Number of elements = " << gmesh->NElements() << std::endl;
131  ofstream arg1("gmesh0.txt");
132  gmesh->Print(arg1);
133 #endif
134 
135  TPZCompMesh * cmesh= MalhaComp(gmesh, p_order.get_value());
136 
137 #ifdef PZDEBUG
138  std::cout << "Number of equations = " << cmesh->NEquations() << std::endl;
139 #endif
140 
141  total_rdt.start();
142 
143 // if (cond_f.was_set()) {
144  // Perform static condensation
145  cond_rdt.start();
146  BuildElementGroups(cmesh, matInterno, interfacemat,lagrangemat);
147  int neq = cmesh->NEquations();
148 
149  TPZFMatrix<STATE> stiff(neq,neq,0.),rhs(neq,1,0.);
150  TPZSkylineStructMatrix fstr(cmesh);
153  fstr.Assemble(stiff, rhs, 0);
154  cond_ass_rdt.stop();
155  cond_rdt.stop();
156  return 0;
157 // }
158 
159  TPZAnalysis an(cmesh);
161  step.SetDirect(ELDLt);
162  TPZSkylineStructMatrix fullstr(cmesh);
163  fullstr.SetNumThreads(n_threads.get_value());
164  an.SetStructuralMatrix(fullstr);
165 
166 #ifdef PZDEBUG
167 
168  ofstream arg4("gmesh1.txt");
169  gmesh->Print(arg4);
170 
171  ofstream arg3("cmesh1.txt");
172  cmesh->Print(arg3);
173 #endif
174 
175  an.SetSolver(step);
176  an.Run();
177  total_rdt.stop();
178  // an.Solution().Print("sol.txt");
179 
180  ResetMesh(cmesh);
181 
182 #ifdef PZDEBUG
183  ofstream arg5("cmesh_apossolve.txt");
184  cmesh->Print(arg5);
185 
186  ofstream arg6("gmesh_apossolve.txt");
187  gmesh->Print(arg6);
188 
189  ofstream file("malhageometrica.vtk");
190  TPZVTKGeoMesh::PrintGMeshVTK(gmesh, file, true);
191 #endif
192 
193  string plotfile("Solution.vtk");
194  PosProcessSol(an,plotfile);
195 
196  delete cmesh;
197  delete gmesh;
198 
199  return EXIT_SUCCESS;
200 }
201 
202 
203 TPZGeoMesh *MalhaGeom(int NRefUnif, REAL Lx, REAL Ly)
204 {
205  int Qnodes = 4;
206 
207  TPZGeoMesh * gmesh = new TPZGeoMesh;
208  gmesh->SetMaxNodeId(Qnodes-1);
209  gmesh->NodeVec().Resize(Qnodes);
210  TPZVec<TPZGeoNode> Node(Qnodes);
211 
212  TPZVec <int64_t> TopolQuad(4);
213  TPZVec <int64_t> TopolLine(2);
214 
215  //indice dos nos
216  int id = 0;
217  REAL valx;
218  for(int xi = 0; xi < Qnodes/2; xi++)
219  {
220  valx = xi*Lx;
221  Node[id].SetNodeId(id);
222  Node[id].SetCoord(0 ,valx );//coord X
223  Node[id].SetCoord(1 ,0. );//coord Y
224  gmesh->NodeVec()[id] = Node[id];
225  id++;
226  }
227 
228  for(int xi = 0; xi < Qnodes/2; xi++)
229  {
230  valx = Lx - xi*Lx;
231  Node[id].SetNodeId(id);
232  Node[id].SetCoord(0 ,valx );//coord X
233  Node[id].SetCoord(1 ,Ly);//coord Y
234  gmesh->NodeVec()[id] = Node[id];
235  id++;
236  }
237 
238  //indice dos elementos
239  id = 0;
240 
241  //elementos internos
242  TopolQuad[0] = 0;
243  TopolQuad[1] = 1;
244  TopolQuad[2] = 2;
245  TopolQuad[3] = 3;
246  new TPZGeoElRefPattern< pzgeom::TPZGeoQuad> (id,TopolQuad,matInterno,*gmesh);
247  id++;
248 
249  //elementos de contorno
250  TopolLine[0] = 0;
251  TopolLine[1] = 1;
252  new TPZGeoElRefPattern< pzgeom::TPZGeoLinear > (id,TopolLine,bc1,*gmesh);
253  id++;
254 
255  TopolLine[0] = 1;
256  TopolLine[1] = 2;
257  new TPZGeoElRefPattern< pzgeom::TPZGeoLinear > (id,TopolLine,bc2,*gmesh);
258  id++;
259 
260  TopolLine[0] = 2;
261  TopolLine[1] = 3;
262  new TPZGeoElRefPattern< pzgeom::TPZGeoLinear > (id,TopolLine,bc3,*gmesh);
263  id++;
264 
265  TopolLine[0] = 3;
266  TopolLine[1] = 0;
267  new TPZGeoElRefPattern< pzgeom::TPZGeoLinear > (id,TopolLine,bc4,*gmesh);
268  id++;
269 
270  // define entre quais materiais vou criar interfaces e o terceiro argumento é o tipo de material que quero nessa interface.
271  gmesh->AddInterfaceMaterial(matInterno,lagrangemat, interfacemat);
272 // gmesh->AddInterfaceMaterial(lagrangemat,bc1, bc1);
273 // gmesh->AddInterfaceMaterial(lagrangemat,bc2, bc2);
274 // gmesh->AddInterfaceMaterial(lagrangemat,bc3, bc3);
275 // gmesh->AddInterfaceMaterial(lagrangemat,bc4, bc4);
276 
277  //construir a malha
278  gmesh->BuildConnectivity();
279 
280 
281  //Refinamento uniforme
282  for( int ref = 0; ref < NRefUnif; ref++ ){
283  TPZVec<TPZGeoEl *> filhos;
284  int64_t n = gmesh->NElements();
285  for ( int64_t i = 0; i < n; i++ ){
286  TPZGeoEl * gel = gmesh->ElementVec()[i];
287  gel->Divide (filhos);
288  }//for i
289  }//ref
290 
291  return gmesh;
292 
293 }
294 
295 
296 TPZCompMesh* MalhaComp(TPZGeoMesh * gmesh, int pOrder)
297 {
299  int dim = 2;
300  TPZMatPoisson3d *material = new TPZMatPoisson3d(matInterno,dim);
301  TPZMatPoisson3d *matlagrange = new TPZHybridPoisson(lagrangemat, dim);
302  TPZMatPoisson3d *matinterface = new TPZHybridPoisson(interfacemat,dim);
303 
304  TPZMaterial * mat1(material);
305  TPZMaterial * mat2(matlagrange);
306  TPZMaterial * mat3(matinterface);
307 
308  material->NStateVariables();
309  matlagrange->NStateVariables();
310  matinterface->NStateVariables();
311 
312  REAL diff = 1.;
313  REAL conv = 0.;
314  TPZVec<REAL> convdir(3,0.);
315  material->SetParameters(diff, conv, convdir);
316  //REAL flux = 0.;
317  //material->SetInternalFlux(flux);
318 
320  force = new TPZDummyFunction<STATE>(Forcing);
321  material->SetForcingFunction(force);
322 
323  material->NStateVariables();
324 
325 
326  TPZCompEl::SetgOrder(pOrder);
327  TPZCompMesh * cmesh = new TPZCompMesh(gmesh);
328  cmesh->SetDimModel(dim);
329 
330  cmesh->InsertMaterialObject(mat1);
331  cmesh->InsertMaterialObject(mat2);
332  cmesh->InsertMaterialObject(mat3);
333 
335  TPZFMatrix<STATE> val1(2,2,0.), val2(2,1,0.);
336 
337  TPZFMatrix<STATE> val12(2,2,0.), val22(2,1,0.);
338 
340  solexata = new TPZDummyFunction<STATE>(SolExata);
341  material->SetForcingFunctionExact(solexata);
342 
343  REAL uD=0.;
344  val22(0,0)=uD;
345  TPZMaterial * BCondD1 = material->CreateBC(mat1, bc2,dirichlet, val12, val22);
346  cmesh->InsertMaterialObject(BCondD1);
347 
348  TPZMaterial * BCondD2 = material->CreateBC(mat1, bc4,dirichlet, val12, val22);
349  cmesh->InsertMaterialObject(BCondD2);
350 
351  TPZMaterial * BCondN1 = material->CreateBC(mat1, bc1,dirichlet, val1, val2);
352  cmesh->InsertMaterialObject(BCondN1);
353 
354  TPZMaterial * BCondN2 = material->CreateBC(mat1, bc3,dirichlet, val1, val2);
355  cmesh->InsertMaterialObject(BCondN2);
356 
358 
359  set<int> SETmat1;
360  SETmat1.insert(bc1);
361  SETmat1.insert(bc2);
362  SETmat1.insert(bc3);
363  SETmat1.insert(bc4);
364 
365  //criar set dos materiais
366  std::set<int> MaterialIDs;
367  std::set<int> BCMaterialIDs;
368  MaterialIDs.insert(matInterno);
369  //MaterialIDs.insert(lagrangemat);
370  //MaterialIDs.insert(interfacemat);
371  BCMaterialIDs.insert(bc1);
372  BCMaterialIDs.insert(bc2);
373  BCMaterialIDs.insert(bc3);
374  BCMaterialIDs.insert(bc4);
375 
376 // cmesh->AutoBuild(MaterialIDs);
377 
378  TPZBuildMultiphysicsMesh::BuildHybridMesh(cmesh, MaterialIDs, BCMaterialIDs, lagrangemat, interfacemat);
379 
380 // TPZMaterial *lagrange = cmesh->MaterialVec()[lagrangemat];
381 // cmesh->MaterialVec().erase(lagrangemat);
382 // delete lagrange;
383 
384 // int nel = cmesh->NElements();
385 // for(int i=0; i<nel; i++){
386 // TPZCompEl *cel = cmesh->ElementVec()[i];
387 // if(!cel) continue;
388 //
389 // int mid = cel->Material()->Id();
390 //
391 // if(mid==lagrangemat){
392 //
393 // int nsides = cel->Reference()->NSides();
394 //
395 // for(int i = 0; i<nsides; i++){
396 // TPZConnect &newnod = cel->Connect(i);
397 // newnod.SetPressure(true);
398 // }
399 // }
400 // }
401 
402  return cmesh;
403 }
404 
405 void BuildElementGroups(TPZCompMesh *cmesh, int materialid, int interfacemat, int lagrangemat)
406 {
407  int64_t nel = cmesh->NElements();
408  std::map<int,TPZElementGroup *> elgroup;
409  cmesh->LoadReferences();
410  for (int64_t el=0; el<nel; el++) {
411  TPZCompEl *cel = cmesh->ElementVec()[el];
412  if (!cel) {
413  continue;
414  }
415  TPZGeoEl *gel = cel->Reference();
416  if (gel && gel->MaterialId() == materialid) {
417  int64_t index;
418  TPZElementGroup *elgr = new TPZElementGroup(*cmesh,index);
419  elgroup[el] = elgr;
420 #ifdef LOG4CXX
421  {
422  std::stringstream sout;
423  sout << "Creating an element group around element index " << el;
424  LOGPZ_DEBUG(logger, sout.str())
425  }
426 #endif
427  }
428  }
429  for (std::map<int,TPZElementGroup *>::iterator it = elgroup.begin(); it != elgroup.end(); it++) {
430  TPZCompEl *cel = cmesh->ElementVec()[it->first];
431  TPZGeoEl *gel = cel->Reference();
432  int64_t dim = gel->Dimension();
433  int nsides = gel->NSides();
434  for (int is=0; is<nsides; is++) {
435  int sidedim = gel->SideDimension(is);
436  if (sidedim != dim-1) {
437  continue;
438  }
440  TPZGeoElSide gelside(gel,is);
441  gelside.EqualLevelCompElementList(equal, 0, 0);
442  // look for the interface elements (which look at me)
443  int neq = equal.size();
444  for (int eq =0; eq < neq; eq++) {
445  TPZCompElSide eqsize = equal[eq];
446  TPZCompEl *eqcel = eqsize.Element();
447  TPZGeoEl *eqgel = eqcel->Reference();
448  if (!eqgel) {
449  continue;
450  }
451  int matid = eqgel->MaterialId();
452  if (matid == interfacemat) {
453  TPZInterfaceElement *interfacee = dynamic_cast<TPZInterfaceElement *>(eqcel);
454  if (!interfacee ) {
455  DebugStop();
456  }
457  TPZCompEl *left = interfacee->LeftElement();
458  TPZCompEl *right = interfacee->RightElement();
459  if (left == cel || right == cel) {
460  it->second->AddElement(interfacee);
461  eqgel->ResetReference();
462  }
463  }
464  // look for the boundary elements (all elements which are not lagrange materials)
465  else if (matid != lagrangemat && eqgel->Dimension() == dim-1)
466  {
467  it->second->AddElement(eqcel);
468  eqgel->ResetReference();
469  }
470  }
471  }
472  it->second->AddElement(cel);
473  gel->ResetReference();
474  }
475  cmesh->ComputeNodElCon();
476  nel = cmesh->NElements();
477  for (int64_t el=0; el<nel; el++) {
478  TPZCompEl *cel = cmesh->ElementVec()[el];
479  TPZElementGroup *elgr = dynamic_cast<TPZElementGroup *>(cel);
480  if(elgr) {
481  TPZCondensedCompEl *cond = NULL;
482  cond = new TPZCondensedCompEl(elgr);
483  }
484  }
485  cmesh->CleanUpUnconnectedNodes();
486 }
487 
488 void ResetMesh(TPZCompMesh *cmesh)
489 {
490  int64_t nel = cmesh->NElements();
491  for (int64_t el = 0; el<nel; el++) {
492  TPZCompEl *cel = cmesh->ElementVec()[el];
493  TPZCondensedCompEl *cond = dynamic_cast<TPZCondensedCompEl *>(cel);
494  if (cond) {
495  cond->Unwrap();
496  }
497  }
498  for (int64_t el = 0; el<nel; el++) {
499  TPZCompEl *cel = cmesh->ElementVec()[el];
500  TPZElementGroup *elgr = dynamic_cast<TPZElementGroup *>(cel);
501  if (elgr) {
502  elgr->Unwrap();
503  }
504  }
505 }
506 
507 
508 void Forcing(const TPZVec<REAL> &pt, TPZVec<STATE> &disp){
509  double x = pt[0];
510  double y = pt[1];
511  disp[0]= 2.*Pi*Pi*sin(Pi*x)*sin(Pi*y);
512 }
513 
514 void SolExata(const TPZVec<REAL> &pt, TPZVec<STATE> &disp, TPZFMatrix<STATE> &flux){
515 
516  disp.Resize(1, 0.);
517  flux.Resize(3, 1.);
518  flux(0,0)=flux(1,0)=flux(2,0)=0.;
519  double x = pt[0];
520  double y = pt[1];
521  flux.Resize(3, 1);
522  disp[0]= sin(Pi*x)*sin(Pi*y);
523  flux(0,0)=-Pi*cos(Pi*x)*sin(Pi*y);
524  flux(1,0)=-Pi*cos(Pi*y)*sin(Pi*x);
525  flux(2,0)=2.*Pi*Pi*sin(Pi*x)*sin(Pi*y);
526 }
527 
528 void PosProcessSol(TPZAnalysis &an, std::string plotfile){
529  TPZManVector<std::string,10> scalnames(2), vecnames(2);
530  scalnames[0] = "Pressure";
531  scalnames[1] = "ExactPressure";
532 
533  vecnames[0]= "Flux";
534  vecnames[1]= "ExactFlux";
535 
536  const int dim = 2;
537  int div = 0;
538  an.DefineGraphMesh(dim,scalnames,vecnames,plotfile);
539  an.PostProcess(div,dim);
540  std::ofstream out("malha.txt");
541  an.Print("nothing",out);
542 }
543 
544 
545 
int64_t NElements() const
Number of computational elements allocated.
Definition: pzcmesh.h:169
Contains a class to record running statistics on CSV tables.
Contains the TPZFrontSym class which implements decomposition process of the frontal matrix (case sym...
clarg::argInt p_order("-p", "polynomial order", 1)
static void SetgOrder(int order)
Sets the value of the default interpolation order.
Definition: pzcompel.h:825
Contains TPZAnalysis class which implements the sequence of actions to perform a finite element analy...
Implements computational element and a side. Computational Element.
Definition: pzcompel.h:632
Definition: pzmatrix.h:52
Contains the TPZParSkylineStructMatrix class which defines parallel structural matrix for skyline mat...
Contains declaration of TPZGeoElSide class which represents an element and its side, and TPZGeoElSideIndex class which represents an TPZGeoElSide index.
Contains definitions to LOGPZ_DEBUG, LOGPZ_INFO, LOGPZ_WARN, LOGPZ_ERROR and LOGPZ_FATAL, and the implementation of the inline InitializePZLOG(string) function using log4cxx library or not. It must to be called out of "#ifdef LOG4CXX" scope.
void SetStructuralMatrix(TPZAutoPointer< TPZStructMatrix > strmatrix)
Set structural matrix as auto pointer for analysis.
Definition: pzanalysis.cpp:82
Implements a vector class which allows to use external storage provided by the user. Utility.
Definition: pzquad.h:16
void Print(const std::string &name, std::ostream &out)
Print connect and solution information.
Definition: pzanalysis.cpp:447
void BuildElementGroups(TPZCompMesh *cmesh, int materialid, int interfacemat, int lagrangemat)
Definition: main.cpp:405
clarg::argInt n_threads("-nthreads", "Number of threads", 1)
int MaterialId() const
Returns the material index of the element.
Definition: pzgeoel.h:250
void Unwrap()
put the elements in the element group back in the mesh and delete the element group ...
clarg::argBool cond_f("-cond", "perform static condensation")
void SolExata(const TPZVec< REAL > &pt, TPZVec< STATE > &disp, TPZFMatrix< STATE > &flux)
Definition: main.cpp:514
int64_t NEquations()
This computes the number of equations associated with non-restrained nodes.
Definition: pzcmesh.cpp:721
RunStatsTable total_rdt("-tot_rdt","Statistics for the whole application")
Contains declaration of TPZCompEl class which defines the interface of a computational element...
Templated vector implementation.
Contains the declaration of the TPZElementGroup class, which implements an computational element whic...
RunStatsTable cond_ass_rdt("-cond_ass_rdt","Statistics for the assemble step during static condensation")
TPZCompMesh * MalhaComp(TPZGeoMesh *gmesh, int pOrder)
Definition: main.cpp:296
Defines step solvers class. Solver.
Definition: pzmganalysis.h:17
void SetSolver(TPZMatrixSolver< STATE > &solver)
Set solver matrix.
Contains the TPZFrontNonSym class which implements storage and decomposition process of the frontal m...
int64_t NElements() const
Number of elements of the mesh.
Definition: pzgmesh.h:129
RunStatsTable cond_rdt("-cond_rdt","Statistics for the static condensation step")
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.
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
virtual int NSides() const =0
Returns the number of connectivities of the element.
Contains the TPZStructMatrixOR class which responsible for a interface among Matrix and Finite Elemen...
virtual void Divide(TPZVec< TPZGeoEl *> &pv)
Divides the element and puts the resulting elements in the vector.
Definition: pzgeoel.h:742
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...
void LoadReferences()
Map this grid in the geometric grid.
Definition: pzcmesh.cpp:482
Contains the TPZMatPoisson3d class.
const int bc3
Definition: main.cpp:88
TPZAutoPointer< TPZGeoMesh > MalhaGeom(int dimension, TPZVec< int > &nblocks, int nref)
malha geometrica de grande porte
Definition: main.cpp:170
REAL const Pi
Definition: main.cpp:91
Contains the TPZFStructMatrix class which implements Full Structural Matrices.
const int bc4
Definition: main.cpp:89
Implements SkyLine Structural Matrices. Structural Matrix.
This abstract class defines the behaviour which each derived class needs to implement.
Definition: TPZMaterial.h:39
Contains the TPZBndCond class which implements a boundary condition for TPZMaterial objects...
int64_t size() const
Returns the number of elements of the vector.
Definition: pzvec.h:196
Contains the TPZSpStructMatrix class which implements sparse structural matrices. ...
void SetForcingFunctionExact(TPZAutoPointer< TPZFunction< STATE > > fp)
Sets a procedure as exact solution for the problem.
Definition: TPZMaterial.h:405
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
clarg::argInt n_uref("-nuref", "Number of uniform refinements", 1)
void Resize(const int newsize)
Increase the size of the chunk vector.
Definition: pzadmchunk.h:280
void Unwrap()
unwrap the condensed element from the computational element and delete the condensed element ...
sin
Definition: fadfunc.h:63
Contains declaration of TPZMesh class which defines a geometrical mesh and contains a corresponding l...
Implements the sequence of actions to perform a finite element analysis. Analysis.
Definition: pzanalysis.h:32
void SetMaxNodeId(int64_t id)
Used in patch meshes.
Definition: pzgmesh.h:120
const int matInterno
Definition: main.cpp:78
virtual void Print(std::ostream &out=std::cout) const
Print the information of the grid to an ostream.
Definition: pzgmesh.cpp:130
Implements a generic geometric element which is refined according to a generic refinement pattern...
Definition: pzgmesh.h:35
virtual void SetParameters(STATE diff, REAL conv, TPZVec< REAL > &convdir)
Definition: pzpoisson3d.cpp:78
Defines the behaviour of all geometric elements. GeometryTPZGeoEl is the common denominator for all g...
Definition: pzgeoel.h:43
Contains declaration of TPZCompMeshReferred class which implements the structure to allow one mesh to...
clarg::argBool help("-h", "display the help message")
Contains the TPZBandStructMatrix class which implements Banded Structural Matrices.
Contains TPZMatrixclass which implements full matrix (using column major representation).
#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...
int parse_arguments(int argc, char *argv[])
Definition: arglib.cpp:195
virtual void SetNumThreads(int n)
#define LOGPZ_DEBUG(A, B)
Define log for debug info.
Definition: pzlog.h:87
Contains the TPZElasticityMaterial class which implements a two dimensional elastic material in plane...
Contains the declaration of the TPZBuildmultiphysicsMesh class.
virtual void ComputeNodElCon()
Compute the number of elements connected to each connect object.
Definition: pzcmesh.cpp:668
TPZAdmChunkVector< TPZGeoNode > & NodeVec()
Definition: pzgmesh.h:140
void PosProcessSol(TPZAnalysis &an, std::string plotfile)
Definition: main.cpp:528
Contains declaration of TPZGeoElRefPattern class which implements a generic geometric element which i...
Contains declaration of the TPZAutoPointer class which has Increment and Decrement actions are mutexe...
Class which implements an element which condenses the internal connects.
Contains the TPZMatPoisson3dReferred class which implements a version of TPZMatPoisson3d (convection...
void arguments_descriptions(ostream &os, string prefix, string suffix)
Definition: arglib.cpp:189
static void PrintGMeshVTK(TPZGeoMesh *gmesh, std::ofstream &file, bool matColor=true)
Default constructor for graphical mesh with VTK format.
Contains declaration of TPZCompMesh class which is a repository for computational elements...
virtual void PostProcess(int resolution)
Draw solution over mesh for all dimensions.
Contains the TPZRefPattern class which defines the topology of the current refinement pattern to a me...
virtual void Assemble(TPZMatrix< STATE > &mat, TPZFMatrix< STATE > &rhs, TPZAutoPointer< TPZGuiInterface > guiInterface) override
Assemble the global system of equations into the matrix which has already been created.
Definition: pzstrmatrix.cpp:80
void SetDimModel(int dim)
Set de dimension of the domain of the problem.
Definition: pzcmesh.h:139
virtual void Run(std::ostream &out=std::cout)
Calls the appropriate sequence of methods to build a solution or a time stepping sequence.
Definition: pzanalysis.cpp:920
A simple stack.
Contains the TPZGeoPoint class which implements the geometry of a point element or 0-D element...
Computes the contribution over an interface between two discontinuous elements. Computational Element...
void Forcing(const TPZVec< REAL > &pt, TPZVec< STATE > &disp)
Definition: main.cpp:508
void BuildConnectivity()
Build the connectivity of the grid.
Definition: pzgmesh.cpp:967
const int dirichlet
Definition: main.cpp:82
virtual TPZBndCond * CreateBC(TPZMaterial *reference, int id, int typ, TPZFMatrix< STATE > &val1, TPZFMatrix< STATE > &val2)
Creates an object TPZBndCond derived of TPZMaterial.
Contains the TPBSpStructMatrix class which assembles on the pair equations.
int InsertMaterialObject(TPZMaterial *mat)
Insert a material object in the datastructure.
Definition: pzcmesh.cpp:287
DESCRIBE PLEASE.
Definition: pzpoisson3d.h:26
void InitializePZLOG()
Initializes log file for log4cxx with commom name log4cxx.cfg.
Definition: pzlog.cpp:14
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
int AddInterfaceMaterial(int leftmaterial, int rightmaterial, int interfacematerial)
Add an interface material associated to left and right element materials.
Definition: pzgmesh.cpp:1534
TPZGeoEl * Reference() const
Return a pointer to the corresponding geometric element if such exists, return 0 otherwise.
Definition: pzcompel.cpp:1137
TPZCompEl * LeftElement() const
Returns the left element from the element interface.
static void BuildHybridMesh(TPZCompMesh *cmesh, std::set< int > &MaterialIDs, std::set< int > &BCMaterialIds, int LagrangeMat, int InterfaceMat)
Creating computational mesh with interface elements.
expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ atan
Definition: tfadfunc.h:85
This class implements a geometric mesh for the pz environment. Geometry.
Definition: pzgmesh.h:48
void SetForcingFunction(TPZAutoPointer< TPZFunction< STATE > > fp)
Sets a procedure as source function for the material.
Definition: TPZMaterial.h:368
void ResetReference()
Reset the element referenced by the geometric element to NULL.
Definition: pzgeoel.h:431
const int bc1
Definition: main.cpp:86
Implements computational mesh. Computational Mesh.
Definition: pzcmesh.h:47
void SetAllCreateFunctionsHDivPressure()
Definition: pzcmesh.h:531
const T & get_value() const
Definition: arglib.h:177
TPZAdmChunkVector< TPZCompEl * > & ElementVec()
Returns a reference to the element pointers vector.
Definition: pzcmesh.h:183
const int interfacemat
Definition: main.cpp:80
Contains TPZStepSolver class which defines step solvers class.
const int bc2
Definition: main.cpp:87
pthread_cond_t cond
Definition: numatst.cpp:318
int Resize(const int64_t newRows, const int64_t wCols) override
Redimension a matrix, but maintain your elements.
Definition: pzfmatrix.cpp:1016
const int lagrangemat
Definition: main.cpp:79
TPZCompEl * RightElement() const
Returns the right element from the element interface.
virtual int NStateVariables() const override
Returns the number of state variables associated with the material.
Definition: pzpoisson3d.h:161
void SetDirect(const DecomposeType decomp)
Contains the TPZElasticityHybridMaterial class which implements a two dimensional elastic material to...
void ResetMesh(TPZCompMesh *cmesh)
Definition: main.cpp:488
Defines the interface of a computational element. Computational Element.
Definition: pzcompel.h:59
Contains the TPZVTKGeoMesh class which implements the graphical mesh to VTK environment to geometric ...
TPZFlopCounter cos(const TPZFlopCounter &orig)
Returns the cosine in radians and increments the counter of the Cosine.
Definition: pzreal.h:514
Contains the declaration of the TPZCondensedCompEl class, which implements an computational element w...
Material to solve a mixed poisson problem 2d by multiphysics simulation.
int main()
Definition: main.cpp:60
virtual void Print(std::ostream &out=std::cout) const
Prints mesh data.
Definition: pzcmesh.cpp:236
TPZAdmChunkVector< TPZGeoEl * > & ElementVec()
Methods for handling pzlists.
Definition: pzgmesh.h:138
This class implements a reference counter mechanism to administer a dynamically allocated object...