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.
discrete_element.h
Go to the documentation of this file.
1 //
2 // Project Name: Kratos
3 // Last Modified by: $Author: pooyan $
4 // Date: $Date: 2006-11-27 16:07:33 $
5 // Revision: $Revision: 1.1.1.1 $
6 //
7 //
8 
9 
10 #if !defined(KRATOS_DISCRETE_ELEMENT_H_INCLUDED )
11 #define KRATOS_DISCRETE_ELEMENT_H_INCLUDED
12 
13 
14 
15 // System includes
16 #include <string>
17 #include <iostream>
18 #include <cmath>
19 
20 // External includes
21 
22 // Project includes
23 #include "includes/define.h"
24 #include "includes/node.h"
25 #include "includes/element.h"
26 #include "geometries/geometry.h"
27 #include "includes/properties.h"
28 #include "includes/process_info.h"
32 
33 //Cfeng,RigidFace
34 #include "includes/condition.h"
35 
36 namespace Kratos {
37 
38  class KRATOS_API(DEM_APPLICATION) DiscreteElement : public Element {
39  public:
41  DiscreteElement(IndexType NewId = 0) : Element(NewId) {}
42  DiscreteElement(IndexType NewId, const NodesArrayType& ThisNodes) : Element(NewId, ThisNodes) {}
43  DiscreteElement(IndexType NewId, GeometryType::Pointer pGeometry) : Element(NewId, pGeometry) {}
44  DiscreteElement(IndexType NewId, GeometryType::Pointer pGeometry, PropertiesType::Pointer pProperties) : Element(NewId, pGeometry, pProperties) {}
46  DiscreteElement(DiscreteElement const& rOther) : Element(rOther) {
47  }
49  virtual ~DiscreteElement() {
50  }
51 
53  Element::operator=(rOther);
54  return *this;
55  }
56 
57  virtual void InitializeSolutionStep(const ProcessInfo& r_process_info) override {}
58 
59  virtual void FinalizeSolutionStep(const ProcessInfo& r_process_info) override {}
60 
61  virtual std::string Info() const override {
62  std::stringstream buffer;
63  buffer << "Discrete Element #" << Id();
64  return buffer.str();
65  }
66 
68  virtual void PrintInfo(std::ostream& rOStream) const override { rOStream << "Discrete Element #" << Id();}
69 
71  //virtual void PrintData(std::ostream& rOStream) const override { /*mpGeometry->PrintData(rOStream);*/ }
72 
73  protected:
74 
75 
76  private:
77 
78  friend class Serializer;
79 
80  virtual void save(Serializer& rSerializer) const override {
82  }
83 
84  virtual void load(Serializer& rSerializer) override {
86  }
87 
88 
89  }; // Class DiscreteElement
90 
91 
93  inline std::istream& operator>>(std::istream& rIStream,
94  DiscreteElement& rThis);
95 
97 
98  inline std::ostream& operator<<(std::ostream& rOStream,
99  const DiscreteElement& rThis) {
100  rThis.PrintInfo(rOStream);
101  rOStream << std::endl;
102  rThis.PrintData(rOStream);
103 
104  return rOStream;
105  }
106 
107 
108 } // namespace Kratos.
109 
110 #endif // KRATOS_DISCRETE_ELEMENT_H_INCLUDED defined
Definition: discrete_element.h:38
DiscreteElement & operator=(const DiscreteElement &rOther)
Definition: discrete_element.h:52
virtual ~DiscreteElement()
Destructor.
Definition: discrete_element.h:49
KRATOS_CLASS_INTRUSIVE_POINTER_DEFINITION(DiscreteElement)
virtual void InitializeSolutionStep(const ProcessInfo &r_process_info) override
Definition: discrete_element.h:57
DiscreteElement(IndexType NewId, const NodesArrayType &ThisNodes)
Definition: discrete_element.h:42
DiscreteElement(DiscreteElement const &rOther)
Copy constructor.
Definition: discrete_element.h:46
virtual void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: discrete_element.h:68
DiscreteElement(IndexType NewId, GeometryType::Pointer pGeometry)
Definition: discrete_element.h:43
virtual void FinalizeSolutionStep(const ProcessInfo &r_process_info) override
Definition: discrete_element.h:59
DiscreteElement(IndexType NewId, GeometryType::Pointer pGeometry, PropertiesType::Pointer pProperties)
Definition: discrete_element.h:44
DiscreteElement(IndexType NewId=0)
Definition: discrete_element.h:41
virtual std::string Info() const override
Turn back information as a string.
Definition: discrete_element.h:61
Base class for all Elements.
Definition: element.h:60
Element & operator=(Element const &rOther)
Assignment operator.
Definition: element.h:179
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: element.h:1135
std::size_t IndexType
Definition: flags.h:74
PointerVector is a container like stl vector but using a vector to store pointers to its data.
Definition: pointer_vector.h:72
ProcessInfo holds the current value of different solution parameters.
Definition: process_info.h:59
The serialization consists in storing the state of an object into a storage format like data file or ...
Definition: serializer.h:123
#define KRATOS_SERIALIZE_SAVE_BASE_CLASS(Serializer, BaseType)
Definition: define.h:812
#define KRATOS_SERIALIZE_LOAD_BASE_CLASS(Serializer, BaseType)
Definition: define.h:815
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