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.
TransferDriver.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_TRANSFERDRIVER_H_
30 #define NEMOSYS_TRANSFERDRIVER_H_
31 
32 #include "nemosys_export.h"
33 #include "Drivers/NemDriver.H"
34 #include "Transfer/TransferBase.H"
35 #include "Mesh/meshBase.H"
36 
37 namespace NEM {
38 namespace DRV {
39 
40 class NEMOSYS_EXPORT TransferDriver : public NemDriver {
41  public:
42  struct NEMOSYS_EXPORT Files {
43  public:
44  Files(std::string source, std::string target, std::string output);
45  std::string sourceMeshFile{};
46  std::string targetMeshFile{};
47  std::string outputMeshFile{};
48  JSONCONS_TYPE_TRAITS_FRIEND
49  private:
50  Files() = default;
51  };
52 
53  struct NEMOSYS_EXPORT Opts {
54  public:
55  Opts(std::string method, bool checkQuality);
56  std::string method{};
57  bool checkQuality{};
58  jsoncons::optional<std::vector<std::string>> arrayNames{};
59  JSONCONS_TYPE_TRAITS_FRIEND
60  private:
61  Opts() = default;
62  };
63 
64  TransferDriver(Files files, Opts opts);
65 
66  const Files &getFiles() const;
67  void setFiles(Files files);
68  const Opts &getOpts() const;
69  void setOpts(Opts opts);
70  void execute() const override;
71 
72  ~TransferDriver() override;
73 
74  static std::shared_ptr<TransferBase> CreateTransferObject(
75  meshBase *srcmsh, meshBase *trgmsh, const std::string &method);
76 
77  JSONCONS_TYPE_TRAITS_FRIEND
78 
79  private:
81 
82  static constexpr const char *programType = "Transfer";
83  jsoncons::string_view getProgramType() const override;
84 
87 };
88 
89 } // namespace DRV
90 } // namespace NEM
91 
92 #endif // NEMOSYS_TRANSFERDRIVER_H_
base class for drivers
Definition: NemDriver.H:46
A brief description of meshBase.
Definition: meshBase.H:64
static constexpr auto programType