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.
ConversionDriver.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_CONVERSIONDRIVER_H_
30 #define NEMOSYS_CONVERSIONDRIVER_H_
31 
32 #include "nemosys_export.h"
33 #include "Drivers/NemDriver.H"
34 
35 #include <map>
36 #include <string>
37 #include <vector>
38 
39 #include "Mesh/exoMesh.H"
40 #include "Mesh/meshBase.H"
41 
42 namespace NEM {
43 namespace DRV {
44 
45 class NEMOSYS_EXPORT ConversionDriver : public NemDriver {
46  public:
47  static void genExo(std::vector<meshBase *> meshes, const std::string &fname);
48 
49  JSONCONS_TYPE_TRAITS_FRIEND
50 
51  protected:
52  static void genExo(meshBase *mb, NEM::MSH::EXOMesh::exoMesh *em,
53  const int &ndeIdOffset, const int &elmIdOffset, int &ins,
54  int &ieb, int &iss, std::string mshName,
55  const bool &usePhys, int &ndeIdOffset_local,
56  int &elmIdOffset_local, const bool &makeFreeSurfSS,
57  const bool &splitTopBotSS,
58  std::vector<std::string> sideSetNames);
59 
60  static void procExo(const jsoncons::json &ppJson, const std::string &fname,
62 
63  /**
64  * @brief Creates side set(s) for the free surface, exterior surface, during
65  * conversion
66  * @param mb Meshbase object
67  * @param em ExoMesh object
68  * @param elmIdOffset Exodus element ID offset
69  * @param v2e_elemID_map VTK to EXO element ID map
70  * @param splitTopBotSS Boolean to split the side set into three side sets
71  * @param sideSetNames The list of name(s) for the side set(s)
72  */
73  static void freeSurfaceSideSet(const meshBase *mb,
75  int elmIdOffset,
76  std::map<int, int> v2e_elemID_map,
77  bool splitTopBotSS,
78  std::vector<std::string> sideSetNames);
79 
80  private:
81  static constexpr const char *programType = "Conversion";
82  jsoncons::string_view getProgramType() const override;
83 };
84 
85 } // namespace DRV
86 } // namespace NEM
87 
88 #endif // NEMOSYS_CONVERSIONDRIVER_H_
base class for drivers
Definition: NemDriver.H:46
A complete I/O class for EXODUS II file format.
Definition: exoMesh.H:172
A brief description of meshBase.
Definition: meshBase.H:64
static constexpr auto programType