LifeV
ensightToVTK.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 test for converting from Ensight to VTK
30 
31  @author Tiziano Passerini <tiziano@mathcs.emory.edu>
32  @contributor
33  @maintainer
34 
35  @date 13-1-2011
36 
37  */
38 
39 
40 #include <Epetra_ConfigDefs.h>
41 #include <Epetra_Comm.h>
42 
43 
44 #include <lifev/core/LifeV.hpp>
45 #include "../importExport/TestImportExport.hpp"
46 
47 #include <lifev/core/filter/ExporterEnsight.hpp>
48 #include <lifev/core/filter/ExporterVTK.hpp>
51 
52 using namespace LifeV;
53 
54 int
55 main ( int argc, char** argv )
56 {
57  //MPI communicator initialization
58  std::shared_ptr<Epetra_Comm> commPtr;
59 
60 #ifdef HAVE_MPI
61  std::cout << "MPI Initialization" << std::endl;
62  MPI_Init ( &argc, &argv );
63 #endif
64 
65  //MPI Preprocessing
66 #ifdef EPETRA_MPI
67 
68  int nprocs;
69  int rank;
70 
71  MPI_Comm_size ( MPI_COMM_WORLD, &nprocs );
72  MPI_Comm_rank ( MPI_COMM_WORLD, &rank );
73 
74  if ( rank == 0 )
75  {
76  std::cout << "MPI processes: " << nprocs << std::endl;
77  std::cout << "MPI Epetra Initialization ... " << std::endl;
78  }
79  commPtr.reset ( new Epetra_MpiComm ( MPI_COMM_WORLD ) );
80 
81  commPtr->Barrier();
82 
83 #else
84 
85  std::cout << "MPI SERIAL Epetra Initialization ... " << std::endl;
86  commPtr.reset ( new Epetra_SerialComm() );
87 
88 #endif
89 
90  GetPot command_line (argc, argv);
91  TestImportExport testImportExport ( commPtr );
92 
93  bool passed (false);
94 
95  passed = testImportExport.run<exporter1_Type, exporter2_Type > ( command_line, "import" );
96 
97  // ----- End of test calls -----
98 
99 #ifdef HAVE_MPI
100  std::cout << "MPI Finalization" << std::endl;
101  MPI_Finalize();
102 #endif
103 
104  if (passed)
105  {
106  return EXIT_SUCCESS;
107  }
108  else
109  {
110  return EXIT_FAILURE;
111  }
112 }
ExporterEnsight data exporter.
LifeV::RegionMesh< LifeV::LinearTetra > mesh_Type
GetPot(const int argc_, char **argv_, const char *FieldSeparator=0x0)
Definition: GetPot.hpp:507
LifeV::ExporterVTK< TestImportExport::mesh_Type > exporter2_Type
LifeV::ExporterEnsight< TestImportExport::mesh_Type > exporter1_Type
int main(int argc, char **argv)
ExporterVTK data exporter.
Definition: ExporterVTK.hpp:57