14 #ifndef KRATOS_UNV_OUTPUT_H_INCLUDED
15 #define KRATOS_UNV_OUTPUT_H_INCLUDED
45 ELEMENTS_DATASET = 2412,
46 RESULTS_DATASET = 2414
52 DATA_AT_NODES_ON_ELEMENTS = 3,
54 DATA_ON_ELEMENTS_AT_NODES = 6
68 COMPLEX_EIGENVALUE_FIRST_ORDER = 3,
70 FREQUENCY_RESPONSE = 5,
72 COMPLEX_EIGENVALUE_SECOND_ORDER = 7,
73 STATIC_NON_LINEAR = 9,
74 CRAIG_BAMPTON_CONSTRAINT_MODES = 10,
75 EQUIVALENT_ATTACHMENT_MODES = 11,
76 EFFECTIVE_MASS_MODES = 12,
77 EFFECTIVE_MASS_MATRIX = 13,
78 EFFECTIVE_MASS_MATRIX_COPY = 14,
79 DISTRIBUTED_LOAD_LOAD_DISTRIBUTION = 15,
80 DISTRIBUTED_LOAD_ATTACHMENT_MODES = 16
87 D3_DOF_GLOBAL_TRANSLATION_VECTOR = 2,
88 D3_DOF_GLOBAL_TRANSLATION_ROTATION_VECTOR = 3,
89 SYMMETRIC_GLOBAL_TENSOR = 4,
100 SINGLE_PRECISION_FLOATING_POINT = 2,
101 DOUBLE_PRECISION_FLOATING_POINT = 4,
102 SINGLE_PRECISION_COMPLEX = 5,
103 DOUBLE_PRECISION_COMPLEX = 6
108 template <
typename Enumeration>
118 void InitializeOutputFile();
136 void WriteElements();
144 void WriteNodalResults(
const Variable<bool>& rVariable,
const double timeStep);
145 void WriteNodalResults(
const Variable<int>& rVariable,
const double timeStep);
146 void WriteNodalResults(
const Variable<double>& rVariable,
const double timeStep);
148 void WriteNodalResults(
const Variable<Vector>& rVariable,
const double timeStep);
149 void WriteNodalResults(
const Variable<Matrix>& rVariable,
const double timeStep);
174 void WriteNodalResultValues(std::ofstream &outputFile,
const Node&
node,
const Variable<bool>& rVariable);
175 void WriteNodalResultValues(std::ofstream &outputFile,
const Node&
node,
const Variable<int>& rVariable);
187 template<
class TVariablebleType>
189 if(rVariable == VELOCITY)
return 11;
190 if(rVariable == TEMPERATURE)
return 5;
191 if(rVariable == PRESSURE)
return 117;
224 template<
class TVariablebleType>
226 std::ofstream outputFile;
227 outputFile.open(mOutputFileName,
std::ios::out | std::ios::app);
229 std::string dataSetName =
"NodalResults";
230 const std::string& dataSetLabel = rVariable.Name();
232 outputFile << std::setw(6) <<
"-1" <<
"\n";
233 outputFile << std::setw(6) << as_integer(DatasetID::RESULTS_DATASET) <<
"\n";
235 outputFile << std::setw(10) << dataSetLabel <<
"\n";
236 outputFile << std::setw(6) << dataSetName <<
"\n";
237 outputFile << std::setw(10) << as_integer(DatasetLocation::DATA_AT_NODES) <<
"\n";
240 outputFile <<
"" <<
"\n";
241 outputFile <<
"" <<
"\n";
242 outputFile <<
"" <<
"\n";
243 outputFile <<
"" <<
"\n";
244 outputFile <<
"" <<
"\n";
247 outputFile << std::setw(10) << as_integer(ModelType::STRUCTURAL);
248 outputFile << std::setw(10) << as_integer(AnalysisType::TRANSIENT);
249 outputFile << std::setw(10) << as_integer(GetDataType(rVariable));
250 outputFile << std::setw(10) << GetUnvVariableName(rVariable);
251 outputFile << std::setw(10) << as_integer(DataType::SINGLE_PRECISION_FLOATING_POINT);
252 outputFile << std::setw(10) << numComponents;
256 outputFile << std::setw(10) << 0;
257 outputFile << std::setw(10) << timeStep;
258 outputFile << std::setw(10) << 0;
259 outputFile << std::setw(10) << 0;
260 outputFile << std::setw(10) << 0;
261 outputFile << std::setw(10) << 1;
262 outputFile << std::setw(10) << timeStep;
263 outputFile << std::setw(10) << 0;
267 outputFile << std::setw(10) << 0;
268 outputFile << std::setw(10) << 0;
272 outputFile << std::setw(13) << timeStep * 0.1;
273 outputFile << std::setw(13) <<
"0.00000E+00";
274 outputFile << std::setw(13) <<
"0.00000E+00";
275 outputFile << std::setw(13) <<
"0.00000E+00";
276 outputFile << std::setw(13) <<
"0.00000E+00";
277 outputFile << std::setw(13) <<
"0.00000E+00";
281 outputFile << std::setw(13) <<
"0.00000E+00";
282 outputFile << std::setw(13) <<
"0.00000E+00";
283 outputFile << std::setw(13) <<
"0.00000E+00";
284 outputFile << std::setw(13) <<
"0.00000E+00";
285 outputFile << std::setw(13) <<
"0.00000E+00";
286 outputFile << std::setw(13) <<
"0.00000E+00";
290 for (
auto &node_i : mrOutputModelPart.Nodes()) {
291 int node_label = node_i.Id();
292 outputFile << std::setw(6) << node_label <<
"\n";
293 WriteNodalResultValues(outputFile, node_i, rVariable);
296 outputFile << std::setw(6) <<
"-1" <<
"\n";
303 std::string mOutputFileName;
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
This class defines the node.
Definition: node.h:65
Provides a tool to write UNV files.
Definition: unv_output.h:40
AnalysisType
Definition: unv_output.h:64
void WriteNodalResultRecords(const TVariablebleType &rVariable, const int numComponents, const double timeStep)
Writes a result dataset using the results in node mode.
Definition: unv_output.h:225
KRATOS_CLASS_POINTER_DEFINITION(UnvOutput)
DataCharacteristics
Definition: unv_output.h:84
DataType
Definition: unv_output.h:98
int GetUnvVariableName(const TVariablebleType &rVariable)
Get the id of the UNV variable name corresponding to rVariable. 1000+ if none found.
Definition: unv_output.h:188
DatasetID
Definition: unv_output.h:43
DatasetLocation
Definition: unv_output.h:49
auto as_integer(Enumeration const value) -> typename std::underlying_type< Enumeration >::type
Definition: unv_output.h:109
ModelType
Definition: unv_output.h:57
Variable class contains all information needed to store and retrive data from a data container.
Definition: variable.h:63
void WriteMesh(GidIOType &dummy, GidIOType::MeshType &rThisMesh)
Definition: add_custom_io_to_python.cpp:74
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
type
Definition: generate_gid_list_file.py:35
out
Definition: isotropic_damage_automatic_differentiation.py:200
Definition: mesh_converter.cpp:38