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.
smeshGeoMesh.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_SMESHGEOMESH_H_
30 #define NEMOSYS_SMESHGEOMESH_H_
31 
32 #include "nemosys_export.h"
33 #include "Mesh/geoMeshBase.H"
34 
35 #include <memory>
36 
37 class SMESH_Gen;
38 class SMESH_Mesh;
39 
40 namespace NEM {
41 namespace MSH {
42 
43 class NEMOSYS_EXPORT smeshGeoMesh : public geoMeshBase {
44  public:
45  smeshGeoMesh();
46  ~smeshGeoMesh() override;
47  static smeshGeoMesh *New();
48  vtkTypeMacro(smeshGeoMesh, geoMeshBase)
49 
50  void write(const std::string &fileName) override;
51  void report(std::ostream &out) const override;
52 
53  void setSMeshMesh(std::unique_ptr<SMESH_Mesh> &&mesh,
54  std::shared_ptr<SMESH_Gen> gen);
55  const SMESH_Mesh &getSMESHMesh() const;
56 
57  private:
58  void resetNative() override;
59 
60  static GeoMesh SmeshToGM(SMESH_Mesh &mesh);
61  static void GMToSMESH(const GeoMesh& geoMesh, SMESH_Mesh &outMesh);
62 
63  std::shared_ptr<SMESH_Gen> gen_;
64  std::unique_ptr<SMESH_Mesh> mesh_;
65 };
66 
67 } // namespace MSH
68 } // namespace NEM
69 
70 #endif // NEMOSYS_SMESHGEOMESH_H_
geoMeshBase * New(MeshType meshType)
Create a new mesh object.
std::shared_ptr< meshBase > mesh
std::unique_ptr< SMESH_Mesh > mesh_
Definition: smeshGeoMesh.H:64
std::shared_ptr< SMESH_Gen > gen_
Definition: smeshGeoMesh.H:63
abstract class to specify geometry and mesh data
Definition: geoMeshBase.H:102