Commit 1b7fb0b1 authored by Sebastian Eibl's avatar Sebastian Eibl
Browse files

Merge remote-tracking branch 'official/master' into pdeBoundary

parents 29f35cd4 281ce66f
---
Checks: '-*,bugprone-*,-bugprone-exception-escape,misc-*,-misc-misplaced-const,modernize-*,-modernize-use-auto,-modernize-loop-convert,-modernize-pass-by-value,-modernize-raw-string-literal,-modernize-use-using,-modernize-avoid-bind,-modernize-return-braced-init-list,-modernize-use-transparent-functors,-modernize-redundant-void-arg,performance-*'
WarningsAsErrors: '*'
HeaderFilterRegex: ''
AnalyzeTemporaryDtors: false
FormatStyle: none
User: si11fita
CheckOptions:
- key: modernize-loop-convert.MaxCopySize
value: '16'
- key: modernize-loop-convert.MinConfidence
value: reasonable
- key: modernize-loop-convert.NamingStyle
value: CamelCase
- key: modernize-make-shared.IgnoreMacros
value: '1'
- key: modernize-make-shared.IncludeStyle
value: '0'
- key: modernize-make-shared.MakeSmartPtrFunction
value: 'std::make_shared'
- key: modernize-make-shared.MakeSmartPtrFunctionHeader
value: memory
- key: modernize-make-unique.IgnoreMacros
value: '1'
- key: modernize-make-unique.IncludeStyle
value: '0'
- key: modernize-make-unique.MakeSmartPtrFunction
value: 'std::make_unique'
- key: modernize-make-unique.MakeSmartPtrFunctionHeader
value: memory
- key: modernize-pass-by-value.IncludeStyle
value: llvm
- key: modernize-pass-by-value.ValuesOnly
value: '0'
- key: modernize-raw-string-literal.ReplaceShorterLiterals
value: '0'
- key: modernize-replace-auto-ptr.IncludeStyle
value: llvm
- key: modernize-replace-random-shuffle.IncludeStyle
value: llvm
- key: modernize-use-auto.RemoveStars
value: '0'
- key: modernize-use-default-member-init.IgnoreMacros
value: '1'
- key: modernize-use-default-member-init.UseAssignment
value: '0'
- key: modernize-use-emplace.ContainersWithPushBack
value: '::std::vector;::std::list;::std::deque'
- key: modernize-use-emplace.SmartPointers
value: '::std::shared_ptr;::std::unique_ptr;::std::auto_ptr;::std::weak_ptr'
- key: modernize-use-emplace.TupleMakeFunctions
value: '::std::make_pair;::std::make_tuple'
- key: modernize-use-emplace.TupleTypes
value: '::std::pair;::std::tuple'
- key: modernize-use-equals-default.IgnoreMacros
value: '1'
- key: modernize-use-noexcept.ReplacementString
value: ''
- key: modernize-use-noexcept.UseNoexceptFalse
value: '1'
- key: modernize-use-nullptr.NullMacros
value: 'NULL'
- key: modernize-use-transparent-functors.SafeMode
value: '0'
- key: modernize-use-using.IgnoreMacros
value: '1'
...
......@@ -4,6 +4,9 @@ ui_*
qrc_*
*~
# macOS
**/.DS_Store
# Backup files of kate/kwrite
# Generated files
......
This diff is collapsed.
......@@ -4,6 +4,7 @@ List of contributors
Christian Feichtinger
Christian Godenschwager
Christoph Rettinger
Christoph Schwarzmeier
Daniel Ritter
Daniela Anderl
David Staubach
......
......@@ -1086,17 +1086,8 @@ if ( WALBERLA_BUILD_WITH_CUDA )
list( APPEND CUDA_NVCC_FLAGS "-Wno-deprecated-gpu-targets")
# FindCUDA does not respect system includes i.e. there are also warnings for boost etc reported (as of cmake 3.5.1)
# if all includes are added to the flags manually as sytem includes they occur double on the command line
# but the compiler seems to note the "isystem" not the "-I"
# it is also not possible to get all system include directories - so as a workaround we at least add boost here
# as system include
foreach( boostInclude ${Boost_INCLUDE_DIRS} AND NOT WALBERLA_CXX_COMPILER_IS_MSVC )
list( APPEND CUDA_NVCC_FLAGS "-isystem ${boostInclude}" )
endforeach()
if ( NOT "${CUDA_NVCC_FLAGS}" MATCHES "-std=" AND NOT WALBERLA_CXX_COMPILER_IS_MSVC )
list ( APPEND CUDA_NVCC_FLAGS "-std=c++11" )
list ( APPEND CUDA_NVCC_FLAGS "-std=c++14" )
endif ()
# Bug with gcc5 and cuda7.5:
......@@ -1327,3 +1318,12 @@ add_subdirectory ( apps )
waLBerla_export()
############################################################################################################################
############################################################################################################################
##
## clang-tidy
##
############################################################################################################################
waLBerla_link_files_to_builddir( .clang-tidy )
add_subdirectory( utilities )
waLBerla_add_executable( NAME WorkloadEvaluation FILES WorkloadEvaluation.cpp DEPENDS blockforest boundary core field lbm pe pe_coupling postprocessing stencil timeloop vtk )
if( WALBERLA_BUILD_WITH_PARMETIS )
waLBerla_add_executable( NAME AMRSedimentSettling FILES AMRSedimentSettling.cpp DEPENDS blockforest boundary core field lbm pe pe_coupling postprocessing stencil timeloop vtk )
endif()
\ No newline at end of file
add_subdirectory( AdaptiveMeshRefinementFluidParticleCoupling )
add_subdirectory( ComplexGeometry )
add_subdirectory( DEM )
add_subdirectory( MeshDistance )
add_subdirectory( CouetteFlow )
add_subdirectory( ForcesOnSphereNearPlaneInShearFlow )
add_subdirectory( NonUniformGrid )
add_subdirectory( MotionSingleHeavySphere )
add_subdirectory( PeriodicGranularGas )
add_subdirectory( PoiseuilleChannel )
add_subdirectory( SchaeferTurek )
add_subdirectory( UniformGrid )
\ No newline at end of file
add_subdirectory( UniformGrid )
......@@ -217,9 +217,9 @@ int main( int argc, char * argv[] )
typedef lbm::D3Q19<lbm::collision_model::SRT, false, lbm::force_model::SimpleConstant> LatticeModel_T;
typedef walberla::uint8_t flag_t;
typedef FlagField< flag_t > FlagField_T;
typedef lbm::PdfField< LatticeModel_T > PdfField_T;
using flag_t = walberla::uint8_t;
using FlagField_T = FlagField<flag_t>;
using PdfField_T = lbm::PdfField<LatticeModel_T>;
LatticeModel_T latticeModel{ lbm::collision_model::SRT( omega ), lbm::force_model::SimpleConstant( bodyForce ) };
......
ComplexGeometry
{
meshFile cube.obj;
coarseDx 0.2;
coarseDx 0.1;
coarseOmega 1.6;
coarseTimeSteps 1;
numLevels 2;
bodyForce <0.0001, 0, 0>;
blockSize <8,8,8>;
blockSize <16,16,16>;
domainBlowUp <5,5,5>; // simulation domain is blow up factor times mesh size per dimension
Boundaries {
......
......@@ -91,7 +91,6 @@
#include "vtk/Initialization.h"
#include "vtk/VTKOutput.h"
#include <boost/bind.hpp>
#include <boost/mpl/or.hpp>
#include <boost/type_traits/is_same.hpp>
......@@ -99,7 +98,9 @@
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <memory>
#include <utility>
#include <vector>
......@@ -138,12 +139,12 @@ typedef lbm::D3Q27< lbm::collision_model::TRT, true > D3Q27_TRT_COMP;
template< typename LatticeModel_T >
struct Types
{
typedef typename LatticeModel_T::Stencil Stencil_T;
typedef lbm::PdfField< LatticeModel_T > PdfField_T;
using Stencil_T = typename LatticeModel_T::Stencil;
using PdfField_T = lbm::PdfField<LatticeModel_T>;
};
typedef walberla::uint16_t flag_t;
typedef FlagField< flag_t > FlagField_T;
using flag_t = walberla::uint16_t;
using FlagField_T = FlagField<flag_t>;
const uint_t FieldGhostLayers = uint_t(4);
......@@ -241,7 +242,7 @@ class BorderRefinementSelection
public:
BorderRefinementSelection( const Setup & setup, const uint_t level, const real_t bufferDistance ) :
setup_( setup ), level_( level ), bufferDistance_( bufferDistance ) {}
setup_( setup ), level_( level ), bufferDistance_( bufferDistance ) { WALBERLA_UNUSED(setup_); }
void operator()( SetupBlockForest & forest )
{
......@@ -294,7 +295,7 @@ static shared_ptr< SetupBlockForest > createSetupBlockForest( const blockforest:
( setup.zCells + uint_t(2) * FieldGhostLayers ) ) * memoryPerCell;
forest->addRefinementSelectionFunction( refinementSelectionFunctions );
forest->addWorkloadMemorySUIDAssignmentFunction( boost::bind( workloadAndMemoryAssignment, _1, memoryPerBlock ) );
forest->addWorkloadMemorySUIDAssignmentFunction( std::bind( workloadAndMemoryAssignment, std::placeholders::_1, memoryPerBlock ) );
forest->init( AABB( real_c(0), real_c(0), real_c(0), real_c( setup.xBlocks * setup.xCells ),
real_c( setup.yBlocks * setup.yCells ),
......@@ -334,9 +335,9 @@ shared_ptr< blockforest::StructuredBlockForest > createStructuredBlockForest( co
MPIManager::instance()->useWorldComm();
auto bf = shared_ptr< BlockForest >( new BlockForest( uint_c( MPIManager::instance()->rank() ), sbffile.c_str(), true, false ) );
auto bf = std::make_shared< BlockForest >( uint_c( MPIManager::instance()->rank() ), sbffile.c_str(), true, false );
auto sbf = shared_ptr< StructuredBlockForest >( new StructuredBlockForest( bf, setup.xCells, setup.yCells, setup.zCells ) );
auto sbf = std::make_shared< StructuredBlockForest >( bf, setup.xCells, setup.yCells, setup.zCells );
sbf->createCellBoundingBoxes();
return sbf;
......@@ -349,9 +350,9 @@ shared_ptr< blockforest::StructuredBlockForest > createStructuredBlockForest( co
memoryPerCell, processMemoryLimit,
configBlock.getParameter< bool >( "outputSetupForest", false ) );
auto bf = shared_ptr< blockforest::BlockForest >( new blockforest::BlockForest( uint_c( MPIManager::instance()->rank() ), *sforest, false ) );
auto bf = std::make_shared< blockforest::BlockForest >( uint_c( MPIManager::instance()->rank() ), *sforest, false );
auto sbf = shared_ptr< blockforest::StructuredBlockForest >( new blockforest::StructuredBlockForest( bf, setup.xCells, setup.yCells, setup.zCells ) );
auto sbf = std::make_shared< blockforest::StructuredBlockForest >( bf, setup.xCells, setup.yCells, setup.zCells );
sbf->createCellBoundingBoxes();
return sbf;
......@@ -398,7 +399,7 @@ template< typename LatticeModel_T >
typename MyBoundaryHandling<LatticeModel_T>::BoundaryHandling_T *
MyBoundaryHandling<LatticeModel_T>::operator()( IBlock * const block ) const
{
typedef typename Types<LatticeModel_T>::PdfField_T PdfField_T;
using PdfField_T = typename Types< LatticeModel_T >::PdfField_T;
FlagField_T * flagField = block->getData< FlagField_T >( flagFieldId_ );
PdfField_T * pdfField = block->getData< PdfField_T > ( pdfFieldId_ );
......@@ -456,16 +457,16 @@ class ErrorVTKWriter : public vtk::BlockCellDataWriter< OutputType, 3 >
{
public:
typedef lbm::PdfField< LatticeModel_T > PdfField_T;
using PdfField_T = lbm::PdfField< LatticeModel_T >;
ErrorVTKWriter( const ConstBlockDataID & pdfFieldId, const std::string & id, const Setup & setup ) :
vtk::BlockCellDataWriter< OutputType, 3 >( id ), bdid_( pdfFieldId ), pdf_( NULL ), setup_( setup ) {}
vtk::BlockCellDataWriter< OutputType, 3 >( id ), bdid_( pdfFieldId ), pdf_( nullptr ), setup_( setup ) {}
protected:
void configure() { WALBERLA_ASSERT_NOT_NULLPTR( this->block_ ); pdf_ = this->block_->template getData< PdfField_T >( bdid_ ); }
void configure() override { WALBERLA_ASSERT_NOT_NULLPTR( this->block_ ); pdf_ = this->block_->template getData< PdfField_T >( bdid_ ); }
OutputType evaluate( const cell_idx_t x, const cell_idx_t y, const cell_idx_t z, const cell_idx_t f )
OutputType evaluate( const cell_idx_t x, const cell_idx_t y, const cell_idx_t z, const cell_idx_t f ) override
{
WALBERLA_ASSERT_NOT_NULLPTR( pdf_ );
......@@ -503,7 +504,7 @@ class MyVTKOutput {
public:
MyVTKOutput( const ConstBlockDataID & pdfField, const ConstBlockDataID & flagField,
vtk::VTKOutput::BeforeFunction pdfGhostLayerSync, const Setup & setup ) :
const vtk::VTKOutput::BeforeFunction& pdfGhostLayerSync, const Setup & setup ) :
setup_( setup ), pdfField_( pdfField ), flagField_( flagField ), pdfGhostLayerSync_( pdfGhostLayerSync ) {}
void operator()( std::vector< shared_ptr<vtk::BlockCellDataWriterInterface> > & writers,
......@@ -588,7 +589,7 @@ void addRefinementTimeStep( SweepTimeloop & timeloop, shared_ptr< blockforest::S
const bool syncComm, const bool fullComm, const bool linearExplosion,
shared_ptr< Sweep_T > & sweep, const std::string & info )
{
typedef typename MyBoundaryHandling< LatticeModel_T >::BoundaryHandling_T BH_T;
using BH_T = typename MyBoundaryHandling< LatticeModel_T >::BoundaryHandling_T;
auto ts = lbm::refinement::makeTimeStep< LatticeModel_T, BH_T >( blocks, sweep, pdfFieldId, boundaryHandlingId );
ts->asynchronousCommunication( !syncComm );
......@@ -611,7 +612,7 @@ struct AddRefinementTimeStep
{
if( pure )
{
typedef lbm::SplitPureSweep< LatticeModel_T > Sweep_T;
using Sweep_T = lbm::SplitPureSweep< LatticeModel_T >;
auto mySweep = make_shared< Sweep_T >( pdfFieldId );
addRefinementTimeStep< LatticeModel_T, Sweep_T >( timeloop, blocks, pdfFieldId, boundaryHandlingId, timingPool, levelwiseTimingPool,
......@@ -684,8 +685,8 @@ void run( const shared_ptr< Config > & config, const LatticeModel_T & latticeMod
Vector3< real_t >( initVelocity, real_c(0), real_c(0) ), real_t(1),
FieldGhostLayers, field::zyxf );
typedef typename lbm::Adaptor<LatticeModel_T>::VelocityVector VelocityAdaptor_T;
typedef typename lbm::Adaptor<LatticeModel_T>::Density DensityAdaptor_T;
using VelocityAdaptor_T = typename lbm::Adaptor< LatticeModel_T >::VelocityVector;
using DensityAdaptor_T = typename lbm::Adaptor< LatticeModel_T >::Density;
BlockDataID velocityAdaptorId = field::addFieldAdaptor< VelocityAdaptor_T >( blocks, pdfFieldId, "velocity adaptor" );
BlockDataID densityAdaptorId = field::addFieldAdaptor< DensityAdaptor_T >( blocks, pdfFieldId, "density adaptor" );
......@@ -736,11 +737,11 @@ void run( const shared_ptr< Config > & config, const LatticeModel_T & latticeMod
// evaluation
const auto exactSolutionFunction = boost::bind( exactVelocity, _1, blocks->getDomain(), setup.maxVelocity_L );
const auto exactSolutionFunction = std::bind( exactVelocity, std::placeholders::_1, blocks->getDomain(), setup.maxVelocity_L );
auto volumetricFlowRate = field::makeVolumetricFlowRateEvaluation< VelocityAdaptor_T, FlagField_T >( configBlock, blocks, velocityAdaptorId,
flagFieldId, Fluid_Flag,
boost::bind( exactFlowRate, setup.flowRate_L ),
std::bind( exactFlowRate, setup.flowRate_L ),
exactSolutionFunction );
volumetricFlowRate->setNormalizationFactor( real_t(1) / setup.maxVelocity_L );
volumetricFlowRate->setDomainNormalization( Vector3<real_t>( real_t(1) ) );
......@@ -994,7 +995,7 @@ int main( int argc, char **argv )
//WALBERLA_ROOT_SECTION() { logging::Logging::instance()->setLogLevel( logging::Logging::PROGRESS ); }
#ifdef _OPENMP
if( std::getenv( "OMP_NUM_THREADS" ) == NULL )
if( std::getenv( "OMP_NUM_THREADS" ) == nullptr )
WALBERLA_ABORT( "If you are using a version of the program that was compiled with OpenMP you have to "
"specify the environment variable \'OMP_NUM_THREADS\' accordingly!" );
#endif
......
waLBerla_add_executable( NAME DEM FILES DEM.cpp DEPENDS blockforest core pe )
//======================================================================================================================
//
// 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 DEM.cpp
//! \brief demonstration of basic functionality of DEM
//! \author Sebastian Eibl <sebastian.eibl@fau.de>
//
//======================================================================================================================
#include "pe/basic.h"
#include <blockforest/Initialization.h>
#include <core/DataTypes.h>
#include <string>
namespace walberla {
namespace dem {
real_t calcCoefficientOfRestitution(const real_t k, const real_t gamma, const real_t meff)
{
auto a = real_t(0.5) * gamma / meff;
return std::exp(-a * math::PI / std::sqrt(k / meff - a*a));
}
real_t calcCollisionTime(const real_t k, const real_t gamma, const real_t meff)
{
auto a = real_t(0.5) * gamma / meff;
return math::PI / std::sqrt( k/meff - a*a);
}
}
int main( int argc, char** argv )
{
using namespace walberla;
using namespace walberla::pe;
typedef boost::tuple<Sphere, Plane> BodyTuple ;
walberla::MPIManager::instance()->initializeMPI( &argc, &argv );
real_t dt = real_c(0.0001); //!< integration time
real_t radius = real_c(1); //!< particle radius
real_t density = real_c(2707); //!< particle density
real_t m = Sphere::calcMass( radius, density); //!< particle mass
std::string model = "kg"; //!< input model
real_t k = real_c(8.11e6); //!< linear spring stiffness
real_t gamma = real_c(6.86e1); //!< damper
real_t e = dem::calcCoefficientOfRestitution(k, gamma, m); //!< coefficient of restitution
real_t t = dem::calcCollisionTime(k, gamma, m); //!< collision time
for( int i = 1; i < argc; ++i )
{
if( std::strcmp( argv[i], "-dt" ) == 0 ) dt = real_c( std::stod( argv[++i] ) );
else if( std::strcmp( argv[i], "-radius" ) == 0 ) radius = real_c( std::stod( argv[++i] ) );
else if( std::strcmp( argv[i], "-density" ) == 0 ) density = real_c( std::stod( argv[++i] ) );
else if( std::strcmp( argv[i], "-kg" ) == 0 )
{
k = real_c( std::stod( argv[++i] ) );
gamma = real_c( std::stod( argv[++i] ) );
model = "kg";
}
else if( std::strcmp( argv[i], "-et" ) == 0 )
{
e = real_c( std::atof( argv[++i] ) );
t = real_c( std::atof( argv[++i] ) );
model = "et";
}
else WALBERLA_ABORT("Found invalid command line argument: \"" << argv[i] << "\" - aborting...");
}
m = Sphere::calcMass( radius, density);
if (model=="kg")
{
e = dem::calcCoefficientOfRestitution(k, gamma, m); //!< coefficient of restitution
t = dem::calcCollisionTime(k, gamma, m); //!< collision time
} else
WALBERLA_ABORT("unsupported model");
shared_ptr<BodyStorage> globalBodyStorage = make_shared<BodyStorage>();
// create blocks
shared_ptr< StructuredBlockForest > forest = blockforest::createUniformBlockGrid(
math::AABB(-5,-5,0,5,5,10),
uint_c( 1), uint_c( 1), uint_c( 1), // number of blocks in x,y,z direction
uint_c( 1), uint_c( 1), uint_c( 1), // how many cells per block (x,y,z)
true, // max blocks per process
false, false, false, // full periodicity
false);
SetBodyTypeIDs<BodyTuple>::execute();
auto storageID = forest->addBlockData(createStorageDataHandling<BodyTuple>(), "Storage");
auto hccdID = forest->addBlockData(ccd::createHashGridsDataHandling( globalBodyStorage, storageID ), "HCCD");
auto fcdID = forest->addBlockData(fcd::createGenericFCDDataHandling<BodyTuple, fcd::AnalyticCollideFunctor>(), "FCD");
cr::DEM cr(globalBodyStorage, forest->getBlockStoragePointer(), storageID, hccdID, fcdID);
const real_t static_cof ( real_t(0.4) / real_t(2) ); // Coefficient of static friction. Roughly 0.85 with high variation depending on surface roughness for low stresses. Note: pe doubles the input coefficient of friction for material-material contacts.
const real_t dynamic_cof ( static_cof ); // Coefficient of dynamic friction. Similar to static friction for low speed friction.
MaterialID material = createMaterial( "granular", density, e, static_cof, dynamic_cof, real_t( 0.5 ), 1, k, gamma, 0 );
pe::createPlane( *globalBodyStorage, 0, Vec3(0, 0, 1), forest->getDomain().minCorner(), material );
SphereID sp = pe::createSphere(
*globalBodyStorage,
forest->getBlockStorage(),
storageID,
999999999,
Vec3(0,0,1),
real_c(1.0),
material);
WALBERLA_CHECK_NOT_NULLPTR(sp);
sp->setLinearVel( Vec3(0,0,-1) );
uint_t steps = 0;
do
{
cr.timestep( dt );
++steps;
} while (cr.getNumberOfContacts() != 0);
WALBERLA_LOG_RESULT(std::setw(30) << "steps: " << steps );
WALBERLA_LOG_RESULT(std::setw(30) << "final velocity: " << sp->getLinearVel()[2]);
WALBERLA_LOG_RESULT(std::setw(30) << "final position: " << sp->getPosition()[2]);
WALBERLA_LOG_RESULT(std::setw(30) << "integration time: " << dt);
WALBERLA_LOG_RESULT(std::setw(30) << "particle radius: " << radius);
WALBERLA_LOG_RESULT(std::setw(30) << "particle density: " << density);
WALBERLA_LOG_RESULT(std::setw(30) << "particle mass: " << m);
WALBERLA_LOG_RESULT(std::setw(30) << "linear spring stiffness: " << k);
WALBERLA_LOG_RESULT(std::setw(30) << "damper: " << gamma);
WALBERLA_LOG_RESULT(std::setw(30) << "coefficient of restitution: " << e);
WALBERLA_LOG_RESULT(std::setw(30) << "collision time: " << t);
return EXIT_SUCCESS;
}
}
int main( int argc, char** argv )
{
return walberla::main(argc, argv);
}
......@@ -20,6 +20,8 @@
#include "blockforest/Initialization.h"
#include "blockforest/communication/UniformBufferedScheme.h"
#include <blockforest/loadbalancing/StaticCurve.h>
#include <blockforest/SetupBlockForest.h>
#include "boundary/all.h"
......@@ -62,6 +64,8 @@
#include "field/vtk/all.h"
#include "lbm/vtk/all.h"
#include <functional>
namespace forces_on_sphere_near_plane_in_shear_flow
{
......@@ -78,11 +82,11 @@ using walberla::uint_t;
// PDF field, flag field & body field
typedef lbm::D3Q19< lbm::collision_model::TRT, false > LatticeModel_T;
typedef LatticeModel_T::Stencil Stencil_T;
typedef lbm::PdfField< LatticeModel_T > PdfField_T;
using Stencil_T = LatticeModel_T::Stencil;
using PdfField_T = lbm::PdfField<LatticeModel_T>;
typedef walberla::uint8_t flag_t;
typedef FlagField< flag_t > FlagField_T;
using flag_t = walberla::uint8_t;
using FlagField_T = FlagField<flag_t>;
typedef GhostLayerField< pe::BodyID, 1 > BodyField_T;
const uint_t FieldGhostLayers = 4;
......@@ -109,7 +113,7 @@ const FlagUID MO_CLI_Flag( "moving obstacle CLI" );
// BLOCK STRUCTURE //
/////////////////////
static void refinementSelection( SetupBlockForest& forest, uint_t levels, AABB refinementBox )
static void refinementSelection( SetupBlockForest& forest, uint_t levels, const AABB& refinementBox )
{
real_t dx = real_t(1); // dx on finest level
for( auto block = forest.begin(); block != forest.end(); ++block )
......@@ -177,7 +181,7 @@ static shared_ptr< StructuredBlockForest > createBlockStructure( const AABB & do
WALBERLA_LOG_INFO_ON_ROOT(" - refinement box: " << refinementBox);
sforest.addRefinementSelectionFunction( boost::bind( refinementSelection, _1, numberOfLevels, refinementBox ) );
sforest.addRefinementSelectionFunction( std::bind( refinementSelection, std::placeholders::_1, numberOfLevels, refinementBox ) );
sforest.addWorkloadMemorySUIDAssignmentFunction( workloadAndMemoryAssignment );
sforest.init( domainAABB, numberOfCoarseBlocksPerDirection[0], numberOfCoarseBlocksPerDirection[1], numberOfCoarseBlocksPerDirection[2], true, true, false );
......@@ -576,7 +580,7 @@ int main( int argc, char **argv )
// set up synchronization procedure
const real_t overlap = real_t( 1.5 ) * dx;
std::function<void(void)> syncCall = boost::bind( pe::syncShadowOwners<BodyTypeTuple>, boost::ref(blocks->getBlockForest()), bodyStorageID, static_cast<WcTimingTree*>(NULL), overlap, false );
std::function<void(void)> syncCall = std::bind( pe::syncShadowOwners<BodyTypeTuple>, std::ref(blocks->getBlockForest()), bodyStorageID, static_cast<WcTimingTree*>(nullptr), overlap, false );
// create pe bodies
......@@ -608,7 +612,7 @@ int main( int argc, char **argv )
BlockDataID flagFieldID = field::addFlagFieldToStorage<FlagField_T>( blocks, "flag field", FieldGhostLayers );
// add body field
BlockDataID bodyFieldID = field::addToStorage<BodyField_T>( blocks, "body field", NULL, field::zyxf, FieldGhostLayers );
BlockDataID bodyFieldID = field::addToStorage<BodyField_T>( blocks, "body field", nullptr, field::zyxf, FieldGhostLayers );
// add boundary handling
BlockDataID boundaryHandlingID = blocks->addStructuredBlockData< BoundaryHandling_T >( MyBoundaryHandling( flagFieldID, pdfFieldID, bodyFieldID ), "boundary handling" );
......
......@@ -58,6 +58,7 @@
#include "vtk/Initialization.h"
#include "vtk/VTKOutput.h"
#include <functional>
#include <memory>
......@@ -77,11 +78,11 @@ using walberla::uint_t;
// PDF field, flag field & body field
typedef lbm::D3Q19< lbm::collision_model::TRT, false > LatticeModel_T;
typedef LatticeModel_T::Stencil Stencil_T;
typedef lbm::PdfField< LatticeModel_T > PdfField_T;
using Stencil_T = LatticeModel_T::Stencil;
using PdfField_T = lbm::PdfField<LatticeModel_T>;
typedef walberla::uint8_t flag_t;
typedef FlagField< flag_t > FlagField_T;
using flag_t = walberla::uint8_t;
using FlagField_T = FlagField<flag_t>;