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