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

Detailed Description

Definition at line 39 of file SnappyMeshMeshGenDriver.H.

Classes

struct  Opts
 

Public Types

using Files = MeshGenFiles
 

Public Member Functions

 SnappyMeshMeshGenDriver (Files files, snappymeshParams params)
 
const FilesgetFiles () const
 
void setFiles (Files files)
 
const snappymeshParamsgetParams () const
 
void setParams (snappymeshParams 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

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

Private Attributes

Files files_
 
Opts opts_
 

Inherits NEM::DRV::MeshGenDriver.

Member Typedef Documentation

◆ Files

Constructor & Destructor Documentation

◆ SnappyMeshMeshGenDriver() [1/2]

NEM::DRV::SnappyMeshMeshGenDriver::SnappyMeshMeshGenDriver ( Files  files,
snappymeshParams  params 
)

Definition at line 41 of file SnappyMeshMeshGenDriver.C.

◆ SnappyMeshMeshGenDriver() [2/2]

NEM::DRV::SnappyMeshMeshGenDriver::SnappyMeshMeshGenDriver ( )
private

Definition at line 45 of file SnappyMeshMeshGenDriver.C.

Member Function Documentation

◆ execute()

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

Implements NEM::DRV::NemDriver.

Definition at line 80 of file SnappyMeshMeshGenDriver.C.

References meshBase::Create(), snappymeshGen::createMeshFromSTL(), meshBase::CreateShared(), files_, NEM::DRV::MeshGenDriver::MeshGenFiles::inputGeoFile, mesh, opts_, NEM::DRV::MeshGenDriver::MeshGenFiles::outputMeshFile, NEM::DRV::SnappyMeshMeshGenDriver::Opts::params, and nemAux::trim_fname().

80  {
81  auto paramsCopy = this->opts_.params;
82  snappymeshGen generator{&paramsCopy};
83  // TODO: Make sure blockMeshGen::createMeshFromSTL sets return value and check
84  // it here
85  // Parameter not used
86  generator.createMeshFromSTL(nullptr);
87  std::string newname = nemAux::trim_fname(this->files_.inputGeoFile, ".vtu");
88  auto mesh =
89  meshBase::CreateShared(meshBase::Create(generator.getDataSet(), newname));
90  mesh->setFileName(this->files_.outputMeshFile);
91  mesh->report();
92  mesh->write();
93 }
snappymeshGen facilitates full-hexahedral/hex-dominent meshing of complex geometries with surface...
Definition: snappymeshGen.H:55
int createMeshFromSTL(const char *fname) override
Creates mesh from input STL file.
Definition: snappymeshGen.C:91
static meshBase * Create(const std::string &fname)
Construct vtkMesh from filename.
Definition: meshBase.C:78
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 SnappyMeshMeshGenDriver::Files & NEM::DRV::SnappyMeshMeshGenDriver::getFiles ( ) const

Definition at line 48 of file SnappyMeshMeshGenDriver.C.

References files_.

49  {
50  return files_;
51 }

◆ getOpts()

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

Definition at line 66 of file SnappyMeshMeshGenDriver.C.

References opts_.

Referenced by getParams().

66  {
67  return opts_;
68 }

◆ getParams()

const snappymeshParams & NEM::DRV::SnappyMeshMeshGenDriver::getParams ( ) const

◆ 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::SnappyMeshMeshGenDriver::setFiles ( Files  files)

◆ setOpts()

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

Definition at line 70 of file SnappyMeshMeshGenDriver.C.

References files_, snappymeshParams::geomFileName, NEM::DRV::MeshGenDriver::MeshGenFiles::inputGeoFile, opts_, and NEM::DRV::SnappyMeshMeshGenDriver::Opts::params.

Referenced by setParams().

70  {
71  if (!opts.params.geomFileName.empty()) {
72  this->files_.inputGeoFile = opts.params.geomFileName;
73  this->opts_ = std::move(opts);
74  } else {
75  this->opts_ = std::move(opts);
77  }
78 }
std::string geomFileName
Input geometry STL name.

◆ setParams()

void NEM::DRV::SnappyMeshMeshGenDriver::setParams ( snappymeshParams  params)

Definition at line 62 of file SnappyMeshMeshGenDriver.C.

References setOpts().

62  {
63  setOpts(Opts{std::move(params)});
64 }

Member Data Documentation

◆ files_

Files NEM::DRV::SnappyMeshMeshGenDriver::files_
private

Definition at line 66 of file SnappyMeshMeshGenDriver.H.

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

◆ opts_

Opts NEM::DRV::SnappyMeshMeshGenDriver::opts_
private

Definition at line 67 of file SnappyMeshMeshGenDriver.H.

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


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