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.
VtkToPatranConversionDriver.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_VTKTOPATRANCONVERSIONDRIVER_H_
30 #define NEMOSYS_VTKTOPATRANCONVERSIONDRIVER_H_
31 
32 #include "nemosys_export.h"
34 
35 namespace NEM {
36 namespace DRV {
37 
38 class NEMOSYS_EXPORT VtkToPatranConversionDriver : public ConversionDriver {
39  public:
41 
42  /**
43  * @brief PATRAN specific BC information
44  */
45  struct NEMOSYS_EXPORT BoundaryCond {
46  public:
47  explicit BoundaryCond(int patchNum);
48  virtual ~BoundaryCond() = default;
49  /**
50  * @brief patch numbers as specified in RocfracControl.txt
51  */
52  int patchNum{};
53  JSONCONS_TYPE_TRAITS_FRIEND
54  protected:
55  BoundaryCond() = default;
56  BoundaryCond(const BoundaryCond &) = default;
57  BoundaryCond(BoundaryCond &&) = default;
58  BoundaryCond &operator=(const BoundaryCond &) = default;
59  BoundaryCond &operator=(BoundaryCond &&) = default;
60  private:
61  virtual jsoncons::string_view getBCType() const = 0;
62  };
63 
64  struct NEMOSYS_EXPORT FaceBC : public BoundaryCond {
65  public:
66  FaceBC(int patchNum, int rocFracFSIType);
67  /**
68  * @brief Rocfrac FSI Type; 0 = no FSI, 1 = FSI w/ burn, 2 = FSI w/o burn,
69  * etc. see Rocfrac manual for details
70  */
71  int rocFracFSIType{};
72  JSONCONS_TYPE_TRAITS_FRIEND
73  private:
74  FaceBC() = default;
75  static constexpr const char *bcType = "Face";
76  jsoncons::string_view getBCType() const override;
77  };
78 
79  struct NEMOSYS_EXPORT NodeBC : public BoundaryCond {
80  public:
81  NodeBC(int patchNum, int rocfracControlType, bool structural,
82  bool meshMotion, bool thermal);
83  int rocfracControlType{};
84  /**
85  * @brief boolean indicating structural BC
86  */
87  bool structural{};
88  /**
89  * @brief boolean indicating mesh motion BC
90  */
91  bool meshMotion{};
92  /**
93  * @brief boolean indicating heat transfer BC
94  */
95  bool thermal{};
96  JSONCONS_TYPE_TRAITS_FRIEND
97  private:
98  NodeBC() = default;
99  static constexpr const char *bcType = "Node";
100  jsoncons::string_view getBCType() const override;
101  };
102 
103  struct NEMOSYS_EXPORT Opts {
104  public:
105  Opts(std::vector<std::shared_ptr<BoundaryCond>> bcInfo,
106  std::vector<int> nodePatchPreference);
107  std::vector<std::shared_ptr<BoundaryCond>> bcInfo{};
108  /**
109  * @brief // Accumulate node patch preference (determines which patch a node
110  * belongs to if it borders two or more patches)
111  */
112  std::vector<int> nodePatchPreference{};
113  JSONCONS_TYPE_TRAITS_FRIEND
114  private:
115  Opts() = default;
116  static constexpr const char *methodName = "VTK->PATRAN";
117  };
118 
120 
121  const Files &getFiles() const;
122  void setFiles(Files files);
123  const Opts &getOpts() const;
124  void setOpts(Opts opts);
125  void execute() const override;
126 
127  JSONCONS_TYPE_TRAITS_FRIEND
128 
129  private:
131 
134 };
135 
136 } // namespace DRV
137 } // namespace NEM
138 
139 #endif // NEMOSYS_VTKTOPATRANCONVERSIONDRIVER_H_