Commit 2c007046 authored by Sebastian Eibl's avatar Sebastian Eibl
Browse files

Merge branch 'master' of i10git.cs.fau.de:walberla/walberla

parents 8d804824 b82da6d8
......@@ -25,7 +25,7 @@
#include "core/debug/Debug.h"
#include "stencil/Directions.h"
#include <array>
namespace walberla {
namespace blockforest {
......@@ -94,31 +94,28 @@ inline uint_t getBlockMaxNeighborhoodSectionSize( const uint_t sectionIndex )
inline const uint_t * getFaceNeighborhoodSectionIndices()
inline const std::array<uint_t, 6> & getFaceNeighborhoodSectionIndices()
{
static const uint_t faces[] = { uint_t(4), uint_t(10), uint_t(12), uint_t(13), uint_t(15), uint_t(21) };
static std::array<uint_t, 6> faces{ { uint_t(4), uint_t(10), uint_t(12), uint_t(13), uint_t(15), uint_t(21) } };
return faces;
}
inline const uint_t * getEdgeNeighborhoodSectionIndices()
inline const std::array<uint_t,12> & getEdgeNeighborhoodSectionIndices()
{
static const uint_t edges[] = { uint_t( 1), uint_t( 3), uint_t( 5), uint_t( 7), uint_t( 9), uint_t(11),
uint_t(14), uint_t(16), uint_t(18), uint_t(20), uint_t(22), uint_t(24) };
static std::array<uint_t,12> edges{{ uint_t( 1), uint_t( 3), uint_t( 5), uint_t( 7), uint_t( 9), uint_t(11),
uint_t(14), uint_t(16), uint_t(18), uint_t(20), uint_t(22), uint_t(24) }};
return edges;
}
inline const uint_t * getCornerNeighborhoodSectionIndices()
inline const std::array<uint_t, 8> & getCornerNeighborhoodSectionIndices()
{
static const uint_t corners[] = { uint_t( 0), uint_t( 2), uint_t( 6), uint_t( 8),
uint_t(17), uint_t(19), uint_t(23), uint_t(25) };
static std::array<uint_t, 8> corners {{ uint_t( 0), uint_t( 2), uint_t( 6), uint_t( 8),
uint_t(17), uint_t(19), uint_t(23), uint_t(25) }};
return corners;
}
} // namespace blockforest
} // namespace walberla
......@@ -409,8 +409,8 @@ bool DynamicDiffusionBalance< PhantomData_T >::operator()( std::vector< std::pai
const uint_t level = levelwise_ ? block->getLevel() : uint_t(0);
if( level == l && targetProcess[i].second == blockforest.getProcess() )
{
const uint_t * faces = blockforest::getFaceNeighborhoodSectionIndices();
for( uint_t j = uint_t(0); j != uint_t(6); ++j )
auto faces = blockforest::getFaceNeighborhoodSectionIndices();
for( uint_t j = uint_t(0); j != faces.size(); ++j )
{
const uint_t sectionIndex = faces[j];
const uint_t sectionSize = block->getNeighborhoodSectionSize( sectionIndex );
......@@ -427,8 +427,8 @@ bool DynamicDiffusionBalance< PhantomData_T >::operator()( std::vector< std::pai
}
}
}
const uint_t * edges = blockforest::getEdgeNeighborhoodSectionIndices();
for( uint_t j = uint_t(0); j != uint_t(12); ++j )
auto edges = blockforest::getEdgeNeighborhoodSectionIndices();
for( uint_t j = uint_t(0); j != edges.size(); ++j )
{
const uint_t sectionIndex = edges[j];
const uint_t sectionSize = block->getNeighborhoodSectionSize( sectionIndex );
......@@ -445,8 +445,8 @@ bool DynamicDiffusionBalance< PhantomData_T >::operator()( std::vector< std::pai
}
}
}
const uint_t * corners = blockforest::getCornerNeighborhoodSectionIndices();
for( uint_t j = uint_t(0); j != uint_t(8); ++j )
auto corners = blockforest::getCornerNeighborhoodSectionIndices();
for( uint_t j = uint_t(0); j != corners.size(); ++j )
{
const uint_t sectionIndex = corners[j];
const uint_t sectionSize = block->getNeighborhoodSectionSize( sectionIndex );
......@@ -655,8 +655,8 @@ bool DynamicDiffusionBalance< PhantomData_T >::operator()( std::vector< std::pai
{
if( regardConnectivity_ && iteration < disregardConnectivityStart_ )
{
const uint_t * faces = blockforest::getFaceNeighborhoodSectionIndices();
for( uint_t j = uint_t(0); j != uint_t(6); ++j )
auto faces = blockforest::getFaceNeighborhoodSectionIndices();
for( uint_t j = uint_t(0); j != faces.size(); ++j )
{
const uint_t sectionIndex = faces[j];
const uint_t sectionSize = block->getNeighborhoodSectionSize( sectionIndex );
......@@ -675,8 +675,8 @@ bool DynamicDiffusionBalance< PhantomData_T >::operator()( std::vector< std::pai
}
}
}
const uint_t * edges = blockforest::getEdgeNeighborhoodSectionIndices();
for( uint_t j = uint_t(0); j != uint_t(12); ++j )
auto edges = blockforest::getEdgeNeighborhoodSectionIndices();
for( uint_t j = uint_t(0); j != edges.size(); ++j )
{
const uint_t sectionIndex = edges[j];
const uint_t sectionSize = block->getNeighborhoodSectionSize( sectionIndex );
......@@ -695,8 +695,8 @@ bool DynamicDiffusionBalance< PhantomData_T >::operator()( std::vector< std::pai
}
}
}
const uint_t * corners = blockforest::getCornerNeighborhoodSectionIndices();
for( uint_t j = uint_t(0); j != uint_t(8); ++j )
auto corners = blockforest::getCornerNeighborhoodSectionIndices();
for( uint_t j = uint_t(0); j != corners.size(); ++j )
{
const uint_t sectionIndex = corners[j];
const uint_t sectionSize = block->getNeighborhoodSectionSize( sectionIndex );
......
......@@ -1170,7 +1170,11 @@ const Vec3 RigidBody::accFromWF( real_t px, real_t py, real_t pz ) const
}
//*************************************************************************************************
inline id_t RigidBody::getTypeID() const{
inline id_t RigidBody::getTypeID() const
{
WALBERLA_ASSERT_LESS( typeID_, std::numeric_limits<id_t>::max(), "You are requesting the type " \
" id of a body, but the static type id for the body has not yet been " \
" initialized! Call SetBodyTypeIDs<BodyTypeTuple>::execute to initialize!" );
return typeID_;
}
......
......@@ -48,7 +48,7 @@
using namespace walberla;
using namespace walberla::pe;
typedef boost::tuple<Box, Capsule, Plane, Sphere, Union<boost::tuple<Sphere, Union<boost::tuple<Sphere>>>>, Ellipsoid> BodyTuple ;
typedef boost::tuple<Box, Capsule, Plane, Sphere, Union<boost::tuple<Sphere>>, Union<boost::tuple<Sphere, Union<boost::tuple<Sphere>>>>, Ellipsoid> BodyTuple ;
bool gjkEPAcollideHybrid(GeomPrimitive &geom1, GeomPrimitive &geom2, Vec3& normal, Vec3& contactPoint, real_t& penetrationDepth)
{
......
......@@ -19,18 +19,19 @@
//======================================================================================================================
#include "pe/Materials.h"
#include "pe/rigidbody/Sphere.h"
#include "pe/Types.h"
#include "pe/rigidbody/BodyStorage.h"
#include "pe/rigidbody/SetBodyTypeIDs.h"
#include "pe/rigidbody/Sphere.h"
#include "pe/ccd/SimpleCCD.h"
#include "pe/ccd/HashGrids.h"
#include "pe/fcd/SimpleFCD.h"
#include "core/DataTypes.h"
#include "core/DataTypes.h"
#include "core/UniqueID.h"
#include "core/timing/TimingPool.h"
#include "core/debug/TestSubsystem.h"
#include "core/math/Random.h"
#include "core/UniqueID.h"
using namespace walberla;
using namespace walberla::pe;
......@@ -43,6 +44,8 @@ int main( int argc, char** argv )
walberla::MPIManager::instance()->initializeMPI( &argc, &argv );
SetBodyTypeIDs<BodyTuple>::execute();
MaterialID iron = Material::find("iron");
BodyStorage globalStorage;
......
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