PeriDEM 0.3.0
PeriDEM -- Peridynamics-based high-fidelity model for granular media
Loading...
Searching...
No Matches
geom::GeomData Struct Reference

Input data for geometrical objects. More...

#include <geomObjectsUtil.h>

Collaboration diagram for geom::GeomData:

Public Member Functions

 GeomData ()
 Constructor.
 
 GeomData (const GeomData &z)
 Constructor.
 
void createNullGeomObject (std::string description="")
 Creates NullGeomObject.
 
void copyGeometry (GeomData &z)
 Copies the geometry details.
 
void copyGeometry (std::string &name, std::vector< double > &params, std::pair< std::vector< std::string >, std::vector< std::string > > &complexInfo, std::shared_ptr< geom::GeomObject > &geom)
 Copies the geometry details.
 
std::string printStr (int nt=0, int lvl=0) const
 Returns the string containing printable information about the object.
 
void print (int nt=0, int lvl=0) const
 Prints the information about the object.
 

Data Fields

std::string d_geomName
 Zone type.
 
std::vector< double > d_geomParams
 Zone parameters.
 
std::shared_ptr< geom::GeomObjectd_geom_p
 Zone geometry.
 
std::pair< std::vector< std::string >, std::vector< std::string > > d_geomComplexInfo
 Zone geometry info if it is a complex type.
 

Detailed Description

Input data for geometrical objects.

Definition at line 22 of file geomObjectsUtil.h.

Constructor & Destructor Documentation

◆ GeomData() [1/2]

geom::GeomData::GeomData ( )
inline

Constructor.

Definition at line 39 of file geomObjectsUtil.h.

39: d_geom_p(nullptr) {};
std::shared_ptr< geom::GeomObject > d_geom_p
Zone geometry.

◆ GeomData() [2/2]

geom::GeomData::GeomData ( const GeomData z)
inline

Constructor.

Parameters
zAnother GeomData object

Definition at line 46 of file geomObjectsUtil.h.

47 : d_geomName(z.d_geomName),
48 d_geomParams(z.d_geomParams),
49 d_geom_p(z.d_geom_p),
50 d_geomComplexInfo(z.d_geomComplexInfo) {};
std::vector< double > d_geomParams
Zone parameters.
std::string d_geomName
Zone type.
std::pair< std::vector< std::string >, std::vector< std::string > > d_geomComplexInfo
Zone geometry info if it is a complex type.

Member Function Documentation

◆ copyGeometry() [1/2]

void geom::GeomData::copyGeometry ( geom::GeomData z)

Copies the geometry details.

Parameters
zAnother GeomData object that will be modified

Definition at line 1315 of file geomObjectsUtil.cpp.

1315 {
1319
1320 if (d_geom_p->d_name == "null") {
1321 z.d_geom_p =
1322 std::make_shared<geom::NullGeomObject>(
1323 d_geom_p->d_description);
1324 } else if (d_geom_p->d_name.empty()) {
1325 z.d_geom_p =
1326 std::make_shared<geom::GeomObject>(
1327 d_geom_p->d_name, d_geom_p->d_description);
1328 } else {
1330 }
1331 }
void createGeomObject(const std::string &geom_type, const std::vector< double > &params, const std::vector< std::string > &vec_type, const std::vector< std::string > &vec_flag, std::shared_ptr< geom::GeomObject > &obj, bool perform_check)

References geom::createGeomObject(), d_geom_p, d_geomComplexInfo, d_geomName, and d_geomParams.

Here is the call graph for this function:

◆ copyGeometry() [2/2]

void geom::GeomData::copyGeometry ( std::string &  name,
std::vector< double > &  params,
std::pair< std::vector< std::string >, std::vector< std::string > > &  complexInfo,
std::shared_ptr< geom::GeomObject > &  geom 
)

Copies the geometry details.

Parameters
nameName of geometry
paramsParameters
complexInfoPair of vector of geometry names and flags for complex geometry
geomPointer to geometry object

Definition at line 1333 of file geomObjectsUtil.cpp.

1336 {
1337 name = d_geomName;
1338 params = d_geomParams;
1339 complexInfo = d_geomComplexInfo;
1340
1341 if (d_geom_p->d_name == "null") {
1342 geom =
1343 std::make_shared<geom::NullGeomObject>(
1344 d_geom_p->d_description);
1345 } else if (d_geom_p->d_name.empty()) {
1346 geom =
1347 std::make_shared<geom::GeomObject>(
1348 d_geom_p->d_name, d_geom_p->d_description);
1349 } else {
1351 params,
1352 complexInfo.first,
1353 complexInfo.second,
1354 geom);
1355 }
1356 }

References geom::createGeomObject().

Here is the call graph for this function:

◆ createNullGeomObject()

void geom::GeomData::createNullGeomObject ( std::string  description = "")
inline

Creates NullGeomObject.

Parameters
descriptionDescription (if any)

Definition at line 56 of file geomObjectsUtil.h.

56 {
57 d_geomName = "null";
58 d_geomParams.resize(0);
59 d_geom_p = std::make_shared<geom::NullGeomObject>(
60 description);
61};

References d_geom_p, d_geomName, and d_geomParams.

◆ print()

void geom::GeomData::print ( int  nt = 0,
int  lvl = 0 
) const
inline

Prints the information about the object.

Parameters
ntNumber of tabs to append before printing
lvlInformation level (higher means more information)

Definition at line 121 of file geomObjectsUtil.h.

121 {
122 std::cout << printStr(nt, lvl);
123}
std::string printStr(int nt=0, int lvl=0) const
Returns the string containing printable information about the object.

References printStr().

Here is the call graph for this function:

◆ printStr()

std::string geom::GeomData::printStr ( int  nt = 0,
int  lvl = 0 
) const
inline

Returns the string containing printable information about the object.

Parameters
ntNumber of tabs to append before printing
lvlInformation level (higher means more information)
Returns
string String containing printable information about the object

Definition at line 90 of file geomObjectsUtil.h.

90 {
91
92 auto tabS = util::io::getTabS(nt);
93 std::ostringstream oss;
94 oss << tabS << "------- GeomData --------" << std::endl
95 << std::endl;
96 oss << tabS << "Type = " << d_geomName << std::endl;
97 oss << tabS << "Parameters = ["
98 << util::io::printStr<double>(d_geomParams, 0)
99 << "]" << std::endl;
100 if (!d_geomComplexInfo.first.empty()) {
101 oss << tabS << "Vec type for complex geometry = ["
103 << "]" << std::endl;
104
105 oss << tabS << "Vec flag for complex geometry = ["
107 << "]" << std::endl;
108 }
109 if (d_geom_p != nullptr)
110 oss << d_geom_p->printStr(nt + 1, lvl);
111
112 return oss.str();
113}
std::string getTabS(int nt)
Returns tab spaces of a given size.
Definition io.h:39
std::string printStr(const T &msg, int nt=print_default_tab)
Returns formatted string for output.
Definition io.h:53

References d_geom_p, d_geomComplexInfo, d_geomName, d_geomParams, util::io::getTabS(), and util::io::printStr().

Referenced by print(), and inp::BCBaseDeck::printStr().

Here is the call graph for this function:
Here is the caller graph for this function:

Field Documentation

◆ d_geom_p

◆ d_geomComplexInfo

std::pair<std::vector<std::string>, std::vector<std::string> > geom::GeomData::d_geomComplexInfo

◆ d_geomName

◆ d_geomParams


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