KratosMultiphysics
KRATOS Multiphysics (Kratos) is a framework for building parallel, multi-disciplinary simulation software, aiming at modularity, extensibility, and high performance. Kratos is written in C++, and counts with an extensive Python interface.
vtk_eigen_output.h
Go to the documentation of this file.
1 // KRATOS ___| | | |
2 // \___ \ __| __| | | __| __| | | __| _` | |
3 // | | | | | ( | | | | ( | |
4 // _____/ \__|_| \__,_|\___|\__|\__,_|_| \__,_|_| MECHANICS
5 //
6 // License: BSD License
7 // license: StructuralMechanicsApplication/license.txt
8 //
9 // Main authors: Philipp Bucher
10 //
11 
12 #pragma once
13 
14 // System includes
15 
16 // External includes
17 
18 // Project includes
20 
21 namespace Kratos
22 {
26 class KRATOS_API(STRUCTURAL_MECHANICS_APPLICATION) VtkEigenOutput : public VtkOutput
27 {
28 public:
29 
32 
35 
36  explicit VtkEigenOutput(
37  ModelPart& rModelPart,
38  Parameters EigenOutputParameters,
39  Parameters VtkParameters)
40  : VtkOutput(rModelPart, VtkParameters),
41  mEigenOutputSettings(EigenOutputParameters) {};
42 
44  virtual ~VtkEigenOutput() = default;
45 
49 
50  void PrintEigenOutput(
51  const std::string& rLabel,
52  const int AnimationStep,
53  const std::vector<const Variable<double>*>& rRequestedDoubleResults,
54  const std::vector<const Variable<array_1d<double,3>>*>& rRequestedVectorResults);
55 
57 
59  std::string Info() const override
60  {
61  return " VtkEigenOutput object ";
62  }
63 
68  void PrintInfo(std::ostream& rOStream) const override
69  {
70  rOStream << " VtkEigenOutput object " << std::endl;
71  }
72 
74  void PrintData(std::ostream& rOStream) const override
75  {
76  }
77 
78 private:
81 
82  int mLastWrittenAnimationStepIndex = -1;
83  Parameters mEigenOutputSettings;
84 
88 
90  void OpenOutputFile(
91  const std::string& rFileName,
92  const std::ios::openmode OpenModeFlags,
93  std::ofstream& rOutputFile) const;
94 
96  std::string GetEigenOutputFileName(const int AnimationStep) const;
97 
99  void WriteScalarEigenVariable(
100  const ModelPart::NodesContainerType& rNodes,
101  const Variable<double>& rVariable,
102  const std::string& rLabel,
103  std::ofstream& rFileStream) const;
104 
106  void WriteVectorEigenVariable(
107  const ModelPart::NodesContainerType& rNodes,
108  const Variable<array_1d<double, 3>>& rVariable,
109  const std::string& rLabel,
110  std::ofstream& rFileStream) const;
111 
113 };
114 
115 } // namespace Kratos
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
MeshType::NodesContainerType NodesContainerType
Nodes container. Which is a vector set of nodes with their Id's as key.
Definition: model_part.h:128
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
VtkEigenOutput A simple class to write Eigenresults in Vtk format.
Definition: vtk_eigen_output.h:27
VtkEigenOutput(ModelPart &rModelPart, Parameters EigenOutputParameters, Parameters VtkParameters)
Definition: vtk_eigen_output.h:36
void PrintInfo(std::ostream &rOStream) const override
Prints information about the class.
Definition: vtk_eigen_output.h:68
virtual ~VtkEigenOutput()=default
Destructor.
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: vtk_eigen_output.h:74
KRATOS_CLASS_POINTER_DEFINITION(VtkEigenOutput)
Pointer definition of VtkEigenOutput.
std::string Info() const override
Turn back information as a string.
Definition: vtk_eigen_output.h:59
VtkOutput A simple class that has functionality to write vtk output.
Definition: vtk_output.h:35
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21