NLMech  0.1.0
meshDeck.h
1 // Copyright (c) 2019 Prashant K. Jha
3 // Copyright (c) 2019 Patrick Diehl
4 //
5 // Distributed under the Boost Software License, Version 1.0. (See accompanying
6 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
8 
9 #ifndef INP_MESHDECK_H
10 #define INP_MESHDECK_H
11 
12 #include <string>
13 #include "util/utilIO.h"
14 
15 namespace inp {
16 
23 struct MeshDeck {
24 
26  size_t d_dim;
27 
38 
40  std::string d_filename;
41 
44 
46  double d_h;
47 
52 
57 
62 
67  : d_dim(0), d_computeMeshSize(false), d_h(0.),
69 
79  std::string printStr(int nt = 0, int lvl = 0) const {
80  auto tabS = util::io::getTabS(nt);
81  std::ostringstream oss;
82  oss << tabS << "------- MeshDeck --------" << std::endl << std::endl;
83  oss << tabS << "Dimension = " << d_dim << std::endl;
84  oss << tabS << "Spatial discretization type = " << d_spatialDiscretization << std::endl;
85  oss << tabS << "Mesh filename = " << d_filename << std::endl;
86  oss << tabS << "Compute mesh size = " << d_computeMeshSize << std::endl;
87  oss << tabS << "Mesh size = " << d_h << std::endl;
88  oss << tabS << "Is this centroid-based particle mesh = " << d_isCentroidBasedDiscretization <<
89  std::endl;
90  oss << tabS << std::endl;
91 
92  return oss.str();
93  };
94 
102  void print(int nt = 0, int lvl = 0) const { std::cout << printStr(nt, lvl); };
103 };
104 
107 } // namespace inp
108 
109 #endif // INP_MESHDECK_H
Collection of methods and database related to input.
Definition: main.cpp:21
std::string getTabS(int nt)
Generate a string contaning nt tabs.
Definition: utilIO.h:26
Structure to read and store mesh related input data.
Definition: meshDeck.h:23
bool d_keepElementConn
Specify if we keep the element-node connectivity data.
Definition: meshDeck.h:56
std::string d_spatialDiscretization
Tag for spatial discretization.
Definition: meshDeck.h:37
bool d_loadPUMData
Specify if coupling data from PUM is loaded.
Definition: meshDeck.h:61
bool d_computeMeshSize
Flag which indicates if mesh size is to be computed.
Definition: meshDeck.h:43
double d_h
Mesh size.
Definition: meshDeck.h:46
bool d_isCentroidBasedDiscretization
Centroid based discretization.
Definition: meshDeck.h:51
void print(int nt=0, int lvl=0) const
Prints the information about the instance of the object.
Definition: meshDeck.h:102
size_t d_dim
Dimension.
Definition: meshDeck.h:26
std::string printStr(int nt=0, int lvl=0) const
Returns the string containing information about the instance of the object.
Definition: meshDeck.h:79
MeshDeck()
Constructor.
Definition: meshDeck.h:66
std::string d_filename
Filename to read mesh data.
Definition: meshDeck.h:40