Commit 63b0fe3c authored by Sebastian Eibl's avatar Sebastian Eibl

separated update function of hashgrids

parent cef8ac0c
...@@ -770,23 +770,12 @@ void HashGrids::reloadBodies() ...@@ -770,23 +770,12 @@ void HashGrids::reloadBodies()
} }
//************************************************************************************************* //*************************************************************************************************
//**Implementation of ICCD interface ********************************************************
//************************************************************************************************* //*************************************************************************************************
/*!\brief Contact generation between colliding rigid bodies. /*!\brief Updates all hash grids and reassigns 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 ) 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 ----- // // ----- UPDATE PHASE ----- //
if (tt != NULL) tt->start("AddNewBodies"); if (tt != NULL) tt->start("AddNewBodies");
...@@ -921,6 +910,26 @@ PossibleContacts& HashGrids::generatePossibleContacts( WcTimingTree* tt ) ...@@ -921,6 +910,26 @@ PossibleContacts& HashGrids::generatePossibleContacts( WcTimingTree* tt )
} }
} }
if (tt != NULL) tt->stop("Update"); 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"); if (tt != NULL) tt->start("Detection");
// ----- DETECTION STEP ----- // // ----- DETECTION STEP ----- //
......
...@@ -276,6 +276,7 @@ public: ...@@ -276,6 +276,7 @@ public:
//@} //@}
//********************************************************************************************** //**********************************************************************************************
void update(WcTimingTree* tt);
//**Implementation of ICCD interface ******************************************************** //**Implementation of ICCD interface ********************************************************
virtual PossibleContacts& generatePossibleContacts( WcTimingTree* tt = NULL ); virtual PossibleContacts& generatePossibleContacts( WcTimingTree* tt = NULL );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment