PeriDEM 0.2.0
PeriDEM -- Peridynamics-based high-fidelity model for granular media
Loading...
Searching...
No Matches
pICDeck.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_ICDECK_H
12#define INP_P_ICDECK_H
13
14#include "util/io.h"
15
16namespace inp {
17
24struct PICDeck {
25
28
31
33 std::vector<size_t> d_pList;
34
36 std::vector<size_t> d_pNotList;
37
41 PICDeck() : d_icActive(false), d_icVec(){};
42
50 std::string printStr(int nt = 0, int lvl = 0) const {
51
52 auto tabS = util::io::getTabS(nt);
53 std::ostringstream oss;
54 oss << tabS << "------- PICDeck --------" << std::endl << std::endl;
55 oss << tabS << "IC active = " << d_icActive << std::endl;
56 oss << tabS << "IC vector = " << d_icVec.printStr(0, 0) << std::endl;
57 if (!d_pList.empty())
58 oss << tabS << "Particle list = ["
59 << util::io::printStr<size_t>(d_pList, 0) << "]" << std::endl;
60 if (!d_pNotList.empty())
61 oss << tabS << "Particle excluded list = ["
62 << util::io::printStr<size_t>(d_pNotList, 0) << "]" << std::endl;
63 oss << tabS << std::endl;
64
65 return oss.str();
66 }
67
74 void print(int nt = 0, int lvl = 0) const { std::cout << printStr(nt, lvl); }
75};
76
79} // namespace inp
80
81#endif // INP_P_ICDECK_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
bool d_icActive
Specify if particle initial condition is active.
Definition pICDeck.h:27
std::vector< size_t > d_pNotList
List of particles to not include (if any)
Definition pICDeck.h:36
std::vector< size_t > d_pList
List of particles (if any)
Definition pICDeck.h:33
util::Point d_icVec
Initial velocity vector.
Definition pICDeck.h:30
void print(int nt=0, int lvl=0) const
Prints the information about the object.
Definition pICDeck.h:74
PICDeck()
Constructor.
Definition pICDeck.h:41
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