LifeV
ETA_ADR2DTest.hpp
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  @file ETA_ADR2DTest.cpp
28  @author L. Pasquale <luca.pasquale@mail.polimi.it>
29  @date 2012-11-20
30 */
31 
32 #ifndef __ETA_ADR2DTEST_H
33 #define __ETA_ADR2DTEST_H 1
34 
35 
36 
37 #include <Epetra_ConfigDefs.h>
38 #ifdef EPETRA_MPI
39 #include <mpi.h>
40 #include <Epetra_MpiComm.h>
41 #else
42 #include <Epetra_SerialComm.h>
43 #endif
44 
45 
46 #include <lifev/core/LifeV.hpp>
47 
48 #include <lifev/core/mesh/MeshPartitioner.hpp>
49 #include <lifev/core/mesh/RegionMesh2DStructured.hpp>
50 #include <lifev/core/mesh/RegionMesh.hpp>
51 
52 #include <lifev/core/array/MatrixEpetra.hpp>
53 #include <lifev/core/array/VectorEpetra.hpp>
54 
55 #include <boost/shared_ptr.hpp>
56 
57 
58 // ---------------------------------------------------------------
59 // We include two additional files which are useful to make the
60 // assembly using the "classical way". We also include a file to
61 // monitor the different timings.
62 // ---------------------------------------------------------------
63 
64 #include <lifev/core/fem/FESpace.hpp>
65 #include <lifev/core/solver/ADRAssembler.hpp>
66 
67 #include <lifev/core/util/LifeChrono.hpp>
68 
69 
70 // ---------------------------------------------------------------
71 // We work in the LifeV namespace and define the mesh, matrix and
72 // vector types that we will need several times.
73 // ---------------------------------------------------------------
74 
75 /*!
76  @class ETA_ADR2DTest
77  @brief Simple ETA test to compare ETA to ADRAssembly in a 2D space
78 
79  @author L. Pasquale <luca.pasquale@mail.polimi.it>
80 
81  This test computes the matrix associated to the advection-diffusion-reaction problem: \n
82  \f$
83  -\alpha \delta u + \beta \cdot \nabla u +\gamma u = f
84  \f$ \n
85  with \f$\alpha=1\f$, \f$\beta=\left(\begin{array}{c}1\\0\end{array}\right)\f$, \f$\gamma=2\f$, \f$f=2\f$ and \f$u\f$ a scalar field \n
86  The domain is the square (-1,1)x(-1,1). \n
87  The matrix and the vector for the RHS are first assembled using the class ADRAssembler and then the ExpressionAssembly::integrate function of the ETA module. \n
88  if the two matrices (and vectors) are assembled correctly, they should be almost exactly the same. \n
89 */
91  // :
92  // public LifeV::Application
93 {
94 public:
95 
96  /* @name Constructors and destructor
97  */
98  //@{
99 
100  //! Constructor
101  ETA_ADR2DTest ();
102 
103 
104  //! Destructor
106 
107  //@}
108 
109  /* @name Methods
110  */
111  //@{
112 
113  //! To lunch the simulation
114  LifeV::Real run();
115 
116  //@}
117 
118 
119 private:
121  bool M_verbose;
122 
123 };
124 
125 #endif /* __ETA_ADR2DTEST_H */
ETA_ADR2DTest()
Constructor.
Simple ETA test to compare ETA to ADRAssembly in a 2D space.
~ETA_ADR2DTest()
Destructor.
LifeV::Real run()
To lunch the simulation.
std::shared_ptr< Epetra_Comm > M_comm