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.
CFMeshMeshGenDriver.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/MeshGen/CFMeshMeshGenDriver.H
"
30
31
#include "
AuxiliaryFunctions.H
"
32
#include "
MeshGeneration/cfmeshGen.H
"
33
34
namespace
NEM
{
35
namespace
DRV {
36
37
CFMeshMeshGenDriver::Opts::Opts
(
cfmeshParams
params)
38
: params(
std
::move(params)) {}
39
40
CFMeshMeshGenDriver::CFMeshMeshGenDriver
(
Files
files,
cfmeshParams
params
)
41
:
files_
(
std
::move(files)),
opts_
(
std
::move(params)) {}
42
43
CFMeshMeshGenDriver::CFMeshMeshGenDriver
()
44
:
CFMeshMeshGenDriver
({{}, {}}, {}) {}
45
46
const
CFMeshMeshGenDriver::Files
&
CFMeshMeshGenDriver::getFiles
()
const
{
47
return
files_
;
48
}
49
50
void
CFMeshMeshGenDriver::setFiles
(
Files
files) {
51
this->
opts_
.
params
.
geomFilePath
= files.
inputGeoFile
;
52
this->
files_
= std::move(files);
53
}
54
55
const
cfmeshParams
&
CFMeshMeshGenDriver::getParams
()
const
{
56
return
getOpts
().
params
;
57
}
58
59
void
CFMeshMeshGenDriver::setParams
(
cfmeshParams
params) {
60
setOpts
(
Opts
{std::move(params)});
61
}
62
63
const
CFMeshMeshGenDriver::Opts
&
CFMeshMeshGenDriver::getOpts
()
const
{
64
return
opts_
;
65
}
66
67
void
CFMeshMeshGenDriver::setOpts
(
Opts
opts) {
68
if
(!opts.
params
.
geomFilePath
.empty()) {
69
this->
files_
.
inputGeoFile
= opts.
params
.
geomFilePath
;
70
this->
opts_
= std::move(opts);
71
}
else
{
72
this->
opts_
= std::move(opts);
73
this->
opts_
.
params
.
geomFilePath
= this->
files_
.
inputGeoFile
;
74
}
75
}
76
77
void
CFMeshMeshGenDriver::execute
()
const
{
78
auto
paramsCopy = this->
opts_
.
params
;
79
cfmeshGen
generator{¶msCopy};
80
// TODO: Make sure blockMeshGen::createMeshFromSTL sets return value and check
81
// it here
82
// Parameter not used
83
generator.
createMeshFromSTL
(
nullptr
);
84
std::string newname =
nemAux::trim_fname
(this->
files_
.
inputGeoFile
,
".vtu"
);
85
// auto mesh =
86
// meshBase::CreateShared(meshBase::Create(generator.getDataSet(),
87
// newname));
88
// mesh->setFileName(this->files_.outputMeshFile);
89
// mesh->report();
90
// mesh->write();
91
auto
mesh
=
NEM::MSH::New
(this->
files_
.
outputMeshFile
);
92
mesh
->takeGeoMesh(generator.gmData.get());
93
mesh
->write(this->
files_
.
outputMeshFile
);
94
mesh
->Delete();
95
}
96
97
}
// namespace DRV
98
}
// namespace NEM
NEM::DRV::CFMeshMeshGenDriver::getFiles
const Files & getFiles() const
Definition:
CFMeshMeshGenDriver.C:46
NEM::DRV::MeshGenDriver::MeshGenFiles::inputGeoFile
std::string inputGeoFile
Definition:
MeshGenDriver.H:44
NEM::DRV::CFMeshMeshGenDriver::files_
Files files_
Definition:
CFMeshMeshGenDriver.H:66
cfmeshGen::createMeshFromSTL
int createMeshFromSTL(const char *fname) override
Definition:
cfmeshGen.C:99
NEM::DRV::MeshGenDriver::MeshGenFiles
Definition:
MeshGenDriver.H:40
cfmeshGen.H
NEM::MSH::New
geoMeshBase * New(MeshType meshType)
Create a new mesh object.
Definition:
geoMeshFactory.C:116
std
STL namespace.
NEM::DRV::CFMeshMeshGenDriver::Opts::params
cfmeshParams params
Definition:
CFMeshMeshGenDriver.H:54
cfmeshGen
Definition:
cfmeshGen.H:42
NEM::DRV::CFMeshMeshGenDriver::Opts
Definition:
CFMeshMeshGenDriver.H:51
NEM::DRV::CFMeshMeshGenDriver::setParams
void setParams(cfmeshParams params)
Definition:
CFMeshMeshGenDriver.C:59
NEM
Definition:
AutoVerificationDriver.C:38
nemAux::trim_fname
std::string trim_fname(const std::string &name, const std::string &ext)
Definition:
AuxiliaryFunctions.H:440
AuxiliaryFunctions.H
NEM::DRV::MeshGenDriver::MeshGenFiles::outputMeshFile
std::string outputMeshFile
Definition:
MeshGenDriver.H:45
NEM::DRV::CFMeshMeshGenDriver::CFMeshMeshGenDriver
CFMeshMeshGenDriver()
Definition:
CFMeshMeshGenDriver.C:43
NEM::DRV::CFMeshMeshGenDriver::setFiles
void setFiles(Files files)
Definition:
CFMeshMeshGenDriver.C:50
mesh
std::shared_ptr< meshBase > mesh
Definition:
RocPartCommGenDriver.C:145
NEM::DRV::CFMeshMeshGenDriver::setOpts
void setOpts(Opts opts)
Definition:
CFMeshMeshGenDriver.C:67
NEM::DRV::CFMeshMeshGenDriver
Definition:
CFMeshMeshGenDriver.H:39
CFMeshMeshGenDriver.H
cfmeshParams::geomFilePath
std::string geomFilePath
Definition:
cfmeshParams.H:104
NEM::DRV::CFMeshMeshGenDriver::execute
void execute() const override
Run the workflow represented by the driver.
Definition:
CFMeshMeshGenDriver.C:77
cfmeshParams
Definition:
cfmeshParams.H:97
NEM::DRV::CFMeshMeshGenDriver::getOpts
const Opts & getOpts() const
Definition:
CFMeshMeshGenDriver.C:63
NEM::DRV::CFMeshMeshGenDriver::getParams
const cfmeshParams & getParams() const
Definition:
CFMeshMeshGenDriver.C:55
NEM::DRV::CFMeshMeshGenDriver::Opts::Opts
Opts()=default
NEM::DRV::CFMeshMeshGenDriver::opts_
Opts opts_
Definition:
CFMeshMeshGenDriver.H:67
src
Drivers
MeshGen
CFMeshMeshGenDriver.C
Generated on Wed Jan 26 2022 16:40:00 for NEMoSys by
1.8.13