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.
apply_sinusoidal_function_process.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: Miguel Maso Sotomayor
11 //
12 
13 #ifndef KRATOS_APPLY_SINUSOIDAL_FUNCTION_PROCESS_H_INCLUDED
14 #define KRATOS_APPLY_SINUSOIDAL_FUNCTION_PROCESS_H_INCLUDED
15 
16 
17 // System includes
18 #include <iostream>
19 
20 
21 // External includes
22 
23 
24 // Project includes
25 #include "includes/define.h"
26 #include "processes/process.h"
27 #include "includes/model_part.h"
29 
30 
31 namespace Kratos
32 {
35 
38 
42 
46 
50 
54 
60 template< class TVarType >
61 class KRATOS_API(SHALLOW_WATER_APPLICATION) ApplySinusoidalFunctionProcess : public Process
62 {
63 public:
66 
67  typedef std::size_t IndexType;
68  typedef Node NodeType;
69 
72 
76 
79  ModelPart& rThisModelPart,
80  TVarType& rThisVariable,
81  Parameters& rThisParameters
82  );
83 
86 
90 
94 
98  void ExecuteInitializeSolutionStep() override;
99 
103  int Check() override;
104 
108 
109 
113 
114 
118 
120  virtual std::string Info() const override
121  {
122  std::stringstream buffer;
123  buffer << "ApplySinusoidalFunctionProcess" ;
124  return buffer.str();
125  }
126 
128  virtual void PrintInfo(std::ostream& rOStream) const override {rOStream << "ApplySinusoidalFunctionProcess";}
129 
131  virtual void PrintData(std::ostream& rOStream) const override {}
132 
133 
137 
138 
140 
141 private:
144 
145 
149 
150  ModelPart& mrModelPart;
151  const TVarType& mrVariable;
152  array_1d<double,3> mDirection;
153  double mAmplitude;
154  double mFrequency;
155  double mWavenumber;
156  double mPhase;
157  double mShift;
158  double mSmoothTime;
159  Vector mSmoothTimes;
160 
164 
165 
169 
170  const Parameters GetDefaultParameters() const override;
171 
172  double Function(const array_1d<double,3>& rCoordinates, const double& rTime);
173 
174  double SmoothFactor(const double& rTime);
175 
179 
180 
184 
185 
189 
192 
195 
196 
198 
199 }; // Class ApplySinusoidalFunctionProcess
200 
202 
205 
206 
210 
211 // /// input stream function
212 // inline std::istream& operator >> (std::istream& rIStream,
213 // ApplySinusoidalFunctionProcess& rThis);
214 
215 // /// output stream function
216 // inline std::ostream& operator << (std::ostream& rOStream,
217 // const ApplySinusoidalFunctionProcess& rThis)
218 // {
219 // rThis.PrintInfo(rOStream);
220 // rOStream << std::endl;
221 // rThis.PrintData(rOStream);
222 
223 // return rOStream;
224 // }
225 
227 
229 
230 } // namespace Kratos.
231 
232 #endif // KRATOS_APPLY_SINUSOIDAL_FUNCTION_PROCESS_H_INCLUDED defined
PeriodicInterfaceProcess & operator=(const PeriodicInterfaceProcess &)=delete
The aim of this process is to generate sinusoidal waves.
Definition: apply_sinusoidal_function_process.h:62
virtual std::string Info() const override
Turn back information as a string.
Definition: apply_sinusoidal_function_process.h:120
~ApplySinusoidalFunctionProcess() override
Destructor.
Definition: apply_sinusoidal_function_process.h:85
virtual void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: apply_sinusoidal_function_process.h:128
Node NodeType
Definition: apply_sinusoidal_function_process.h:68
std::size_t IndexType
Definition: apply_sinusoidal_function_process.h:67
KRATOS_CLASS_POINTER_DEFINITION(ApplySinusoidalFunctionProcess)
Pointer definition of ApplySinusoidalFunctionProcess.
virtual void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: apply_sinusoidal_function_process.h:131
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
This class defines the node.
Definition: node.h:65
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
The base class for all processes in Kratos.
Definition: process.h:49
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21