42 : taskFile(
std::move(taskFile)) {}
45 : meshFileName(
std::move(meshFile)) {}
48 std::vector<MeshData> meshData,
50 : numMeshes(numMeshes),
51 meshData(
std::move(meshData)),
52 needsPostProc(needsPostProc) {}
66 this->
file_ = std::move(file);
75 this->
opts_ = std::move(opts);
79 std::cout <<
"Converting to EXODUS II..." << std::endl;
83 std::cerr <<
"Error: At least one mesh should be provided!\n";
100 if (fileExt ==
".g" || fileExt ==
".e" || fileExt ==
".exo" ||
101 fileExt ==
".exodus") {
104 em2.
read(meshData.meshFileName);
107 for (
const auto &kv : meshData.elmBlkNames)
111 if (meshData.addGlobalNodeSet) {
115 ns.
name = meshData.addGlobalNodeSet.value();
117 for (
int iNde = 0; iNde < ns.
nNde; ++iNde)
118 ns.
ndeIds.emplace_back(iNde + 1);
136 int ndeIdOffset_local = 0;
137 int elmIdOffset_local = 0;
140 mb, em, ndeIdOffset, elmIdOffset, ins, ieb, iss, meshData.meshName,
141 meshData.usePhys, ndeIdOffset_local, elmIdOffset_local,
142 meshData.makeFreeSurfSS, meshData.splitTopBotSS, meshData.sideSetNames);
145 ndeIdOffset += ndeIdOffset_local;
146 elmIdOffset += elmIdOffset_local;
158 const auto &ppFName = this->
opts_.
tasks[iTsk].taskFile;
159 std::cout <<
"Reading Post Processing JSON file " << iTsk << std::endl;
160 std::ifstream inputStream(ppFName);
162 std::cerr <<
"Error opening file " << ppFName << std::endl;
166 std::cerr <<
"Input File must be in .json format" << std::endl;
169 jsoncons::json ppJson;
170 inputStream >> ppJson;
175 std::cout <<
"writing exodus file" << std::endl;
A complete I/O class for EXODUS II file format.
void setBlockName(int idx, const std::string &name)
Sets/changes block name.
A brief description of meshBase.
int getNumberOfNodeSets() const
Returns total number of node sets.
static void procExo(const jsoncons::json &ppJson, const std::string &fname, NEM::MSH::EXOMesh::exoMesh *em)
static meshBase * Create(const std::string &fname)
Construct vtkMesh from filename.
std::string find_ext(const std::string &fname)
int getNumberOfSideSets() const
Returns total number of side sets.
int getNumberOfNodes() const
Returns total number of nodes.
const Files & getFiles() const
void execute() const override
Run the workflow represented by the driver.
virtual void write() const
write the mesh to file named after the private var 'filename'.
GmshToExoConversionDriver()
std::vector< MeshData > meshData
const Opts & getOpts() const
void setFiles(Files file)
void addNdeSet(const ndeSetType &ns)
Add node set to the database.
Stores node set information.
std::vector< int > ndeIds
int getNumberOfElements() const
Returns total number of elements.
void read(const std::string &ifname=std::string())
Resets the class and reads from file name provided.
int getNumberOfElementBlocks() const
Returns total number of element blocks.
std::vector< PostProcTask > tasks
static void genExo(std::vector< meshBase *> meshes, const std::string &fname)