PeriDEM 0.2.0
PeriDEM -- Peridynamics-based high-fidelity model for granular media
Loading...
Searching...
No Matches
inp::ContactDeck Struct Reference

Structure to read and store particle-particle contact related input data. More...

#include <contactDeck.h>

Collaboration diagram for inp::ContactDeck:

Public Member Functions

const ContactPairDeckgetContact (const size_t &i, const size_t &j) const
 Returns the contact data.
 
ContactPairDeckgetContact (const size_t &i, const size_t &j)
 Returns the contact data.
 
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::vector< std::vector< ContactPairDeck > > d_data
 Store contact parameters for each pair of zone.
 

Detailed Description

Structure to read and store particle-particle contact related input data.

Definition at line 181 of file contactDeck.h.

Member Function Documentation

◆ getContact() [1/2]

ContactPairDeck & inp::ContactDeck::getContact ( const size_t &  i,
const size_t &  j 
)
inline

Returns the contact data.

Parameters
iZone i
jZone j
Returns
data Contact data between zone i and j

Definition at line 201 of file contactDeck.h.

201 {
202 //return d_data[i < j ? i : j][i < j ? j : i];
203 return d_data[i][j];
204 }
std::vector< std::vector< ContactPairDeck > > d_data
Store contact parameters for each pair of zone.

References d_data.

◆ getContact() [2/2]

const ContactPairDeck & inp::ContactDeck::getContact ( const size_t &  i,
const size_t &  j 
) const
inline

Returns the contact data.

Parameters
iZone i
jZone j
Returns
data Contact data between zone i and j

Definition at line 195 of file contactDeck.h.

195 {
196 //return d_data[i < j ? i : j][i < j ? j : i];
197 return d_data[i][j];
198 }

References d_data.

Referenced by printStr().

Here is the caller graph for this function:

◆ print()

void inp::ContactDeck::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 237 of file contactDeck.h.

237{ std::cout << printStr(nt, lvl); }
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 inp::ContactDeck::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 213 of file contactDeck.h.

213 {
214
215 auto tabS = util::io::getTabS(nt);
216 std::ostringstream oss;
217 oss << tabS << "------- ContactDeck --------" << std::endl << std::endl;
218 for (size_t i =0; i<d_data.size(); i++) {
219 for (size_t j = 0; j < d_data.size(); j++) {
220 oss << tabS << "ContactPairDeck id = (" << i << "," << j << ") info:"
221 << std::endl;
222 oss << getContact(i,j).printStr(nt+2, lvl);
223 }
224 }
225
226 oss << tabS << std::endl;
227
228 return oss.str();
229 }
std::string getTabS(int nt)
Returns tab spaces of given size.
Definition io.h:40
const ContactPairDeck & getContact(const size_t &i, const size_t &j) const
Returns the contact data.
std::string printStr(int nt=0, int lvl=0) const
Returns the string containing printable information about the object.
Definition contactDeck.h:82

References d_data, getContact(), util::io::getTabS(), and inp::ContactPairDeck::printStr().

Referenced by print().

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

Field Documentation

◆ d_data

std::vector<std::vector<ContactPairDeck> > inp::ContactDeck::d_data

Store contact parameters for each pair of zone.

Definition at line 186 of file contactDeck.h.

Referenced by getContact(), getContact(), and printStr().


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