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::NetgenMeshGenDriver Class Reference

Detailed Description

Definition at line 40 of file NetgenMeshGenDriver.H.

Classes

struct  Opts
 

Public Types

using Files = MeshGenFiles
 

Public Member Functions

 NetgenMeshGenDriver (Files files, netgenParams params)
 
const FilesgetFiles () const
 
void setFiles (Files files)
 
const netgenParamsgetParams () const
 
void setParams (netgenParams 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

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

Private Attributes

Files files_
 
Opts opts_
 

Inherits NEM::DRV::MeshGenDriver.

Member Typedef Documentation

◆ Files

Constructor & Destructor Documentation

◆ NetgenMeshGenDriver() [1/2]

NEM::DRV::NetgenMeshGenDriver::NetgenMeshGenDriver ( Files  files,
netgenParams  params 
)

Definition at line 41 of file NetgenMeshGenDriver.C.

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

◆ NetgenMeshGenDriver() [2/2]

NEM::DRV::NetgenMeshGenDriver::NetgenMeshGenDriver ( )
private

Definition at line 44 of file NetgenMeshGenDriver.C.

Member Function Documentation

◆ execute()

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

Implements NEM::DRV::NemDriver.

Definition at line 69 of file NetgenMeshGenDriver.C.

References meshBase::CreateShared(), meshBase::exportVolToVtk(), files_, NEM::DRV::MeshGenDriver::MeshGenFiles::inputGeoFile, mesh, opts_, NEM::DRV::MeshGenDriver::MeshGenFiles::outputMeshFile, NEM::DRV::NetgenMeshGenDriver::Opts::params, and nemAux::trim_fname().

69  {
70  netgenGen generator{&this->opts_.params};
71  int status = generator.createMeshFromSTL(this->files_.inputGeoFile.c_str());
72  if (status) {
73  std::cerr << "Mesh Generation encountered error." << std::endl;
74  exit(1);
75  }
76  std::string newname = nemAux::trim_fname(this->files_.inputGeoFile, ".vol");
78  mesh->setFileName(this->files_.outputMeshFile);
79  mesh->report();
80  mesh->write();
81 }
static meshBase * exportVolToVtk(const std::string &fname)
construct vtkMesh from netgen vol file (called in Create methods)
Definition: meshBase.C:766
std::string trim_fname(const std::string &name, const std::string &ext)
std::shared_ptr< meshBase > mesh
static std::shared_ptr< meshBase > CreateShared(const std::string &fname)
Create shared ptr from fname.
Definition: meshBase.C:171

◆ getFiles()

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

Definition at line 47 of file NetgenMeshGenDriver.C.

References files_.

47  {
48  return files_;
49 }

◆ getOpts()

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

Definition at line 63 of file NetgenMeshGenDriver.C.

References opts_.

Referenced by getParams().

63  {
64  return opts_;
65 }

◆ getParams()

const netgenParams & NEM::DRV::NetgenMeshGenDriver::getParams ( ) const

Definition at line 55 of file NetgenMeshGenDriver.C.

References getOpts(), and NEM::DRV::NetgenMeshGenDriver::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::NetgenMeshGenDriver::setFiles ( Files  files)

Definition at line 51 of file NetgenMeshGenDriver.C.

References files_.

51  {
52  this->files_ = std::move(files);
53 }

◆ setOpts()

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

Definition at line 67 of file NetgenMeshGenDriver.C.

References opts_.

Referenced by setParams().

67 { this->opts_ = std::move(opts); }

◆ setParams()

void NEM::DRV::NetgenMeshGenDriver::setParams ( netgenParams  params)

Definition at line 59 of file NetgenMeshGenDriver.C.

References setOpts().

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

Member Data Documentation

◆ files_

Files NEM::DRV::NetgenMeshGenDriver::files_
private

Definition at line 67 of file NetgenMeshGenDriver.H.

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

◆ opts_

Opts NEM::DRV::NetgenMeshGenDriver::opts_
private

Definition at line 68 of file NetgenMeshGenDriver.H.

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


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