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

Class to create 2d geometry from polygons and circles and mesh it. More...

Detailed Description

Definition at line 50 of file NucMeshDriver.H.

Public Types

using Files = DriverOutFile
 
using Opts = NEM::SRV::NucMeshConf
 

Public Member Functions

 NucMeshDriver (Files file, Opts opts)
 NucMeshDriver ctor. More...
 
const FilesgetFiles () const
 Get the output file name. More...
 
void setFiles (Files files)
 Set the output file for the driver. More...
 
const OptsgetOpts () const
 Get the options set on a driver object. More...
 
void setOpts (Opts opts)
 Set the geometry/mesh and extrusion to execute. More...
 
vtkSmartPointer< NEM::MSH::geoMeshBasedraw () const
 Construct the mesh. More...
 
void execute () const override
 Construct the mesh and write to file. More...
 

Static Public Member Functions

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

Private Member Functions

 NucMeshDriver ()
 
jsoncons::string_view getProgramType () const override
 

Private Attributes

Files file_
 
Opts opts_
 

Static Private Attributes

static constexpr const char * programType = "NucMesh Generation"
 

Inherits NEM::DRV::NemDriver.

Member Typedef Documentation

◆ Files

Definition at line 52 of file NucMeshDriver.H.

◆ Opts

Constructor & Destructor Documentation

◆ NucMeshDriver() [1/2]

NEM::DRV::NucMeshDriver::NucMeshDriver ( Files  file,
Opts  opts 
)
explicit
Parameters
fileOutput file. Should end in ".vtu"
optsSpecify shapes and extrusion.

Definition at line 38 of file NucMeshDriver.C.

39  : file_(std::move(file)), opts_(std::move(opts)) {}

◆ NucMeshDriver() [2/2]

NEM::DRV::NucMeshDriver::NucMeshDriver ( )
private

Definition at line 41 of file NucMeshDriver.C.

41 : NucMeshDriver(Files{std::string{}}, Opts{}) {}
NEM::SRV::NucMeshConf Opts
Definition: NucMeshDriver.H:54

Member Function Documentation

◆ draw()

vtkSmartPointer< NEM::MSH::geoMeshBase > NEM::DRV::NucMeshDriver::draw ( ) const
Returns
geoMeshBase with 1d and 2d cells (and 3d if any extrusion)

Definition at line 55 of file NucMeshDriver.C.

References opts_.

Referenced by execute().

55  {
56  vtkNew<NEM::SRV::NucMeshSrv> nucMeshRunner{};
57  nucMeshRunner->SetConfiguration(opts_);
58  nucMeshRunner->Update();
59  return NEM::MSH::smeshGeoMesh::SafeDownCast(nucMeshRunner->GetOutput());
60 }

◆ execute()

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

Implements NEM::DRV::NemDriver.

Definition at line 62 of file NucMeshDriver.C.

References draw(), file_, NEM::MSH::New(), and NEM::DRV::DriverOutFile::outputFile.

62  {
63  auto outNative = this->draw();
64  auto outType = vtkSmartPointer<NEM::MSH::geoMeshBase>::Take(
66  outType->takeGeoMesh(outNative);
67  outType->write(file_.outputFile);
68 }
std::string outputFile
Definition: NemDriver.H:78
geoMeshBase * New(MeshType meshType)
Create a new mesh object.
vtkSmartPointer< NEM::MSH::geoMeshBase > draw() const
Construct the mesh.
Definition: NucMeshDriver.C:55

◆ getFiles()

const NucMeshDriver::Files & NEM::DRV::NucMeshDriver::getFiles ( ) const
Returns
output file object containing file name

Definition at line 43 of file NucMeshDriver.C.

References file_.

43 { return file_; }

◆ getOpts()

const NucMeshDriver::Opts & NEM::DRV::NucMeshDriver::getOpts ( ) const
Returns
geometry, meshing options, and extrusion steps

Definition at line 47 of file NucMeshDriver.C.

References opts_.

47 { return opts_; }

◆ getProgramType()

jsoncons::string_view NEM::DRV::NucMeshDriver::getProgramType ( ) const
overrideprivatevirtual

Implements NEM::DRV::NemDriver.

Definition at line 51 of file NucMeshDriver.C.

References programType.

51  {
52  return programType;
53 }
static constexpr const char * programType

◆ 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::NucMeshDriver::setFiles ( Files  files)
Parameters
filesNEM::DRV::NucMeshDriver::Files object containing output file

Definition at line 45 of file NucMeshDriver.C.

References file_.

45 { file_ = std::move(files); }

◆ setOpts()

void NEM::DRV::NucMeshDriver::setOpts ( Opts  opts)
Parameters
optsgeometry/mesh options

Definition at line 49 of file NucMeshDriver.C.

References opts_.

49 { opts_ = std::move(opts); }

Member Data Documentation

◆ file_

Files NEM::DRV::NucMeshDriver::file_
private

Definition at line 100 of file NucMeshDriver.H.

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

◆ opts_

Opts NEM::DRV::NucMeshDriver::opts_
private

Definition at line 101 of file NucMeshDriver.H.

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

◆ programType

constexpr const char* NEM::DRV::NucMeshDriver::programType = "NucMesh Generation"
staticprivate

Definition at line 103 of file NucMeshDriver.H.

Referenced by NEM::DRV::JSON::as_shape(), and getProgramType().


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