From cf94bc7fad3787a03e5e17b8a60002d3a7a681b3 Mon Sep 17 00:00:00 2001 From: Christoph Rettinger <christoph.rettinger@fau.de> Date: Thu, 14 Jun 2018 17:33:55 +0200 Subject: [PATCH] Split selector functions into header and source files --- .../utility/BodySelectorFunctions.cpp | 50 +++++++++++++++++++ .../utility/BodySelectorFunctions.h | 29 ++++------- 2 files changed, 59 insertions(+), 20 deletions(-) create mode 100644 src/pe_coupling/utility/BodySelectorFunctions.cpp diff --git a/src/pe_coupling/utility/BodySelectorFunctions.cpp b/src/pe_coupling/utility/BodySelectorFunctions.cpp new file mode 100644 index 000000000..4c10f9502 --- /dev/null +++ b/src/pe_coupling/utility/BodySelectorFunctions.cpp @@ -0,0 +1,50 @@ +//====================================================================================================================== +// +// 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 BodySelectorFunctions.cpp +//! \ingroup pe_coupling +//! \author Christoph Rettinger <christoph.rettinger@fau.de> +// +//====================================================================================================================== + +#include "BodySelectorFunctions.h" + +#include "pe/rigidbody/RigidBody.h" + +namespace walberla { +namespace pe_coupling { + +bool selectAllBodies(pe::BodyID /*bodyID*/) +{ + return true; +} + +bool selectRegularBodies(pe::BodyID bodyID) +{ + return !bodyID->hasInfiniteMass() && !bodyID->isGlobal(); +} + +bool selectFixedBodies(pe::BodyID bodyID) +{ + return bodyID->hasInfiniteMass() && !bodyID->isGlobal(); +} + +bool selectGlobalBodies(pe::BodyID bodyID) +{ + return bodyID->isGlobal(); +} + +} // namespace pe_coupling +} // namespace walberla diff --git a/src/pe_coupling/utility/BodySelectorFunctions.h b/src/pe_coupling/utility/BodySelectorFunctions.h index 75bc5c93b..a811d416b 100644 --- a/src/pe_coupling/utility/BodySelectorFunctions.h +++ b/src/pe_coupling/utility/BodySelectorFunctions.h @@ -21,29 +21,18 @@ #pragma once -#include "pe/Types.h" +#include "pe/rigidbody/RigidBody.h" namespace walberla { namespace pe_coupling { -bool selectAllBodies(pe::BodyID /*bodyID*/) -{ - return true; -} - -bool selectRegularBodies(pe::BodyID bodyID) -{ - return !bodyID->hasInfiniteMass() && !bodyID->isGlobal(); -} - -bool selectFixedBodies(pe::BodyID bodyID) -{ - return bodyID->hasInfiniteMass() && !bodyID->isGlobal(); -} - -bool selectGlobalBodies(pe::BodyID bodyID) -{ - return bodyID->isGlobal(); -} +bool selectAllBodies(pe::BodyID /*bodyID*/); + +bool selectRegularBodies(pe::BodyID bodyID); + +bool selectFixedBodies(pe::BodyID bodyID); + +bool selectGlobalBodies(pe::BodyID bodyID); + } // namespace pe_coupling } // namespace walberla -- GitLab