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.
output_controller.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 #pragma once
14 
15 // System includes
16 #include <variant>
17 #include <string>
18 
19 // External includes
20 
21 // Project includes
22 #include "containers/model.h"
24 #include "controllers/controller.h"
25 
26 namespace Kratos
27 {
28 
31 
39 class KRATOS_API(KRATOS_CORE) OutputController: public Controller
40 {
41 public:
44 
47 
51 
54  const Model& rModel,
55  Parameters Settings);
56 
58  ~OutputController() override = default;
59 
61  //TODO: Check. It is required by the registry
62  OutputController(OutputController const& rOther) = default;
63 
65  OutputController(OutputController&& rOther) noexcept = default;
66 
70 
72  OutputController& operator=(OutputController const& rOther) = delete;
73 
77 
85  Controller::Pointer Create(
86  Model& rModel,
87  Parameters Settings) const override;
88 
92  int Check() const override;
93 
97  bool Evaluate() const override;
98 
102  void Update() override;
103 
107  std::variant<int, double> GetCurrentControlValue() const;
108 
112  std::variant<int, double> GetInterval() const;
113 
117  std::variant<int, double> GetNextPossibleEvaluateControlValue() const;
118 
122  Parameters GetDefaultParameters() const override;
123 
127 
129  std::string Info() const override;
130 
132  void PrintInfo(std::ostream& rOStream) const override;
133 
135  void PrintData(std::ostream& rOStream) const override;
136 
138 
139 private:
142 
143  Model const * mpModel;
144 
145  std::variant<int, double> mNextPossibleEvaluate;
146 
147  std::variant<int, double> mInterval;
148 
149  std::variant<
150  const Variable<int>*,
151  const Variable<double>*> mpVariable;
152 
153  std::string mModelPartName;
154 
156 
157 }; // Class OutputController
158 
159 } // namespace Kratos.
std::string Info() const override
Turn back information as a string.
Definition: periodic_interface_process.hpp:93
The base class for all Controllers in Kratos.
Definition: controller.h:39
This class aims to manage different model parts across multi-physics simulations.
Definition: model.h:60
Definition: output_controller.h:40
OutputController(OutputController const &rOther)=default
Copy constructor.
OutputController & operator=(OutputController const &rOther)=delete
Assignment operator.
OutputController(OutputController &&rOther) noexcept=default
Move constructor.
KRATOS_CLASS_POINTER_DEFINITION(OutputController)
Pointer definition of OutputController.
~OutputController() override=default
Destructor.
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
Modeler::Pointer Create(const std::string &ModelerName, Model &rModel, const Parameters ModelParameters)
Checks if the modeler is registered.
Definition: modeler_factory.cpp:30
double Evaluate(const PolynomialType &rPolynomial, double x)
Definition: polynomial_utilities.cpp:77
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21