PeriDEM 0.2.0
PeriDEM -- Peridynamics-based high-fidelity model for granular media
Loading...
Searching...
No Matches
outputDeck.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_OUTPUTDECK_H
12#define INP_OUTPUTDECK_H
13
14#include "util/io.h"
15#include <string>
16#include <vector>
17
18namespace inp {
19
26struct OutputDeck {
27
32 std::string d_outFormat;
33
38 std::string d_path;
39
41 std::vector<std::string> d_outTags;
42
44 size_t d_dtOut;
45
47 size_t d_dtOutOld;
48
57 size_t d_debug;
58
66
68 std::string d_compressType;
69
80 std::string d_outCriteria;
81
87
89 std::vector<double> d_outCriteriaParams;
90
93
96
98 std::string d_tagPPFile;
99
104 : d_outFormat("vtu"), d_path("./"), d_dtOut(0), d_dtOutOld(0), d_debug(0),
106 d_dtTestOut(0), d_tagPPFile("") {};
107
115 std::string printStr(int nt = 0, int lvl = 0) const {
116
117 auto tabS = util::io::getTabS(nt);
118 std::ostringstream oss;
119 oss << tabS << "------- OutputDeck --------" << std::endl << std::endl;
120 oss << tabS << "Output format = " << d_outFormat << std::endl;
121 oss << tabS << "Output path = " << d_path
122 << std::endl;
123 oss << tabS << "Output tags = " << util::io::printStr<std::string>(d_outTags, 0) << std::endl;
124 oss << tabS << "Output time step = " << d_dtOut << std::endl;
125 oss << tabS << "Output time step old = " << d_dtOutOld << std::endl;
126 oss << tabS << "Debug level = " << d_debug << std::endl;
127 oss << tabS << "Perform FE output = " << d_performFEOut << std::endl;
128 oss << tabS << "Output file compression type = " << d_compressType << std::endl;
129 oss << tabS << "Output criteria = " << d_outCriteria << std::endl;
130 oss << tabS << "Output dt criteria = " << d_dtOutCriteria << std::endl;
131 oss << tabS << "Output criteria parameters = " << util::io::printStr<double>(d_outCriteriaParams, 0) << std::endl;
132 oss << tabS << "Perform output = " << d_performOut << std::endl;
133 oss << tabS << "Output time step when test = " << d_dtTestOut << std::endl;
134 oss << tabS << "Tag for postprocessing file = " << d_tagPPFile << std::endl;
135 oss << tabS << std::endl;
136
137 return oss.str();
138 }
139
146 void print(int nt = 0, int lvl = 0) const { std::cout << printStr(nt, lvl); }
147
154 bool isTagInOutput(const std::string &tag) {
155
156 // search for tag in output tag list
157 for (const auto &type : d_outTags)
158 if (tag == type)
159 return true;
160
161 return false;
162 };
163};
164
167} // namespace inp
168
169#endif // INP_OUTPUTDECK_H
Collection of methods and database related to input.
Definition mesh.h:20
std::string getTabS(int nt)
Returns tab spaces of given size.
Definition io.h:40
Structure to read input data for performing simulation output.
Definition outputDeck.h:26
size_t d_dtTestOut
Size of time steps (or frequency) for output operation.
Definition outputDeck.h:95
std::vector< std::string > d_outTags
List of tags of data to be dumped.
Definition outputDeck.h:41
void print(int nt=0, int lvl=0) const
Prints the information about the object.
Definition outputDeck.h:146
std::string d_compressType
Compressor type for .vtu files.
Definition outputDeck.h:68
size_t d_dtOutCriteria
Specify output frequency if output criteria is met.
Definition outputDeck.h:86
std::string printStr(int nt=0, int lvl=0) const
Returns the string containing printable information about the object.
Definition outputDeck.h:115
OutputDeck()
Constructor.
Definition outputDeck.h:103
std::string d_outCriteria
Specify output criteria to change output frequency.
Definition outputDeck.h:80
size_t d_dtOut
Size of time steps (or frequency) for output operation.
Definition outputDeck.h:44
bool d_performFEOut
Flag specifying if element-node connectivity should not be dumped.
Definition outputDeck.h:65
std::string d_outFormat
Output format: currently supports vtu, msh, legacy_vtk output.
Definition outputDeck.h:32
std::string d_path
Output Path where the files will be written.
Definition outputDeck.h:38
std::string d_tagPPFile
Tag for postprocessing file.
Definition outputDeck.h:98
size_t d_debug
Flag specifying debug level TODO verify below value-description text value = 0: code is almost comple...
Definition outputDeck.h:57
bool d_performOut
Perform vtu output.
Definition outputDeck.h:92
size_t d_dtOutOld
Size of time steps (or frequency) for output operation.
Definition outputDeck.h:47
std::vector< double > d_outCriteriaParams
List of parameters required in checking output criteria.
Definition outputDeck.h:89
bool isTagInOutput(const std::string &tag)
Searches list of tags and returns true if the asked tag is in the list.
Definition outputDeck.h:154