16#include <nlohmann_json/json.hpp>
17using json = nlohmann::ordered_json;
59 d_geom_p = std::make_shared<geom::NullGeomObject>(
79 std::vector<double> ¶ms,
80 std::pair<std::vector<std::string>, std::vector<std::string>> &complexInfo,
81 std::shared_ptr<geom::GeomObject> &
geom);
90std::string
printStr(
int nt = 0,
int lvl = 0)
const {
93 std::ostringstream oss;
94 oss << tabS <<
"------- GeomData --------" << std::endl
96 oss << tabS <<
"Type = " <<
d_geomName << std::endl;
97 oss << tabS <<
"Parameters = ["
101 oss << tabS <<
"Vec type for complex geometry = ["
105 oss << tabS <<
"Vec flag for complex geometry = ["
110 oss <<
d_geom_p->printStr(nt + 1, lvl);
121void print(
int nt = 0,
int lvl = 0)
const {
139 "circle_minus_circle",
140 "ellipse_minus_ellipse",
141 "sphere_minus_sphere",
142 "rectangle_minus_rectangle",
143 "cuboid_minus_cuboid",
144 "open_rect_channel_2d",
145 "open_cuboid_channel_3d",
191 std::vector<std::string> vec_type);
203 std::vector<std::string> vec_type);
218 const std::vector<double> ¶ms,
219 const std::vector<std::string> &vec_type,
220 const std::vector<std::string> &vec_flag,
221 std::shared_ptr<geom::GeomObject> &obj,
222 bool perform_check =
true);
225 const std::vector<double> ¶ms,
226 const std::vector<std::string> &vec_type,
227 const std::vector<std::string> &vec_flag,
228 std::shared_ptr<geom::GeomObject> &obj,
229 bool perform_check =
true);
250 bool perform_check =
true);
nlohmann::ordered_json json
void createGeomObject(const std::string &geom_type, const std::vector< double > ¶ms, const std::vector< std::string > &vec_type, const std::vector< std::string > &vec_flag, std::shared_ptr< geom::GeomObject > &obj, bool perform_check)
GeomObject * createGeomDeepCopy(GeomObject *obj)
Creates a deep copy of a geometric object.
void readGeometry(const json &j, geom::GeomData &geomData)
bool isNumberOfParamForComplexGeometryValid(size_t n, std::string geom_type, std::vector< std::string > vec_type)
Ascertain if number of parameters are correct for the given geometry.
std::shared_ptr< GeomObject > makeExampleGeomObject(const std::string &geom_type, const util::Point &c, double s)
One-liner: createGeomObject(exampleGeomParams(...)). Prefer this over per-class static factories so a...
void createGeomObjectOld(const std::string &type, const std::vector< double > ¶ms, const std::vector< std::string > &vec_type, const std::vector< std::string > &vec_flag, std::shared_ptr< geom::GeomObject > &obj, bool perform_check)
Create geometrical object from the given data.
bool checkParamForComplexGeometry(size_t n, std::string geom_type, std::vector< std::string > vec_type)
Check parameter data for validity.
const std::vector< std::string > & getAcceptableGeometries()
Returns list of acceptable geometries for PeriDEM simulation.
void writeGeometry(json &j, const geom::GeomData &geomData)
bool checkParamForGeometry(size_t n, std::string geom_type)
Check parameter data for validity.
std::vector< double > exampleGeomParams(const std::string &geom_type, const util::Point &c, double s)
Canonical parameter vector for examples, mesh generation tests, and demos.
std::vector< size_t > getNumParamsRequired(std::string geom_type)
Get num params required for creation of object.
bool isNumberOfParamForGeometryValid(size_t n, std::string geom_type)
Ascertain if number of parameters are correct for the given geometry.
const std::vector< std::string > acceptable_geometries
List of acceptable geometries for particles in PeriDEM.
std::string getTabS(int nt)
Returns tab spaces of a given size.
std::string printStr(const T &msg, int nt=print_default_tab)
Returns formatted string for output.
Input data for geometrical objects.
std::shared_ptr< geom::GeomObject > d_geom_p
Zone geometry.
void createNullGeomObject(std::string description="")
Creates NullGeomObject.
void print(int nt=0, int lvl=0) const
Prints the information about the object.
void copyGeometry(GeomData &z)
Copies the geometry details.
std::vector< double > d_geomParams
Zone parameters.
std::string d_geomName
Zone type.
std::string printStr(int nt=0, int lvl=0) const
Returns the string containing printable information about the object.
std::pair< std::vector< std::string >, std::vector< std::string > > d_geomComplexInfo
Zone geometry info if it is a complex type.
GeomData(const GeomData &z)
Constructor.
A structure to represent 3d vectors.