PeriDEM 0.2.0
PeriDEM -- Peridynamics-based high-fidelity model for granular media
Loading...
Searching...
No Matches
particleDeck.h
Go to the documentation of this file.
1/*
2 * -------------------------------------------
3 * Copyright (c) 2021 - 2024 Prashant K. Jha
4 * -------------------------------------------
5 * PeriDEM https://github.com/prashjha/PeriDEM
6 *
7 * Distributed under the Boost Software License, Version 1.0. (See accompanying
8 * file LICENSE)
9 */
10
11#ifndef INP_PARTICLEDECK_H
12#define INP_PARTICLEDECK_H
13
14#include "zoneDeck.h"
15#include "pNeighborDeck.h"
16#include "pBCData.h"
17#include "pICDeck.h"
19#include <memory>
20
21namespace inp {
22
32
34 std::vector<inp::Zone> d_zoneVec;
35
37 std::vector<std::pair<std::string, size_t>> d_zoneToParticleORWallDeck;
38
40 std::vector<inp::ParticleZone> d_particleZones;
41
47
50
53
56
58 std::vector<inp::PBCData> d_forceDeck;
59
61 std::vector<inp::PBCData> d_dispDeck;
62
65
67 std::string d_testName;
68
71
74
87
95 std::string printStr(int nt = 0, int lvl = 0) const {
96
97 auto tabS = util::io::getTabS(nt);
98 std::ostringstream oss;
99 oss << tabS << "------- ParticleDeck --------" << std::endl << std::endl;
100 oss << tabS << "Number of particle zones = " << d_particleZones.size() << std::endl;
101 oss << tabS << "Particle data:" << std::endl;
102 for (size_t i = 0; i < d_particleZones.size(); i++) {
103 oss << tabS << "Particle data for zone = " << i << std::endl;
104 oss << d_particleZones[i].printStr(nt + 1, lvl);
105 }
106 oss << tabS << "Container geometry details:" << std::endl;
107 oss << d_contGeomData.printStr(nt+1, lvl);
108 oss << tabS << "Neighbor data:" << std::endl;
109 oss << d_pNeighDeck.printStr(nt+1, lvl);
110 oss << tabS << "Gravity: Status = " << d_gravityActive
111 << ", force = " << d_gravity.printStr(0, 0) << std::endl;
112 oss << tabS << "Num of Force BC = " << d_forceDeck.size() << std::endl;
113 oss << tabS << "Force BC info:" << std::endl;
114 size_t bc_count = 0;
115 for (const auto &f: d_forceDeck) {
116 oss << tabS << " Force BC id = " << bc_count++ << std::endl;
117 oss << f.printStr(nt+2, lvl);
118 }
119 oss << tabS << "Num of Displacement BC = " << d_dispDeck.size() <<
120 std::endl;
121 oss << tabS << "Displacement BC info:" << std::endl;
122 bc_count = 0;
123 for (const auto &f: d_dispDeck) {
124 oss << tabS << " Displacement BC id = " << bc_count++ << std::endl;
125 oss << f.printStr(nt+2, lvl);
126 }
127 oss << tabS << "IC data:" << std::endl;
128 oss << d_icDeck.printStr(nt+1, lvl);
129 oss << tabS << "Test name = " << d_testName << std::endl;
130 oss << tabS << std::endl;
131
132 return oss.str();
133 }
134
141 void print(int nt = 0, int lvl = 0) const { std::cout << printStr(nt, lvl); }
142};
143
146} // namespace inp
147
148#endif // INP_PARTICLEDECK_H
Collection of methods and database related to input.
Definition mesh.h:20
std::string getTabS(int nt)
Returns tab spaces of given size.
Definition io.h:40
User-input data for particle neighbor search.
Definition pICDeck.h:24
std::string printStr(int nt=0, int lvl=0) const
Returns the string containing printable information about the object.
Definition pICDeck.h:50
User-input data for particle neighbor search.
std::string printStr(int nt=0, int lvl=0) const
Returns the string containing printable information about the object.
Structure to read and store particle related input data.
void print(int nt=0, int lvl=0) const
Prints the information about the object.
std::vector< inp::ParticleZone > d_particleZones
Particle in zones.
bool d_gravityActive
Gravity loading value.
std::vector< inp::PBCData > d_dispDeck
Displacement loading deck.
std::vector< inp::Zone > d_zoneVec
All zones.
size_t d_particleForceDirectionCompressiveTest
if it is a compressive test, specify force direction on wall
std::vector< inp::PBCData > d_forceDeck
Force loading deck.
size_t d_particleIdCompressiveTest
if it is a compressive test, specify wall id and direction
std::string printStr(int nt=0, int lvl=0) const
Returns the string containing printable information about the object.
inp::PNeighborDeck d_pNeighDeck
Neighbor search data.
ParticleDeck()
Constructor.
inp::PICDeck d_icDeck
Initial condition deck.
std::vector< std::pair< std::string, size_t > > d_zoneToParticleORWallDeck
Maps particle/wall to corresponding zone.
util::Point d_gravity
Gravity loading value.
std::string d_testName
Specify test name (if any)
util::geometry::GeomData d_contGeomData
Geometry of container in which all particles reside. Currently, we only support rectangle (2-d) and c...
A structure to represent 3d vectors.
Definition point.h:30
std::string printStr(int nt=0, int lvl=0) const
Returns the string containing printable information about the object.
Definition point.h:94
Input data for geometrical objects.
std::string printStr(int nt=0, int lvl=0) const
Returns the string containing printable information about the object.