PeriDEM 0.2.0
PeriDEM -- Peridynamics-based high-fidelity model for granular media
Loading...
Searching...
No Matches
pBCData.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_P_BCDATA_H
12#define INP_P_BCDATA_H
13
15
16namespace inp {
17
24struct PBCData {
25
35 std::string d_selectionType;
36
43
46
48 std::vector<size_t> d_pList;
49
51 std::vector<size_t> d_pNotList;
52
64 std::string d_timeFnType;
65
77 std::string d_spatialFnType;
78
86 std::vector<size_t> d_direction;
87
89 std::vector<double> d_timeFnParams;
90
92 std::vector<double> d_spatialFnParams;
93
96
102
110 std::string printStr(int nt = 0, int lvl = 0) const {
111
112 auto tabS = util::io::getTabS(nt);
113 std::ostringstream oss;
114 oss << tabS << "------- PBCData --------" << std::endl << std::endl;
115 oss << tabS << "Selection type = " << d_selectionType << std::endl;
116 oss << tabS << "Is region active = " << d_isRegionActive << std::endl;
117 if (d_regionGeomData.d_geom_p != nullptr) {
118 oss << tabS << "Region geometry info: " << std::endl;
119 oss << d_regionGeomData.printStr(nt+1, lvl);
120 }
121 if (!d_pList.empty())
122 oss << tabS << "Particle list = ["
123 << util::io::printStr<size_t>(d_pList, 0) << "]" << std::endl;
124 if (!d_pNotList.empty())
125 oss << tabS << "Particle excluded list = ["
126 << util::io::printStr<size_t>(d_pNotList, 0) << "]" << std::endl;
127 oss << tabS << "Time function type = " << d_timeFnType << std::endl;
128 oss << tabS << "Time function parameters = ["
129 << util::io::printStr<double>(d_timeFnParams, 0) << "]" << std::endl;
130 oss << tabS << "Spatial function type = " << d_spatialFnType << std::endl;
131 oss << tabS << "Spatial function parameters = ["
132 << util::io::printStr<double>(d_spatialFnParams, 0) << "]" << std::endl;
133 oss << tabS << "Direction = [" << util::io::printStr<size_t>(d_direction, 0)
134 << "]" << std::endl;
135 oss << tabS << "Is displacement zero = " << d_isDisplacementZero << std::endl;
136 oss << tabS << std::endl;
137
138 return oss.str();
139 }
140
147 void print(int nt = 0, int lvl = 0) const { std::cout << printStr(nt, lvl); }
148};
149
152} // namespace inp
153
154#endif // INP_P_BCDATA_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 pBCData.h:24
std::string d_timeFnType
Name of the formula with respect to time.
Definition pBCData.h:64
std::string printStr(int nt=0, int lvl=0) const
Returns the string containing printable information about the object.
Definition pBCData.h:110
std::vector< size_t > d_pList
List of particles (if any)
Definition pBCData.h:48
std::vector< double > d_spatialFnParams
List of parameters for function wrt spatial coordinate.
Definition pBCData.h:92
std::string d_selectionType
Method for applying force e.g.
Definition pBCData.h:35
util::geometry::GeomData d_regionGeomData
Region geometry (if any)
Definition pBCData.h:45
std::string d_spatialFnType
Name of the formula of with respect to spatial coordinate.
Definition pBCData.h:77
void print(int nt=0, int lvl=0) const
Prints the information about the object.
Definition pBCData.h:147
std::vector< size_t > d_pNotList
List of particles to not include (if any)
Definition pBCData.h:51
bool d_isDisplacementZero
Specify if this bc corresponds to zero displacement condition.
Definition pBCData.h:95
bool d_isRegionActive
Flag that indicates if region-based application of boundary condition is active. So cases of 'region'...
Definition pBCData.h:42
std::vector< double > d_timeFnParams
List of parameters for function wrt time.
Definition pBCData.h:89
std::vector< size_t > d_direction
List of dofs on which this bc will be applied.
Definition pBCData.h:86
PBCData()
Constructor.
Definition pBCData.h:100
Input data for geometrical objects.
std::string printStr(int nt=0, int lvl=0) const
Returns the string containing printable information about the object.
std::shared_ptr< util::geometry::GeomObject > d_geom_p
Zone geometry.