diff --git a/src/pe/rigidbody/Node.h b/src/pe/rigidbody/Node.h deleted file mode 100644 index 584d44e4f5bb66ce8c2d55d7891992178776160e..0000000000000000000000000000000000000000 --- a/src/pe/rigidbody/Node.h +++ /dev/null @@ -1,137 +0,0 @@ -//====================================================================================================================== -// -// This file is part of waLBerla. waLBerla is free software: you can -// redistribute it and/or modify it under the terms of the GNU General Public -// License as published by the Free Software Foundation, either version 3 of -// the License, or (at your option) any later version. -// -// waLBerla is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -// for more details. -// -// You should have received a copy of the GNU General Public License along -// with waLBerla (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. -// -//! \file Node.h -//! \author Klaus Iglberger -//! \author Sebastian Eibl <sebastian.eibl@fau.de> -// -//====================================================================================================================== - -#pragma once - - -//************************************************************************************************* -// Includes -//************************************************************************************************* - -#include <pe/Types.h> -#include <core/DataTypes.h> - -namespace walberla { -namespace pe { - -//================================================================================================= -// -// SPECIALIZATION FOR THE UNION FIND ALGORITHM -// -//================================================================================================= - -//************************************************************************************************* -/*!\brief Node for the 'Union Find' algorithm. - * - * This specialization of the BodyTrait class template adapts rigid bodies to the 'Union Find' - * batch generation algorithm. In this algorithm, rigid bodies act as nodes in a graph and - * contacts between the rigid bodies act as edges. - */ -class Node -{ -public: - - //**Constructor********************************************************************************* - /*!\name Constructor */ - //@{ - explicit inline Node(); - //@} - //********************************************************************************************** - - //**Node functions****************************************************************************** - /*!\name Node functions */ - //@{ - inline ConstNodeID getRoot() const; - inline void resetNode() const; - //@} - //********************************************************************************************** - -public: - //**Member variables**************************************************************************** - /*!\name Member variables */ - //@{ - mutable ConstNodeID root_; //!< The root of the contact graph containing the rigid body. - mutable size_t rank_; //!< The current rank of the rigid body in the contact graph. - mutable size_t batch_; //!< Index of the batch containing all contacts in the contact graph. - //@} - //********************************************************************************************** -}; -//************************************************************************************************* - - -//************************************************************************************************* -/*!\brief Default constructor for the BodyTrait<UnionFind> specialization. - */ -inline Node::Node() - : rank_ ( 0 ) - , batch_( 0 ) -{ - root_ = this ; -} -//************************************************************************************************* - - -//************************************************************************************************* -/*!\brief Calculating the current root of the contact graph. - * - * \return The current root of the contact graph. - * - * This function returns the current root of the contact graph and compresses the graph for - * a fast access to the root node. - */ -inline ConstNodeID Node::getRoot() const -{ - ConstNodeID root( this ); - - // Traverse the contact graph to find the root node - while( root->root_ != root ) { - root = root->root_; - } - - // Retraverse the graph for graph compression - ConstNodeID tmp( this ); - while( tmp->root_ != tmp ) { - ConstNodeID last = tmp; - tmp = tmp->root_; - last->root_ = root; - } - - return root; -} -//************************************************************************************************* - - -//************************************************************************************************* -/*!\brief Resetting the data members of the node. - * - * \return void - */ -inline void Node::resetNode() const -{ - root_ = this; - rank_ = 0; - batch_ = 0; -} -//************************************************************************************************* - -} // namespace pe - -} // namespace walberla diff --git a/src/pe/rigidbody/RigidBody.cpp b/src/pe/rigidbody/RigidBody.cpp index eb57563de73b9c99950e516815f3f39752c1510f..f23bde4e08d0e5c320a89a356cfdb3cdc2988e18 100644 --- a/src/pe/rigidbody/RigidBody.cpp +++ b/src/pe/rigidbody/RigidBody.cpp @@ -33,8 +33,7 @@ namespace pe{ * \param uid The user-specific ID of the rigid body. */ RigidBody::RigidBody( id_t const typeID, id_t sid, id_t uid ) - : Node() - , awake_( true ) // Sleep mode flag + : awake_( true ) // Sleep mode flag , mass_( 0 ) // Total mass of the rigid body , invMass_( 0 ) // Inverse total mass of the rigid body , motion_(sleepThreshold) // The current motion of the rigid body diff --git a/src/pe/rigidbody/RigidBody.h b/src/pe/rigidbody/RigidBody.h index 69033ffe953dd02079ba9e9295cde00d6f693bb8..c457cb88ff4c9b289a854f5ef3f0dd1fad368271 100644 --- a/src/pe/rigidbody/RigidBody.h +++ b/src/pe/rigidbody/RigidBody.h @@ -28,7 +28,6 @@ #include "core/math/Matrix3.h" #include "core/math/Quaternion.h" #include "core/math/Vector3.h" -#include <pe/rigidbody/Node.h> #include "core/NonCopyable.h" #include "core/DataTypes.h" @@ -48,8 +47,7 @@ class Union; /** * \ingroup pe */ -class RigidBody : public Node - , public ccd::HashGridsBodyTrait +class RigidBody : public ccd::HashGridsBodyTrait , public cr::HCSITSBodyTrait , private NonCopyable {