Skip to content
Snippets Groups Projects
Commit 02adfdcd authored by Christoph Rettinger's avatar Christoph Rettinger
Browse files

Merge branch 'squirmer' into 'master'

pe_coupling geometry: squirmers are spheres too

See merge request walberla/walberla!129
parents 3ebfa15a bd03d2d3
Branches
Tags
No related merge requests found
......@@ -27,6 +27,7 @@
#include "pe/rigidbody/RigidBody.h"
#include "pe/rigidbody/Sphere.h"
#include "pe/rigidbody/Plane.h"
#include "pe/rigidbody/Squirmer.h"
namespace walberla {
namespace geometry {
......@@ -83,6 +84,21 @@ template<> inline bool contains( const pe::Sphere & peSphere, const Vector3<real
return peSphere.containsPoint( point[0], point[1], point[2] );
}
template<> inline FastOverlapResult fastOverlapCheck( const pe::Squirmer & peSquirmer, const AABB & box )
{
return fastOverlapCheck( static_cast<const pe::Sphere &>(peSquirmer), box );
}
template<> inline FastOverlapResult fastOverlapCheck( const pe::Squirmer & peSquirmer, const Vector3<real_t> & cellMidpoint, const Vector3<real_t> & dx )
{
return fastOverlapCheck( static_cast<const pe::Sphere &>(peSquirmer), cellMidpoint, dx );
}
template<> inline bool contains( const pe::Squirmer & peSquirmer, const Vector3<real_t> & point )
{
return contains( static_cast<const pe::Sphere &>(peSquirmer), point );
}
/////////////////////////////////////////////////
// specialization for pe::Plane //
/////////////////////////////////////////////////
......
......@@ -29,6 +29,7 @@
#include "pe/rigidbody/Ellipsoid.h"
#include "pe/rigidbody/Plane.h"
#include "pe/rigidbody/Sphere.h"
#include "pe/rigidbody/Squirmer.h"
#include "pe/Types.h"
......@@ -52,7 +53,7 @@ inline real_t intersectionRatio( const pe::RigidBody & peRigidBody,
const Vector3<real_t> & direction,
const real_t epsilon )
{
if( peRigidBody.getTypeID() == pe::Sphere::getStaticTypeID() )
if( peRigidBody.getTypeID() == pe::Sphere::getStaticTypeID() || peRigidBody.getTypeID() == pe::Squirmer::getStaticTypeID() )
{
const pe::Sphere & sphere = static_cast< const pe::Sphere & >( peRigidBody );
const real_t ratio = intersectionRatioSpherePe( sphere, fluidPoint, direction );
......
......@@ -25,6 +25,7 @@
#include "pe/rigidbody/RigidBody.h"
#include "pe/rigidbody/Sphere.h"
#include "pe/rigidbody/Squirmer.h"
#include "pe/rigidbody/Plane.h"
#include "PeBodyOverlapFunctions.h"
......@@ -36,7 +37,7 @@ namespace pe_coupling{
real_t overlapFractionPe( const pe::RigidBody & peRigidBody, const Vector3<real_t> & cellMidpoint,
const Vector3<real_t> & dx, uint_t maxDepth=4 )
{
if( peRigidBody.getTypeID() == pe::Sphere::getStaticTypeID() )
if( peRigidBody.getTypeID() == pe::Sphere::getStaticTypeID() || peRigidBody.getTypeID() == pe::Squirmer::getStaticTypeID() )
{
const pe::Sphere & sphere = static_cast< const pe::Sphere & >( peRigidBody );
return geometry::overlapFraction( sphere, cellMidpoint, dx, maxDepth );
......
......@@ -24,6 +24,7 @@
#include "pe/rigidbody/RigidBody.h"
#include "pe/rigidbody/Sphere.h"
#include "pe/rigidbody/Squirmer.h"
namespace walberla {
namespace pe_coupling {
......@@ -32,7 +33,7 @@ namespace pe_coupling {
// calculates sphere-equivalent diameter (diameter of a sphere with same volume as given body)
real_t getSphereEquivalentDiameter( pe::RigidBody & body )
{
if( body.getTypeID() == pe::Sphere::getStaticTypeID() )
if( body.getTypeID() == pe::Sphere::getStaticTypeID() || body.getTypeID() == pe::Squirmer::getStaticTypeID() )
{
pe::Sphere & sphere = static_cast<pe::Sphere &>( body );
real_t radius = sphere.getRadius();
......
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