diff --git a/src/pe/ccd/HashGrids.cpp b/src/pe/ccd/HashGrids.cpp index e126e554d56db11e2325c9d5ea8e7860c55ce2c4..31d4c96cc8a84206298eab9ea2738a978aa3e5e3 100644 --- a/src/pe/ccd/HashGrids.cpp +++ b/src/pe/ccd/HashGrids.cpp @@ -770,23 +770,12 @@ void HashGrids::reloadBodies() } //************************************************************************************************* -//**Implementation of ICCD interface ******************************************************** + //************************************************************************************************* -/*!\brief Contact generation between colliding rigid bodies. - * - * \return Vector of possible contacts. - * - * This function generates all contacts between all registered rigid bodies. The contacts are - * added to the contact container which can be retrieved via getPossibleContacts(). +/*!\brief Updates all hash grids and reassigns bodies. */ -PossibleContacts& HashGrids::generatePossibleContacts( WcTimingTree* tt ) +void HashGrids::update(WcTimingTree* tt) { - if (tt != NULL) tt->start("CCD"); - - contacts_.clear(); - - WALBERLA_LOG_DETAIL( " Finding the contacts via the hierarchical hash grids algorithm..."); - // ----- UPDATE PHASE ----- // if (tt != NULL) tt->start("AddNewBodies"); @@ -921,6 +910,26 @@ PossibleContacts& HashGrids::generatePossibleContacts( WcTimingTree* tt ) } } if (tt != NULL) tt->stop("Update"); +} + +//**Implementation of ICCD interface ******************************************************** +//************************************************************************************************* +/*!\brief Contact generation between colliding rigid bodies. + * + * \return Vector of possible contacts. + * + * This function generates all contacts between all registered rigid bodies. The contacts are + * added to the contact container which can be retrieved via getPossibleContacts(). + */ +PossibleContacts& HashGrids::generatePossibleContacts( WcTimingTree* tt ) +{ + if (tt != NULL) tt->start("CCD"); + + contacts_.clear(); + + WALBERLA_LOG_DETAIL( " Finding the contacts via the hierarchical hash grids algorithm..."); + + update(tt); if (tt != NULL) tt->start("Detection"); // ----- DETECTION STEP ----- // diff --git a/src/pe/ccd/HashGrids.h b/src/pe/ccd/HashGrids.h index 18871eff3a1e0c7ac376b14b52f22706a667b7fb..b1ab8198be32c6ea707e58011b048b9e66a0304d 100644 --- a/src/pe/ccd/HashGrids.h +++ b/src/pe/ccd/HashGrids.h @@ -276,6 +276,7 @@ public: //@} //********************************************************************************************** + void update(WcTimingTree* tt); //**Implementation of ICCD interface ******************************************************** virtual PossibleContacts& generatePossibleContacts( WcTimingTree* tt = NULL );