11#ifndef INP_PNEIGHBORDECK_H
12#define INP_PNEIGHBORDECK_H
53 size_t neighUpdateInterval = 1,
double nearBdNodesTol = 0.5)
65 static const std::vector<Field<PNeighborDeck>> &
fields() {
66 static const std::vector<Field<PNeighborDeck>> f = {
68 std::string(
"simple_all"),
69 "When the contact neighbor list is rebuilt"),
71 "Search length as a multiple of the largest particle radius"),
73 size_t(1),
"Steps between contact neighbor list updates"),
75 "Depth within which a node counts as near the boundary"),
116 json j = json::object();
128 std::string
printStr(
int nt = 0,
int lvl = 0)
const {
131 std::ostringstream oss;
132 oss << tabS <<
"------- PNeighborDeck --------" << std::endl << std::endl;
134 oss << tabS << std::endl;
145 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.
Field< Deck > field(T Deck::*m, std::string key, T def, std::string doc, Accepts< T > accepts={}, std::function< bool(const T &)> emitIf=[](const T &) { return true;})
Declares a field that maps one key to one member.
void readFields(Deck &d, const json &j, const std::vector< Field< Deck > > &fs)
Reads every field of the table from the block.
void writeFields(const Deck &d, json &j, const std::vector< Field< Deck > > &fs)
Writes every field of the table into the block.
void printFields(const Deck &d, std::ostringstream &oss, const std::vector< Field< Deck > > &fs, const std::string &tab="")
Appends every field of the table to a stream.
json applyGiven(const json &given, const std::vector< Field< Deck > > &fs, const std::vector< std::string > &extra={})
The default block with the given keys replaced.
std::string getTabS(int nt)
Returns tab spaces of a given size.
User-input data for particle neighbor search.
void print(int nt=0, int lvl=0) const
Prints the information about the object.
std::string printStr(int nt=0, int lvl=0) const
Returns the string containing printable information about the object.
std::string d_updateCriteria
Neighbor search update criteria (if any)
void readFromJson(const json &j)
Reads from json object.
json writeToJson() const
Returns this deck as a JSON object.
double d_nearBdNodesTol
Specify how deep we search for nodes near boundary for contact calculations.
static const std::vector< Field< PNeighborDeck > > & fields()
The fields of this deck, declared once.
static json getExampleJson(const json &given=json::object())
Returns the block with the given fields set.
static json getExampleJson(const char *)=delete
Rejects a value given where a set of named values is expected.
double d_sFactor
Neighbor search factor (search length is factor times biggest radius of particle)
static json getExampleJson(const std::string &)=delete
Rejects a value given where a set of named values is expected.
size_t d_neighUpdateInterval
Neighbor update time interval (for contact)
PNeighborDeck(std::string updateCriteria, double sFactor=1., size_t neighUpdateInterval=1, double nearBdNodesTol=0.5)
Constructor.
PNeighborDeck(const json &j=json({}))
Constructor.