LifeV
lifev/eta/examples/mesh_volume_subdivision/main.cpp
Go to the documentation of this file.
1 //@HEADER
2 /*
3 *******************************************************************************
4 
5  Copyright (C) 2004, 2005, 2007 EPFL, Politecnico di Milano, INRIA
6  Copyright (C) 2010 EPFL, Politecnico di Milano, Emory University
7 
8  This file is part of LifeV.
9 
10  LifeV is free software; you can redistribute it and/or modify
11  it under the terms of the GNU Lesser General Public License as published by
12  the Free Software Foundation, either version 3 of the License, or
13  (at your option) any later version.
14 
15  LifeV is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  Lesser General Public License for more details.
19 
20  You should have received a copy of the GNU Lesser General Public License
21  along with LifeV. If not, see <http://www.gnu.org/licenses/>.
22 
23 *******************************************************************************
24 */
25 //@HEADER
26 
27 /*!
28  @file
29  @brief Laplacian problem
30 
31  @author Niccolo' Dal Santo <niccolo.dalsanto@epfl.ch>
32  @date 19-05-2015
33 
34  This code aims at showing how to assemble a stiffness matrix as sum of
35  matrices corresponding to the restriction of the bilinear form to subdomains.
36  This is done by a extension of the method integrate
37  that computes the stiffness matrix only over a subset of the volumes identified by a
38  specific physical flag. The volume subdivision is done through the class
39  lifev/core/mesh/MeshVolumeSubdivision
40 
41  The macro TESTMESHSUB allows to check the correctness of the local matrices by comparing
42  them to the ones computed by the usual integrate (simply by defining for every subdomain a
43  diffusion coefficient that is an indicator function on it). The matrices computed
44  in this way are saved and can be checked. Then the full matrix is assembled using the standard
45  integrate and both results are exported in paraview.
46  The check is coded for the mesh 4cube1.mesh which correspond to have a [0,1]^3 cube divided in
47  4 regions. The diffusion coefficients are read from datafile.
48  */
49 
50 #include <Epetra_ConfigDefs.h>
51 #ifdef EPETRA_MPI
52 #include <Epetra_MpiComm.h>
53 #else
54 #include <Epetra_SerialComm.h>
55 #endif
56 
57 #include <lifev/core/LifeV.hpp>
58 #include <lifev/core/util/LifeChronoManager.hpp>
59 
60 #include <lifev/core/mesh/MeshPartitioner.hpp>
61 #include <lifev/core/mesh/RegionMesh3DStructured.hpp>
62 #include <lifev/core/mesh/RegionMesh.hpp>
63 #include <lifev/core/array/MatrixEpetra.hpp>
64 
65 #include <lifev/core/fem/BCManage.hpp>
66 #include <lifev/eta/fem/ETFESpace.hpp>
67 #include <lifev/eta/expression/BuildGraph.hpp>
68 #include <lifev/eta/expression/Integrate.hpp>
69 #include <Epetra_FECrsGraph.h>
70 
71 #include <Teuchos_ParameterList.hpp>
72 #include <Teuchos_XMLParameterListHelpers.hpp>
73 #include <Teuchos_RCP.hpp>
74 #include <lifev/core/algorithm/LinearSolver.hpp>
75 #include <lifev/core/algorithm/PreconditionerIfpack.hpp>
76 
77 #include <lifev/core/filter/ExporterHDF5.hpp>
78 
79 #include <lifev/eta/examples/laplacian/laplacianFunctor.hpp>
80 #include <lifev/core/mesh/RegionMesh.hpp>
81 #include <lifev/core/mesh/ElementShapes.hpp>
82 #include <lifev/core/mesh/MeshEntityContainer.hpp>
83 #include <lifev/core/mesh/MeshData.hpp>
84 #include <lifev/core/mesh/MeshVolumeSubdivision.hpp>
85 
86 using namespace LifeV;
87 
88 // Dirichlet BC functions
89 Real zeroFunction (const Real& /*t*/, const Real& /*x*/, const Real& /*y*/, const Real& /*z*/, const ID& /*i*/)
90 {
91  return 0.;
92 }
93 
94 Real sourceFunction (const Real& /*t*/, const Real& x, const Real& y, const Real& z, const ID& /*i*/)
95 {
96  return 100.;
97 }
98 
99 const int BACK = 101;
100 const int FRONT = 102;
101 const int LEFT = 103;
102 const int RIGHT = 104;
103 const int BOTTOM = 105;
104 const int TOP = 106;
105 
106 #define TESTMESHSUB
107 
108 
109 Real diffusion4Function1 (const Real& /*t*/, const Real& x, const Real& y, const Real& z, const ID& /*i*/)
110 {
111  if( z<0.5 && y < 0.5 ) return 1.0;
112 
113  return 0.;
114 }
115 Real diffusion4Function2 (const Real& /*t*/, const Real& x, const Real& y, const Real& z, const ID& /*i*/)
116 {
117  if( z>0.5 && y < 0.5 ) return 1.0;
118 
119  return 0.;
120 }
121 
122 Real diffusion4Function3 (const Real& /*t*/, const Real& x, const Real& y, const Real& z, const ID& /*i*/)
123 {
124  if( z<0.5 && y > 0.5 ) return 1.0;
125 
126  return 0.;
127 }
128 Real diffusion4Function4 (const Real& /*t*/, const Real& x, const Real& y, const Real& z, const ID& /*i*/)
129 {
130  if( z>0.5 && y > 0.5 ) return 1.0;
131 
132  return 0.;
133 }
134 
135 Real mu1 = 1.0;
136 Real mu2 = 1.0;
137 Real mu3 = 1.0;
138 Real mu4 = 1.0;
139 
140 Real diffusion4FunctionTotal (const Real& /*t*/, const Real& x, const Real& y, const Real& z, const ID& /*i*/)
141 {
142  if( z<0.5 && y < 0.5 ) return mu1;
143  if( z>0.5 && y < 0.5 ) return mu2;
144  if( z<0.5 && y > 0.5 ) return mu3;
145 
146  return mu4;
147 }
148 
149 
150 int main ( int argc, char** argv )
151 {
152 
153  // MPI initialization
154 #ifdef HAVE_MPI
155  MPI_Init ( &argc, &argv );
156  std::shared_ptr< Epetra_Comm > Comm ( new Epetra_MpiComm ( MPI_COMM_WORLD ) );
157 #else
158  std::shared_ptr< Epetra_Comm > Comm ( new Epetra_SerialComm );
159 #endif
160 
161  // Reading parameters through GetPot
162  GetPot command_line ( argc, argv );
163  const std::string dataFileName = command_line.follow ( "data", 2, "-f", "--file" );
164  GetPot dataFile ( dataFileName );
165 
166  const bool verbose ( Comm->MyPID() == 0 );
167 
168  if ( verbose )
169  {
170  std::cout << "-- Building and partitioning the mesh... " << std::flush;
171  }
172 
173 
174  // +-----------------------------------------------+
175  // | Building mesh |
176  // +-----------------------------------------------+
177 
178  typedef RegionMesh< LinearTetra > mesh_Type;
179 
180  std::shared_ptr< mesh_Type > fullMeshPtr ( new mesh_Type ( Comm ) );
181 
182  MeshData meshData;
183  meshData.setup ( dataFile, "mesh");
184  readMesh (*fullMeshPtr, meshData);
185 
186  std::shared_ptr< mesh_Type > localMeshPtr;
187 
188  MeshPartitioner< mesh_Type > meshPart;
189 
190  meshPart.doPartition ( fullMeshPtr, Comm );
191  localMeshPtr = meshPart.meshPartition();
192 
193  // Clearing global mesh
194  fullMeshPtr.reset();
195 
196  if ( verbose )
197  {
198  std::cout << " done" << std::endl;
199  }
200 
201  // +-----------------------------------------------+
202  // | Building FE space and matrix |
203  // +-----------------------------------------------+
204 
205  typedef FESpace< mesh_Type, MapEpetra > uSpaceStd_Type;
206  typedef std::shared_ptr< uSpaceStd_Type > uSpaceStdPtr_Type;
207 
208  typedef ETFESpace< mesh_Type, MapEpetra, 3, 1 > uSpaceETA_Type;
209  typedef std::shared_ptr< uSpaceETA_Type > uSpaceETAPtr_Type;
210 
211  typedef FESpace<mesh_Type, MapEpetra>::function_Type function_Type;
212 
213  if ( verbose )
214  {
215  std::cout << "-- Building finite elements spaces... " << std::flush;
216  }
217 
218  // Defining finite elements standard and ET spaces
219  uSpaceStdPtr_Type uFESpace ( new uSpaceStd_Type ( localMeshPtr, dataFile( "finite_element/degree", "P1" ), 1, Comm ) );
220  uSpaceETAPtr_Type ETuFESpace ( new uSpaceETA_Type ( localMeshPtr, & ( uFESpace->refFE() ), & ( uFESpace->fe().geoMap() ), Comm ) );
221 
222  if ( verbose )
223  {
224  std::cout << " done. " << " (Dofs: " << uFESpace->dof().numTotalDof() << ")" << std::endl;
225  }
226 
227  typedef MatrixEpetra< Real > matrix_Type;
228  typedef std::shared_ptr< MatrixEpetra< Real > > matrixPtr_Type;
229  typedef VectorEpetra vector_Type;
230  typedef std::shared_ptr<VectorEpetra> vectorPtr_Type;
231 
232  if ( verbose )
233  {
234  std::cout << " done " << std::endl;
235  }
236 
237  // Clearing problem's matrix
238  if ( verbose )
239  {
240  std::cout << "-- Subdividing the mesh... " << std::flush;
241  }
242 
243  int numSubregions = dataFile( "physicalParameters/numSubregions", 1 );
244 
245  typedef LifeV::MeshVolumeSubdivision<RegionMesh<LinearTetra> > meshSub_Type;
246  typedef std::shared_ptr<meshSub_Type> meshSubPtr_Type;
247 
248  // suppose we are running the test with 4cube1.mesh,
249  // so we have 4 subregions identified by the flags 1001,1002,1003,1004
250  Epetra_IntSerialDenseVector regions(numSubregions);
251 
252  regions(0) = 1001;
253  regions(1) = 1002;
254  regions(2) = 1003;
255  regions(3) = 1004;
256 
257  meshSubPtr_Type meshSub;
258  meshSub.reset( new meshSub_Type( Comm, localMeshPtr, regions, numSubregions ) );
259 
260  meshSub->makeSubDivision();
261 
262 // meshSub->printNumElementPerFlag();
263 
264  if ( verbose )
265  {
266  std::cout << "-- Assembling the Laplace submatrices... " << std::flush;
267  }
268 
269  matrixPtr_Type systemMatrixMeshSub1( new matrix_Type( ETuFESpace->map(), 100 ) );
270  matrixPtr_Type systemMatrixMeshSub2( new matrix_Type( ETuFESpace->map(), 100 ) );
271  matrixPtr_Type systemMatrixMeshSub3( new matrix_Type( ETuFESpace->map(), 100 ) );
272  matrixPtr_Type systemMatrixMeshSub4( new matrix_Type( ETuFESpace->map(), 100 ) );
273 
274  {
275  using namespace ExpressionAssembly;
276 
277  if ( verbose )
278  {
279  std::cout << "Building with MeshSub" << std::endl;
280  }
281 
282  integrate ( elements ( localMeshPtr, meshSub->getFlag(0),
283  meshSub->getNumElements( 0 ), meshSub->getSubmesh( 0 ),
284  true ),
285  uFESpace->qr(),
286  ETuFESpace,
287  ETuFESpace,
288  value(1.0) * dot( grad( phi_j ), grad( phi_i ) )
289  )
290  >> systemMatrixMeshSub1;
291 
292  integrate ( elements ( localMeshPtr, meshSub->getFlag(1),
293  meshSub->getNumElements( 1 ), meshSub->getSubmesh( 1 ),
294  true ),
295  uFESpace->qr(),
296  ETuFESpace,
297  ETuFESpace,
298  value(1.0) * dot( grad( phi_j ), grad( phi_i ) )
299  )
300  >> systemMatrixMeshSub2;
301 
302  integrate ( elements ( localMeshPtr, meshSub->getFlag(2),
303  meshSub->getNumElements( 2 ), meshSub->getSubmesh( 2 ),
304  true ),
305  uFESpace->qr(),
306  ETuFESpace,
307  ETuFESpace,
308  value(1.0) * dot( grad( phi_j ), grad( phi_i ) )
309  )
310  >> systemMatrixMeshSub3;
311 
312  integrate ( elements ( localMeshPtr, meshSub->getFlag(3),
313  meshSub->getNumElements( 3 ), meshSub->getSubmesh( 3 ),
314  true ),
315  uFESpace->qr(),
316  ETuFESpace,
317  ETuFESpace,
318  value(1.0) * dot( grad( phi_j ), grad( phi_i ) )
319  )
320  >> systemMatrixMeshSub4;
321 
322  }
323 
324  systemMatrixMeshSub1->globalAssemble();
325  systemMatrixMeshSub2->globalAssemble();
326  systemMatrixMeshSub3->globalAssemble();
327  systemMatrixMeshSub4->globalAssemble();
328 
329  // diffusion parameters
330  mu1 = dataFile( "physicalParameters/mu1", 1 );
331  mu2 = dataFile( "physicalParameters/mu2", 1 );
332  mu3 = dataFile( "physicalParameters/mu3", 1 );
333  mu4 = dataFile( "physicalParameters/mu4", 1 );
334 
335  matrixPtr_Type matrixMeshSubFull( new matrix_Type( ETuFESpace->map(), 100 ) );
336 
337  *matrixMeshSubFull += ( *systemMatrixMeshSub1 ) * mu1;
338  *matrixMeshSubFull += ( *systemMatrixMeshSub2 ) * mu2;
339  *matrixMeshSubFull += ( *systemMatrixMeshSub3 ) * mu3;
340  *matrixMeshSubFull += ( *systemMatrixMeshSub4 ) * mu4;
341 
342  if (verbose)
343  {
344  std::cout << " done" << std::endl;
345  }
346 
347  // +-----------------------------------------------+
348  // | Initializing vectors and exporter |
349  // +-----------------------------------------------+
350 
351  vectorPtr_Type rhsLap;
352  vectorPtr_Type solutionLap;
353 
354  rhsLap.reset ( new vector_Type ( uFESpace->map(), Unique ) );
355  solutionLap.reset ( new vector_Type ( uFESpace->map(), Unique ) );
356 
357  rhsLap->zero();
358  solutionLap->zero();
359 
360  std::shared_ptr<laplacianFunctor< Real > > laplacianSourceFunctor ( new laplacianFunctor< Real >( sourceFunction ) );
361 
362  {
363  using namespace ExpressionAssembly;
364 
365  integrate (
366  elements ( localMeshPtr ),
367  uFESpace->qr(),
368  ETuFESpace,
369  eval(laplacianSourceFunctor, X) * phi_i
370  )
371  >> rhsLap;
372 
373  }
374 
375  // Setting exporter
376  ExporterHDF5< mesh_Type > exporter ( dataFile, "exporter" );
377  exporter.setMeshProcId( localMeshPtr, Comm->MyPID() );
378  exporter.setPrefix( "mesh_volume_subdivision_laplace" );
379  exporter.setPostDir( "./" );
380 
381  exporter.addVariable ( ExporterData< mesh_Type >::ScalarField, "temperature", uFESpace, solutionLap, UInt ( 0 ) );
382 
383  // +-----------------------------------------------+
384  // | Setting BCs |
385  // +-----------------------------------------------+
386 
387  if (verbose)
388  {
389  std::cout << "-- Setting boundary conditions... " << std::flush;
390  }
391 
392  BCHandler bcHandler;
393 
394  BCFunctionBase ZeroBC ( zeroFunction );
395 
396  bcHandler.addBC( "Back", BACK, Essential, Full, ZeroBC, 1 );
397  bcHandler.addBC( "Left", LEFT, Essential, Full, ZeroBC, 1 );
398  bcHandler.addBC( "Top", TOP, Essential, Full, ZeroBC, 1 );
399 
400 
401  bcHandler.addBC( "Front", FRONT, Essential, Full, ZeroBC, 1 );
402  bcHandler.addBC( "Right", RIGHT, Essential, Full, ZeroBC, 1 );
403  bcHandler.addBC( "Bottom", BOTTOM, Essential, Full, ZeroBC, 1 );
404 
405  bcHandler.bcUpdate( *uFESpace->mesh(), uFESpace->feBd(), uFESpace->dof() );
406 
407  matrixMeshSubFull->globalAssemble();
408  rhsLap->globalAssemble();
409 
410  bcManage ( *matrixMeshSubFull, *rhsLap, *uFESpace->mesh(), uFESpace->dof(), bcHandler, uFESpace->feBd(), 1.0, 0.0 );
411 
412  if (verbose)
413  {
414  std::cout << " done " << std::endl;
415  }
416 
417  // +-----------------------------------------------+
418  // | Setting solver and preconditioner |
419  // +-----------------------------------------------+
420 
421  typedef LinearSolver::SolverType solver_Type;
422 
423  typedef LifeV::Preconditioner basePrec_Type;
424  typedef std::shared_ptr<basePrec_Type> basePrecPtr_Type;
425  typedef PreconditionerIfpack prec_Type;
426  typedef std::shared_ptr<prec_Type> precPtr_Type;
427 
428 
429  if (verbose)
430  {
431  std::cout << "-- Setting up the solver ... " << std::flush;
432  }
433 
434  LinearSolver linearSolver ( Comm );
435  linearSolver.setOperator ( matrixMeshSubFull );
436 
437  Teuchos::RCP< Teuchos::ParameterList > aztecList = Teuchos::rcp ( new Teuchos::ParameterList );
438  aztecList = Teuchos::getParametersFromXmlFile ( "SolverParamList.xml" );
439 
440  linearSolver.setParameters ( *aztecList );
441 
442  prec_Type* precRawPtr;
443  basePrecPtr_Type precPtr;
444  precRawPtr = new prec_Type;
445  precRawPtr->setDataFromGetPot ( dataFile, "prec" );
446  precPtr.reset ( precRawPtr );
447 
448  linearSolver.setPreconditioner ( precPtr );
449 
450 
451  if (verbose)
452  {
453  std::cout << " done" << std::endl;
454  }
455 
456 
457  // +-----------------------------------------------+
458  // | Solving problem |
459  // +-----------------------------------------------+
460 
461  if (verbose)
462  {
463  std::cout << "-- Solving problem ... " << std::flush;
464  }
465 
466  linearSolver.setRightHandSide( rhsLap );
467  linearSolver.solve( solutionLap );
468 
469  exporter.postProcess( 0.0 );
470 
471 #ifdef TESTMESHSUB
472 
473  matrixPtr_Type standardSystemMatrix1( new matrix_Type( ETuFESpace->map(), 100 ) );
474  matrixPtr_Type standardSystemMatrix2( new matrix_Type( ETuFESpace->map(), 100 ) );
475  matrixPtr_Type standardSystemMatrix3( new matrix_Type( ETuFESpace->map(), 100 ) );
476  matrixPtr_Type standardSystemMatrix4( new matrix_Type( ETuFESpace->map(), 100 ) );
477  matrixPtr_Type systemMatrixTotal( new matrix_Type( ETuFESpace->map(), 100 ) );
478 
479  std::shared_ptr<laplacianFunctor< Real > > laplacianDiffusionFunctor1 ( new laplacianFunctor< Real >( diffusion4Function1 ) );
480  std::shared_ptr<laplacianFunctor< Real > > laplacianDiffusionFunctor2 ( new laplacianFunctor< Real >( diffusion4Function2 ) );
481  std::shared_ptr<laplacianFunctor< Real > > laplacianDiffusionFunctor3 ( new laplacianFunctor< Real >( diffusion4Function3 ) );
482  std::shared_ptr<laplacianFunctor< Real > > laplacianDiffusionFunctor4 ( new laplacianFunctor< Real >( diffusion4Function4 ) );
483  std::shared_ptr<laplacianFunctor< Real > > laplacianDiffusionFunctorTotal ( new laplacianFunctor< Real >( diffusion4FunctionTotal ) );
484 
485  {
486  using namespace ExpressionAssembly;
487  integrate (
488  elements ( localMeshPtr ),
489  uFESpace->qr(),
490  ETuFESpace,
491  ETuFESpace,
492  eval(laplacianDiffusionFunctor1, X) * dot ( grad ( phi_i ) , grad ( phi_j ) )
493  )
494  >> standardSystemMatrix1;
495 
496  integrate (
497  elements ( localMeshPtr ),
498  uFESpace->qr(),
499  ETuFESpace,
500  ETuFESpace,
501  eval(laplacianDiffusionFunctor2, X) * dot ( grad ( phi_i ) , grad ( phi_j ) )
502  )
503  >> standardSystemMatrix2;
504 
505  integrate (
506  elements ( localMeshPtr ),
507  uFESpace->qr(),
508  ETuFESpace,
509  ETuFESpace,
510  eval(laplacianDiffusionFunctor3, X) * dot ( grad ( phi_i ) , grad ( phi_j ) )
511  )
512  >> standardSystemMatrix3;
513 
514  integrate (
515  elements ( localMeshPtr ),
516  uFESpace->qr(),
517  ETuFESpace,
518  ETuFESpace,
519  eval(laplacianDiffusionFunctor4, X) * dot ( grad ( phi_i ) , grad ( phi_j ) )
520  )
521  >> standardSystemMatrix4;
522 
523  integrate (
524  elements ( localMeshPtr ),
525  uFESpace->qr(),
526  ETuFESpace,
527  ETuFESpace,
528  eval(laplacianDiffusionFunctorTotal, X) * dot ( grad ( phi_i ) , grad ( phi_j ) )
529  )
530  >> systemMatrixTotal;
531 
532  }
533 
534  std::stringstream convertNumProc, convertProc;
535 
536  convertNumProc << Comm->NumProc();
537  convertProc << Comm->MyPID();
538 
539  bcManage ( *standardSystemMatrix1, *rhsLap, *uFESpace->mesh(), uFESpace->dof(), bcHandler, uFESpace->feBd(), 1.0, 0.0 );
540  bcManage ( *standardSystemMatrix2, *rhsLap, *uFESpace->mesh(), uFESpace->dof(), bcHandler, uFESpace->feBd(), 1.0, 0.0 );
541  bcManage ( *standardSystemMatrix3, *rhsLap, *uFESpace->mesh(), uFESpace->dof(), bcHandler, uFESpace->feBd(), 1.0, 0.0 );
542  bcManage ( *standardSystemMatrix4, *rhsLap, *uFESpace->mesh(), uFESpace->dof(), bcHandler, uFESpace->feBd(), 1.0, 0.0 );
543  bcManage ( *systemMatrixTotal, *rhsLap, *uFESpace->mesh(), uFESpace->dof(), bcHandler, uFESpace->feBd(), 1.0, 0.0 );
544 
545  bcManage ( *systemMatrixMeshSub1, *rhsLap, *uFESpace->mesh(), uFESpace->dof(), bcHandler, uFESpace->feBd(), 1.0, 0.0 );
546  bcManage ( *systemMatrixMeshSub2, *rhsLap, *uFESpace->mesh(), uFESpace->dof(), bcHandler, uFESpace->feBd(), 1.0, 0.0 );
547  bcManage ( *systemMatrixMeshSub3, *rhsLap, *uFESpace->mesh(), uFESpace->dof(), bcHandler, uFESpace->feBd(), 1.0, 0.0 );
548  bcManage ( *systemMatrixMeshSub4, *rhsLap, *uFESpace->mesh(), uFESpace->dof(), bcHandler, uFESpace->feBd(), 1.0, 0.0 );
549 
550  standardSystemMatrix1->globalAssemble();
551  standardSystemMatrix2->globalAssemble();
552  standardSystemMatrix3->globalAssemble();
553  standardSystemMatrix4->globalAssemble();
554  systemMatrixTotal->globalAssemble();
555 
556  /*
557  standardSystemMatrix1->spy("matrixClassic1" + convertNumProc.str() );
558  standardSystemMatrix2->spy("matrixClassic2" + convertNumProc.str() );
559  standardSystemMatrix3->spy("matrixClassic3" + convertNumProc.str() );
560  standardSystemMatrix4->spy("matrixClassic4" + convertNumProc.str() );
561  systemMatrixMeshSub1->spy("matrixMeshSub1" + convertNumProc.str()) ;
562  systemMatrixMeshSub2->spy("matrixMeshSub2" + convertNumProc.str() );
563  systemMatrixMeshSub3->spy("matrixMeshSub3" + convertNumProc.str()) ;
564  systemMatrixMeshSub4->spy("matrixMeshSub4" + convertNumProc.str() );
565 
566  systemMatrixTotal->spy("matrixClassicFull" + convertNumProc.str() );
567  matrixMeshSubFull->spy("matrixMeshSubFull" + convertNumProc.str() );
568  */
569 
570  solutionLap->zero();
571 
572  linearSolver.setOperator ( systemMatrixTotal );
573  linearSolver.setPreconditioner ( precPtr );
574  linearSolver.solve( solutionLap );
575 
576  exporter.postProcess( 1.0 );
577 
578 #endif
579 
580 
581 
582 
583 
584  exporter.closeFile();
585 
586 #ifdef HAVE_MPI
587  MPI_Finalize();
588 #endif
589 
590  return ( EXIT_SUCCESS );
591 }
int main(int argc, char **argv)
Real diffusion4Function4(const Real &, const Real &x, const Real &y, const Real &z, const ID &)
Real diffusion4FunctionTotal(const Real &, const Real &x, const Real &y, const Real &z, const ID &)
Real diffusion4Function1(const Real &, const Real &x, const Real &y, const Real &z, const ID &)
Real diffusion4Function3(const Real &, const Real &x, const Real &y, const Real &z, const ID &)
uint32_type ID
IDs.
Definition: LifeV.hpp:194
Real sourceFunction(const Real &, const Real &x, const Real &y, const Real &z, const ID &)
double Real
Generic real data.
Definition: LifeV.hpp:175
Real zeroFunction(const Real &, const Real &, const Real &, const Real &, const ID &)
Real diffusion4Function2(const Real &, const Real &x, const Real &y, const Real &z, const ID &)