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.
rans_variable_difference_norm_calculation_utility.h
Go to the documentation of this file.
1 // | / |
2 // ' / __| _` | __| _ \ __|
3 // . \ | ( | | ( |\__ `
4 // _|\_\_| \__,_|\__|\___/ ____/
5 // Multi-Physics
6 //
7 // License: BSD License
8 // Kratos default license: kratos/license.txt
9 //
10 // Main authors: Suneth Warnakulasuriya
11 //
12 
13 #if !defined(KRATOS_RANS_VARIABLE_DIFFERENCE_NORM_CALCULATION_UTILITY_H_INCLUDED)
14 #define KRATOS_RANS_VARIABLE_DIFFERENCE_NORM_CALCULATION_UTILITY_H_INCLUDED
15 
16 // System includes
17 #include <tuple>
18 
19 // External includes
20 
21 // Project includes
22 #include "containers/variable.h"
23 #include "includes/define.h"
24 #include "includes/model_part.h"
25 
26 // Application includes
27 
28 namespace Kratos
29 {
32 
38 template <typename TDataType>
39 class KRATOS_API(RANS_APPLICATION) RansVariableDifferenceNormsCalculationUtility
40 {
41 public:
45 
49 
54  const ModelPart& rModelPart,
55  const Variable<TDataType>& rVariable)
56  : mrModelPart(rModelPart), mrVariable(rVariable)
57  {
58  }
59 
64  {
65  mData.clear();
66  }
67 
71 
72  void InitializeCalculation();
73 
74  std::tuple<double, double> CalculateDifferenceNorm();
75 
79 
81  std::string Info() const
82  {
83  std::stringstream buffer;
84  buffer << "RansVariableDifferenceNormsCalculationUtility";
85  return buffer.str();
86  }
88  void PrintInfo(std::ostream& rOStream) const
89  {
90  rOStream << "RansVariableDifferenceNormsCalculationUtility";
91  }
92 
93 private:
96  const ModelPart& mrModelPart;
97  const Variable<TDataType>& mrVariable;
98  std::vector<TDataType> mData;
99 
101 
102 }; // Class RansVariableDifferenceNormsCalculationUtility
103 
107 
108 template <typename TDataType>
109 inline std::istream& operator>>(
110  std::istream& rIStream,
112 
114 template <typename TDataType>
115 inline std::ostream& operator<<(
116  std::ostream& rOStream,
118 {
119  rThis.PrintInfo(rOStream);
120  rOStream << " : " << std::endl;
121  rThis.PrintData(rOStream);
122  return rOStream;
123 }
124 
126 
127 } // namespace Kratos.
128 
129 #endif // KRATOS_RANS_VARIABLE_DIFFERENCE_NORM_CALCULATION_UTILITY_H_INCLUDED defined
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
This class is used to calculate difference norms of a given variable.
Definition: rans_variable_difference_norm_calculation_utility.h:40
RansVariableDifferenceNormsCalculationUtility(const ModelPart &rModelPart, const Variable< TDataType > &rVariable)
Definition: rans_variable_difference_norm_calculation_utility.h:53
void PrintInfo(std::ostream &rOStream) const
Print information about this object.
Definition: rans_variable_difference_norm_calculation_utility.h:88
~RansVariableDifferenceNormsCalculationUtility()
Definition: rans_variable_difference_norm_calculation_utility.h:63
std::string Info() const
Turn back information as a string.
Definition: rans_variable_difference_norm_calculation_utility.h:81
KRATOS_CLASS_POINTER_DEFINITION(RansVariableDifferenceNormsCalculationUtility)
Variable class contains all information needed to store and retrive data from a data container.
Definition: variable.h:63
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
std::istream & operator>>(std::istream &rIStream, LinearMasterSlaveConstraint &rThis)
input stream function
std::ostream & operator<<(std::ostream &rOStream, const LinearMasterSlaveConstraint &rThis)
output stream function
Definition: linear_master_slave_constraint.h:432