PeriDEM 0.2.0
PeriDEM -- Peridynamics-based high-fidelity model for granular media
Loading...
Searching...
No Matches
input.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_INPUT_H
12#define INP_INPUT_H
13
14#include <string>
15#include <vector>
16#include <memory>
17
33namespace inp {
34
35// forward declarations of decks
36struct MaterialDeck;
37struct MeshDeck;
38struct ModelDeck;
39struct OutputDeck;
40struct RestartDeck;
41struct ParticleDeck;
42struct ParticleZone;
43struct WallZone;
44struct Zone;
45struct ContactDeck;
46struct ContactPairDeck;
47
61class Input {
62
63public:
69 explicit Input(std::string filename = "", bool createDefault = false);
70
80 std::shared_ptr<inp::MaterialDeck> getMaterialDeck();
81
86 std::shared_ptr<inp::MeshDeck> getMeshDeck();
87
92 std::shared_ptr<inp::ModelDeck> getModelDeck();
93
98 std::shared_ptr<inp::OutputDeck> getOutputDeck();
99
104 std::shared_ptr<inp::RestartDeck> getRestartDeck();
105
110 std::shared_ptr<inp::ParticleDeck> getParticleDeck();
111
116 std::shared_ptr<inp::ContactDeck> getContactDeck();
117
122 bool isMultiParticle();
123
128 bool isPeriDEM();
131private:
143
144
148 void setMaterialDeck();
149
153 void setMeshDeck();
154
158 void setModelDeck();
159
163 void setOutputDeck();
164
168 void setRestartDeck();
169
173 void setParticleDeck();
174
182 void setZoneMaterialDeck(std::vector<std::string> s_config,
183 inp::MaterialDeck *m_deck, size_t zone_id);
184
191 void setZoneMeshDeck(std::vector<std::string> s_config,
192 inp::MeshDeck *mesh_deck);
193
200 void setZoneData(std::vector<std::string> s_config,
201 inp::Zone *zone_data);
202
209 void setParticleData(std::string string_zone,
210 inp::ParticleZone *particle_data);
211
215 void setContactDeck();
216
225 std::string d_inputFilename;
226
229
242 std::shared_ptr<inp::MaterialDeck> d_materialDeck_p;
243
249 std::shared_ptr<inp::MeshDeck> d_meshDeck_p;
250
257 std::shared_ptr<inp::ModelDeck> d_modelDeck_p;
258
265 std::shared_ptr<inp::OutputDeck> d_outputDeck_p;
266
271 std::shared_ptr<inp::RestartDeck> d_restartDeck_p;
272
278 std::shared_ptr<inp::ParticleDeck> d_particleDeck_p;
279
285 std::shared_ptr<inp::ContactDeck> d_contactDeck_p;
286
288};
289
292} // namespace inp
293
294#endif // INPUT_H
A class to read input file.
Definition input.h:61
std::shared_ptr< inp::ParticleDeck > getParticleDeck()
Get the pointer to particle deck.
Definition input.cpp:181
std::shared_ptr< inp::ParticleDeck > d_particleDeck_p
Pointer to deck holding particle related data.
Definition input.h:278
void setParticleData(std::string string_zone, inp::ParticleZone *particle_data)
Read particle data.
Definition input.cpp:1278
std::shared_ptr< inp::MaterialDeck > getMaterialDeck()
Get the pointer to material deck.
Definition input.cpp:166
std::shared_ptr< inp::ModelDeck > getModelDeck()
Get the pointer to model deck.
Definition input.cpp:172
void setOutputDeck()
Read data into output deck and store its pointer.
Definition input.cpp:998
std::shared_ptr< inp::RestartDeck > d_restartDeck_p
Pointer to deck holding restart related data such as restart filename and restart time step.
Definition input.h:271
std::shared_ptr< inp::ContactDeck > getContactDeck()
Get the pointer to contact deck.
Definition input.cpp:183
void setModelDeck()
Read data into model deck and store its pointer.
Definition input.cpp:189
void setMaterialDeck()
Read data into material deck and store its pointer.
Definition input.cpp:915
void setZoneMaterialDeck(std::vector< std::string > s_config, inp::MaterialDeck *m_deck, size_t zone_id)
Read data into material deck and store its pointer.
Definition input.cpp:1048
std::shared_ptr< inp::MeshDeck > d_meshDeck_p
Pointer to deck holding geometry related data.
Definition input.h:249
void setParticleDeck()
Read data into particle deck and store its pointer.
Definition input.cpp:292
std::string d_inputFilename
Name of input file.
Definition input.h:225
void createDefaultInputConfiguration()
Create default input configuration.
std::shared_ptr< inp::OutputDeck > d_outputDeck_p
Pointer to deck holding output related data.
Definition input.h:265
void setRestartDeck()
Read data into restart deck and store its pointer.
Definition input.cpp:835
void setZoneData(std::vector< std::string > s_config, inp::Zone *zone_data)
Read zone data.
Definition input.cpp:1244
std::shared_ptr< inp::MaterialDeck > d_materialDeck_p
Pointer to deck holding material related data.
Definition input.h:242
bool d_createDefault
Specify if create defaul objects in Input.
Definition input.h:228
std::shared_ptr< inp::MeshDeck > getMeshDeck()
Get the pointer to mesh deck.
Definition input.cpp:169
void setContactDeck()
Read data into particle deck and store its pointer.
Definition input.cpp:665
bool isMultiParticle()
Get particle simulation type.
Definition input.cpp:154
std::shared_ptr< inp::RestartDeck > getRestartDeck()
Get the pointer to restart deck.
Definition input.cpp:178
std::shared_ptr< inp::ModelDeck > d_modelDeck_p
Pointer to deck holding problem related data.
Definition input.h:257
std::shared_ptr< inp::ContactDeck > d_contactDeck_p
Pointer to deck holding particle related data.
Definition input.h:285
void setZoneMeshDeck(std::vector< std::string > s_config, inp::MeshDeck *mesh_deck)
Read data into mesh deck and store its pointer.
Definition input.cpp:1175
bool isPeriDEM()
Specify if PeriDEM model should be run.
Definition input.cpp:158
std::shared_ptr< inp::OutputDeck > getOutputDeck()
Get the pointer to output deck.
Definition input.cpp:175
void setMeshDeck()
Read data into mesh deck and store its pointer.
Definition input.cpp:866
Collection of methods and database related to input.
Definition mesh.h:20
Structure to read and store material related data.
Structure to read and store mesh related input data.
Definition meshDeck.h:26
User-input data for particle zone.
Definition zoneDeck.h:78
User-input data for zones.
Definition zoneDeck.h:27