NEMoSys  0.63.0
A modular, extensible resource with robust automated mesh generation, mesh quality analysis, adaptive mesh refinement, and data transfer between arbitrary meshes.
geoMeshFactory.H
Go to the documentation of this file.
1 /*******************************************************************************
2 * Promesh *
3 * Copyright (C) 2022, IllinoisRocstar LLC. All rights reserved. *
4 * *
5 * Promesh is the property of IllinoisRocstar LLC. *
6 * *
7 * IllinoisRocstar LLC *
8 * Champaign, IL *
9 * www.illinoisrocstar.com *
10 * promesh@illinoisrocstar.com *
11 *******************************************************************************/
12 /*******************************************************************************
13 * This file is part of Promesh *
14 * *
15 * This version of Promesh is free software: you can redistribute it and/or *
16 * modify it under the terms of the GNU Lesser General Public License as *
17 * published by the Free Software Foundation, either version 3 of the License, *
18 * or (at your option) any later version. *
19 * *
20 * Promesh is distributed in the hope that it will be useful, but WITHOUT ANY *
21 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS *
22 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more *
23 * details. *
24 * *
25 * You should have received a copy of the GNU Lesser General Public License *
26 * along with this program. If not, see <https://www.gnu.org/licenses/>. *
27 * *
28 *******************************************************************************/
29 #ifndef NEMOSYS_GEOMESHFACTORY_H_
30 #define NEMOSYS_GEOMESHFACTORY_H_
31 
32 #include "Mesh/geoMeshBase.H"
33 
34 namespace NEM {
35 namespace MSH {
36 
37 /**
38  * List of supported @c geoMeshBase classes
39  *
40  * Note: When adding a new format, extend the switch statements in the static
41  * factory methods.
42  */
43 enum class NEMOSYS_EXPORT MeshType {
44  VTK_GEO_MESH, ///< Based on vtkUnstructuredGrid from VTK library.
45  GMSH_GEO_MESH, ///< Mesh and geometry based on Gmsh's public API.
46  OSH_GEO_MESH, ///< Based on Omega_h::Mesh from Omega_h library.
47  EXO_GEO_MESH, ///< Interface to EXODUS II library.
48  FOAM_GEO_MESH, ///< Based on fvMesh from OpenFOAM library.
49  INP_GEO_MESH, ///< Abaqus/CalculiX mesh input format
50  SMESH_GEO_MESH,///< Based on SMESH_Mesh from Salome SMESH (see contrib/)
51 };
52 
53 /**
54  * Read a mesh from file
55  * @param fileName name of file
56  * @param type type of mesh
57  * @return pointer to base mesh class
58  */
59 NEMOSYS_EXPORT geoMeshBase *Read(const std::string &fileName, MeshType type);
60 
61 /**
62  * Read a mesh from file. Determines mesh type from file extension.
63  * @param fileName name of file
64  * @return pointer to base mesh class
65  */
66 NEMOSYS_EXPORT geoMeshBase *Read(const std::string &fileName);
67 
68 /**
69  * Create a new mesh object
70  * @param type type of mesh
71  * @return pointer to base mesh class
72  */
73 NEMOSYS_EXPORT geoMeshBase *New(MeshType type);
74 /**
75  * Create a new mesh object. Determines mesh type from file extension.
76  * @param fileName name of file
77  * @return pointer to base mesh class
78  */
79 NEMOSYS_EXPORT geoMeshBase *New(const std::string &fileName);
80 
81 } // namespace MSH
82 } // namespace NEM
83 
84 #endif // NEMOSYS_GEOMESHFACTORY_H_
OSH_GEO_MESH
Based on Omega_h::Mesh from Omega_h library.
SMESH_GEO_MESH
Based on SMESH_Mesh from Salome SMESH (see contrib/)
geoMeshBase * Read(const std::string &fileName)
Read a mesh from file.
geoMeshBase * New(MeshType meshType)
Create a new mesh object.
INP_GEO_MESH
Abaqus/CalculiX mesh input format.
VTK_GEO_MESH
Based on vtkUnstructuredGrid from VTK library.
FOAM_GEO_MESH
Based on fvMesh from OpenFOAM library.
GMSH_GEO_MESH
Mesh and geometry based on Gmsh&#39;s public API.
EXO_GEO_MESH
Interface to EXODUS II library.