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

Detailed Description

Definition at line 41 of file InputGenDriver.H.

Public Member Functions

 InputGenDriver (std::string service, jsoncons::json opts)
 
const std::string & getService () const
 
void setService (std::string service)
 
const jsoncons::json & getOpts () const
 
void setOpts (jsoncons::json opts)
 
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

 InputGenDriver ()=default
 
jsoncons::string_view getProgramType () const override
 

Private Attributes

std::string service_ {}
 
jsoncons::json opts_ {}
 

Static Private Attributes

static constexpr const char * programType = "Input Generation"
 

Inherits NEM::DRV::NemDriver.

Constructor & Destructor Documentation

◆ InputGenDriver() [1/2]

NEM::DRV::InputGenDriver::InputGenDriver ( std::string  service,
jsoncons::json  opts 
)

Definition at line 39 of file InputGenDriver.C.

40  : service_(std::move(service)), opts_(std::move(opts)) {}

◆ InputGenDriver() [2/2]

NEM::DRV::InputGenDriver::InputGenDriver ( )
privatedefault

Member Function Documentation

◆ execute()

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

Implements NEM::DRV::NemDriver.

Definition at line 58 of file InputGenDriver.C.

References opts_, service_, nemAux::Timer::start(), nemAux::Timer::stop(), and nemAux::toLower().

58  {
59  std::string srvName = this->service_;
60  nemAux::toLower(srvName);
61  nemAux::Timer T;
62  T.start();
63  if (srvName == "epic_2016") {
64 #ifdef HAVE_EPIC
65  ep16Prep::readJSON(this->opts_);
66 #else
67  std::cerr << "Compile the code with EPIC module enabled." << std::endl;
68  exit(0);
69 #endif
70  } else if (srvName == "epic_2016_post") {
71 #ifdef HAVE_EPIC
72  int ret;
73  NEM::EPC::ep16Post::readJSON(this->opts_, ret);
74 #else
75  std::cerr << "Compile the code with EPIC module enabled." << std::endl;
76  exit(0);
77 #endif
78  } else {
79  std::cerr << "The input generation service " << srvName << "is unsupported."
80  << std::endl;
81  }
82  T.stop();
83 }
void toLower(std::string &str)

◆ getOpts()

const jsoncons::json & NEM::DRV::InputGenDriver::getOpts ( ) const

Definition at line 48 of file InputGenDriver.C.

References opts_.

48 { return opts_; }

◆ getProgramType()

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

Implements NEM::DRV::NemDriver.

Definition at line 54 of file InputGenDriver.C.

References programType.

54  {
55  return programType;
56 }
static constexpr const char * programType

◆ getService()

const std::string & NEM::DRV::InputGenDriver::getService ( ) const

Definition at line 42 of file InputGenDriver.C.

References service_.

42 { return service_; }

◆ 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 }

◆ setOpts()

void NEM::DRV::InputGenDriver::setOpts ( jsoncons::json  opts)

Definition at line 50 of file InputGenDriver.C.

References opts_.

50  {
51  this->opts_ = std::move(opts);
52 }

◆ setService()

void NEM::DRV::InputGenDriver::setService ( std::string  service)

Definition at line 44 of file InputGenDriver.C.

References service_.

44  {
45  this->service_ = std::move(service);
46 }

Member Data Documentation

◆ opts_

jsoncons::json NEM::DRV::InputGenDriver::opts_ {}
private

Definition at line 59 of file InputGenDriver.H.

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

◆ programType

constexpr const char* NEM::DRV::InputGenDriver::programType = "Input Generation"
staticprivate

Definition at line 56 of file InputGenDriver.H.

Referenced by getProgramType().

◆ service_

std::string NEM::DRV::InputGenDriver::service_ {}
private

Definition at line 58 of file InputGenDriver.H.

Referenced by execute(), getService(), and setService().


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