NLMech  0.1.0
input.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_INPUT_H
10 #define INP_INPUT_H
11 
12 #include <string>
13 #include <iostream>
14 #include <stdio.h>
15 
31 namespace inp {
32 
33 // forward declarations of decks
34 struct FractureDeck;
35 struct InitialConditionDeck;
36 struct InteriorFlagsDeck;
37 struct LoadingDeck;
38 struct MassMatrixDeck;
39 struct MaterialDeck;
40 struct MeshDeck;
41 struct ModelDeck;
42 struct NeighborDeck;
43 struct OutputDeck;
44 struct PolicyDeck;
45 struct QuadratureDeck;
46 struct RestartDeck;
47 struct SolverDeck;
48 struct AbsorbingCondDeck;
49 
63 class Input {
64 
65 public:
70  explicit Input(const std::string &filename);
71 
82 
88 
94 
100 
106 
112 
118 
124 
130 
136 
142 
148 
154 
160 
166 
179  const std::string getSpatialDiscretization();
180 
192  std::string printStr(int nt = 0, int lvl = 0) const;
193 
201  void print(int nt = 0, int lvl = 0) const { std::cout << printStr(nt, lvl); };
202 
203 private:
214  void setFractureDeck();
215 
220 
224  void setInteriorFlagsDeck();
225 
229  void setLoadingDeck();
230 
234  void setMassMatrixDeck();
235 
239  void setMaterialDeck();
240 
244  void setMeshDeck();
245 
249  void setModelDeck();
250 
254  void setNeighborDeck();
255 
259  void setOutputDeck();
260 
264  void setPolicyDeck();
265 
269  void setQuadratureDeck();
270 
274  void setRestartDeck();
275 
279  void setAbsorbingCondDeck();
280 
284  void setSolverDeck();
285 
294  std::string d_inputFilename;
295 
310 
319 
324 
331 
338 
345 
352 
360 
367 
375 
382 
390 
396 
404 
409 
411 };
412 
415 } // namespace inp
416 
417 #endif // INPUT_H
A class to read input file.
Definition: input.h:63
const std::string getSpatialDiscretization()
Get the name of spatial discretization.
Definition: input.cpp:117
inp::MassMatrixDeck * getMassMatrixDeck()
Get the pointer to mass matrix deck.
Definition: input.cpp:89
Input(const std::string &filename)
Constructor.
Definition: input.cpp:42
inp::InitialConditionDeck * d_initialConditionDeck_p
Pointer to deck holding initial condition related data.
Definition: input.h:318
inp::PolicyDeck * d_policyDeck_p
Pointer to deck holding policy related data.
Definition: input.h:381
inp::SolverDeck * d_solverDeck_p
Pointer to deck holding solver related data.
Definition: input.h:403
void setOutputDeck()
Read data into output deck and store its pointer.
Definition: input.cpp:701
inp::MassMatrixDeck * d_massMatrixDeck_p
Pointer to deck holding mass matrix calculation related data.
Definition: input.h:337
inp::RestartDeck * d_restartDeck_p
Pointer to deck holding restart related data such as restart filename and restart time step.
Definition: input.h:395
void setInteriorFlagsDeck()
Read data into interior flags deck and store its pointer.
Definition: input.cpp:357
inp::FractureDeck * d_fractureDeck_p
Pointer to deck holding fracture related data.
Definition: input.h:309
void setModelDeck()
Read data into model deck and store its pointer.
Definition: input.cpp:124
inp::ModelDeck * getModelDeck()
Get the pointer to model deck.
Definition: input.cpp:97
void setSolverDeck()
Read data into solver deck and store its pointer.
Definition: input.cpp:751
void setMaterialDeck()
Read data into material deck and store its pointer.
Definition: input.cpp:612
inp::QuadratureDeck * getQuadratureDeck()
Get the pointer to quadrature deck.
Definition: input.cpp:105
void setPolicyDeck()
Read data into policy deck and store its pointer.
Definition: input.cpp:739
inp::FractureDeck * getFractureDeck()
Get the pointer to fracture deck.
Definition: input.cpp:77
std::string d_inputFilename
Name of input file.
Definition: input.h:294
inp::MaterialDeck * d_materialDeck_p
Pointer to deck holding material related data.
Definition: input.h:344
void print(int nt=0, int lvl=0) const
Prints the information about the instance of the object.
Definition: input.h:201
void setAbsorbingCondDeck()
Read data into absorbing condition deck and store its pointer.
Definition: input.cpp:766
inp::QuadratureDeck * d_quadratureDeck_p
Pointer to deck holding quadrature point approximation related data.
Definition: input.h:389
inp::AbsorbingCondDeck * d_absorbingCondDeck_p
Pointer to deck holding absorbing condition related data.
Definition: input.h:408
inp::ModelDeck * d_modelDeck_p
Pointer to deck holding problem related data.
Definition: input.h:359
void setRestartDeck()
Read data into restart deck and store its pointer.
Definition: input.cpp:190
inp::MaterialDeck * getMaterialDeck()
Get the pointer to material deck.
Definition: input.cpp:93
inp::InteriorFlagsDeck * d_interiorFlagsDeck_p
Pointer to deck holding interior flags information.
Definition: input.h:323
void setQuadratureDeck()
Read data into quadrature deck and store its pointer.
Definition: input.cpp:265
inp::LoadingDeck * d_loadingDeck_p
Pointer to deck holding loading related data.
Definition: input.h:330
void setInitialConditionDeck()
Read data into initial condition deck and store its pointer.
Definition: input.cpp:403
inp::LoadingDeck * getLoadingDeck()
Get the pointer to loading deck.
Definition: input.cpp:87
std::string printStr(int nt=0, int lvl=0) const
Returns the string containing information about the instance of the object.
Definition: input.cpp:901
void setLoadingDeck()
Read data into loading deck and store its pointer.
Definition: input.cpp:438
inp::SolverDeck * getSolverDeck()
Get the pointer to solver deck.
Definition: input.cpp:111
inp::InteriorFlagsDeck * getInteriorFlagsDeck()
Get the pointer to interior flags deck.
Definition: input.cpp:83
inp::NeighborDeck * getNeighborDeck()
Get the pointer to neighbor list deck.
Definition: input.cpp:99
inp::MeshDeck * getMeshDeck()
Get the pointer to mesh deck.
Definition: input.cpp:95
inp::InitialConditionDeck * getInitialConditionDeck()
Get the pointer to initial condition deck.
Definition: input.cpp:79
inp::RestartDeck * getRestartDeck()
Get the pointer to restart deck.
Definition: input.cpp:109
inp::OutputDeck * getOutputDeck()
Get the pointer to output deck.
Definition: input.cpp:101
inp::AbsorbingCondDeck * getAbsorbingCondDeck()
Get the pointer to absorbing condition deck.
Definition: input.cpp:113
inp::NeighborDeck * d_neighborDeck_p
Pointer to deck holding neighbor list related data.
Definition: input.h:366
inp::PolicyDeck * getPolicyDeck()
Get the pointer to policy info deck.
Definition: input.cpp:103
inp::MeshDeck * d_meshDeck_p
Pointer to deck holding geometry related data.
Definition: input.h:351
void setFractureDeck()
Read data into fracture deck and store its pointer.
Definition: input.cpp:290
inp::OutputDeck * d_outputDeck_p
Pointer to deck holding output related data.
Definition: input.h:374
void setNeighborDeck()
Read data into neighbor list deck and store its pointer.
Definition: input.cpp:277
void setMassMatrixDeck()
Read data into mass matrix deck and store its pointer.
Definition: input.cpp:255
void setMeshDeck()
Read data into mesh deck and store its pointer.
Definition: input.cpp:214
Collection of methods and database related to input.
Definition: main.cpp:21
Structure to read and store mesh related input data.
Definition: absborbingCondDeck.h:82
Structure to read and store fracture related input data.
Definition: fractureDeck.h:227
Structure to read and store policy data.
Definition: initialConditionDeck.h:78
Structure to read and store input data for interior flags (no-fail region)
Definition: interiorFlagsDeck.h:25
Structure to read and store policy data.
Definition: loadingDeck.h:144
Structure to read and store mass matrix related input data.
Definition: massMatrixDeck.h:23
Structure to read and store material related data.
Definition: materialDeck.h:226
Structure to read and store mesh related input data.
Definition: meshDeck.h:23
Structure to read and store model related input data.
Definition: modelDeck.h:23
Structure to read and store neighbor list related input data.
Definition: neighborDeck.h:22
Structure to read input data for performing simulation output.
Definition: outputDeck.h:24
Structure to read and store policy related input data.
Definition: policyDeck.h:23
Structure to read and store quadrature point related input data.
Definition: quadratureDeck.h:23
Structure to read and store restart related data input.
Definition: restartDeck.h:23
Structure to read and store solver related input data.
Definition: solverDeck.h:24