56 BCDeck(
size_t nForceSets,
size_t nDispSets = 0,
size_t nICSets = 0,
72 if (nForceSets + nDispSets + nICSets == 0 and !gravityActive)
77 if (gravityActive) j[
"Force_BC"] = {{
"Gravity", gravity.toVec()}};
80 j[
"Force_BC"] = {{
"Sets", nForceSets}};
86 j[
"Displacement_BC"] = {{
"Sets", nDispSets}};
93 j[
"IC"] = {{
"Sets", nICSets}};
111 if (j.find(
"Force_BC") != j.end()) {
112 if (j.at(
"Force_BC").find(
"Gravity") != j.at(
"Force_BC").end()) {
122 for (
auto tag : std::vector<std::string>({
"Force_BC",
"Displacement_BC",
"IC"})) {
123 if (j.find(tag) == j.end())
126 auto nSets = j.at(tag).value(
"Sets", 0);
128 for (
size_t i = 0; i < nSets; i++) {
130 auto set = j.at(tag).at(
"Set_" + std::to_string(i + 1));
132 if (tag ==
"Force_BC") {
136 }
else if (tag ==
"Displacement_BC") {
140 }
else if (tag ==
"IC") {
156 std::string
printStr(
int nt = 0,
int lvl = 0)
const {
158 std::ostringstream oss;
159 oss << tabS <<
"------- BCDeck --------" << std::endl << std::endl;
160 oss << tabS <<
"Force loading deck size = " <<
d_forceDeck.size() << std::endl;
161 oss << tabS <<
"Force loading data:" << std::endl;
163 oss << tabS <<
"Force data for set = " << i << std::endl;
167 oss << tabS <<
"Displacement loading deck size = " <<
d_dispDeck.size() << std::endl;
168 oss << tabS <<
"Displacement loading data:" << std::endl;
169 for (
size_t i = 0; i <
d_dispDeck.size(); i++) {
170 oss << tabS <<
"Displacement data for set = " << i << std::endl;
174 oss << tabS <<
"Initial condition deck size = " <<
d_icDeck.size() << std::endl;
175 oss << tabS <<
"Initial condition data:" << std::endl;
176 for (
size_t i = 0; i <
d_icDeck.size(); i++) {
177 oss << tabS <<
"Initial condition for set = " << i << std::endl;
178 oss <<
d_icDeck[i].printStr(nt + 1, lvl);
181 oss << tabS <<
"Gravity loading active = " <<
d_gravityActive << std::endl;
182 oss << tabS <<
"Gravity loading value = " <<
d_gravity.
printStr(0, 0) << std::endl;
183 oss << tabS << std::endl;
194 void print(
int nt = 0,
int lvl = 0)
const { std::cout <<
printStr(nt, lvl); }
nlohmann::ordered_json json
Collection of methods and database related to input.
std::string getTabS(int nt)
Returns tab spaces of a given size.
User-input data for particle neighbor search.
void readFromJson(const json &j, std::string type)
Reads from json object.
Structure to read and store test-related input data.
static json getExampleJson(size_t nForceSets=0, size_t nDispSets=0, size_t nICSets=0, bool gravityActive=false, util::Point gravity=util::Point())
Returns example JSON object for ModelDeck configuration.
std::vector< inp::BCBaseDeck > d_icDeck
Initial condition deck.
std::vector< inp::BCBaseDeck > d_dispDeck
Displacement loading deck.
BCDeck(const json &j=json({}))
Constructor.
void print(int nt=0, int lvl=0) const
Prints the information about the object.
void readFromJson(const json &j)
Reads from json object.
std::vector< inp::BCBaseDeck > d_forceDeck
Force loading deck.
BCDeck(size_t nForceSets, size_t nDispSets=0, size_t nICSets=0, bool gravityActive=false, util::Point gravity=util::Point())
Constructor.
util::Point d_gravity
Gravity loading value.
bool d_gravityActive
Gravity loading value.
std::string printStr(int nt=0, int lvl=0) const
Returns the string containing printable information about the object.
A structure to represent 3d vectors.
std::string printStr(int nt=0, int lvl=0) const
Returns the string containing printable information about the object.