(1) | ### Start Time Loop #### |
(2) | while dem_analysis.time < dem_analysis.end_time: |
(3) | # increase time step if particles are not near to the interface |
(4) | if not dem_mesh_moving_utility. CheckIsNearToWall(mp_dem_particle.Nodes): |
(5) | dem_analysis.SetDeltaTime(multiply = 100.0) |
(6) | # reset time step if particles are near to the interface |
(7) | else: |
(8) | dem_analysis.SetDeltaTime(multiply = 1.0) |
(9) | ### Solve DEM Problem #### |
(10) | # update time parameters |
(11) | dem_analysis._UpdateTimeParameters() |
(12) | # search and find neighbouring elements/particles which are in contact |
(13) | dem_analysis.SearchOperations() |
(14) | # calculate contact forces |
(15) | dem_analysis.ForceOperations() |
(16) | # integrate in time to obtain new position and velocity of DEM particles |
(17) | dem_analysis.IntegrationOfMotion() |
(18) | # finalize time step by updating state variables |
(19) | dem_analysis.FinalizeSingleTimeStep() |
(20) | # check for contact forces and solve FEM part if contact forces exist |
(21) | if dem_mesh_moving_utility.CheckContact(mp_dem.Nodes): |
(22) | ### Map Contact Forces #### |
(23) | # DEM to Structure |
(24) | mapper.Map(DEMApplication.CONTACT_FORCES, StructuralMechanicsApplication.POINT_LOAD) |
(25) | ### Solve Structural Mechanics Problem #### |
(26) | structural_analysis.AdvanceInTime() |
(27) | # set the previous configuration as the current configuration |
(28) | structural_analysis.InitializeSolutionStep() |
(29) | # prediction step for solution scheme if necessary |
(30) | structural_analysis.Predict() |
(31) | # solve the FEM system of equations or explicitly integrate in time |
(32) | structural_analysis.SolveSolutionStep() |
(33) | # finalize time step by updating state variables and spatial position |
(34) | structural_analysis.FinalizeSolutionStep() |
(35) | ### Map Velocity and Displacement #### |
(36) | # Structure to DEM |
(37) | mapper.InverseMap(VELOCITY) |
(38) | mapper.InverseMap(DISPLACEMENT) |
(39) | # update position of DEM wall condition |
(40) | dem_analysis.MoveMesh() |
(41) | ### Finalize Applications #### |
(42) | # e.g., free memory, make output, ... |
(43) | dem_analysis.Finalize() |
(44) | structural_analysis.Finalize() |