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.
fs_periodic_condition.h
Go to the documentation of this file.
1 /*
2 ==============================================================================
3 Kratos
4 A General Purpose Software for Multi-Physics Finite Element Analysis
5 Version 1.0 (Released on march 05, 2007).
6 
7 Copyright 2007
8 Pooyan Dadvand, Riccardo Rossi
9 pooyan@cimne.upc.edu
10 rrossi@cimne.upc.edu
11 CIMNE (International Center for Numerical Methods in Engineering),
12 Gran Capita' s/n, 08034 Barcelona, Spain
13 
14 Permission is hereby granted, free of charge, to any person obtaining
15 a copy of this software and associated documentation files (the
16 "Software"), to deal in the Software without restriction, including
17 without limitation the rights to use, copy, modify, merge, publish,
18 distribute, sublicense and/or sell copies of the Software, and to
19 permit persons to whom the Software is furnished to do so, subject to
20 the following condition:
21 
22 Distribution of this code for any commercial purpose is permissible
23 ONLY BY DIRECT ARRANGEMENT WITH THE COPYRIGHT OWNER.
24 
25 The above copyright notice and this permission notice shall be
26 included in all copies or substantial portions of the Software.
27 
28 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
29 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
30 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
31 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
32 CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
33 TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
34 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
35 
36 ==============================================================================
37  */
38 
39 #ifndef KRATOS_FS_PERIODIC_CONDITION_H
40 #define KRATOS_FS_PERIODIC_CONDITION_H
41 
42 // System includes
43 #include <string>
44 #include <iostream>
45 #include <sstream>
46 #include <cstddef>
47 
48 
49 // External includes
50 
51 
52 // Project includes
53 #include "includes/define.h"
54 #include "includes/node.h"
55 #include "geometries/geometry.h"
56 #include "includes/properties.h"
57 #include "includes/process_info.h"
59 #include "includes/condition.h"
60 #include "includes/serializer.h"
61 
62 // Application includes
64 
65 namespace Kratos
66 {
69 
72 
76 
80 
84 
88 
90 
102 template< unsigned int TDim >
104 {
105 public:
108 
111 
113 
115 
116  typedef Node NodeType;
117 
119 
121 
123 
125 
127 
128  typedef std::size_t IndexType;
129 
130  typedef std::size_t SizeType;
131 
132  typedef std::vector<std::size_t> EquationIdVectorType;
133 
134  typedef std::vector< Dof<double>::Pointer > DofsVectorType;
135 
137 
141 
143 
145  FSPeriodicCondition(IndexType NewId = 0);
146 
148 
153  const NodesArrayType& ThisNodes);
154 
156 
161  GeometryType::Pointer pGeometry);
162 
164 
170  GeometryType::Pointer pGeometry,
171  PropertiesType::Pointer pProperties);
172 
175 
176 
178  ~FSPeriodicCondition() override;
179 
180 
184 
187 
191 
193  Condition::Pointer Create(IndexType NewId,
194  NodesArrayType const& ThisNodes,
195  PropertiesType::Pointer pProperties) const override;
196 
198  Condition::Pointer Create(
199  IndexType NewId,
200  GeometryType::Pointer pGeom,
201  PropertiesType::Pointer pProperties) const override;
202 
203 
205  int Check(const ProcessInfo& rCurrentProcessInfo) const override;
206 
207  void CalculateLocalSystem(MatrixType& rLeftHandSideMatrix,
208  VectorType& rRightHandSideVector,
209  const ProcessInfo& rCurrentProcessInfo) override;
210 
211  void CalculateLeftHandSide(MatrixType& rLeftHandSideMatrix,
212  const ProcessInfo& rCurrentProcessInfo) override;
213 
214  void CalculateRightHandSide(VectorType& rRightHandSideVector,
215  const ProcessInfo& rCurrentProcessInfo) override;
216 
218 
225  const ProcessInfo& rCurrentProcessInfo) const override;
226 
228 
232  void GetDofList(DofsVectorType& ElementalDofList,
233  const ProcessInfo& CurrentProcessInfo) const override;
234 
236  void GetValuesVector(Vector& Values, int Step = 0) const override;
237 
241 
242 
246 
250 
251 
255 
257  std::string Info() const override
258  {
259  std::stringstream buffer;
260  buffer << "FSPeriodicCondition #" << Id();
261  return buffer.str();
262  }
263 
265  void PrintInfo(std::ostream& rOStream) const override
266  {
267  rOStream << "FSPeriodicCondition #" << Id();
268  }
269 
271  void PrintData(std::ostream& rOStream) const override
272  {
273  Condition::PrintData(rOStream);
274  }
275 
276 
280 
281 
283 
284 protected:
287 
288 
292 
293 
297 
298 
302 
303  void GetVelocityDofList(DofsVectorType& rElementalDofList,
304  const ProcessInfo& rCurrentProcessInfo) const ;
305 
306  void GetPressureDofList(DofsVectorType& rElementalDofList,
307  const ProcessInfo& rCurrentProcessInfo) const ;
308 
309 
310 
314 
315 
319 
320 
324 
325 
327 
328 private:
331 
332 
336 
337 
341 
342  friend class Serializer;
343 
344  void save(Serializer& rSerializer) const override;
345 
346  void load(Serializer& rSerializer) override;
347 
348 
352 
353 
357 
358 
362 
363 
367 
368 
372 
373 
374 
376 
377 }; // Class FSPeriodicCondition
378 
380 
383 
384 
388 
389 
391 template< unsigned int TDim >
392 inline std::istream & operator >>(std::istream& rIStream,
394 {
395  return rIStream;
396 }
397 
399 template< unsigned int TDim >
400 inline std::ostream & operator <<(std::ostream& rOStream,
401  const FSPeriodicCondition<TDim>& rThis)
402 {
403  rThis.PrintInfo(rOStream);
404  rOStream << " : " << std::endl;
405  rThis.PrintData(rOStream);
406 
407  return rOStream;
408 }
410 
412 
413 } // namespace Kratos.
414 
415 
416 #endif /* KRATOS_FS_PERIODIC_CONDITION_H */
417 
Base class for all Conditions.
Definition: condition.h:59
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: condition.h:1085
std::vector< std::size_t > EquationIdVectorType
Definition: condition.h:98
std::vector< DofType::Pointer > DofsVectorType
Definition: condition.h:100
Condition used to assign periodic boundary conditions when using a fractional step fluid solver.
Definition: fs_periodic_condition.h:104
Node NodeType
Definition: fs_periodic_condition.h:116
void GetVelocityDofList(DofsVectorType &rElementalDofList, const ProcessInfo &rCurrentProcessInfo) const
Vector VectorType
Definition: fs_periodic_condition.h:124
Geometry< NodeType >::PointsArrayType NodesArrayType
Definition: fs_periodic_condition.h:122
Matrix MatrixType
Definition: fs_periodic_condition.h:126
std::string Info() const override
Turn back information as a string.
Definition: fs_periodic_condition.h:257
int Check(const ProcessInfo &rCurrentProcessInfo) const override
Check input to ensure that it makes sense.
Definition: fs_periodic_condition.cpp:62
Geometry< NodeType > GeometryType
Definition: fs_periodic_condition.h:120
std::size_t IndexType
Definition: fs_periodic_condition.h:128
Condition::Pointer Create(IndexType NewId, NodesArrayType const &ThisNodes, PropertiesType::Pointer pProperties) const override
Create a new FSPeriodicCondition instance.
Definition: fs_periodic_condition.cpp:50
void CalculateRightHandSide(VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo) override
Definition: fs_periodic_condition.cpp:85
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: fs_periodic_condition.h:265
void GetValuesVector(Vector &Values, int Step=0) const override
Returns the values of the unknowns for each node.
Definition: fs_periodic_condition.cpp:129
void CalculateLeftHandSide(MatrixType &rLeftHandSideMatrix, const ProcessInfo &rCurrentProcessInfo) override
Definition: fs_periodic_condition.cpp:79
std::vector< Dof< double >::Pointer > DofsVectorType
Definition: fs_periodic_condition.h:134
KRATOS_CLASS_INTRUSIVE_POINTER_DEFINITION(FSPeriodicCondition)
Pointer definition of FSPeriodicCondition.
PointerVectorSet< Dof< double >, IndexedObject > DofsArrayType
Definition: fs_periodic_condition.h:136
void GetDofList(DofsVectorType &ElementalDofList, const ProcessInfo &CurrentProcessInfo) const override
Returns a list of the element's Dofs.
Definition: fs_periodic_condition.cpp:98
void GetPressureDofList(DofsVectorType &rElementalDofList, const ProcessInfo &rCurrentProcessInfo) const
Definition: fs_periodic_condition.cpp:202
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: fs_periodic_condition.h:271
~FSPeriodicCondition() override
Destructor.
Definition: fs_periodic_condition.cpp:37
void CalculateLocalSystem(MatrixType &rLeftHandSideMatrix, VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo) override
Definition: fs_periodic_condition.cpp:72
std::size_t SizeType
Definition: fs_periodic_condition.h:130
FSPeriodicCondition & operator=(FSPeriodicCondition const &rOther)
Assignment operator.
Definition: fs_periodic_condition.cpp:42
FSPeriodicCondition(IndexType NewId=0)
Constructor.
Definition: fs_periodic_condition.cpp:7
void EquationIdVector(EquationIdVectorType &rResult, const ProcessInfo &rCurrentProcessInfo) const override
Provides the global indices for each one of this element's local rows.
Definition: fs_periodic_condition.cpp:92
IndexedObject IndexedObjectType
Definition: fs_periodic_condition.h:112
Condition BaseType
Definition: fs_periodic_condition.h:114
Properties PropertiesType
Definition: fs_periodic_condition.h:118
std::vector< std::size_t > EquationIdVectorType
Definition: fs_periodic_condition.h:132
std::size_t IndexType
Definition: flags.h:74
Geometry base class.
Definition: geometry.h:71
This object defines an indexed object.
Definition: indexed_object.h:54
IndexType Id() const
Definition: indexed_object.h:107
This class defines the node.
Definition: node.h:65
PointerVector is a container like stl vector but using a vector to store pointers to its data.
Definition: pointer_vector.h:72
A sorted associative container similar to an STL set, but uses a vector to store pointers to its data...
Definition: pointer_vector_set.h:72
ProcessInfo holds the current value of different solution parameters.
Definition: process_info.h:59
Properties encapsulates data shared by different Elements or Conditions. It can store any type of dat...
Definition: properties.h:69
The serialization consists in storing the state of an object into a storage format like data file or ...
Definition: serializer.h:123
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
def load(f)
Definition: ode_solve.py:307