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.
dem_wall.h
Go to the documentation of this file.
1 //
2 // Author: Miquel Santasusana msantasusana@cimne.upc.edu
3 //
4 
5 #if !defined(KRATOS_DEM_WALL_H_INCLUDED )
6 #define KRATOS_DEM_WALL_H_INCLUDED
7 
8 // System includes
9 
10 
11 // External includes
12 
13 
14 // Project includes
15 #include "includes/define.h"
16 #include "includes/element.h"
17 #include "includes/serializer.h"
18 #include "includes/condition.h"
19 //#include "includes/variables.h"
20 //#include "custom_elements/spheric_particle.h"
21 // #include "custom_strategies/schemes/glued_to_wall_scheme.h"
22 
23 class GluedToWallScheme;
24 
25 namespace Kratos
26 {
27 class SphericParticle;
28 class KRATOS_API(DEM_APPLICATION) DEMWall : public Condition
29 {
30 public:
31 
32  // Counted pointer of DEMWall
34 
35 
39 
42 
43 
44  // Constructor void
45  DEMWall();
46 
47  // Constructor using an array of nodes
48  DEMWall( IndexType NewId, GeometryType::Pointer pGeometry );
49 
50  // Constructor using an array of nodes with properties
51  DEMWall( IndexType NewId, GeometryType::Pointer pGeometry, PropertiesType::Pointer pProperties );
52 
53  // Destructor
54  virtual ~DEMWall();
55 
56 
57  // Name Operations
58 
59  virtual Condition::Pointer Create(
60  IndexType NewId,
61  NodesArrayType const& ThisNodes,
62  PropertiesType::Pointer pProperties ) const override;
63 
64 
65  void Initialize(const ProcessInfo& rCurrentProcessInfo) override;
66  virtual void CalculateRightHandSide(VectorType& rRightHandSideVector, const ProcessInfo& r_process_info) override;
67  virtual void ComputeForceAndWeightsOfSphereOnThisFace(SphericParticle* p_particle, array_1d<double, 3>& force, std::vector<double>& weights_vector);
68  virtual void CalculateElasticForces(VectorType& rRightHandSideVector, const ProcessInfo& r_process_info );
69  virtual void InitializeSolutionStep(const ProcessInfo& r_process_info) override;
70  virtual void FinalizeSolutionStep(const ProcessInfo& r_process_info) override;
71  virtual void CalculateNormal(array_1d<double, 3>& rnormal);
72  virtual void AddExplicitContribution(const VectorType& rRHS,
73  const Variable<VectorType>& rRHSVariable,
74  const Variable<array_1d<double,3> >& rDestinationVariable,
75  const ProcessInfo& r_process_info) override;
76 
77  virtual void GetDeltaDisplacement( array_1d<double, 3> & delta_displacement, int inode);
78  virtual void ComputeConditionRelativeData(int rigid_neighbour_index,
79  SphericParticle* const particle,
80  double LocalCoordSystem[3][3],
81  double& DistPToB,
82  array_1d<double, 4>& Weight,
83  array_1d<double, 3>& wall_delta_disp_at_contact_point,
84  array_1d<double, 3>& wall_velocity_at_contact_point,
85  int& ContactType){
86  KRATOS_ERROR << "Base class DemWall method ComputeConditionRelativeData was called!" << std::endl;
87  }
88  virtual bool IsPhantom(){return false;}
89  virtual int CheckSide(SphericParticle* p_particle){return 1.0;}
90 
91  double GetYoung() const;
92  double GetPoisson() const;
93 
94  std::vector<SphericParticle*> mNeighbourSphericParticles;
95  std::vector<array_1d <double, 3> > mRightHandSideVector;
96 
97  virtual void GetRightHadSideVector(std::vector<array_1d <double, 3> >& rRightHandSideVector);
98  virtual void SetRightHadSideVector(const std::vector<array_1d <double, 3> >& rRightHandSideVector);
99  virtual void AddToRightHadSideVector(const std::vector<array_1d <double, 3> >& rRightHandSideVector);
107  std::vector<SphericParticle*>& GetVectorOfGluedParticles() {
108  return mVectorOfGluedParticles;
109  }
110 
111 
112 protected:
113 
114 
115 
116 private:
118  std::vector<SphericParticle*> mVectorOfGluedParticles;
120 
121 
122  // private name Operations
123 
124 
128 
129  friend class Serializer;
130 
131  virtual void save( Serializer& rSerializer ) const override
132  {
134  //rSerializer.save("mRightHandSideVector", mRightHandSideVector);
135  }
136 
137  virtual void load( Serializer& rSerializer ) override
138  {
140  //rSerializer.load("mRightHandSideVector", mRightHandSideVector);
141  }
142 
143 
144 }; // class DEMWall.
145 
146 } // namespace Kratos.
147 
148 #endif // KRATOS_DEM_WALL_H_INCLUDED defined
149 
Base class for all Conditions.
Definition: condition.h:59
Definition: dem_wall.h:29
ParticleWeakVectorType::ptr_iterator ParticleWeakIteratorType_ptr
Definition: dem_wall.h:37
GlobalPointersVector< Condition >::iterator ConditionWeakIteratorType
Definition: dem_wall.h:41
virtual void ComputeConditionRelativeData(int rigid_neighbour_index, SphericParticle *const particle, double LocalCoordSystem[3][3], double &DistPToB, array_1d< double, 4 > &Weight, array_1d< double, 3 > &wall_delta_disp_at_contact_point, array_1d< double, 3 > &wall_velocity_at_contact_point, int &ContactType)
Definition: dem_wall.h:78
std::vector< array_1d< double, 3 > > mRightHandSideVector
Definition: dem_wall.h:95
GlobalPointersVector< Element > ParticleWeakVectorType
Definition: dem_wall.h:36
KRATOS_CLASS_INTRUSIVE_POINTER_DEFINITION(DEMWall)
virtual int CheckSide(SphericParticle *p_particle)
Definition: dem_wall.h:89
std::vector< SphericParticle * > mNeighbourSphericParticles
Definition: dem_wall.h:94
virtual bool IsPhantom()
Definition: dem_wall.h:88
std::vector< SphericParticle * > & GetVectorOfGluedParticles()
Definition: dem_wall.h:107
GlobalPointersVector< Element >::iterator ParticleWeakIteratorType
Definition: dem_wall.h:38
GlobalPointersVector< Condition > ConditionWeakVectorType
Definition: dem_wall.h:40
std::size_t IndexType
Definition: flags.h:74
boost::indirect_iterator< typename TContainerType::iterator > iterator
Definition: global_pointers_vector.h:79
typename TContainerType::iterator ptr_iterator
Definition: global_pointers_vector.h:85
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
Definition: spheric_particle.h:31
Variable class contains all information needed to store and retrive data from a data container.
Definition: variable.h:63
#define KRATOS_SERIALIZE_SAVE_BASE_CLASS(Serializer, BaseType)
Definition: define.h:812
#define KRATOS_SERIALIZE_LOAD_BASE_CLASS(Serializer, BaseType)
Definition: define.h:815
#define KRATOS_ERROR
Definition: exception.h:161
Modeler::Pointer Create(const std::string &ModelerName, Model &rModel, const Parameters ModelParameters)
Checks if the modeler is registered.
Definition: modeler_factory.cpp:30
void InitializeSolutionStep(ConstructionUtility &rThisUtil, std::string ThermalSubModelPartName, std::string MechanicalSubModelPartName, std::string HeatFluxSubModelPartName, std::string HydraulicPressureSubModelPartName, bool thermal_conditions, bool mechanical_conditions, int phase)
Definition: add_custom_utilities_to_python.cpp:45
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
def load(f)
Definition: ode_solve.py:307