7 #ifndef CREATE_AND_DESTROY_H
8 #define CREATE_AND_DESTROY_H
38 static const std::size_t space_dim = 3;
62 int FindMaxNodeIdInModelPart(
ModelPart& r_modelpart);
63 void FindAndSaveMaxNodeIdInModelPart(
ModelPart& r_modelpart);
64 int FindMaxElementIdInModelPart(
ModelPart& r_modelpart);
65 int FindMaxConditionIdInModelPart(
ModelPart& r_modelpart);
66 void RenumberElementIdsFromGivenValue(
ModelPart& r_modelpart,
const int initial_id);
67 void DestroyMarkedParticles(
ModelPart& r_model_part);
68 virtual double SelectRadius(
bool initial,
69 ModelPart& r_sub_model_part_with_parameters,
70 std::map<std::string, std::unique_ptr<RandomVariable>>& r_random_variables_map);
72 void NodeCreatorWithPhysicalParameters(
ModelPart& r_modelpart,
73 Node ::Pointer& pnew_node,
75 Node ::Pointer & reference_node,
78 ModelPart& r_sub_model_part_with_parameters,
83 void NodeForClustersCreatorWithPhysicalParameters(
ModelPart& r_modelpart,
84 Node ::Pointer& pnew_node,
86 Node ::Pointer& reference_node,
88 ModelPart& r_sub_model_part_with_parameters,
95 Node ::Pointer reference_node,
96 Element::Pointer injector_element,
97 Properties::Pointer r_params,
98 ModelPart& r_sub_model_part_with_parameters,
99 std::map<std::string, std::unique_ptr<RandomVariable>>& r_random_variables_map,
100 const Element& r_reference_element,
108 Properties::Pointer r_params,
109 const double radius, Node::Pointer& pnew_node,
110 Element::Pointer& p_particle);
116 Properties::Pointer r_params,
118 const Element& r_reference_element);
122 Node ::Pointer reference_node,
123 Properties::Pointer r_params,
125 const Element& r_reference_element);
129 Node ::Pointer reference_node,
130 Properties::Pointer r_params,
135 Node ::Pointer reference_node,
136 Properties::Pointer r_params,
143 Properties::Pointer r_params,
149 Properties::Pointer r_params,
153 Element::Pointer CreateSphericParticle(
ModelPart& r_modelpart,
156 Properties::Pointer r_params,
158 const Element& r_reference_element);
160 Element::Pointer CreateSphericParticle(
ModelPart& r_modelpart,
162 Node ::Pointer reference_node,
163 Properties::Pointer r_params,
165 const Element& r_reference_element);
167 Element::Pointer CreateSphericParticle(
ModelPart& r_modelpart,
169 Node ::Pointer reference_node,
170 Properties::Pointer r_params,
174 Element::Pointer CreateSphericParticle(
ModelPart& r_modelpart,
175 Node ::Pointer reference_node,
176 Properties::Pointer r_params,
180 Element::Pointer CreateSphericParticle(
ModelPart& r_modelpart,
183 Properties::Pointer r_params,
187 Element::Pointer CreateSphericParticle(
ModelPart& r_modelpart,
189 Properties::Pointer r_params,
197 Node ::Pointer reference_node,
198 Element::Pointer injector_element,
199 Properties::Pointer r_params,
200 ModelPart& r_sub_model_part_with_parameters,
201 const Element& r_reference_element,
206 int& number_of_added_spheres,
207 const bool mStrategyForContinuum,
208 std::vector<SphericParticle*>& new_component_spheres);
211 void NodeCreatorForClusters(
ModelPart& r_modelpart,
212 Node ::Pointer& pnew_node,
218 void CentroidCreatorForRigidBodyElements(
ModelPart& r_modelpart,
219 Node::Pointer& pnew_node,
224 Node ::Pointer& pnew_node,
229 Properties::Pointer r_params,
230 const Element& r_reference_element,
231 const int cluster_id,
235 Node ::Pointer& pnew_node,
239 Properties::Pointer r_params,
240 const Element& r_reference_element,
241 const int cluster_id,
244 void CalculateSurroundingBoundingBox(
ModelPart& r_balls_model_part,
251 void UpdateSurroundingBoundingBox(
ModelPart& spheres_model_part);
253 template<
class TParticleType>
254 bool CheckParticlePreservationCriteria(
const Element::Pointer p_element,
const double current_time);
256 template<
class TParticleType>
257 void DestroyParticles(
ModelPart& r_model_part);
259 void DestroyParticleElements(
ModelPart& r_model_part,
Flags flag_for_destruction);
261 template<
class TParticleType>
263 void DestroyContactElements(
ModelPart& r_model_part);
264 void MarkIsolatedParticlesForErasing(
ModelPart& r_model_part);
266 void RemoveUnusedNodesOfTheClustersModelPart(
ModelPart& r_clusters_modelpart);
268 template<
class TParticleType>
269 void MarkDistantParticlesForErasing(
ModelPart& r_model_part);
270 void MarkParticlesForErasingGivenScalarVariableValue(
ModelPart& r_model_part,
const Variable<double>& rVariable,
double value,
double tol);
273 template<
class TParticleType>
276 void MarkContactElementsForErasing(
ModelPart& r_model_part,
ModelPart& mcontacts_model_part);
278 template<
class TParticleType>
279 void DestroyParticlesOutsideBoundingBox(
ModelPart& r_model_part);
280 void MoveParticlesOutsideBoundingBoxBackInside(
ModelPart& r_model_part);
281 void DestroyContactElementsOutsideBoundingBox(
ModelPart& r_model_part,
ModelPart& mcontacts_model_part);
283 static double rand_normal(
const double mean,
const double stddev,
const double max_radius,
const double min_radius);
284 static double rand_lognormal(
const double mean,
const double stddev,
const double max_radius,
const double min_radius);
291 double GetDiameter();
292 double GetStrictDiameter();
295 unsigned int GetCurrentMaxNodeId();
296 unsigned int* pGetCurrentMaxNodeId();
297 void SetMaxNodeId(
unsigned int id);
300 virtual std::string
Info()
const;
303 virtual void PrintInfo(std::ostream& rOStream)
const;
306 virtual void PrintData(std::ostream& rOStream)
const;
313 void SetDoSearchNeighbourElements(
bool true_or_false){mDoSearchNeighbourElements = true_or_false;}
320 double mStrictDiameter;
321 double mScaleFactor=1.0;
322 bool mDoSearchNeighbourElements;
323 AnalyticWatcher::Pointer mpAnalyticWatcher;
325 void Clear(ModelPart::NodesContainerType::iterator node_it,
int step_data_size);
327 inline void ClearVariables(ParticleIterator particle_it,
Variable<double>& rVariable);
334 extern template void KRATOS_API(DEM_APPLICATION) ParticleCreatorDestructor::DestroyParticles<SphericParticle>(
ModelPart&);
335 extern template void KRATOS_API(DEM_APPLICATION) ParticleCreatorDestructor::DestroyParticles<Cluster3D>(
ModelPart&);
336 extern template bool KRATOS_API(DEM_APPLICATION) ParticleCreatorDestructor::CheckParticlePreservationCriteria<SphericParticle>(
const Element::Pointer,
const double);
337 extern template bool KRATOS_API(DEM_APPLICATION) ParticleCreatorDestructor::CheckParticlePreservationCriteria<Cluster3D>(
const Element::Pointer,
const double);
338 extern template void KRATOS_API(DEM_APPLICATION) ParticleCreatorDestructor::DestroyParticles<SphericParticle>(
ModelPart::MeshType&,
const double);
340 extern template void KRATOS_API(DEM_APPLICATION) ParticleCreatorDestructor::MarkDistantParticlesForErasing<SphericParticle>(
ModelPart&);
341 extern template void KRATOS_API(DEM_APPLICATION) ParticleCreatorDestructor::MarkDistantParticlesForErasing<Cluster3D>(
ModelPart&);
342 extern template void KRATOS_API(DEM_APPLICATION) ParticleCreatorDestructor::MarkParticlesForErasingGivenBoundingBox<SphericParticle>(
ModelPart&, array_1d<double, 3 >, array_1d<double, 3 >);
343 extern template void KRATOS_API(DEM_APPLICATION) ParticleCreatorDestructor::MarkParticlesForErasingGivenBoundingBox<Cluster3D>(
ModelPart&, array_1d<double, 3 >, array_1d<double, 3 >);
344 extern template void KRATOS_API(DEM_APPLICATION) ParticleCreatorDestructor::DestroyParticlesOutsideBoundingBox<SphericParticle>(
ModelPart&);
345 extern template void KRATOS_API(DEM_APPLICATION) ParticleCreatorDestructor::DestroyParticlesOutsideBoundingBox<Cluster3D>(
ModelPart&);
PeriodicInterfaceProcess & operator=(const PeriodicInterfaceProcess &)=delete
std::string Info() const override
Turn back information as a string.
Definition: periodic_interface_process.hpp:93
Definition: cluster3D.h:29
Definition: discrete_particle_configure.h:46
ContainerType::iterator IteratorType
Definition: discrete_particle_configure.h:68
SearchType::ElementsContainerType::ContainerType ContainerType
Definition: discrete_particle_configure.h:63
Base class for all Elements.
Definition: element.h:60
Definition: explicit_solver_strategy.h:70
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
MeshType::ElementsContainerType ElementsContainerType
Element container. A vector set of Elements with their Id's as key.
Definition: model_part.h:168
Mesh< NodeType, PropertiesType, ElementType, ConditionType > MeshType
Definition: model_part.h:123
MeshType::NodesContainerType NodesContainerType
Nodes container. Which is a vector set of nodes with their Id's as key.
Definition: model_part.h:128
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
Definition: create_and_destroy.h:33
Configure::IteratorType ParticleIterator
Definition: create_and_destroy.h:42
unsigned int mMaxNodeId
Definition: create_and_destroy.h:46
PointerVectorSet< Element, IndexedObject > ElementsContainerType
Definition: create_and_destroy.h:43
DiscreteParticleConfigure< space_dim > Configure
WARNING: generalize to 2d.
Definition: create_and_destroy.h:39
ModelPart::NodesContainerType NodesArrayType
Definition: create_and_destroy.h:45
ModelPart::ElementsContainerType ElementsArrayType
Definition: create_and_destroy.h:44
void MarkInitialNeighboursThatAreBeingRemoved(ModelPart &r_model_part)
Configure::ContainerType ParticlePointerVector
Definition: create_and_destroy.h:40
ParticlePointerVector::iterator ParticlePointerIterator
Definition: create_and_destroy.h:41
KRATOS_CLASS_POINTER_DEFINITION(ParticleCreatorDestructor)
PointerVector is a container like stl vector but using a vector to store pointers to its data.
Definition: pointer_vector.h:72
boost::indirect_iterator< typename TContainerType::iterator > iterator
Definition: pointer_vector.h:89
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
Properties encapsulates data shared by different Elements or Conditions. It can store any type of dat...
Definition: properties.h:69
Definition: properties_proxies.h:18
Definition: spheric_particle.h:31
#define KRATOS_API(...)
Definition: kratos_export_api.h:40
Kratos::ModelPart ModelPart
Definition: kratos_wrapper.h:31
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
int tol
Definition: hinsberg_optimization.py:138
element_type
Choosing element type for lagrangian_model_part.
Definition: lagrangian_droplet_test.py:56
float radius
Definition: mesh_to_mdpa_converter.py:18
subroutine initial(STRESS, T, DSTRAN, DEPS, NTENS, NDI, NSHR)
Definition: TensorModule.f:377
Definition: mesh_converter.cpp:38