LifeV
Importer.cpp
Go to the documentation of this file.
1 //@HEADER
2 /*
3 *******************************************************************************
4  Copyright (C) 2004, 2005, 2007 EPFL, Politecnico di Milano, INRIA
5  Copyright (C) 2010 EPFL, Politecnico di Milano, Emory University
6  This file is part of LifeV.
7  LifeV is free software; you can redistribute it and/or modify
8  it under the terms of the GNU Lesser General Public License as published by
9  the Free Software Foundation, either version 3 of the License, or
10  (at your option) any later version.
11  LifeV is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  Lesser General Public License for more details.
15  You should have received a copy of the GNU Lesser General Public License
16  along with LifeV. If not, see <http://www.gnu.org/licenses/>.
17 *******************************************************************************
18 */
19 //@HEADER
20 /*!
21  * @file
22  * @brief Import mesh data formats into LifeV mesh data structure.
23  *
24  *
25  * @date 06-11-2004
26  *
27  * @author Christophe Prud'homme <christophe.prudhomme@epfl.ch>
28  *
29  *
30  * @contributor Alessio Fumagalli <alessio.fumagalli@mail.polimi.it>
31  *
32  * @mantainer Alessio Fumagalli <alessio.fumagalli@mail.polimi.it>
33  *
34  */
35 
36 
37 #include <lifev/core/filter/ImporterMesh3D.hpp>
38 #include <lifev/core/filter/ImporterMesh2D.hpp>
39 #include <lifev/core/filter/Importer.hpp>
40 
41 
42 namespace LifeV
43 {
44 
45 // ===================================================
46 // Operators
47 // ===================================================
48 
49 // Assign opertor overloading
50 Importer& Importer::operator= ( const Importer& importer )
51 {
52  // Avoid auto-copy
53  if ( this != &importer )
54  {
55  M_fileName = importer.M_fileName;
56  M_format = importer.M_format;
57  }
58 
59  return *this;
60 }
61 
62 // ===================================================
63 // Methods
64 // ===================================================
65 
66 // Import mesh with tetrahedras
67 void
68 Importer::import ( RegionMesh<LinearTetra>& mesh,
69  markerID_Type regionFlag )
70 {
71  detail::import3D ( M_fileName, M_format, mesh, regionFlag );
72 } // import
73 
74 // Import mesh with linear hexahedras
75 void
76 Importer::import ( RegionMesh<LinearHexa>& mesh,
77  markerID_Type regionFlag )
78 {
79  detail::import3D ( M_fileName, M_format, mesh, regionFlag );
80 } // import
81 
82 // Import mesh with linear triangles
83 void
84 Importer::import ( RegionMesh<LinearTriangle>& mesh,
85  markerID_Type regionFlag )
86 {
87  detail::import2D ( M_fileName, M_format, mesh, regionFlag );
88 } // import
89 
90 // Import mesh with linear quadrangles
91 void
93 {
94  ERROR_MSG ("Importer:No importers available for this type of mesh");
95 } // import
96 
97 // Print attributes of the class
98 void
99 Importer::showMe ( std::ostream& output ) const
100 {
101  output << "Class importer" << std::endl
102  << "File Name " << M_fileName << std::endl
103  << "File format " << M_format << std::endl
104  << std::flush;
105 } // showMe
106 
107 } // Namespace LifeV
void showMe(std::ostream &output=std::cout) const
Print attributes of the class.
Definition: Importer.cpp:99
Importer General interface for read different types of mesh.
Definition: Importer.hpp:126
ID markerID_Type
markerID_Type is the type used to store the geometric entity marker IDs
Definition: Marker.hpp:81
Importer & operator=(const Importer &importer)
Assign opertor overloading.
Definition: Importer.cpp:50
#define ERROR_MSG(A)
Definition: LifeAssert.hpp:69
std::string M_fileName
Name of the file to import.
Definition: Importer.hpp:238
void import(RegionMesh< LinearQuad > &mesh, markerID_Type regionFlag)
Import mesh with linear quadrangles.
Definition: Importer.cpp:92
MeshFormat M_format
Format of the file to import.
Definition: Importer.hpp:241