49 #include <Teuchos_ParameterList.hpp> 51 #include <lifev/core/LifeV.hpp> 52 #include <lifev/core/filter/GetPot.hpp> 53 #include <lifev/core/filter/ImporterMesh2D.hpp> 54 #include <lifev/core/mesh/RegionMesh.hpp> 55 #include <lifev/core/filter/ImporterMesh3D.hpp> 56 #include <lifev/core/mesh/RegionMesh3DStructured.hpp> 57 #include <lifev/core/filter/ParserINRIAMesh.hpp> 58 #include <lifev/core/filter/ParserGmsh.hpp> 59 #include <lifev/core/mesh/ConvertBareMesh.hpp> 87 MeshData (
const GetPot& dataFile,
const std::string& section =
"space_discretization" );
108 void setup (
const GetPot& dataFile,
const std::string& section );
118 void setup (
const Teuchos::ParameterList& meshParameters);
121 virtual void showMe ( std::ostream& output = std::cout )
const;
189 template <
typename MC>
194 std::cout <<
"\nBuilding mesh ... ";
198 if ( data.meshType() ==
".msh" )
201 ifile.open ( ( data.meshDir() + data.meshFile() ).c_str() );
202 ASSERT (ifile.is_open(),
"Error! Unable to read mesh file.\n");
205 if (ifile.get() ==
'$')
210 MeshIO::ReadGmshFile (data.meshDir() + data.meshFile(), bareMesh, 0, data.verbose() );
211 convertBareMesh ( bareMesh, mesh, data.verbose() );
222 ERROR_MSG (
"Sorry, this mesh file can not be loaded" );
226 mesh.updateElementFacets (
true);
230 std::cout <<
"mesh read.\n" << std::endl;
234 template <
typename GEOSHAPE,
typename MC>
239 std::cout <<
"\nBuilding mesh ... ";
242 bool updateEdgesAndFaces (
true);
244 if ( data.meshType() ==
".mesh" )
248 convertBareMesh ( bareMesh, mesh, data
.verbose() );
251 else if ( data.meshType() ==
".m++" )
255 else if ( data.meshType() ==
".msh" )
259 else if ( data.meshType() ==
".vol" )
265 ERROR_MSG (
"Sorry, this mesh file can not be loaded" );
269 if (updateEdgesAndFaces)
271 mesh.updateElementRidges (
true, data
.verbose() );
272 mesh.updateElementFacets (
true, data
.verbose() );
277 std::cout <<
"mesh read.\n" << std::endl;
void setMeshDir(const std::string &dir)
MeshData(const MeshData &meshData)
Copy constructor.
const std::string & meshFile() const
virtual ~MeshData()
Virtual destructor.
bool M_verbose
verbose output?
void setMeshType(const std::string &type)
const std::string & meshType() const
void setMeshFile(const std::string &file)
std::string M_meshDir
mesh directory
MeshData(const GetPot &dataFile, const std::string §ion="space_discretization")
Constructor.
std::string M_meshType
mesh type
const std::string & mOrder() const
Class for 3D, 2D and 1D Mesh.
void readMesh(RegionMesh< LinearTriangle, MC > &mesh, const MeshData &data)
MeshData - class for handling spatial discretization.
const std::string & meshDir() const
void setup(const GetPot &dataFile, const std::string §ion)
Read the dataFile and set all the members.
const bool & verbose() const
MeshData()
Empty Constructor.
virtual void showMe(std::ostream &output=std::cout) const
Display the values.
std::string M_order
mesh type
void readMesh(RegionMesh< GEOSHAPE, MC > &mesh, const MeshData &data)
void setMOrder(const std::string &order)
void setup(const Teuchos::ParameterList &meshParameters)
Set all members using a Teuchos ParameterList.
A struct for a bare mesh.
void setVerbose(const bool &isVerbose)
std::string M_meshFile
mesh file