Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
No results found
Show changes
Commits on Source (261)
Showing
with 1254 additions and 1778 deletions
...@@ -61,21 +61,21 @@ IncludeCategories: ...@@ -61,21 +61,21 @@ IncludeCategories:
Priority: 3 Priority: 3
- Regex: '^"core/' - Regex: '^"core/'
Priority: 4 Priority: 4
- Regex: '^"cuda/'
Priority: 5
- Regex: '^"domain_decomposition/' - Regex: '^"domain_decomposition/'
Priority: 6 Priority: 5
- Regex: '^"executiontree/' - Regex: '^"executiontree/'
Priority: 7 Priority: 6
- Regex: '^"fft/' - Regex: '^"fft/'
Priority: 8 Priority: 7
- Regex: '^"field/' - Regex: '^"field/'
Priority: 9 Priority: 8
- Regex: '^"gather/' - Regex: '^"gather/'
Priority: 10 Priority: 9
- Regex: '^"geometry/' - Regex: '^"geometry/'
Priority: 10
- Regex: '^"gpu/'
Priority: 11 Priority: 11
- Regex: '^"gui/' - Regex: '^"gpu/'
Priority: 12 Priority: 12
- Regex: '^"lbm/' - Regex: '^"lbm/'
Priority: 13 Priority: 13
...@@ -97,16 +97,18 @@ IncludeCategories: ...@@ -97,16 +97,18 @@ IncludeCategories:
Priority: 21 Priority: 21
- Regex: '^"simd/' - Regex: '^"simd/'
Priority: 22 Priority: 22
- Regex: '^"stencil/' - Regex: '^"sqlite/'
Priority: 23 Priority: 23
- Regex: '^"timeloop/' - Regex: '^"stencil/'
Priority: 24 Priority: 24
- Regex: '^"vtk/' - Regex: '^"timeloop/'
Priority: 25 Priority: 25
- Regex: '^<boost/' - Regex: '^"vtk/'
Priority: 26 Priority: 26
- Regex: '^<' - Regex: '^<boost/'
Priority: 27 Priority: 27
- Regex: '^<'
Priority: 28
IndentCaseLabels: false IndentCaseLabels: false
IndentPPDirectives: AfterHash IndentPPDirectives: AfterHash
IndentWidth: 3 IndentWidth: 3
......
...@@ -4,30 +4,39 @@ Checks: ' ...@@ -4,30 +4,39 @@ Checks: '
-*, -*,
boost-*, boost-*,
-boost-use-ranges,
bugprone-*, bugprone-*,
-bugprone-branch-clone, -bugprone-branch-clone,
-bugprone-exception-escape, -bugprone-exception-escape,
-bugprone-easily-swappable-parameters,
-bugprone-crtp-constructor-accessibility,
-bugprone-implicit-widening-of-multiplication-result,
-bugprone-macro-parentheses,
-bugprone-narrowing-conversions,
-bugprone-switch-missing-default-case,
-bugprone-assignment-in-if-condition,
-bugprone-reserved-identifier,
misc-*, misc-*,
-misc-misplaced-const,
-misc-no-recursion, -misc-no-recursion,
-misc-non-private-member-variables-in-classes, -misc-non-private-member-variables-in-classes,
-misc-include-cleaner,
-misc-header-include-cycle,
-misc-use-internal-linkage,
-misc-use-anonymous-namespace,
-misc-const-correctness,
-misc-misplaced-const
modernize-*, modernize-*,
-modernize-use-auto, -modernize-use-auto,
-modernize-loop-convert,
-modernize-pass-by-value, -modernize-pass-by-value,
-modernize-raw-string-literal, -modernize-raw-string-literal,
-modernize-use-using,
-modernize-avoid-bind,
-modernize-return-braced-init-list,
-modernize-use-transparent-functors, -modernize-use-transparent-functors,
-modernize-redundant-void-arg,
-modernize-use-trailing-return-type, -modernize-use-trailing-return-type,
-modernize-avoid-c-arrays,
-modernize-concat-nested-namespaces,
-modernize-use-nodiscard, -modernize-use-nodiscard,
-modernize-macro-to-enum,
-modernize-concat-nested-namespaces,
mpi-*, mpi-*,
-mpi-type-mismatch, -mpi-type-mismatch,
...@@ -37,25 +46,25 @@ openmp-*, ...@@ -37,25 +46,25 @@ openmp-*,
-openmp-use-default-none, -openmp-use-default-none,
performance-*, performance-*,
-performance-enum-size,
-performance-noexcept-swap,
-performance-unnecessary-value-param,
-performance-avoid-endl,
-performance-no-int-to-ptr,
portability-*, portability-*,
readability-const-return-type,
readability-container-size-empty, readability-container-size-empty,
readability-delete-null-pointer, readability-delete-null-pointer,
readability-deleted-default, readability-deleted-default,
readability-isolate-declaration,
readability-misleading-indentation,
readability-misplaced-array-index, readability-misplaced-array-index,
readability-non-const-parameter, readability-non-const-parameter,
readability-redundant-access-specifiers,
readability-redundant-control-flow, readability-redundant-control-flow,
readability-redundant-declaration, readability-redundant-declaration,
readability-redundant-function-ptr-dereference, readability-redundant-function-ptr-dereference,
readability-redundant-preprocessor, readability-redundant-preprocessor,
readability-redundant-smartptr-get, readability-redundant-smartptr-get,
readability-redundant-string-cstr, readability-redundant-string-cstr,
readability-simplify-boolean-expr,
readability-simplify-subscript-expr, readability-simplify-subscript-expr,
readability-static-accessed-through-instance, readability-static-accessed-through-instance,
readability-static-definition-in-anonymous-namespace, readability-static-definition-in-anonymous-namespace,
......
# See https://editorconfig.org/ # See https://editorconfig.org/
root = true # top-most .editorconfig-file # top-most .editorconfig-file
root = true
[*] [*]
tab_width = 3 tab_width = 3
...@@ -12,4 +13,4 @@ insert_final_newline = false ...@@ -12,4 +13,4 @@ insert_final_newline = false
[*.py] [*.py]
tab_width = 4 tab_width = 4
indent_size = 4 indent_size = 4
insert_final_newline = true insert_final_newline = true
\ No newline at end of file
...@@ -8,6 +8,10 @@ qrc_* ...@@ -8,6 +8,10 @@ qrc_*
# macOS # macOS
**/.DS_Store **/.DS_Store
# CLion indexing
*.uuid
.fleet
# Generated files # Generated files
*.out *.out
...@@ -29,9 +33,12 @@ qrc_* ...@@ -29,9 +33,12 @@ qrc_*
# Visual Studio Code # Visual Studio Code
/.vscode /.vscode
# Zed
/.cache*
# CLion # CLion
*.idea *.idea
*.clion*
# QtCreator # QtCreator
CMakeLists.txt.user.* CMakeLists.txt.user.*
...@@ -48,6 +55,8 @@ CMakeLists.txt.user.* ...@@ -48,6 +55,8 @@ CMakeLists.txt.user.*
logfile*.txt logfile*.txt
*TestLog_p*.txt *TestLog_p*.txt
# Python venv
.venv
# Compiled python # Compiled python
*.pyc *.pyc
...@@ -60,7 +69,9 @@ logfile*.txt ...@@ -60,7 +69,9 @@ logfile*.txt
# CMake # CMake
CMakeUserPresets.json
/CMakeLists.txt.user /CMakeLists.txt.user
CMakeUserPresets.json
# CMake build files # CMake build files
CMakeFiles CMakeFiles
...@@ -73,3 +84,10 @@ CMakeDefs.h ...@@ -73,3 +84,10 @@ CMakeDefs.h
/moduleStatistics.json /moduleStatistics.json
/walberla-config.cmake /walberla-config.cmake
cmake-build-* cmake-build-*
# Virtual environments
.venv/
env/
venv/
ENV/
This diff is collapsed.
[submodule "extern/pybind11"]
path = extern/pybind11
url = https://github.com/pybind/pybind11.git
...@@ -31,6 +31,7 @@ Matthias Markl ...@@ -31,6 +31,7 @@ Matthias Markl
Michael Kuron Michael Kuron
Nils Kohl Nils Kohl
Paulo Carvalho Paulo Carvalho
Philipp Suffa
Regina Ammer Regina Ammer
Sagar Dolas Sagar Dolas
Sebastian Eibl Sebastian Eibl
......
# Changelog # Changelog
## [7.1] - 2025-04-11
### Build System
- Bump minimum required CMake version to 3.24
- Add support for clang-mode of the Fujitsu C++ compiler (`FCC -nclang`)
- Remove support for PGI and NEC SXI compilers
- Introduce qualified export targets (`walberla::<module>`) and deprecate unqualified waLBerla module targets
### Modules
#### Core
- Add `DeviceSynchronize` timing policy which synchronizes with GPUs before time measurements
#### GPU
- Add support for AMD HIP / ROCm
- Add generic aliases for CUDA/HIP runtime API functions
- Minor improvements to `UniformGpuScheme`.
#### Blockforest
- Allow blocks to be removed during the refinement process when a user-defined criterion is fulfilled,
for example, when blocks are entirely inside an object.
#### Field
- Improve SIMD support, especially data alignment with SVE
- Change default data layout from AoS (zyxf) to SoA (fzyx) in all data creation functions
#### LBM & Code Generation
- Introduce new `lbm_generated` module providing and supporting automatically generated implementations
of lattice Boltzmann methods on uniform and refined grids, for CPU and GPU targets
- Integration of a new mesh refinement procedure (described in [this bachelor's thesis](https://www10.cs.fau.de/publications/theses/2021/Bachelor_HennigFrederik.pdf))
- Adaptation of this mesh refinement procedure for GPUs
- Add code generation for the partially saturated cells method (published: [doi:10.1177/10943420241313385](https://doi.org/10.1177/10943420241313385))
- Stability checker now supports custom Functor as checking criterium
#### Mesa-PD
- Refactor load balancing to remove interdependency with `pe` module
#### Python-Bindings
- Replace `pycuda` with `cupy` for representing GPU arrays
#### VTK
- Introduce OverlappingAMR format in VTKWriter
- Allow one file per process (instead of one file per block) for unstructured VTKWriter
### Applications
#### Showcases
- Add *Fluidized Bed* showcase using the PSM method
- Add *Antidunes* showcase (published: [doi:10.1017/jfm.2023.262](https://doi.org/10.1017/jfm.2023.262))
- Feature extensions to the *Particle Packing* showcase
- Add FlowAroundSphere showcase, which shows complex phenomenon of the drag crisis
(published in chapter 6 of [doi:10.25593/open-fau-1432](https://doi.org/10.25593/open-fau-1432))
- Added Thermocapillary showcase, which shows interaction of the Allen-Cahn phasefield model
under the influence of a temperature gradient.
The results are published at [doi:10.1016/j.jcp.2024.113337](https://doi.org/10.1016/j.jcp.2024.113337)
and in chapter 8 of [doi:10.25593/open-fau-1432](https://doi.org/10.25593/open-fau-1432)
#### Benchmarks
- Add mass advection benchmarks for the free-surface LBM
- Add *Zalesak's Rotating Disk* benchmark for the free-surface LBM
- Add `NonUniformGridCPU` and `NonUniformGridGPU` benchmarks for new mesh refinement algorithms on GPU and CPU hardware
- Add adapted forms of the UniformGridGPU and UniformGridCPU benchmarks using code generation.
New results of these benchmarks in large scales are published in chapter 9 of [doi:10.25593/open-fau-1432](https://doi.org/10.25593/open-fau-1432)
### Deprecations and Removals
- Deprecated `pe` module, slated for removal in the next release
- Removed `gui` module
## [6.1] - 2022-07-25 ## [6.1] - 2022-07-25
### Added ### Added
- Free-surface LBM extension: - Free-surface LBM extension:
...@@ -13,6 +96,11 @@ ...@@ -13,6 +96,11 @@
- Add support for more shapes, e.g., convex polyhedron - Add support for more shapes, e.g., convex polyhedron
- MESA_PD: - MESA_PD:
- Add extensive application for dense particle packing generation - Add extensive application for dense particle packing generation
- AMD - HIP support
- Support of the ROCm Toolchain and thus AMD HIP as second GPU language
- All CUDA related files, namespaces, folders etc are renamed to gpu.
- Include "GPUWrapper.h" to use general GPU functions cudaMalloc -> gpuMalloc
- WALBERLA_BUILD_WITH_HIP and WALBERLA_BUILD_WITH_GPU_SUPPORT as new CMake variables introduced
### Changed ### Changed
- Update and extend phase-field LBM showcases - Update and extend phase-field LBM showcases
......
This diff is collapsed.
{
"version": 6,
"cmakeMinimumRequired": {
"major": 3,
"minor": 23,
"patch": 0
},
"configurePresets": [
{
"name": "clang-tidy",
"generator": "Unix Makefiles",
"binaryDir": "${sourceDir}/build/clang-tidy",
"cacheVariables": {
"CMAKE_EXPORT_COMPILE_COMMANDS": true,
"WALBERLA_BUFFER_DEBUG": true,
"WALBERLA_BUILD_TESTS": true,
"WALBERLA_BUILD_BENCHMARKS": true,
"WALBERLA_BUILD_TUTORIALS": true,
"WALBERLA_BUILD_TOOLS": true,
"WALBERLA_BUILD_WITH_MPI": true,
"WALBERLA_BUILD_WITH_OPENMP": true,
"CMAKE_BUILD_TYPE": "Debug",
"WALBERLA_BUILD_WITH_METIS": true,
"WALBERLA_BUILD_WITH_PARMETIS": true,
"WALBERLA_BUILD_WITH_OPENMESH": true,
"WALBERLA_DOUBLE_ACCURACY": true,
"WALBERLA_LOGLEVEL": "DETAIL"
}
}
]
}
\ No newline at end of file
...@@ -165,9 +165,9 @@ template< typename LatticeModel_T, typename Filter_T > ...@@ -165,9 +165,9 @@ template< typename LatticeModel_T, typename Filter_T >
void VectorGradientRefinement< LatticeModel_T, Filter_T >::operator()( std::vector< std::pair< const Block *, uint_t > > & minTargetLevels, void VectorGradientRefinement< LatticeModel_T, Filter_T >::operator()( std::vector< std::pair< const Block *, uint_t > > & minTargetLevels,
std::vector< const Block * > &, const BlockForest & ) std::vector< const Block * > &, const BlockForest & )
{ {
for( auto it = minTargetLevels.begin(); it != minTargetLevels.end(); ++it ) for(auto & minTargetLevel : minTargetLevels)
{ {
const Block * const block = it->first; const Block * const block = minTargetLevel.first;
const uint_t currentLevelOfBlock = block->getLevel(); const uint_t currentLevelOfBlock = block->getLevel();
...@@ -175,7 +175,7 @@ void VectorGradientRefinement< LatticeModel_T, Filter_T >::operator()( std::vect ...@@ -175,7 +175,7 @@ void VectorGradientRefinement< LatticeModel_T, Filter_T >::operator()( std::vect
if( uField == nullptr ) if( uField == nullptr )
{ {
it->second = uint_t(0); minTargetLevel.second = uint_t(0);
continue; continue;
} }
...@@ -253,12 +253,12 @@ void VectorGradientRefinement< LatticeModel_T, Filter_T >::operator()( std::vect ...@@ -253,12 +253,12 @@ void VectorGradientRefinement< LatticeModel_T, Filter_T >::operator()( std::vect
if( refine && currentLevelOfBlock < maxLevel_ ) if( refine && currentLevelOfBlock < maxLevel_ )
{ {
WALBERLA_ASSERT( !coarsen ); WALBERLA_ASSERT( !coarsen );
it->second = currentLevelOfBlock + uint_t(1); minTargetLevel.second = currentLevelOfBlock + uint_t(1);
} }
if( coarsen && currentLevelOfBlock > uint_t(0) ) if( coarsen && currentLevelOfBlock > uint_t(0) )
{ {
WALBERLA_ASSERT( !refine ); WALBERLA_ASSERT( !refine );
it->second = currentLevelOfBlock - uint_t(1); minTargetLevel.second = currentLevelOfBlock - uint_t(1);
} }
} }
} }
...@@ -500,7 +500,7 @@ static shared_ptr< StructuredBlockForest > createBlockStructure( const AABB & do ...@@ -500,7 +500,7 @@ static shared_ptr< StructuredBlockForest > createBlockStructure( const AABB & do
MPIManager::instance()->useWorldComm(); MPIManager::instance()->useWorldComm();
sforest.addRefinementSelectionFunction( std::bind( refinementSelection, std::placeholders::_1, numberOfLevels, refinementBox ) ); sforest.addRefinementSelectionFunction( [numberOfLevels, refinementBox](auto && PH1) { refinementSelection(std::forward<decltype(PH1)>(PH1), numberOfLevels, refinementBox); } );
sforest.addWorkloadMemorySUIDAssignmentFunction( workloadAndMemoryAssignment ); sforest.addWorkloadMemorySUIDAssignmentFunction( workloadAndMemoryAssignment );
Vector3<bool> periodicity( true, true, false); Vector3<bool> periodicity( true, true, false);
...@@ -1375,7 +1375,7 @@ int main( int argc, char **argv ) ...@@ -1375,7 +1375,7 @@ int main( int argc, char **argv )
cr.setRelaxationModel( pe::cr::HardContactSemiImplicitTimesteppingSolvers::ApproximateInelasticCoulombContactByDecoupling ); cr.setRelaxationModel( pe::cr::HardContactSemiImplicitTimesteppingSolvers::ApproximateInelasticCoulombContactByDecoupling );
// set up synchronization procedure // set up synchronization procedure
std::function<void(void)> syncCall = std::bind( pe::syncNextNeighbors<BodyTypeTuple>, std::ref(blocks->getBlockForest()), bodyStorageID, &(*timingTreePE), overlap, false ); std::function<void(void)> syncCall = [&capture0 = blocks->getBlockForest(), bodyStorageID, capture1 = &(*timingTreePE), overlap] { pe::syncNextNeighbors<BodyTypeTuple>(capture0, bodyStorageID, capture1, overlap, false); };
// create pe bodies // create pe bodies
...@@ -1525,14 +1525,14 @@ int main( int argc, char **argv ) ...@@ -1525,14 +1525,14 @@ int main( int argc, char **argv )
// force averaging functionality // force averaging functionality
shared_ptr<pe_coupling::BodiesForceTorqueContainer> bodiesFTContainer1 = make_shared<pe_coupling::BodiesForceTorqueContainer>(blocks, bodyStorageID); shared_ptr<pe_coupling::BodiesForceTorqueContainer> bodiesFTContainer1 = make_shared<pe_coupling::BodiesForceTorqueContainer>(blocks, bodyStorageID);
std::function<void(void)> storeForceTorqueInCont1 = std::bind(&pe_coupling::BodiesForceTorqueContainer::store, bodiesFTContainer1); std::function<void(void)> storeForceTorqueInCont1 = [bodiesFTContainer1] { bodiesFTContainer1->store(); };
shared_ptr<pe_coupling::BodiesForceTorqueContainer> bodiesFTContainer2 = make_shared<pe_coupling::BodiesForceTorqueContainer>(blocks, bodyStorageID); shared_ptr<pe_coupling::BodiesForceTorqueContainer> bodiesFTContainer2 = make_shared<pe_coupling::BodiesForceTorqueContainer>(blocks, bodyStorageID);
std::function<void(void)> setForceTorqueOnBodiesFromCont2 = std::bind(&pe_coupling::BodiesForceTorqueContainer::setOnBodies, bodiesFTContainer2); std::function<void(void)> setForceTorqueOnBodiesFromCont2 = [bodiesFTContainer2] { bodiesFTContainer2->setOnBodies(); };
shared_ptr<pe_coupling::ForceTorqueOnBodiesScaler> forceScaler = make_shared<pe_coupling::ForceTorqueOnBodiesScaler>(blocks, bodyStorageID, real_t(0.5)); shared_ptr<pe_coupling::ForceTorqueOnBodiesScaler> forceScaler = make_shared<pe_coupling::ForceTorqueOnBodiesScaler>(blocks, bodyStorageID, real_t(0.5));
std::function<void(void)> setForceScalingFactorToOne = std::bind(&pe_coupling::ForceTorqueOnBodiesScaler::resetScalingFactor,forceScaler,real_t(1)); std::function<void(void)> setForceScalingFactorToOne = [forceScaler] { forceScaler->resetScalingFactor(real_t(1)); };
std::function<void(void)> setForceScalingFactorToHalf = std::bind(&pe_coupling::ForceTorqueOnBodiesScaler::resetScalingFactor,forceScaler,real_t(0.5)); std::function<void(void)> setForceScalingFactorToHalf = [forceScaler] { forceScaler->resetScalingFactor(real_t(0.5)); };
if( averageForceTorqueOverTwoTimSteps ) { if( averageForceTorqueOverTwoTimSteps ) {
bodiesFTContainer2->store(); bodiesFTContainer2->store();
...@@ -2244,4 +2244,4 @@ int main( int argc, char **argv ) ...@@ -2244,4 +2244,4 @@ int main( int argc, char **argv )
int main( int argc, char **argv ){ int main( int argc, char **argv ){
amr_sediment_settling::main(argc, argv); amr_sediment_settling::main(argc, argv);
} }
\ No newline at end of file
...@@ -158,9 +158,9 @@ template< typename LatticeModel_T, typename Filter_T > ...@@ -158,9 +158,9 @@ template< typename LatticeModel_T, typename Filter_T >
void VectorGradientRefinement< LatticeModel_T, Filter_T >::operator()( std::vector< std::pair< const Block *, uint_t > > & minTargetLevels, void VectorGradientRefinement< LatticeModel_T, Filter_T >::operator()( std::vector< std::pair< const Block *, uint_t > > & minTargetLevels,
std::vector< const Block * > &, const BlockForest & ) std::vector< const Block * > &, const BlockForest & )
{ {
for( auto it = minTargetLevels.begin(); it != minTargetLevels.end(); ++it ) for(auto & minTargetLevel : minTargetLevels)
{ {
const Block * const block = it->first; const Block * const block = minTargetLevel.first;
const uint_t currentLevelOfBlock = block->getLevel(); const uint_t currentLevelOfBlock = block->getLevel();
...@@ -168,7 +168,7 @@ void VectorGradientRefinement< LatticeModel_T, Filter_T >::operator()( std::vect ...@@ -168,7 +168,7 @@ void VectorGradientRefinement< LatticeModel_T, Filter_T >::operator()( std::vect
if( uField == nullptr ) if( uField == nullptr )
{ {
it->second = uint_t(0); minTargetLevel.second = uint_t(0);
continue; continue;
} }
...@@ -246,12 +246,12 @@ void VectorGradientRefinement< LatticeModel_T, Filter_T >::operator()( std::vect ...@@ -246,12 +246,12 @@ void VectorGradientRefinement< LatticeModel_T, Filter_T >::operator()( std::vect
if( refine && currentLevelOfBlock < maxLevel_ ) if( refine && currentLevelOfBlock < maxLevel_ )
{ {
WALBERLA_ASSERT( !coarsen ); WALBERLA_ASSERT( !coarsen );
it->second = currentLevelOfBlock + uint_t(1); minTargetLevel.second = currentLevelOfBlock + uint_t(1);
} }
if( coarsen && currentLevelOfBlock > uint_t(0) ) if( coarsen && currentLevelOfBlock > uint_t(0) )
{ {
WALBERLA_ASSERT( !refine ); WALBERLA_ASSERT( !refine );
it->second = currentLevelOfBlock - uint_t(1); minTargetLevel.second = currentLevelOfBlock - uint_t(1);
} }
} }
} }
...@@ -307,28 +307,28 @@ private: ...@@ -307,28 +307,28 @@ private:
static void refinementSelection( SetupBlockForest& forest, uint_t levels, const AABB & refinementBox ) static void refinementSelection( SetupBlockForest& forest, uint_t levels, const AABB & refinementBox )
{ {
real_t dx = real_t(1); // dx on finest level real_t dx = real_t(1); // dx on finest level
for( auto block = forest.begin(); block != forest.end(); ++block ) for(auto & block : forest)
{ {
uint_t blockLevel = block->getLevel(); uint_t blockLevel = block.getLevel();
uint_t levelScalingFactor = ( uint_t(1) << (levels - uint_t(1) - blockLevel) ); uint_t levelScalingFactor = ( uint_t(1) << (levels - uint_t(1) - blockLevel) );
real_t dxOnLevel = dx * real_c(levelScalingFactor); real_t dxOnLevel = dx * real_c(levelScalingFactor);
AABB blockAABB = block->getAABB(); AABB blockAABB = block.getAABB();
// extend block AABB by ghostlayers // extend block AABB by ghostlayers
AABB extendedBlockAABB = blockAABB.getExtended( dxOnLevel * real_c(FieldGhostLayers) ); AABB extendedBlockAABB = blockAABB.getExtended( dxOnLevel * real_c(FieldGhostLayers) );
if( extendedBlockAABB.intersects( refinementBox ) ) if( extendedBlockAABB.intersects( refinementBox ) )
if( blockLevel < ( levels - uint_t(1) ) ) if( blockLevel < ( levels - uint_t(1) ) )
block->setMarker( true ); block.setMarker( true );
} }
} }
static void workloadAndMemoryAssignment( SetupBlockForest& forest ) static void workloadAndMemoryAssignment( SetupBlockForest& forest )
{ {
for( auto block = forest.begin(); block != forest.end(); ++block ) for(auto & block : forest)
{ {
block->setWorkload( numeric_cast< workload_t >( uint_t(1) << block->getLevel() ) ); block.setWorkload( numeric_cast< workload_t >( uint_t(1) << block.getLevel() ) );
block->setMemory( numeric_cast< memory_t >(1) ); block.setMemory( numeric_cast< memory_t >(1) );
} }
} }
...@@ -378,7 +378,7 @@ static shared_ptr< StructuredBlockForest > createBlockStructure( const AABB & do ...@@ -378,7 +378,7 @@ static shared_ptr< StructuredBlockForest > createBlockStructure( const AABB & do
WALBERLA_LOG_INFO_ON_ROOT(" - refinement box: " << refinementBox); WALBERLA_LOG_INFO_ON_ROOT(" - refinement box: " << refinementBox);
sforest.addRefinementSelectionFunction( std::bind( refinementSelection, std::placeholders::_1, numberOfLevels, refinementBox ) ); sforest.addRefinementSelectionFunction( [numberOfLevels, refinementBox](auto && PH1) { refinementSelection(std::forward<decltype(PH1)>(PH1), numberOfLevels, refinementBox); } );
sforest.addWorkloadMemorySUIDAssignmentFunction( workloadAndMemoryAssignment ); sforest.addWorkloadMemorySUIDAssignmentFunction( workloadAndMemoryAssignment );
sforest.init( domainAABB, numberOfCoarseBlocksPerDirection[0], numberOfCoarseBlocksPerDirection[1], numberOfCoarseBlocksPerDirection[2], true, true, true ); sforest.init( domainAABB, numberOfCoarseBlocksPerDirection[0], numberOfCoarseBlocksPerDirection[1], numberOfCoarseBlocksPerDirection[2], true, true, true );
...@@ -620,9 +620,9 @@ public: ...@@ -620,9 +620,9 @@ public:
for( uint_t level = 0; level < numberOfLevels_; ++level) for( uint_t level = 0; level < numberOfLevels_; ++level)
{ {
real_t timeOnLevelProcessLocal = real_t(0); real_t timeOnLevelProcessLocal = real_t(0);
for( auto timerIt = timerOnEachLevel_.begin(); timerIt != timerOnEachLevel_.end(); ++timerIt ) for(auto const & timerIt : timerOnEachLevel_)
{ {
std::string timerName = *timerIt + " (" + std::to_string(level) + ")"; std::string timerName = timerIt + " (" + std::to_string(level) + ")";
timeOnLevelProcessLocal += real_c((*levelwiseTimingPool_)[timerName].total()); timeOnLevelProcessLocal += real_c((*levelwiseTimingPool_)[timerName].total());
} }
...@@ -630,15 +630,14 @@ public: ...@@ -630,15 +630,14 @@ public:
{ {
// evaluate more timers on finest level // evaluate more timers on finest level
for( auto timerIt = timerOnFinestLevel_.begin(); timerIt != timerOnFinestLevel_.end(); ++timerIt ) for(auto const & timerIt : timerOnFinestLevel_)
{ {
std::string timerName = *timerIt + " (" + std::to_string(level) + ")"; std::string timerName = timerIt + " (" + std::to_string(level) + ")";
timeOnLevelProcessLocal += real_c((*levelwiseTimingPool_)[timerName].total()); timeOnLevelProcessLocal += real_c((*levelwiseTimingPool_)[timerName].total());
} }
for( auto timerIt = timerInPE_.begin(); timerIt != timerInPE_.end(); ++timerIt ) for(auto const & timerName : timerInPE_)
{ {
std::string timerName = *timerIt; timeOnLevelProcessLocal += real_c((*peTimingTree_)[timerName].total());
timeOnLevelProcessLocal += real_c((*peTimingTree_)[timerName].total());
} }
} }
...@@ -950,7 +949,7 @@ int main( int argc, char **argv ) ...@@ -950,7 +949,7 @@ int main( int argc, char **argv )
pe::cr::DEM cr(globalBodyStorage, blocks->getBlockStoragePointer(), bodyStorageID, ccdID, fcdID, &(*timingTreePE)); pe::cr::DEM cr(globalBodyStorage, blocks->getBlockStoragePointer(), bodyStorageID, ccdID, fcdID, &(*timingTreePE));
// set up synchronization procedure // set up synchronization procedure
std::function<void(void)> syncCall = std::bind( pe::syncShadowOwners<BodyTypeTuple>, std::ref(blocks->getBlockForest()), bodyStorageID, &(*timingTreePE), overlap, false ); std::function<void(void)> syncCall = [&capture0 = blocks->getBlockForest(), bodyStorageID, capture1 = &(*timingTreePE), overlap] { pe::syncShadowOwners<BodyTypeTuple>(capture0, bodyStorageID, capture1, overlap, false); };
// create pe bodies // create pe bodies
...@@ -1009,12 +1008,12 @@ int main( int argc, char **argv ) ...@@ -1009,12 +1008,12 @@ int main( int argc, char **argv )
// force averaging functionality // force averaging functionality
shared_ptr<pe_coupling::BodiesForceTorqueContainer> bodiesFTContainer1 = make_shared<pe_coupling::BodiesForceTorqueContainer>(blocks, bodyStorageID); shared_ptr<pe_coupling::BodiesForceTorqueContainer> bodiesFTContainer1 = make_shared<pe_coupling::BodiesForceTorqueContainer>(blocks, bodyStorageID);
std::function<void(void)> storeForceTorqueInCont1 = std::bind(&pe_coupling::BodiesForceTorqueContainer::store, bodiesFTContainer1); std::function<void(void)> storeForceTorqueInCont1 = [bodiesFTContainer1] { bodiesFTContainer1->store(); };
shared_ptr<pe_coupling::BodiesForceTorqueContainer> bodiesFTContainer2 = make_shared<pe_coupling::BodiesForceTorqueContainer>(blocks, bodyStorageID); shared_ptr<pe_coupling::BodiesForceTorqueContainer> bodiesFTContainer2 = make_shared<pe_coupling::BodiesForceTorqueContainer>(blocks, bodyStorageID);
std::function<void(void)> setForceTorqueOnBodiesFromCont2 = std::bind(&pe_coupling::BodiesForceTorqueContainer::setOnBodies, bodiesFTContainer2); std::function<void(void)> setForceTorqueOnBodiesFromCont2 = [bodiesFTContainer2] { bodiesFTContainer2->setOnBodies(); };
shared_ptr<pe_coupling::ForceTorqueOnBodiesScaler> forceScaler = make_shared<pe_coupling::ForceTorqueOnBodiesScaler>(blocks, bodyStorageID, real_t(0.5)); shared_ptr<pe_coupling::ForceTorqueOnBodiesScaler> forceScaler = make_shared<pe_coupling::ForceTorqueOnBodiesScaler>(blocks, bodyStorageID, real_t(0.5));
std::function<void(void)> setForceScalingFactorToOne = std::bind(&pe_coupling::ForceTorqueOnBodiesScaler::resetScalingFactor,forceScaler,real_t(1)); std::function<void(void)> setForceScalingFactorToOne = [forceScaler] { forceScaler->resetScalingFactor(real_t(1)); };
std::function<void(void)> setForceScalingFactorToHalf = std::bind(&pe_coupling::ForceTorqueOnBodiesScaler::resetScalingFactor,forceScaler,real_t(0.5)); std::function<void(void)> setForceScalingFactorToHalf = [forceScaler] { forceScaler->resetScalingFactor(real_t(0.5)); };
if( averageForceTorqueOverTwoTimSteps ) { if( averageForceTorqueOverTwoTimSteps ) {
bodiesFTContainer2->store(); bodiesFTContainer2->store();
...@@ -1331,4 +1330,4 @@ int main( int argc, char **argv ) ...@@ -1331,4 +1330,4 @@ int main( int argc, char **argv )
int main( int argc, char **argv ){ int main( int argc, char **argv ){
amr_settling_sphere::main(argc, argv); amr_settling_sphere::main(argc, argv);
} }
\ No newline at end of file
waLBerla_add_executable( NAME WorkloadEvaluation FILES WorkloadEvaluation.cpp DEPENDS blockforest boundary core field lbm pe pe_coupling postprocessing stencil timeloop vtk ) waLBerla_add_executable( NAME WorkloadEvaluation FILES WorkloadEvaluation.cpp DEPENDS walberla::blockforest walberla::boundary walberla::core walberla::field walberla::lbm walberla::pe walberla::pe_coupling walberla::postprocessing walberla::stencil walberla::timeloop walberla::vtk )
waLBerla_add_executable( NAME AMRSedimentSettling FILES AMRSedimentSettling.cpp DEPENDS blockforest boundary core field lbm pe pe_coupling postprocessing stencil timeloop vtk ) waLBerla_add_executable( NAME AMRSedimentSettling FILES AMRSedimentSettling.cpp DEPENDS walberla::blockforest walberla::boundary walberla::core walberla::field walberla::lbm walberla::pe walberla::pe_coupling walberla::postprocessing walberla::stencil walberla::timeloop walberla::vtk )
waLBerla_add_executable( NAME AMRSettlingSphere FILES AMRSettlingSphere.cpp DEPENDS blockforest boundary core field lbm pe pe_coupling postprocessing stencil timeloop vtk ) waLBerla_add_executable( NAME AMRSettlingSphere FILES AMRSettlingSphere.cpp DEPENDS walberla::blockforest walberla::boundary walberla::core walberla::field walberla::lbm walberla::pe walberla::pe_coupling walberla::postprocessing walberla::stencil walberla::timeloop walberla::vtk )
...@@ -540,7 +540,7 @@ int main( int argc, char **argv ) ...@@ -540,7 +540,7 @@ int main( int argc, char **argv )
// connect to pe // connect to pe
const real_t overlap = real_c( 1.5 ) * dx; const real_t overlap = real_c( 1.5 ) * dx;
std::function<void(void)> syncCall = std::bind( pe::syncNextNeighbors<BodyTypeTuple>, std::ref(blocks->getBlockForest()), bodyStorageID, &timingTreePE, overlap, false ); std::function<void(void)> syncCall = [&capture0 = blocks->getBlockForest(), bodyStorageID, capture1 = &timingTreePE, overlap] { pe::syncNextNeighbors<BodyTypeTuple>(capture0, bodyStorageID, capture1, overlap, false); };
auto generationDomain = AABB( real_t(0), real_t(0), real_t(0), real_c(XCells), real_c(YCells), real_c(ZCells) - topWallOffset); auto generationDomain = AABB( real_t(0), real_t(0), real_t(0), real_c(XCells), real_c(YCells), real_c(ZCells) - topWallOffset);
auto peMaterial = pe::createMaterial( "mat", densityRatio, real_t(1), real_t(0.25), real_t(0.25), real_t(0), real_t(200), real_t(100), real_t(100), real_t(100) ); auto peMaterial = pe::createMaterial( "mat", densityRatio, real_t(1), real_t(0.25), real_t(0.25), real_t(0), real_t(200), real_t(100), real_t(100), real_t(100) );
...@@ -761,11 +761,11 @@ int main( int argc, char **argv ) ...@@ -761,11 +761,11 @@ int main( int argc, char **argv )
( blocks, pdfFieldID, boundaryHandlingID, bodyStorageID, globalBodyStorage, bodyFieldID, reconstructor, FormerMO_Flag, Fluid_Flag, pe_coupling::selectRegularBodies, optimizeForSmallObstacleFraction ), "PDF Restore" ); ( blocks, pdfFieldID, boundaryHandlingID, bodyStorageID, globalBodyStorage, bodyFieldID, reconstructor, FormerMO_Flag, Fluid_Flag, pe_coupling::selectRegularBodies, optimizeForSmallObstacleFraction ), "PDF Restore" );
shared_ptr<pe_coupling::BodiesForceTorqueContainer> bodiesFTContainer1 = make_shared<pe_coupling::BodiesForceTorqueContainer>(blocks, bodyStorageID); shared_ptr<pe_coupling::BodiesForceTorqueContainer> bodiesFTContainer1 = make_shared<pe_coupling::BodiesForceTorqueContainer>(blocks, bodyStorageID);
std::function<void(void)> storeForceTorqueInCont1 = std::bind(&pe_coupling::BodiesForceTorqueContainer::store, bodiesFTContainer1); std::function<void(void)> storeForceTorqueInCont1 = [bodiesFTContainer1] { bodiesFTContainer1->store(); };
shared_ptr<pe_coupling::BodiesForceTorqueContainer> bodiesFTContainer2 = make_shared<pe_coupling::BodiesForceTorqueContainer>(blocks, bodyStorageID); shared_ptr<pe_coupling::BodiesForceTorqueContainer> bodiesFTContainer2 = make_shared<pe_coupling::BodiesForceTorqueContainer>(blocks, bodyStorageID);
std::function<void(void)> setForceTorqueOnBodiesFromCont2 = std::bind(&pe_coupling::BodiesForceTorqueContainer::setOnBodies, bodiesFTContainer2); std::function<void(void)> setForceTorqueOnBodiesFromCont2 = [bodiesFTContainer2] { bodiesFTContainer2->setOnBodies(); };
shared_ptr<pe_coupling::ForceTorqueOnBodiesScaler> forceScaler = make_shared<pe_coupling::ForceTorqueOnBodiesScaler>(blocks, bodyStorageID, real_t(1)); shared_ptr<pe_coupling::ForceTorqueOnBodiesScaler> forceScaler = make_shared<pe_coupling::ForceTorqueOnBodiesScaler>(blocks, bodyStorageID, real_t(1));
std::function<void(void)> setForceScalingFactorToHalf = std::bind(&pe_coupling::ForceTorqueOnBodiesScaler::resetScalingFactor,forceScaler,real_t(0.5)); std::function<void(void)> setForceScalingFactorToHalf = [forceScaler] { forceScaler->resetScalingFactor(real_t(0.5)); };
if( averageForceTorqueOverTwoTimSteps ) { if( averageForceTorqueOverTwoTimSteps ) {
bodiesFTContainer2->store(); bodiesFTContainer2->store();
...@@ -981,4 +981,4 @@ int main( int argc, char **argv ) ...@@ -981,4 +981,4 @@ int main( int argc, char **argv )
int main( int argc, char **argv ){ int main( int argc, char **argv ){
workload_evaluation::main(argc, argv); workload_evaluation::main(argc, argv);
} }
\ No newline at end of file
...@@ -5,9 +5,11 @@ add_subdirectory( DEM ) ...@@ -5,9 +5,11 @@ add_subdirectory( DEM )
add_subdirectory( MeshDistance ) add_subdirectory( MeshDistance )
add_subdirectory( CouetteFlow ) add_subdirectory( CouetteFlow )
add_subdirectory( FreeSurfaceAdvection ) add_subdirectory( FreeSurfaceAdvection )
add_subdirectory( FluidizedBed )
add_subdirectory( FluidParticleCoupling ) add_subdirectory( FluidParticleCoupling )
add_subdirectory( FluidParticleCouplingWithLoadBalancing ) add_subdirectory( FluidParticleCouplingWithLoadBalancing )
add_subdirectory( ForcesOnSphereNearPlaneInShearFlow ) add_subdirectory( ForcesOnSphereNearPlaneInShearFlow )
add_subdirectory(Percolation)
add_subdirectory( GranularGas ) add_subdirectory( GranularGas )
add_subdirectory( IntegratorAccuracy ) add_subdirectory( IntegratorAccuracy )
add_subdirectory( LennardJones ) add_subdirectory( LennardJones )
...@@ -22,13 +24,15 @@ if ( WALBERLA_BUILD_WITH_PYTHON ) ...@@ -22,13 +24,15 @@ if ( WALBERLA_BUILD_WITH_PYTHON )
add_subdirectory( FieldCommunication ) add_subdirectory( FieldCommunication )
if ( WALBERLA_BUILD_WITH_CODEGEN ) if ( WALBERLA_BUILD_WITH_CODEGEN )
add_subdirectory( FlowAroundSphereCodeGen )
add_subdirectory( UniformGridCPU ) add_subdirectory( UniformGridCPU )
add_subdirectory( PhaseFieldAllenCahn ) add_subdirectory( PhaseFieldAllenCahn )
add_subdirectory( NonUniformGridCPU )
add_subdirectory( TurbulentChannel )
endif() endif()
if ( WALBERLA_BUILD_WITH_CODEGEN AND WALBERLA_BUILD_WITH_CUDA ) if ( WALBERLA_BUILD_WITH_CODEGEN AND WALBERLA_BUILD_WITH_GPU_SUPPORT )
add_subdirectory( UniformGridGPU ) add_subdirectory( UniformGridGPU )
add_subdirectory( NonUniformGridGPU )
endif() endif()
endif() endif()
......
...@@ -7,4 +7,4 @@ waLBerla_add_executable( NAME 01_cnt_film ...@@ -7,4 +7,4 @@ waLBerla_add_executable( NAME 01_cnt_film
InitializeCNTs.cpp InitializeCNTs.cpp
SQLProperties.cpp SQLProperties.cpp
Statistics.cpp Statistics.cpp
DEPENDS blockforest core mesa_pd sqlite vtk ) DEPENDS walberla::blockforest walberla::core walberla::mesa_pd walberla::sqlite walberla::vtk )
if ( WALBERLA_BUILD_WITH_OPENMESH ) if ( WALBERLA_BUILD_WITH_OPENMESH )
waLBerla_link_geometry_to_builddir( "*.obj" )
waLBerla_link_files_to_builddir( "*.conf" )
waLBerla_link_files_to_builddir( "*.obj" ) waLBerla_add_executable( NAME ComplexGeometry FILES ComplexGeometry.cpp DEPENDS walberla::boundary walberla::core walberla::lbm walberla::mesh walberla::vtk )
waLBerla_link_files_to_builddir( "*.conf" )
waLBerla_add_executable( NAME ComplexGeometry FILES ComplexGeometry.cpp DEPENDS boundary core lbm mesh vtk )
############## ##############
# Some tests # # Some tests #
......
waLBerla_link_files_to_builddir( "*.dat" ) waLBerla_link_files_to_builddir( "*.dat" )
waLBerla_add_executable( NAME CouetteFlow DEPENDS blockforest boundary core field lbm postprocessing stencil timeloop vtk sqlite ) waLBerla_add_executable( NAME CouetteFlow DEPENDS walberla::blockforest walberla::boundary walberla::core walberla::field walberla::lbm walberla::postprocessing walberla::stencil walberla::timeloop walberla::vtk walberla::sqlite )
############## ##############
# Some tests # # Some tests #
......
...@@ -162,19 +162,19 @@ template< typename LatticeModel_T, class Enable = void > ...@@ -162,19 +162,19 @@ template< typename LatticeModel_T, class Enable = void >
struct StencilString; struct StencilString;
template< typename LatticeModel_T > template< typename LatticeModel_T >
struct StencilString< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q15 >::value >::type > struct StencilString< LatticeModel_T, std::enable_if_t< std::is_same_v< typename LatticeModel_T::Stencil, stencil::D3Q15 > > >
{ {
static const char * str() { return "D3Q15"; } static const char * str() { return "D3Q15"; }
}; };
template< typename LatticeModel_T > template< typename LatticeModel_T >
struct StencilString< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q19 >::value >::type > struct StencilString< LatticeModel_T, std::enable_if_t< std::is_same_v< typename LatticeModel_T::Stencil, stencil::D3Q19 > > >
{ {
static const char * str() { return "D3Q19"; } static const char * str() { return "D3Q19"; }
}; };
template< typename LatticeModel_T > template< typename LatticeModel_T >
struct StencilString< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q27 >::value >::type > struct StencilString< LatticeModel_T, std::enable_if_t< std::is_same_v< typename LatticeModel_T::Stencil, stencil::D3Q27 > > >
{ {
static const char * str() { return "D3Q27"; } static const char * str() { return "D3Q27"; }
}; };
...@@ -184,22 +184,22 @@ template< typename LatticeModel_T, class Enable = void > ...@@ -184,22 +184,22 @@ template< typename LatticeModel_T, class Enable = void >
struct CollisionModelString; struct CollisionModelString;
template< typename LatticeModel_T > template< typename LatticeModel_T >
struct CollisionModelString< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, struct CollisionModelString< LatticeModel_T, std::enable_if_t< std::is_same_v< typename LatticeModel_T::CollisionModel::tag,
lbm::collision_model::SRT_tag >::value >::type > lbm::collision_model::SRT_tag > > >
{ {
static const char * str() { return "SRT"; } static const char * str() { return "SRT"; }
}; };
template< typename LatticeModel_T > template< typename LatticeModel_T >
struct CollisionModelString< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, struct CollisionModelString< LatticeModel_T, std::enable_if_t< std::is_same_v< typename LatticeModel_T::CollisionModel::tag,
lbm::collision_model::TRT_tag >::value >::type > lbm::collision_model::TRT_tag > > >
{ {
static const char * str() { return "TRT"; } static const char * str() { return "TRT"; }
}; };
template< typename LatticeModel_T > template< typename LatticeModel_T >
struct CollisionModelString< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, struct CollisionModelString< LatticeModel_T, std::enable_if_t< std::is_same_v< typename LatticeModel_T::CollisionModel::tag,
lbm::collision_model::MRT_tag >::value >::type > lbm::collision_model::MRT_tag > > >
{ {
static const char * str() { return "MRT"; } static const char * str() { return "MRT"; }
}; };
...@@ -271,10 +271,10 @@ private: ...@@ -271,10 +271,10 @@ private:
static void workloadAndMemoryAssignment( SetupBlockForest& forest, const memory_t memoryPerBlock ) static void workloadAndMemoryAssignment( SetupBlockForest& forest, const memory_t memoryPerBlock )
{ {
for( auto block = forest.begin(); block != forest.end(); ++block ) for(auto & block : forest)
{ {
block->setWorkload( numeric_cast< workload_t >( uint_t(1) << block->getLevel() ) ); block.setWorkload( numeric_cast< workload_t >( uint_t(1) << block.getLevel() ) );
block->setMemory( memoryPerBlock ); block.setMemory( memoryPerBlock );
} }
} }
...@@ -293,7 +293,7 @@ static shared_ptr< SetupBlockForest > createSetupBlockForest( const blockforest: ...@@ -293,7 +293,7 @@ static shared_ptr< SetupBlockForest > createSetupBlockForest( const blockforest:
( setup.zCells + uint_t(2) * FieldGhostLayers ) ) * memoryPerCell; ( setup.zCells + uint_t(2) * FieldGhostLayers ) ) * memoryPerCell;
forest->addRefinementSelectionFunction( refinementSelectionFunctions ); forest->addRefinementSelectionFunction( refinementSelectionFunctions );
forest->addWorkloadMemorySUIDAssignmentFunction( std::bind( workloadAndMemoryAssignment, std::placeholders::_1, memoryPerBlock ) ); forest->addWorkloadMemorySUIDAssignmentFunction([memoryPerBlock](auto & sbf) { workloadAndMemoryAssignment(sbf, memoryPerBlock); });
forest->init( AABB( real_c(0), real_c(0), real_c(0), real_c( setup.xBlocks * setup.xCells ), forest->init( AABB( real_c(0), real_c(0), real_c(0), real_c( setup.xBlocks * setup.xCells ),
real_c( setup.yBlocks * setup.yCells ), real_c( setup.yBlocks * setup.yCells ),
...@@ -634,10 +634,10 @@ struct AddRefinementTimeStep ...@@ -634,10 +634,10 @@ struct AddRefinementTimeStep
}; };
template< typename LatticeModel_T > template< typename LatticeModel_T >
struct AddRefinementTimeStep< LatticeModel_T, typename std::enable_if< std::is_same< typename LatticeModel_T::CollisionModel::tag, lbm::collision_model::MRT_tag >::value || struct AddRefinementTimeStep< LatticeModel_T, std::enable_if_t< std::is_same_v< typename LatticeModel_T::CollisionModel::tag, lbm::collision_model::MRT_tag > ||
std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q15 >::value || std::is_same_v< typename LatticeModel_T::Stencil, stencil::D3Q15 > ||
std::is_same< typename LatticeModel_T::Stencil, stencil::D3Q27 >::value std::is_same_v< typename LatticeModel_T::Stencil, stencil::D3Q27 >
>::type > > >
{ {
static void add( SweepTimeloop & timeloop, shared_ptr< blockforest::StructuredBlockForest > & blocks, static void add( SweepTimeloop & timeloop, shared_ptr< blockforest::StructuredBlockForest > & blocks,
const BlockDataID & pdfFieldId, const BlockDataID & flagFieldId, const BlockDataID & boundaryHandlingId, const BlockDataID & pdfFieldId, const BlockDataID & flagFieldId, const BlockDataID & boundaryHandlingId,
...@@ -718,9 +718,9 @@ void run( const shared_ptr< Config > & config, const LatticeModel_T & latticeMod ...@@ -718,9 +718,9 @@ void run( const shared_ptr< Config > & config, const LatticeModel_T & latticeMod
if( vtkBeforeTimeStep ) if( vtkBeforeTimeStep )
{ {
for( auto output = vtkOutputFunctions.begin(); output != vtkOutputFunctions.end(); ++output ) for(auto & output : vtkOutputFunctions)
timeloop.addFuncBeforeTimeStep( output->second.outputFunction, std::string("VTK: ") + output->first, timeloop.addFuncBeforeTimeStep( output.second.outputFunction, std::string("VTK: ") + output.first,
output->second.requiredGlobalStates, output->second.incompatibleGlobalStates ); output.second.requiredGlobalStates, output.second.incompatibleGlobalStates );
} }
// add 'refinement' LB time step to time loop // add 'refinement' LB time step to time loop
...@@ -733,11 +733,11 @@ void run( const shared_ptr< Config > & config, const LatticeModel_T & latticeMod ...@@ -733,11 +733,11 @@ void run( const shared_ptr< Config > & config, const LatticeModel_T & latticeMod
// evaluation // evaluation
const auto exactSolutionFunction = std::bind( exactVelocity, std::placeholders::_1, blocks->getDomain(), setup.maxVelocity_L ); const auto exactSolutionFunction = [domain = blocks->getDomain(), maxVel = setup.maxVelocity_L](auto & p) { return exactVelocity(p, domain, maxVel); };
auto volumetricFlowRate = field::makeVolumetricFlowRateEvaluation< VelocityAdaptor_T, FlagField_T >( configBlock, blocks, velocityAdaptorId, auto volumetricFlowRate = field::makeVolumetricFlowRateEvaluation< VelocityAdaptor_T, FlagField_T >( configBlock, blocks, velocityAdaptorId,
flagFieldId, Fluid_Flag, flagFieldId, Fluid_Flag,
std::bind( exactFlowRate, setup.flowRate_L ), [flowRate = setup.flowRate_L] { return exactFlowRate(flowRate); },
exactSolutionFunction ); exactSolutionFunction );
volumetricFlowRate->setNormalizationFactor( real_t(1) / setup.maxVelocity_L ); volumetricFlowRate->setNormalizationFactor( real_t(1) / setup.maxVelocity_L );
volumetricFlowRate->setDomainNormalization( Vector3<real_t>( real_t(1) ) ); volumetricFlowRate->setDomainNormalization( Vector3<real_t>( real_t(1) ) );
...@@ -766,14 +766,14 @@ void run( const shared_ptr< Config > & config, const LatticeModel_T & latticeMod ...@@ -766,14 +766,14 @@ void run( const shared_ptr< Config > & config, const LatticeModel_T & latticeMod
if( !vtkBeforeTimeStep ) if( !vtkBeforeTimeStep )
{ {
for( auto output = vtkOutputFunctions.begin(); output != vtkOutputFunctions.end(); ++output ) for(auto & output : vtkOutputFunctions)
timeloop.addFuncAfterTimeStep( output->second.outputFunction, std::string("VTK: ") + output->first, timeloop.addFuncAfterTimeStep( output.second.outputFunction, std::string("VTK: ") + output.first,
output->second.requiredGlobalStates, output->second.incompatibleGlobalStates ); output.second.requiredGlobalStates, output.second.incompatibleGlobalStates );
} }
// remaining time logger // remaining time logger
const double remainingTimeLoggerFrequency = configBlock.getParameter< double >( "remainingTimeLoggerFrequency", 3.0 ); const real_t remainingTimeLoggerFrequency = configBlock.getParameter< real_t >( "remainingTimeLoggerFrequency", real_c(3.0) );
timeloop.addFuncAfterTimeStep( timing::RemainingTimeLogger( timeloop.getNrOfTimeSteps(), remainingTimeLoggerFrequency ), "Remaining time logger" ); timeloop.addFuncAfterTimeStep( timing::RemainingTimeLogger( timeloop.getNrOfTimeSteps(), remainingTimeLoggerFrequency ), "Remaining time logger" );
// logging right before the simulation starts // logging right before the simulation starts
......
waLBerla_add_executable( NAME DEM FILES DEM.cpp DEPENDS blockforest core pe ) waLBerla_add_executable( NAME DEM FILES DEM.cpp DEPENDS walberla::blockforest walberla::core walberla::pe )