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.
ProteusDriver.C
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 #include "Drivers/ProteusDriver.H"
30 
31 #include "Mesh/meshBase.H"
32 #include "IO/proteusHdf5.H"
33 
34 namespace NEM {
35 namespace DRV {
36 
37 ProteusDriver::Files::Files(std::string fieldFName, std::string meshFName,
38  std::string exoMeshFName)
39  : fieldFName(std::move(fieldFName)),
40  meshFName(std::move(meshFName)),
41  exoMeshFName(std::move(exoMeshFName)) {}
42 
43 ProteusDriver::Opts::Opts(std::string edgeSidesetName)
44  : edgeSidesetName(std::move(edgeSidesetName)) {}
45 
47  : files_(std::move(files)), opts_(std::move(opts)) {
48  std::cout << "ProteusDriver created\n";
49 }
50 
52 
54 
55 void ProteusDriver::setFiles(Files files) { this->files_ = std::move(files); }
56 
58 
59 void ProteusDriver::setOpts(Opts opts) { this->opts_ = std::move(opts); }
60 
62  std::cout << "ProteusDriver destroyed" << std::endl;
63 }
64 
65 jsoncons::string_view ProteusDriver::getProgramType() const {
66  return programType;
67 }
68 
69 void ProteusDriver::execute() const {
70  proteusHdf5(this->files_.fieldFName, this->files_.meshFName,
71  this->opts_.edgeSidesetName, this->files_.exoMeshFName,
72  this->opts_.lowOrder, this->opts_.bndryConst);
73 }
74 
75 } // namespace DRV
76 } // namespace NEM
Driver to read Proteus output.
Definition: ProteusDriver.H:42
std::string fieldFName
Proteus format HDF5 field filename.
Definition: ProteusDriver.H:51
jsoncons::string_view getProgramType() const override
Definition: ProteusDriver.C:65
const Opts & getOpts() const
Definition: ProteusDriver.C:57
STL namespace.
void setOpts(Opts opts)
Definition: ProteusDriver.C:59
void setFiles(Files files)
Definition: ProteusDriver.C:55
void execute() const override
Run the workflow represented by the driver.
Definition: ProteusDriver.C:69
const Files & getFiles() const
Definition: ProteusDriver.C:53
Class to store HDF5 data from Proteus files.
Definition: proteusHdf5.H:110
static constexpr const char * programType