LifeV
lifev/structure/testsuite/time_advance_ii/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 /* ========================================================
29 
30 Solve the problem
31 
32  \frac{\partial u}{\partial t} - \Delta u = f
33 
34  u = u0 on the boundary
35 
36 linear_function.hpp:
37 
38  uexact = exp(-sin(Pi/2*t))*(x+y+z);
39 
40  f = (3 \pi^2 + 1 ) exp(-t) sin( \pi x) sin(\pi y) sin ( \pi z) on a cube
41 
42 nonlinear_function.hpp:
43 
44  uexact = exp(-sin(Pi/2*t))*cos(x *Pi)*cos(y*Pi)*cos(z*Pi);
45 
46  f = Pi2/4*( sin(Pi/2*t)+cos(Pi/2*t)*cos(Pi/2*t) )*exp(-sin(Pi/2*t))*cos(x *Pi)*cos(y*Pi)*cos(z*Pi);
47 */
48 /**
49  \file timeAdvance.hpp
50  \date 2010-02-15
51  Author(s): F. Nobile <fabio.nobile@polimi.it>
52  M. Pozzoli <matteo1.pozzoli@mail.polimi.it>
53  C. Vergara <christian.vergara@polimi.it>
54  Date: 2010-02-15
55 */
56 
57 
58 // ===================================================
59 //! Includes
60 // ===================================================
61 
62 #include <Epetra_ConfigDefs.h>
63 #ifdef EPETRA_MPI
64 #include <mpi.h>
65 #include <Epetra_MpiComm.h>
66 #else
67 #include <Epetra_SerialComm.h>
68 #endif
69 
70 
71 #include <lifev/core/LifeV.hpp>
72 
73 #include <lifev/core/algorithm/PreconditionerIfpack.hpp>
74 #include <lifev/core/algorithm/PreconditionerML.hpp>
75 
76 #include "timeAdvance.hpp"
77 
78 
79 // ===================================================
80 //! Namespaces
81 // ===================================================
82 using namespace LifeV;
83 
84 namespace
85 {
86 static bool regIF = (PRECFactory::instance().registerProduct ( "Ifpack", &createIfpack ) );
87 static bool regML = (PRECFactory::instance().registerProduct ( "ML", &createML ) );
88 }
89 
90 // ===================================================
91 //! Main
92 // ===================================================
93 int
94 main ( int argc, char** argv )
95 {
96 #ifdef HAVE_MPI
97  MPI_Init (&argc, &argv);
98 
99  std::shared_ptr<Epetra_MpiComm> Comm (new Epetra_MpiComm ( MPI_COMM_WORLD ) );
100  if ( Comm->MyPID() == 0 )
101  {
102  std::cout << "% using MPI" << std::endl;
103  }
104 #else
105  std::shared_ptr<Epetra_SerialComm> Comm ( new Epetra_SerialComm() );
106  std::cout << "% using serial Version" << std::endl;
107 #endif
108 
109 
110  problem ProblemOrderII ( argc, argv, Comm );
111  ProblemOrderII.run();
112 
113 
114 #ifdef HAVE_MPI
115  MPI_Finalize();
116  std::cout << "MPI Finalization" << std::endl;
117 #endif
118 
119  return ( EXIT_SUCCESS );
120 }
Includes.
Definition: timeAdvance.hpp:57
void run()
void updateInverseJacobian(const UInt &iQuadPt)
int main(int argc, char **argv)
Definition: dummy.cpp:5