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.
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: Daniel Diez
11 //
12 
13 #pragma once
14 
15 // System includes
16 
17 // External includes
18 
19 // Project includes
20 #include "containers/model.h"
22 
23 namespace Kratos
24 {
25 
28 
39 {
40 public:
43 
46 
50 
52  Controller() noexcept = default;
53 
55  virtual ~Controller() = default;
56 
58  //TODO: Check. It is required by the registry
60 
62  Controller(Controller&& rOther) noexcept = default;
63 
67 
69  Controller& operator=(Controller const& rOther) = delete;
70 
74 
82  virtual Controller::Pointer Create(
83  Model& rModel,
84  Parameters ThisParameters) const = 0;
85 
89  virtual int Check() const
90  {
91  return 0;
92  }
93 
97  virtual bool Evaluate() const = 0;
98 
102  virtual void Update() {}
103 
108  {
109  return Parameters(R"({})" );
110  }
111 
115 
117  virtual std::string Info() const
118  {
119  return "Controller";
120  }
121 
123  virtual void PrintInfo(std::ostream& rOStream) const
124  {
125  rOStream << "Controller";
126  }
127 
129  virtual void PrintData(std::ostream& rOStream) const
130  {
131  }
132 
134 }; // Class Controller
135 
136 
139 
141 std::istream& operator >> (std::istream& rIStream, Controller& rThis);
142 
144 std::ostream& operator << (std::ostream& rOStream, const Controller& rThis)
145 {
146  rThis.PrintInfo(rOStream);
147  rOStream << std::endl;
148  rThis.PrintData(rOStream);
149 
150  return rOStream;
151 }
152 
154 } // namespace Kratos.
The base class for all Controllers in Kratos.
Definition: controller.h:39
virtual void Update()
Update the controller parameters.
Definition: controller.h:102
virtual void PrintInfo(std::ostream &rOStream) const
Print information about this object.
Definition: controller.h:123
Controller() noexcept=default
Default constructor.
virtual int Check() const
Checks that input conditions are correct.
Definition: controller.h:89
virtual std::string Info() const
Turn back information as a string.
Definition: controller.h:117
virtual void PrintData(std::ostream &rOStream) const
Print object's data.
Definition: controller.h:129
KRATOS_CLASS_POINTER_DEFINITION(Controller)
Pointer definition of Controller.
virtual Controller::Pointer Create(Model &rModel, Parameters ThisParameters) const =0
This method creates an pointer of the controller.
virtual Parameters GetDefaultParameters() const
This method provides the defaults parameters to avoid conflicts between the different constructors.
Definition: controller.h:107
virtual bool Evaluate() const =0
Using input data, returns bool.
This class aims to manage different model parts across multi-physics simulations.
Definition: model.h:60
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
Kratos::PeriodicInterfaceProcess Process operator(std::istream &rIStream, PeriodicInterfaceProcess &rThis)
input stream function
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
default
Definition: generate_gid_list_file.py:35
tuple const
Definition: ode_solve.py:403