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.
explicit_solver_continuum.h
Go to the documentation of this file.
1 //
2 // Author: Miquel Santasusana msantasusana@cimne.upc.edu
3 //
4 
5 #if !defined(KRATOS_CONTINUUM_EXPLICIT_SOLVER_STRATEGY)
6 #define KRATOS_CONTINUUM_EXPLICIT_SOLVER_STRATEGY
9 
10 namespace Kratos {
11 
12  class KRATOS_API(DEM_APPLICATION) ContinuumExplicitSolverStrategy : public ExplicitSolverStrategy {
13  public:
14 
23 
24  using BaseType::mpInlet_model_part;
25  using BaseType::mpCluster_model_part;
26  using BaseType::mpContact_model_part;
27  using BaseType::GetModelPart;
28  using BaseType::GetFemModelPart;
29  using BaseType::mNumberOfThreads;
30  using BaseType::mListOfSphericParticles;
31  using BaseType::mListOfGhostSphericParticles;
32  using BaseType::SearchNeighbours;
33 
36 
38 
40  }
41 
43  ExplicitSolverSettings& settings,
44  const double max_delta_time,
45  const int n_step_search,
46  const double safety_factor,
47  const int delta_option,
48  ParticleCreatorDestructor::Pointer p_creator_destructor,
49  DEM_FEM_Search::Pointer p_dem_fem_search,
50  SpatialSearch::Pointer pSpSearch,
51  Parameters strategy_parameters)
52  : ExplicitSolverStrategy(settings, max_delta_time, n_step_search, safety_factor, delta_option, p_creator_destructor, p_dem_fem_search, pSpSearch, strategy_parameters) {
53  BaseType::GetParticleCreatorDestructor() = p_creator_destructor;
54  }
55 
57 
59  //Timer::SetOuputFile("TimesPartialRelease");
60  //Timer::PrintTimingInformation();
61  }
62 
63  virtual void Initialize() override;
64  virtual double SolveSolutionStep() override;
65  void SearchDEMOperations(ModelPart& r_model_part, bool has_mpi);
66  void ComputeNewNeighboursHistoricalData() override;
67  void ComputeNewRigidFaceNeighboursHistoricalData() override;
68  void CreateContactElements() override;
69  void SetCoordinationNumber(ModelPart& r_model_part);
70  double ComputeCoordinationNumber(double& standard_dev) override;
71 
73  RebuildListOfSphericParticles<SphericContinuumParticle>(GetModelPart().GetCommunicator().LocalMesh().Elements(), mListOfSphericContinuumParticles);
74  }
75 
76  void SetSearchRadiiOnAllParticles(ModelPart& r_model_part, const double added_search_distance, const double amplification) override;
77  void BoundingBoxUtility(bool is_time_to_mark_and_remove = true) override;
78  virtual void CalculateMaxSearchDistance();
79  virtual void MeshRepairOperations();
80  virtual void DestroyMarkedParticlesRebuildLists();
81  void CalculateMeanContactArea();
82  void BreakAllBonds();
83  void HealAllBonds();
84  void SetInitialDemContacts();
85  void SetInitialFemContacts();
86  void FinalizeSolutionStep() override;
87  void FinalizeSolutionStepFEM();
88  void MarkNewSkinParticles();
89  void ResetSkinParticles(ModelPart& r_model_part);
90  void ComputeSkin(ModelPart& rSpheresModelPart, const double factor_radius = 1.0);
91  void BreakAlmostBrokenSpheres();
92 
93  virtual void Add_As_Own(ModelPart& r_model_part, ModelPart& mcontacts_model_part, ParticleWeakIteratorType_ptr continuum_ini_neighbour_iterator, Element::Pointer p_contact_element) {
95  mcontacts_model_part.Elements().push_back(p_contact_element);
96  KRATOS_CATCH("")
97  }
98  //En aquest cas m'afegeixo jo al local i a la interface local corresponent amb la particio del vei ghost
99 
100  virtual void Add_As_Local(ModelPart& r_model_part, ModelPart& mcontacts_model_part, ParticleWeakIteratorType_ptr continuum_ini_neighbour_iterator, Element::Pointer p_contact_element) {
101  }
102  //I aqui m'afegeixio yo com a ghost de la particio del vei local
103 
104  virtual void Add_As_Ghost(ModelPart& r_model_part, ModelPart& mcontacts_model_part, ParticleWeakIteratorType_ptr continuum_ini_neighbour_iterator, Element::Pointer p_contact_element) {
105  }
106 
107  virtual void Sort_Contact_Modelpart(ModelPart& mcontacts_model_part) {
108  }
109 
110  virtual void Reassign_Ids(ModelPart& mcontacts_model_part) {
111  }
112 
113  virtual ElementsArrayType& GetElements(ModelPart& r_model_part) override {
114  return r_model_part.GetCommunicator().LocalMesh().Elements();
115  }
116 
117  protected:
118 
121  //bool mDempackOption;
122  std::vector<SphericContinuumParticle*> mListOfSphericContinuumParticles;
123  std::vector<SphericContinuumParticle*> mListOfGhostSphericContinuumParticles;
125 
126  }; // Class ContinuumExplicitSolverStrategy
127 
128 } // namespace Kratos
129 
130 #endif // KRATOS_FILENAME_H_INCLUDED defined
MeshType & LocalMesh()
Returns the reference to the mesh storing all local entities.
Definition: communicator.cpp:245
Definition: explicit_solver_continuum.h:12
virtual void Sort_Contact_Modelpart(ModelPart &mcontacts_model_part)
Definition: explicit_solver_continuum.h:107
virtual ElementsArrayType & GetElements(ModelPart &r_model_part) override
Definition: explicit_solver_continuum.h:113
KRATOS_CLASS_POINTER_DEFINITION(ContinuumExplicitSolverStrategy)
Pointer definition of ExplicitSolverStrategy.
std::vector< SphericContinuumParticle * > mListOfSphericContinuumParticles
Definition: explicit_solver_continuum.h:122
virtual void Add_As_Own(ModelPart &r_model_part, ModelPart &mcontacts_model_part, ParticleWeakIteratorType_ptr continuum_ini_neighbour_iterator, Element::Pointer p_contact_element)
Definition: explicit_solver_continuum.h:93
ContinuumExplicitSolverStrategy(ExplicitSolverSettings &settings, const double max_delta_time, const int n_step_search, const double safety_factor, const int delta_option, ParticleCreatorDestructor::Pointer p_creator_destructor, DEM_FEM_Search::Pointer p_dem_fem_search, SpatialSearch::Pointer pSpSearch, Parameters strategy_parameters)
Definition: explicit_solver_continuum.h:42
int mFixSwitch
Definition: explicit_solver_continuum.h:120
ExplicitSolverStrategy BaseType
Definition: explicit_solver_continuum.h:15
BaseType::ConditionsArrayType ConditionsArrayType
Definition: explicit_solver_continuum.h:19
std::vector< SphericContinuumParticle * > mListOfGhostSphericContinuumParticles
Definition: explicit_solver_continuum.h:123
ParticleWeakVectorType::ptr_iterator ParticleWeakIteratorType_ptr
Definition: explicit_solver_continuum.h:22
virtual void Reassign_Ids(ModelPart &mcontacts_model_part)
Definition: explicit_solver_continuum.h:110
GlobalPointersVector< Element >::iterator ParticleWeakIteratorType
Definition: explicit_solver_continuum.h:21
BaseType::ElementsArrayType ElementsArrayType
Definition: explicit_solver_continuum.h:17
DenseVector< int > mSearchControlVector
Definition: explicit_solver_continuum.h:124
virtual void Add_As_Ghost(ModelPart &r_model_part, ModelPart &mcontacts_model_part, ParticleWeakIteratorType_ptr continuum_ini_neighbour_iterator, Element::Pointer p_contact_element)
Definition: explicit_solver_continuum.h:104
virtual ~ContinuumExplicitSolverStrategy()
Destructor.
Definition: explicit_solver_continuum.h:58
GlobalPointersVector< Element > ParticleWeakVectorType
Definition: explicit_solver_continuum.h:20
virtual void Add_As_Local(ModelPart &r_model_part, ModelPart &mcontacts_model_part, ParticleWeakIteratorType_ptr continuum_ini_neighbour_iterator, Element::Pointer p_contact_element)
Definition: explicit_solver_continuum.h:100
void RebuildListOfContinuumSphericParticles()
Definition: explicit_solver_continuum.h:72
BaseType::NodesArrayType NodesArrayType
Definition: explicit_solver_continuum.h:16
ContinuumExplicitSolverStrategy()
Default constructor.
Definition: explicit_solver_continuum.h:39
bool mcontinuum_simulating_option
Definition: explicit_solver_continuum.h:119
BaseType::ElementsIterator ElementsIterator
Definition: explicit_solver_continuum.h:18
Definition: explicit_solver_strategy.h:54
Definition: explicit_solver_strategy.h:70
ModelPart::ElementsContainerType ElementsArrayType
Definition: explicit_solver_strategy.h:74
ModelPart::NodesContainerType NodesArrayType
Definition: explicit_solver_strategy.h:73
ElementsArrayType::iterator ElementsIterator
Definition: explicit_solver_strategy.h:75
ModelPart::ConditionsContainerType ConditionsArrayType
Definition: explicit_solver_strategy.h:76
typename TContainerType::iterator ptr_iterator
Definition: global_pointers_vector.h:85
Definition: amatrix_interface.h:41
ElementsContainerType & Elements()
Definition: mesh.h:568
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
Communicator & GetCommunicator()
Definition: model_part.h:1821
ElementsContainerType & Elements(IndexType ThisIndex=0)
Definition: model_part.h:1189
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_TRY
Definition: define.h:109
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
safety_factor
Definition: edgebased_PureConvection.py:110