PeriDEM 0.2.0
PeriDEM -- Peridynamics-based high-fidelity model for granular media
Loading...
Searching...
No Matches
util::geometry::GeomData Struct Reference

Input data for geometrical objects. More...

#include <geomObjectsUtil.h>

Collaboration diagram for util::geometry::GeomData:

Public Member Functions

 GeomData ()
 Constructor.
 
 GeomData (const GeomData &z)
 Constructor.
 
void createNullGeomObject (std::string description="")
 Creates NullGeomObject.
 
void copyGeometry (GeomData &z, size_t dim)
 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< util::geometry::GeomObject > &geom, size_t dim)
 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< util::geometry::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 21 of file geomObjectsUtil.h.

Constructor & Destructor Documentation

◆ GeomData() [1/2]

util::geometry::GeomData::GeomData ( )
inline

Constructor.

Definition at line 38 of file geomObjectsUtil.h.

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

◆ GeomData() [2/2]

util::geometry::GeomData::GeomData ( const GeomData z)
inline

Constructor.

Parameters
zAnother GeomData object

Definition at line 45 of file geomObjectsUtil.h.

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

Member Function Documentation

◆ copyGeometry() [1/2]

void util::geometry::GeomData::copyGeometry ( GeomData z,
size_t  dim 
)

Copies the geometry details.

Parameters
zAnother GeomData object that will be modified
dimDimension of the object

Definition at line 910 of file geomObjectsUitl.cpp.

910 {
911 z.d_geomName = d_geomName;
912 z.d_geomParams = d_geomParams;
913 z.d_geomComplexInfo = d_geomComplexInfo;
914
915 if (d_geom_p->d_name == "null") {
916 z.d_geom_p =
917 std::make_shared<util::geometry::NullGeomObject>(
918 d_geom_p->d_description);
919 } else if (d_geom_p->d_name.empty()) {
920 z.d_geom_p =
921 std::make_shared<util::geometry::GeomObject>(
922 d_geom_p->d_name, d_geom_p->d_description);
923 } else {
925 }
926 }
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< util::geometry::GeomObject > &obj, const size_t &dim, bool perform_check=true)

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

Referenced by inp::Input::setParticleData().

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

◆ copyGeometry() [2/2]

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

Copies the geometry details.

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

Definition at line 928 of file geomObjectsUitl.cpp.

932 {
933 name = d_geomName;
934 params = d_geomParams;
935 complexInfo = d_geomComplexInfo;
936
937 if (d_geom_p->d_name == "null") {
938 geom =
939 std::make_shared<util::geometry::NullGeomObject>(
940 d_geom_p->d_description);
941 } else if (d_geom_p->d_name.empty()) {
942 geom =
943 std::make_shared<util::geometry::GeomObject>(
944 d_geom_p->d_name, d_geom_p->d_description);
945 } else {
947 params,
948 complexInfo.first,
949 complexInfo.second,
950 geom, dim);
951 }
952 }

References util::geometry::createGeomObject().

Here is the call graph for this function:

◆ createNullGeomObject()

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

Creates NullGeomObject.

Parameters
descriptionDescription (if any)

Definition at line 55 of file geomObjectsUtil.h.

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

References d_geom_p, d_geomName, and d_geomParams.

◆ print()

void util::geometry::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 123 of file geomObjectsUtil.h.

123 {
124 std::cout << printStr(nt, lvl);
125}
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 util::geometry::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 92 of file geomObjectsUtil.h.

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

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

Referenced by print(), inp::MeshDeck::printStr(), inp::ParticleDeck::printStr(), inp::PBCData::printStr(), inp::Zone::printStr(), and inp::ParticleZone::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> > util::geometry::GeomData::d_geomComplexInfo

Zone geometry info if it is a complex type.

Definition at line 33 of file geomObjectsUtil.h.

Referenced by copyGeometry(), util::geometry::createGeomObject(), printStr(), and anonymous_namespace{input.cpp}::readGeometry().

◆ d_geomName

std::string util::geometry::GeomData::d_geomName

◆ d_geomParams

std::vector<double> util::geometry::GeomData::d_geomParams

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