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.
NEM::DRV::CFMeshMeshGenDriver Class Reference

Detailed Description

Definition at line 39 of file CFMeshMeshGenDriver.H.

Classes

struct  Opts
 

Public Types

using Files = MeshGenFiles
 

Public Member Functions

 CFMeshMeshGenDriver (Files files, cfmeshParams params)
 
const FilesgetFiles () const
 
void setFiles (Files files)
 
const cfmeshParamsgetParams () const
 
void setParams (cfmeshParams params)
 
void execute () const override
 Run the workflow represented by the driver. More...
 

Static Public Member Functions

static std::unique_ptr< NemDriverreadJSON (const jsoncons::json &inputjson)
 Factory method for all drivers. More...
 

Private Member Functions

 CFMeshMeshGenDriver ()
 
const OptsgetOpts () const
 
void setOpts (Opts opts)
 

Private Attributes

Files files_
 
Opts opts_
 

Inherits NEM::DRV::MeshGenDriver.

Member Typedef Documentation

◆ Files

Constructor & Destructor Documentation

◆ CFMeshMeshGenDriver() [1/2]

NEM::DRV::CFMeshMeshGenDriver::CFMeshMeshGenDriver ( Files  files,
cfmeshParams  params 
)

Definition at line 40 of file CFMeshMeshGenDriver.C.

41  : files_(std::move(files)), opts_(std::move(params)) {}

◆ CFMeshMeshGenDriver() [2/2]

NEM::DRV::CFMeshMeshGenDriver::CFMeshMeshGenDriver ( )
private

Definition at line 43 of file CFMeshMeshGenDriver.C.

Member Function Documentation

◆ execute()

void NEM::DRV::CFMeshMeshGenDriver::execute ( ) const
overridevirtual

Implements NEM::DRV::NemDriver.

Definition at line 77 of file CFMeshMeshGenDriver.C.

References cfmeshGen::createMeshFromSTL(), files_, NEM::DRV::MeshGenDriver::MeshGenFiles::inputGeoFile, mesh, NEM::MSH::New(), opts_, NEM::DRV::MeshGenDriver::MeshGenFiles::outputMeshFile, NEM::DRV::CFMeshMeshGenDriver::Opts::params, and nemAux::trim_fname().

77  {
78  auto paramsCopy = this->opts_.params;
79  cfmeshGen generator{&paramsCopy};
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();
92  mesh->takeGeoMesh(generator.gmData.get());
93  mesh->write(this->files_.outputMeshFile);
94  mesh->Delete();
95 }
int createMeshFromSTL(const char *fname) override
Definition: cfmeshGen.C:99
geoMeshBase * New(MeshType meshType)
Create a new mesh object.
std::string trim_fname(const std::string &name, const std::string &ext)
std::shared_ptr< meshBase > mesh

◆ getFiles()

const CFMeshMeshGenDriver::Files & NEM::DRV::CFMeshMeshGenDriver::getFiles ( ) const

Definition at line 46 of file CFMeshMeshGenDriver.C.

References files_.

46  {
47  return files_;
48 }

◆ getOpts()

const CFMeshMeshGenDriver::Opts & NEM::DRV::CFMeshMeshGenDriver::getOpts ( ) const
private

Definition at line 63 of file CFMeshMeshGenDriver.C.

References opts_.

Referenced by getParams().

63  {
64  return opts_;
65 }

◆ getParams()

const cfmeshParams & NEM::DRV::CFMeshMeshGenDriver::getParams ( ) const

Definition at line 55 of file CFMeshMeshGenDriver.C.

References getOpts(), and NEM::DRV::CFMeshMeshGenDriver::Opts::params.

55  {
56  return getOpts().params;
57 }

◆ readJSON()

std::unique_ptr< NemDriver > NEM::DRV::NemDriver::readJSON ( const jsoncons::json &  inputjson)
staticinherited
Parameters
inputjsonjson input with "Program Type" key
Returns
pointer to base NemDriver class

Definition at line 37 of file NemDriver.C.

Referenced by NEM::DRV::MeshGenDriver::MeshGenDriver().

37  {
38  return inputjson.as<std::unique_ptr<NemDriver>>();
39 }

◆ setFiles()

void NEM::DRV::CFMeshMeshGenDriver::setFiles ( Files  files)

◆ setOpts()

void NEM::DRV::CFMeshMeshGenDriver::setOpts ( Opts  opts)
private

Definition at line 67 of file CFMeshMeshGenDriver.C.

References files_, cfmeshParams::geomFilePath, NEM::DRV::MeshGenDriver::MeshGenFiles::inputGeoFile, opts_, and NEM::DRV::CFMeshMeshGenDriver::Opts::params.

Referenced by setParams().

67  {
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);
74  }
75 }
std::string geomFilePath
Definition: cfmeshParams.H:104

◆ setParams()

void NEM::DRV::CFMeshMeshGenDriver::setParams ( cfmeshParams  params)

Definition at line 59 of file CFMeshMeshGenDriver.C.

References setOpts().

59  {
60  setOpts(Opts{std::move(params)});
61 }

Member Data Documentation

◆ files_

Files NEM::DRV::CFMeshMeshGenDriver::files_
private

Definition at line 66 of file CFMeshMeshGenDriver.H.

Referenced by execute(), getFiles(), setFiles(), and setOpts().

◆ opts_

Opts NEM::DRV::CFMeshMeshGenDriver::opts_
private

Definition at line 67 of file CFMeshMeshGenDriver.H.

Referenced by execute(), getOpts(), setFiles(), and setOpts().


The documentation for this class was generated from the following files: