8 #if !defined(KRATOS_EXPLICIT_SOLVER_STRATEGY)
9 #define KRATOS_EXPLICIT_SOLVER_STRATEGY
49 #include <CGAL/spatial_sort.h>
101 const double max_delta_time,
102 const int n_step_search,
104 const int delta_option,
105 ParticleCreatorDestructor::Pointer p_creator_destructor,
106 DEM_FEM_Search::Pointer p_dem_fem_search,
107 SpatialSearch::Pointer pSpSearch,
110 mParameters = strategy_parameters;
111 mDeltaOption = delta_option;
112 mpParticleCreatorDestructor = p_creator_destructor;
113 mpDemFemSearch = p_dem_fem_search;
114 mpSpSearch = pSpSearch;
117 if(mParameters[
"do_search_dem_neighbours"].GetBool()) {
118 mDoSearchNeighbourElements =
true;
119 }
else mDoSearchNeighbourElements =
false;
120 p_creator_destructor->SetDoSearchNeighbourElements(mDoSearchNeighbourElements);
122 if(mParameters[
"do_search_fem_neighbours"].GetBool()) mDoSearchNeighbourFEMElements =
true;
123 else mDoSearchNeighbourFEMElements =
false;
125 mMaxTimeStep = max_delta_time;
126 mNStepSearch = n_step_search;
130 KRATOS_ERROR_IF(mpDem_model_part == NULL) <<
"Undefined settings.r_model_part in ExplicitSolverStrategy constructor" << std::endl;
133 KRATOS_ERROR_IF(mpContact_model_part == NULL) <<
"Undefined settings.contact_model_part in ExplicitSolverStrategy constructor" << std::endl;
136 KRATOS_ERROR_IF(mpFem_model_part == NULL) <<
"Undefined settings.fem_model_part in ExplicitSolverStrategy constructor" << std::endl;
139 KRATOS_ERROR_IF(mpCluster_model_part == NULL) <<
"Undefined settings.cluster_model_part in ExplicitSolverStrategy constructor" << std::endl;
142 KRATOS_ERROR_IF(mpInlet_model_part == NULL) <<
"Undefined settings.inlet_model_part in ExplicitSolverStrategy constructor" << std::endl;
144 if(mParameters[
"RemoveBallsInitiallyTouchingWalls"].GetBool()) mRemoveBallsInitiallyTouchingWallsOption =
true;
145 else mRemoveBallsInitiallyTouchingWallsOption =
false;
175 void ReorderParticles() {
176 SpatialSortingTraits sst;
177 CGAL::spatial_sort(mListOfSphericParticles.begin(), mListOfSphericParticles.end(), sst);
183 rCustomListOfParticles.resize(pElements.size());
185 #pragma omp parallel for
186 for (
int k = 0;
k < (
int)pElements.size();
k++){
187 ElementsArrayType::iterator particle_pointer_it = pElements.ptr_begin() +
k;
188 T* spheric_particle =
dynamic_cast<T*
>(&(*particle_pointer_it));
189 rCustomListOfParticles[
k] = spheric_particle;
195 RebuildListOfSphericParticles<SphericParticle>(GetModelPart().GetCommunicator().LocalMesh().Elements(), mListOfSphericParticles);
198 void RebuildPropertiesProxyPointers(std::vector<SphericParticle*>& rCustomListOfSphericParticles);
199 void SendProcessInfoToClustersModelPart();
200 void UpdateMaxIdOfCreatorDestructor();
201 void RepairPointersToNormalProperties(std::vector<SphericParticle*>& rCustomListOfSphericParticles);
202 virtual void Initialize();
203 virtual void AttachSpheresToStickyWalls();
204 virtual void DisplayThreadInfo();
205 double CalculateMaxInletTimeStep();
206 virtual void InitializeClusters();
207 virtual void GetClustersForce();
208 virtual void GetRigidBodyElementsForce();
209 virtual double SolveSolutionStep();
210 void SearchDEMOperations(
ModelPart& r_model_part,
bool has_mpi =
true);
211 void SearchFEMOperations(
ModelPart& r_model_part,
bool has_mpi =
true) ;
212 virtual void ForceOperations(
ModelPart& r_model_part);
215 virtual void PerformTimeIntegrationOfMotion(
int StepFlag = 0);
217 virtual void BoundingBoxUtility(
bool is_time_to_mark_and_remove =
true);
218 virtual void FinalizeSolutionStep();
219 void InitializeElements();
220 void InitializeDEMElements();
221 void InitializeFEMElements();
224 void MarkToDeleteAllSpheresInitiallyIndentedWithFEM(
ModelPart& rSpheresModelPart);
225 void ComputeNodalArea();
227 virtual void CalculateConditionsRHSAndAdd();
228 void ClearFEMForces();
229 void CalculateNodalPressuresAndStressesOnWalls();
232 void ResetPrescribedMotionFlagsRespectingImposedDofs();
233 void ApplyPrescribedBoundaryConditions();
234 void ApplyInitialConditions();
235 virtual void SetSearchRadiiOnAllParticles(
ModelPart& r_model_part,
const double added_search_distance = 0.0,
const double amplification = 1.0);
236 void SetNormalRadiiOnAllParticles(
ModelPart& r_model_part);
237 virtual void SetSearchRadiiWithFemOnAllParticles(
ModelPart& r_model_part,
const double added_search_distance = 0.0,
const double amplification = 1.0);
238 virtual void SearchNeighbours();
239 virtual void ComputeNewNeighboursHistoricalData();
240 virtual void CreateContactElements();
241 void InitializeContactElements();
243 void PrepareContactElementsForPrinting();
244 virtual void ComputeNewRigidFaceNeighboursHistoricalData();
245 virtual void SearchRigidFaceNeighbours();
246 void CheckHierarchyWithCurrentNeighbours();
248 void CalculateInitialMaxIndentations(
const ProcessInfo& r_process_info);
249 void PrepareContactModelPart(
ModelPart& r_model_part,
ModelPart& mcontacts_model_part);
250 void PrepareElementsForPrinting();
251 void SynchronizeHistoricalVariables(
ModelPart& r_model_part);
252 void SynchronizeRHS(
ModelPart& r_model_part);
253 void Check_MPI(
bool& has_mpi);
254 virtual double ComputeCoordinationNumber(
double& standard_dev);
MeshType & LocalMesh()
Returns the reference to the mesh storing all local entities.
Definition: communicator.cpp:245
Definition: discrete_particle_configure.h:46
Definition: explicit_solver_strategy.h:54
KRATOS_CLASS_POINTER_DEFINITION(ExplicitSolverSettings)
ExplicitSolverSettings()
Definition: explicit_solver_strategy.h:58
ModelPart * inlet_model_part
Definition: explicit_solver_strategy.h:67
ModelPart * cluster_model_part
Definition: explicit_solver_strategy.h:66
ModelPart * contact_model_part
Definition: explicit_solver_strategy.h:64
ModelPart * fem_model_part
Definition: explicit_solver_strategy.h:65
ModelPart * r_model_part
Definition: explicit_solver_strategy.h:63
~ExplicitSolverSettings()
Definition: explicit_solver_strategy.h:61
Definition: explicit_solver_strategy.h:70
SpatialSearch::ResultElementsContainerType ResultElementsContainerType
Definition: explicit_solver_strategy.h:80
ModelPart * mpFem_model_part
Definition: explicit_solver_strategy.h:302
ModelPart & GetModelPart()
Definition: explicit_solver_strategy.h:256
int & GetNumberOfThreads()
Definition: explicit_solver_strategy.h:268
VectorResultElementsContainerType & GetResults()
Definition: explicit_solver_strategy.h:263
ModelPart::ElementsContainerType::ContainerType ElementsContainerType
Definition: explicit_solver_strategy.h:78
ModelPart * mpRigidBody_model_part
Definition: explicit_solver_strategy.h:307
RadiusArrayType & GetArrayOfAmplifiedRadii()
Definition: explicit_solver_strategy.h:265
SpatialSearch::Pointer & GetSpSearch()
Definition: explicit_solver_strategy.h:273
PointerVectorSet< Properties, IndexedObject > PropertiesContainerType
Definition: explicit_solver_strategy.h:87
VectorDistanceType & GetRigidFaceResultsDistances()
Definition: explicit_solver_strategy.h:275
void ComputeNormalPressureVectorField()
PropertiesContainerType::iterator PropertiesIterator
Definition: explicit_solver_strategy.h:88
void RebuildListOfDiscontinuumSphericParticles()
Definition: explicit_solver_strategy.h:194
ModelPart::NodesContainerType::ContainerType NodesContainerType
Definition: explicit_solver_strategy.h:77
ModelPart::ElementsContainerType ElementsArrayType
Definition: explicit_solver_strategy.h:74
ModelPart & GetInletModelPart()
Definition: explicit_solver_strategy.h:260
double & GetMaxTimeStep()
Definition: explicit_solver_strategy.h:269
ModelPart * mpInlet_model_part
Definition: explicit_solver_strategy.h:304
NodeConfigure< 3 > NodeConfigureType
Definition: explicit_solver_strategy.h:90
ExplicitSolverStrategy(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_strategy.h:100
ModelPart * mpCluster_model_part
Definition: explicit_solver_strategy.h:306
DiscreteParticleConfigure< 3 > ElementConfigureType
Definition: explicit_solver_strategy.h:89
ModelPart * mpContact_model_part
Definition: explicit_solver_strategy.h:305
int mNumberOfThreads
Definition: explicit_solver_strategy.h:291
SpatialSearch::Pointer mpSpSearch
Definition: explicit_solver_strategy.h:297
int & GetNStepSearch()
Definition: explicit_solver_strategy.h:266
int & GetDeltaOption()
Definition: explicit_solver_strategy.h:271
ExplicitSolverStrategy()
Definition: explicit_solver_strategy.h:97
bool mDoSearchNeighbourElements
Definition: explicit_solver_strategy.h:298
ModelPart & GetFemModelPart()
Definition: explicit_solver_strategy.h:257
int mDeltaOption
Definition: explicit_solver_strategy.h:294
ModelPart & GetContactModelPart()
Definition: explicit_solver_strategy.h:258
SpatialSearch::RadiusArrayType RadiusArrayType
Definition: explicit_solver_strategy.h:82
int & GetSearchControl()
Definition: explicit_solver_strategy.h:267
ModelPart::NodesContainerType NodesArrayType
Definition: explicit_solver_strategy.h:73
SpatialSearch::ResultConditionsContainerType ResultConditionsContainerType
Definition: explicit_solver_strategy.h:85
RigidFaceGeometricalObjectConfigure< 3 > RigidFaceGeometricalConfigureType
Definition: explicit_solver_strategy.h:91
SpatialSearch::DistanceType DistanceType
Definition: explicit_solver_strategy.h:83
VectorDistanceType mResultsDistances
Definition: explicit_solver_strategy.h:287
bool mDoSearchNeighbourFEMElements
Definition: explicit_solver_strategy.h:299
VectorResultElementsContainerType mResults
Definition: explicit_solver_strategy.h:286
DEM_FEM_Search::Pointer mpDemFemSearch
Definition: explicit_solver_strategy.h:296
void RebuildListOfSphericParticles(ElementsArrayType &pElements, std::vector< T * > &rCustomListOfParticles)
Definition: explicit_solver_strategy.h:181
std::vector< SphericParticle * > mListOfSphericParticles
Definition: explicit_solver_strategy.h:308
double & GetSafetyFactor()
Definition: explicit_solver_strategy.h:270
virtual ElementsArrayType & GetElements(ModelPart &r_model_part)
Definition: explicit_solver_strategy.h:277
VectorResultConditionsContainerType mRigidFaceResults
Definition: explicit_solver_strategy.h:300
int mSearchControl
Definition: explicit_solver_strategy.h:290
ElementsArrayType::iterator ElementsIterator
Definition: explicit_solver_strategy.h:75
DEM_FEM_Search::Pointer & GetDemFemSearch()
Definition: explicit_solver_strategy.h:276
SpatialSearch::VectorResultElementsContainerType VectorResultElementsContainerType
Definition: explicit_solver_strategy.h:81
ParticleCreatorDestructor::Pointer mpParticleCreatorDestructor
Definition: explicit_solver_strategy.h:295
void InitializeFEMWallsAsRigidBodyElements(ModelPart::SubModelPartsContainerType::iterator &sub_model_part)
Parameters mParameters
Definition: explicit_solver_strategy.h:284
double mMaxTimeStep
Definition: explicit_solver_strategy.h:292
VectorDistanceType & GetResultsDistances()
Definition: explicit_solver_strategy.h:264
int mNStepSearch
Definition: explicit_solver_strategy.h:289
RadiusArrayType mArrayOfAmplifiedRadii
Definition: explicit_solver_strategy.h:288
SpatialSearch::VectorDistanceType VectorDistanceType
Definition: explicit_solver_strategy.h:84
VectorDistanceType mRigidFaceResultsDistances
Definition: explicit_solver_strategy.h:301
ModelPart & GetRigidBodyModelPart()
Definition: explicit_solver_strategy.h:261
virtual ElementsArrayType & GetAllElements(ModelPart &r_model_part)
Definition: explicit_solver_strategy.h:278
double mSafetyFactor
Definition: explicit_solver_strategy.h:293
VectorResultConditionsContainerType & GetRigidFaceResults()
Definition: explicit_solver_strategy.h:274
KRATOS_CLASS_POINTER_DEFINITION(ExplicitSolverStrategy)
Pointer definition of ExplicitSolverStrategy.
std::vector< SphericParticle * > mListOfGhostSphericParticles
Definition: explicit_solver_strategy.h:309
ModelPart & GetClusterModelPart()
Definition: explicit_solver_strategy.h:259
virtual ~ExplicitSolverStrategy()
Destructor.
Definition: explicit_solver_strategy.h:150
ModelPart::ConditionsContainerType::ContainerType ConditionsContainerType
Definition: explicit_solver_strategy.h:79
Variable< double > ComponentOf3ComponentsVariableType
Definition: explicit_solver_strategy.h:92
bool mRemoveBallsInitiallyTouchingWallsOption
Definition: explicit_solver_strategy.h:285
ParticleCreatorDestructor::Pointer & GetParticleCreatorDestructor()
Definition: explicit_solver_strategy.h:272
ModelPart * mpDem_model_part
Definition: explicit_solver_strategy.h:303
SpatialSearch::VectorResultConditionsContainerType VectorResultConditionsContainerType
Definition: explicit_solver_strategy.h:86
ModelPart::ConditionsContainerType ConditionsArrayType
Definition: explicit_solver_strategy.h:76
ElementsContainerType & Elements()
Definition: mesh.h:568
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
MeshType::ConditionsContainerType ConditionsContainerType
Condintions container. A vector set of Conditions with their Id's as key.
Definition: model_part.h:183
MeshType::ElementsContainerType ElementsContainerType
Element container. A vector set of Elements with their Id's as key.
Definition: model_part.h:168
Communicator & GetCommunicator()
Definition: model_part.h:1821
ElementsContainerType & Elements(IndexType ThisIndex=0)
Definition: model_part.h:1189
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
iterator_adaptor iterator
Definition: pointer_hash_map_set.h:153
boost::indirect_iterator< typename TContainerType::iterator > iterator
Definition: pointer_vector_set.h:95
ProcessInfo holds the current value of different solution parameters.
Definition: process_info.h:59
std::vector< ResultConditionsContainerType > VectorResultConditionsContainerType
Definition: spatial_search.h:92
std::vector< double > RadiusArrayType
Input/output types.
Definition: spatial_search.h:95
ConditionsContainerType::ContainerType ResultConditionsContainerType
Definition: spatial_search.h:91
std::vector< DistanceType > VectorDistanceType
Definition: spatial_search.h:97
std::vector< ResultElementsContainerType > VectorResultElementsContainerType
Definition: spatial_search.h:87
ElementsContainerType::ContainerType ResultElementsContainerType
Definition: spatial_search.h:86
std::vector< double > DistanceType
Definition: spatial_search.h:96
Definition: spheric_particle.h:31
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_TRY
Definition: define.h:109
#define KRATOS_ERROR_IF(conditional)
Definition: exception.h:162
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
REACTION_CHECK_STIFFNESS_FACTOR int
Definition: contact_structural_mechanics_application_variables.h:75
safety_factor
Definition: edgebased_PureConvection.py:110
q
Definition: generate_convection_diffusion_explicit_element.py:109
int k
Definition: quadrature.py:595
p
Definition: sensitivityMatrix.py:52
Definition: explicit_solver_strategy.h:155
bool operator()(const SphericParticle *p, const SphericParticle *q) const
Definition: explicit_solver_strategy.h:156
Definition: explicit_solver_strategy.h:158
bool operator()(const SphericParticle *p, const SphericParticle *q) const
Definition: explicit_solver_strategy.h:159
Definition: explicit_solver_strategy.h:161
bool operator()(const SphericParticle *p, const SphericParticle *q) const
Definition: explicit_solver_strategy.h:162
Definition: explicit_solver_strategy.h:164
LessX Less_x_2
Definition: explicit_solver_strategy.h:166
SphericParticle * Point_2
Definition: explicit_solver_strategy.h:165
LessZ Less_z_2
Definition: explicit_solver_strategy.h:168
LessY Less_y_2
Definition: explicit_solver_strategy.h:167
Less_y_2 less_y_2_object() const
Definition: explicit_solver_strategy.h:170
Less_x_2 less_x_2_object() const
Definition: explicit_solver_strategy.h:169
Less_z_2 less_z_2_object() const
Definition: explicit_solver_strategy.h:171
Configure::ContainerType ContainerType
Definition: transfer_utility.h:247