PeriDEM 0.3.0
PeriDEM -- Peridynamics-based high-fidelity model for granular media
Loading...
Searching...
No Matches
input.cpp
Go to the documentation of this file.
1/*
2 * -------------------------------------------
3 * Copyright (c) 2021 - 2026 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#include "input.h"
12#include "geom/geomIncludes.h"
13#include <iostream>
14#include <cmath>
15
17 d_modelDeck_p = j.find("Model") != j.end() ? std::make_unique<ModelDeck>(j["Model"]) : std::make_shared<ModelDeck>();
18 d_outputDeck_p = j.find("Output") != j.end() ? std::make_unique<OutputDeck>(j["Output"]) : std::make_shared<OutputDeck>();
19 d_restartDeck_p = j.find("Restart") != j.end() ? std::make_unique<RestartDeck>(j["Restart"]) : std::make_shared<RestartDeck>();
20 d_testDeck_p = j.find("Test") != j.end() ? std::make_unique<TestDeck>(j["Test"]) : std::make_shared<TestDeck>();
21 d_bcDeck_p = std::make_shared<inp::BCDeck>(j);
22
23 // particle deck
24 d_particleDeck_p = std::make_shared<inp::ParticleDeck>(j, d_modelDeck_p->d_particleSimType);
25
26 // Enable restart when a restart file is provided (Restart.File).
27 if (!d_restartDeck_p->d_file.empty())
28 d_modelDeck_p->d_isRestartActive = true;
29};
std::shared_ptr< inp::ParticleDeck > d_particleDeck_p
Pointer to deck holding particle related data.
Definition input.h:175
std::shared_ptr< inp::TestDeck > d_testDeck_p
Test deck.
Definition input.h:169
std::shared_ptr< inp::RestartDeck > d_restartDeck_p
Pointer to deck holding restart related data.
Definition input.h:166
std::shared_ptr< inp::BCDeck > d_bcDeck_p
Boundary condition deck.
Definition input.h:172
std::shared_ptr< inp::OutputDeck > d_outputDeck_p
Pointer to deck holding output related data.
Definition input.h:163
Input(const json &j=json({}))
Constructor.
Definition input.cpp:16
std::shared_ptr< inp::ModelDeck > d_modelDeck_p
Pointer to deck holding problem related data.
Definition input.h:160
nlohmann::ordered_json json