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.
NucMeshDriver.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_NUCMESHDRIVER_H_
30 #define NEMOSYS_NUCMESHDRIVER_H_
31 
32 #include "nemosys_export.h"
33 #include "Drivers/NemDriver.H"
34 
35 #include <memory>
36 #include <type_traits>
37 #include <utility>
38 #include <vector>
39 
40 #include <vtkSmartPointer.h>
41 
42 #include "Services/NucMeshSrv.H"
43 
44 namespace NEM {
45 namespace DRV {
46 
47 /**
48  * @brief Class to create 2d geometry from polygons and circles and mesh it.
49  */
50 class NEMOSYS_EXPORT NucMeshDriver : public NemDriver {
51  public:
53 
55 
56  /**
57  * NucMeshDriver ctor
58  * @param file Output file. Should end in ".vtu"
59  * @param opts Specify shapes and extrusion.
60  */
61  explicit NucMeshDriver(Files file, Opts opts);
62 
63  /**
64  * Get the output file name
65  * @return output file object containing file name
66  */
67  const Files &getFiles() const;
68  /**
69  * Set the output file for the driver
70  * @param files NEM::DRV::NucMeshDriver::Files object containing output file
71  */
72  void setFiles(Files files);
73 
74  /**
75  * Get the options set on a driver object
76  * @return geometry, meshing options, and extrusion steps
77  */
78  const Opts &getOpts() const;
79  /**
80  * Set the geometry/mesh and extrusion to execute
81  * @param opts geometry/mesh options
82  */
83  void setOpts(Opts opts);
84 
85  /**
86  * Construct the mesh
87  * @return geoMeshBase with 1d and 2d cells (and 3d if any extrusion)
88  */
89  vtkSmartPointer<NEM::MSH::geoMeshBase> draw() const;
90 
91  /**
92  * Construct the mesh and write to file.
93  */
94  void execute() const override;
95 
96  JSONCONS_TYPE_TRAITS_FRIEND
97 
98  private:
99  NucMeshDriver();
102 
103  static constexpr const char *programType = "NucMesh Generation";
104  jsoncons::string_view getProgramType() const override;
105 };
106 
107 } // namespace DRV
108 } // namespace NEM
109 
110 #endif // NEMOSYS_NUCMESHDRIVER_H_
base class for drivers
Definition: NemDriver.H:46
static constexpr auto programType
Class to create 2d geometry from polygons and circles and mesh it.
Definition: NucMeshDriver.H:50