29 #ifndef NEMOSYS_INPUTGEN_H_ 30 #define NEMOSYS_INPUTGEN_H_ 33 #include "nemosys_export.h" 35 #include <jsoncons/json.hpp> 51 : _jstrm(
std::move(jsnStrm)), _key(
"generic") {};
54 for (
auto &&inp : _inp)
61 void _set_key(
const std::string &key) { _key = key; }
63 virtual void setNameType(
const std::string &fname,
inpFileType ftyp,
64 const std::string &key = std::string());
66 virtual void setOrder(
const std::vector<std::string> &ord,
67 const std::string &key = std::string());
68 virtual std::vector<std::string>
69 getOrder(
const std::string &key = std::string());
70 virtual void pushOrder(
const std::string &ord,
71 const std::string &key = std::string());
74 const std::string &key = std::string());
76 virtual void setCmntStr(
const std::string &cmstr,
77 const std::string &key = std::string());
78 virtual std::string getCmntStr(
const std::string &key = std::string());
80 virtual void process() = 0;
82 virtual void write(
const std::string &key = std::string())
const;
84 virtual void read(
const std::string &fname) = 0;
86 virtual void close(
const std::string &fname) = 0;
91 virtual void addNdeSet() = 0;
92 virtual void addElmSet() = 0;
96 virtual void addMat() = 0;
97 virtual void addBC() = 0;
98 virtual void addIC() = 0;
99 virtual bool addMisc() = 0;
103 virtual void wrtPre(
const std::string &_tsk,
const std::string &__tsk) = 0;
104 virtual void wrtCmnt(
const std::string &cmnt) = 0;
105 virtual void wrtMsh(
const std::string &_tsk,
const std::string &__tsk) = 0;
106 virtual void wrtNdeCrds() = 0;
107 virtual void wrtElmCon() = 0;
108 virtual void wrtPost() = 0;
109 virtual void wrtNdeSet() = 0;
110 virtual void wrtElmSet() = 0;
111 virtual void wrtMisc(
const std::string &_tsk,
const std::string &__tsk) = 0;
112 virtual void edit(
const std::string &_tsk,
const std::string &__tsk) = 0;
116 virtual void _write(std::stringstream &ss)
118 auto key_it = _inp.find(_key);
119 if (key_it == _inp.end())
121 std::pair<std::string, std::stringstream *>(
123 new std::stringstream()
127 *(_inp.at(_key)) << ss.str() << std::endl;
129 ss.str(std::string());
135 std::map<std::string, std::stringstream *>
_inp;
136 std::map<std::string, std::vector<meshBase *>>
_mb;
137 std::map<std::string, std::vector<std::string>>
_ord;
138 std::map<std::string, std::string>
_fn;
139 std::map<std::string, inpFileType>
_tpe;
140 std::map<std::string, std::string>
_cmnt;
143 #endif // NEMOSYS_INPUTGEN_H_
A brief description of meshBase.