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 (1026)
Showing
with 2276 additions and 2232 deletions
......@@ -61,48 +61,54 @@ IncludeCategories:
Priority: 3
- Regex: '^"core/'
Priority: 4
- Regex: '^"cuda/'
Priority: 5
- Regex: '^"domain_decomposition/'
Priority: 6
Priority: 5
- Regex: '^"executiontree/'
Priority: 7
Priority: 6
- Regex: '^"fft/'
Priority: 8
Priority: 7
- Regex: '^"field/'
Priority: 9
Priority: 8
- Regex: '^"gather/'
Priority: 10
Priority: 9
- Regex: '^"geometry/'
Priority: 10
- Regex: '^"gpu/'
Priority: 11
- Regex: '^"gui/'
- Regex: '^"gpu/'
Priority: 12
- Regex: '^"lbm/'
Priority: 13
- Regex: '^"mesh/'
- Regex: '^"lbm_mesapd_coupling/'
Priority: 14
- Regex: '^"pde/'
- Regex: '^"mesh/'
Priority: 15
- Regex: '^"pe/'
- Regex: '^"mesa_pd/'
Priority: 16
- Regex: '^"pe_coupling/'
- Regex: '^"pde/'
Priority: 17
- Regex: '^"postprocessing/'
- Regex: '^"pe/'
Priority: 18
- Regex: '^"python_coupling/'
- Regex: '^"pe_coupling/'
Priority: 19
- Regex: '^"simd/'
- Regex: '^"postprocessing/'
Priority: 20
- Regex: '^"stencil/'
- Regex: '^"python_coupling/'
Priority: 21
- Regex: '^"timeloop/'
- Regex: '^"simd/'
Priority: 22
- Regex: '^"vtk/'
- Regex: '^"sqlite/'
Priority: 23
- Regex: '^<boost/'
- Regex: '^"stencil/'
Priority: 24
- Regex: '^<'
- Regex: '^"timeloop/'
Priority: 25
- Regex: '^"vtk/'
Priority: 26
- Regex: '^<boost/'
Priority: 27
- Regex: '^<'
Priority: 28
IndentCaseLabels: false
IndentPPDirectives: AfterHash
IndentWidth: 3
......
......@@ -4,45 +4,61 @@ Checks: '
-*,
boost-*,
-boost-use-ranges,
bugprone-*,
-bugprone-branch-clone,
-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-misplaced-const,
-misc-no-recursion,
-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-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,
-modernize-use-trailing-return-type,
-modernize-avoid-c-arrays,
-modernize-use-nodiscard,
-modernize-macro-to-enum,
-modernize-concat-nested-namespaces,
mpi-*,
-mpi-type-mismatch,
openmp-*,
-openmp-exception-escape,
-openmp-use-default-none,
performance-*,
-performance-enum-size,
-performance-noexcept-swap,
-performance-unnecessary-value-param,
-performance-avoid-endl,
-performance-no-int-to-ptr,
portability-*,
readability-const-return-type,
readability-container-size-empty,
readability-delete-null-pointer,
readability-deleted-default,
readability-isolate-declaration,
readability-misleading-indentation,
readability-misplaced-array-index,
readability-non-const-parameter,
readability-redundant-control-flow,
readability-redundant-declaration,
readability-redundant-function-ptr-dereference,
......@@ -53,11 +69,11 @@ readability-simplify-subscript-expr,
readability-static-accessed-through-instance,
readability-static-definition-in-anonymous-namespace,
readability-string-compare,
readability-uniqueptr-delete-release
readability-uniqueptr-delete-release,
readability-use-anyofallof
'
WarningsAsErrors: '*'
HeaderFilterRegex: ''
AnalyzeTemporaryDtors: false
HeaderFilterRegex: '.*'
...
# See https://editorconfig.org/
root = true # top-most .editorconfig-file
# top-most .editorconfig-file
root = true
[*]
tab_width = 3
......@@ -7,4 +8,9 @@ indent_style = space
indent_size = 3
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = false
\ No newline at end of file
insert_final_newline = false
[*.py]
tab_width = 4
indent_size = 4
insert_final_newline = true
\ No newline at end of file
[flake8]
max-line-length=120
exclude=apps/showcases/Mixer/GenerateModule.py, # contains only statements
apps/benchmarks/FieldCommunication/config.py # just a config file
utilities/bashhelper/createShortcuts.py # contains a lot of really long strings
ignore = W503 C901 E741
name: waLBerla Tests
on: push
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: create build directory
run: mkdir build
- name: CMake
run: cmake -S . -B build -DWALBERLA_BUILD_WITH_MPI=OFF -DWALBERLA_BUILD_TESTS=ON -DWALBERLA_BUILD_WITH_OPENMP=ON
- name: make
run: cmake --build build -j 2
- name: ctest
run: cd build; ctest
......@@ -8,6 +8,10 @@ qrc_*
# macOS
**/.DS_Store
# CLion indexing
*.uuid
.fleet
# Generated files
*.out
......@@ -26,10 +30,15 @@ qrc_*
/CMakeSettings.json
/.vs
# Visual Studio Code
/.vscode
# Zed
/.cache*
# CLion
*.idea
*.clion*
# QtCreator
CMakeLists.txt.user.*
......@@ -39,23 +48,28 @@ CMakeLists.txt.user.*
/bin/
/lib/
*.a
/build
/build*
# Logfiles
logfile*.txt
*TestLog_p*.txt
# Python venv
.venv
# Compiled python
*.pyc
# Jupyter Notebook
**/.ipynb_checkpoints
# Blockforest saves
*.sav
# CMake
CMakeUserPresets.json
/CMakeLists.txt.user
# CMake build files
......@@ -68,5 +82,11 @@ cmake_install.cmake
CMakeDefs.h
/moduleStatistics.json
/walberla-config.cmake
/cmake-build-debug/
/cmake-build-release/
cmake-build-*
# Virtual environments
.venv/
env/
venv/
ENV/
This diff is collapsed.
File moved
[settings]
line_length=100
balanced_wrapping=True
multi_line_output=4
known_third_party=sympy
List of contributors
====================
Cameron Stewart
Christian Feichtinger
Christian Godenschwager
Christoph Rettinger
......@@ -12,22 +13,34 @@ Dominik Bartuschat
Ehsan Fattahi
Felix Winterhalter
Florian Schornbaum
Frederik Hennig
Grigorii Drozdov
Helen Schottenhamml
Igor Ostanin
Jan Götz
Jan Hönig
João Victor Tozatti Risso
Johannes Habich
Klaus Iglberger
Kristina Pickl
Lorenz Hufnagel
Lukas Werner
Markus Holzer
Martin Bauer
Matthias Markl
Michael Kuron
Nils Kohl
Paulo Carvalho
Philipp Suffa
Regina Ammer
Sagar Dolas
Sebastian Eibl
Silke Bergler
Simon Bogner
Stefan Donath
Stephan Seitz
Sunil Kontham
Tobias Leemann
Tobias Preclik
Tobias Scharpff
Tobias Schruff
# Changelog
## [Unreleased]
## [6.1] - 2022-07-25
### Added
- Free-surface LBM extension:
- Add implementation
- Add several showcases
- Add several tests
- LBM - MESA_PD coupling:
- Add partially saturated cells method (PSM)
- Add fluidized bed showcase
- Add virtual mass stabilization technique for light particles
- Add support for more shapes, e.g., convex polyhedron
- MESA_PD:
- 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
- Update and extend phase-field LBM showcases
- Allow access to PDF centering information (for being used in generated LBM kernels)
- Adapt code generation backend to be compatible with pystencils 1.0 and lbmpy 1.0
- Required minimum dependencies:
- C++17-compliant compiler
- CMake 3.14
- pybind 2.6.2
- lbmpy 1.0
- pystencils 1.0
### Deprecated
- GUI
## [5.1] - 2020-04-09
### Added
- Add new tutorials and showcases
- Extend MESA-PD functionalities, including several molecular dynamics models
- Fluid-particle coupling with MESA-PD: functionalities, tests, benchmark scenarios
### Changed
- Update to C++17
- Update CUDA compiler support
- Extend Clang-Tidy coverage
- Add closer integration of code generation using pystencils and lbmpy
- Python Coupling now build upon pybind11. Boost.Python is no longer supported
- lbm module dropped from python coupling due to deprecation for a long time
- geometry, postprocessing and timeloop dropped from python coupling due to its low usage
- PEP8-ification of Python API. This means all keyword arguments are now in snake_case and not in CamelCase as before.
### Fixed
- Guo force model for non-SRT, may change simulation results
## [4.1] - 2019-04-19
### Added
......@@ -54,4 +104,3 @@
### Deprecated
- all dynamic level-wise balance functions (use the more general ones, without "level-wise")
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
# waLBerla
waLBerla (widely applicable Lattice Boltzmann from Erlangen) is a massively
parallel framework for multi physics applications. Besides its original
objective, Lattice Boltzmann solvers for hydrodynamics, it now contains
modules for other applications like Multigrid and rigid body dynamics
as well. Great emphasis is placed on the interoperability between the modules
in particular the fluid-particle coupling.
It scales from laptops to current and future supercomputers while maintaining
waLBerla (widely applicable Lattice Boltzmann from Erlangen) is a massively
parallel framework for multi physics applications. Besides its original
objective, Lattice Boltzmann solvers for hydrodynamics, it now contains
modules for other applications like Multigrid and rigid body dynamics
as well. Great emphasis is placed on the interoperability between the modules
in particular the fluid-particle coupling.
It scales from laptops to current and future supercomputers while maintaining
near-perfect efficiency.
See https://www.walberla.net/ for more information and a showcase of applications.
......@@ -19,13 +19,45 @@ is documented in [Sphinx](http://walberla.net/sphinx/index.html).
## Getting started
The minimum requirements are a C++14-compliant compiler (e.g. GCC or Clang),
the [Boost](http://www.boost.org) library and the [CMake](http://www.cmake.org)
The minimum requirements are a C++17-compliant compiler (e.g. GCC or Clang)
and the [CMake](http://www.cmake.org)
build system. Furthermore, you need an MPI library (like
[Open MPI](http://www.open-mpi.org)) if you want to make use of parallel
processing capabilities. All of these dependencies are typically available in
your operating system's package manager.
### CMake
The typical steps, assuming your are in the waLBerla source directory, are:
- `mkdir build; cd build` create a build directory and change into it
- `cmake ..` call CMake with the waLBerla source directory as an argument
- `make` build waLBerla
To specify a CMake option you need to use `-D(Option)=(Value)`. For example to set the C++ compiler one can use:
`cmake -DCMAKE_CXX_COMILER=clang++`
To list and modify the CMake options the `ccmake` tool can be used. Just call `ccmake .` in your **build** directory to see and change the
CMake options and variables.
Some important CMake variables:
- `WALBERLA_BUILD_WITH_CODEGEN` Enable pystencils code generation"
- `Python_ROOT_DIR` Specify the directory of the `python` executable. e.g. `~/miniconda/bin/`
- `MPI_HOME` Specify the base directory of the MPI installation.
- `WALBERLA_BUILD_WITH_PYTHON` Support for embedding Python
- `WALBERLA_BUILD_WITH_CUDA` Enable CUDA support
For a full list of CMake Option see the [CMakeLists.txt](CMakeLists.txt) file or use `ccmake` as described above.
### Codegen and Python
To use the `lbmpy`/`pystencils` code generation please install the packages with e.g. `pip3 install lbmpy` and specify the correct python
environment when calling CMake.
In previous versions of CMake one could use `PYTHON_EXECUTABLE` or `PYTHON_ROOT_DIR` (all upper case) to specify the python executable or
the directory. This does **NOT** work anymore. Please use `Python_ROOT_DIR`.
## Get involved
### Contributing
......@@ -45,12 +77,42 @@ Many thanks go to waLBerla's [contributors](AUTHORS.txt)
### Please cite us
If you use waLBerla in a publication, please cite the following article:
- C. Godenschwager, F. Schornbaum, M. Bauer, H. Köstler, and U. Rüde. A
framework for hybrid parallel flow simulations with a trillion cells in complex
geometries. In: Proceedings of the International Conference on High Performance
Computing, Networking, Storage and Analysis, page 35. ACM, 2013.
If you use waLBerla in a publication, please cite the following articles:
Overview:
- M. Bauer et al., *waLBerla: A block-structured high-performance framework for
multiphysics simulations*. Computers & Mathematics with Applications, 2020.
https://doi.org/10.1016/j.camwa.2020.01.007.
Grid Refinement:
- F. Schornbaum and U. Rüde, *Massively parallel algorithms for the lattice boltzmann
method on nonuniform grids*. SIAM Journal on Scientific Computing, 2016.
https://doi.org/10.1137/15M1035240
LBM - Particle Coupling:
- C. Rettinger and U. Rüde, *A comparative study of fluid-particle coupling methods for
fully resolved lattice Boltzmann simulations*. Computers & Fluids, 2017.
https://doi.org/10.1016/j.compfluid.2017.05.033
Free-surface LBM:
- C. Schwarzmeier et al., *Comparison of free-surface and conservative Allen-Cahn phase-field
lattice Boltzmann method*. Journal of Computational Physics, 2023.
https://doi.org/10.1016/j.jcp.2022.111753
Allen-Cahn phase-field LBM
- M. Holzer et al., *Highly efficient lattice Boltzmann multiphase simulations of immiscible
fluids at high-density ratios on CPUs and GPUs through code generation*. The International Journal of High Performance Computing Applications, 2021.
https://doi.org/10.1177/10943420211016525
MESA-PD:
- S. Eibl and U. Rüde, *A Modular and Extensible Software Architecture for Particle Dynamics*.
Proceedings Of The 8Th International Conference On Discrete Element Methods.
https://mercurylab.co.uk/dem8/full-papers/#page-content
Carbon Nanotubes:
- G. Drozdov et al., *Densification of single-walled carbon nanotube films:
Mesoscopic distinct element method simulations and experimental validation*.
Journal of Applied Physics, 2020. https://doi.org/10.1063/5.0025505
## License
......
......@@ -2,37 +2,26 @@
# Benchmarks
if ( WALBERLA_BUILD_BENCHMARKS )
add_subdirectory ( benchmarks )
else ()
add_subdirectory ( benchmarks EXCLUDE_FROM_ALL )
endif()
# Tools
if ( WALBERLA_BUILD_TOOLS )
add_subdirectory ( tools )
else ()
add_subdirectory ( tools EXCLUDE_FROM_ALL )
endif()
# Tutorials
if ( WALBERLA_BUILD_TUTORIALS )
add_subdirectory ( tutorials )
else ()
add_subdirectory ( tutorials EXCLUDE_FROM_ALL )
endif()
# Showcases
if ( WALBERLA_BUILD_SHOWCASES )
add_subdirectory ( showcases )
else ()
add_subdirectory ( showcases EXCLUDE_FROM_ALL )
endif()
# Python module
if ( WALBERLA_BUILD_WITH_PYTHON )
add_subdirectory( pythonmodule )
# no else with "EXLUDE_FROM_ALL" here, since if WALBERLA_BUILD_WITH_PYTHON_MODULE is not activated
# waLBerla was build without -fPIC , so no linking into shared library is possible
endif()
......@@ -20,8 +20,14 @@
//======================================================================================================================
#include "blockforest/Initialization.h"
#include "blockforest/communication/UniformBufferedScheme.h"
#include "blockforest/loadbalancing/all.h"
#include "blockforest/loadbalancing/InfoCollection.h"
#include "blockforest/loadbalancing/DynamicCurve.h"
#include "blockforest/loadbalancing/DynamicDiffusive.h"
#include "blockforest/loadbalancing/DynamicParMetis.h"
#include "blockforest/loadbalancing/StaticCurve.h"
#include "blockforest/loadbalancing/StaticParMetis.h"
#include "blockforest/loadbalancing/weight_assignment/MetisAssignmentFunctor.h"
#include "blockforest/loadbalancing/weight_assignment/WeightAssignmentFunctor.h"
#include "blockforest/AABBRefinementSelection.h"
#include "boundary/all.h"
......@@ -35,7 +41,6 @@
#include "core/timing/RemainingTimeLogger.h"
#include "core/mpi/Broadcast.h"
#include "domain_decomposition/SharedSweep.h"
#include "domain_decomposition/BlockSweepWrapper.h"
#include "field/AddToStorage.h"
......@@ -43,26 +48,21 @@
#include "field/communication/PackInfo.h"
#include "lbm/boundary/all.h"
#include "lbm/communication/PdfFieldPackInfo.h"
#include "lbm/field/AddToStorage.h"
#include "lbm/field/PdfField.h"
#include "lbm/field/VelocityFieldWriter.h"
#include "lbm/lattice_model/D3Q19.h"
#include "lbm/refinement/all.h"
#include "lbm/sweeps/CellwiseSweep.h"
#include "lbm/sweeps/SweepWrappers.h"
#include "pe/basic.h"
#include "pe/Types.h"
#include "pe/fcd/GJKEPACollideFunctor.h"
#include "pe/vtk/BodyVtkOutput.h"
#include "pe/vtk/SphereVtkOutput.h"
#include "pe/vtk/EllipsoidVtkOutput.h"
#include "pe/cr/ICR.h"
#include "pe/synchronization/ClearSynchronization.h"
#include "pe/amr/InfoCollection.h"
#include "pe/amr/weight_assignment/WeightAssignmentFunctor.h"
#include "pe/amr/weight_assignment/MetisAssignmentFunctor.h"
#include "pe_coupling/amr/all.h"
#include "pe_coupling/mapping/all.h"
......@@ -90,25 +90,25 @@ 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 LatticeModel_T = lbm::D3Q19<lbm::collision_model::TRT, false>;
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;
typedef GhostLayerField< pe::BodyID, 1 > BodyField_T;
typedef GhostLayerField< Vector3<real_t>, 1 > VelocityField_T;
using flag_t = walberla::uint8_t;
using FlagField_T = FlagField<flag_t>;
using BodyField_T = GhostLayerField<pe::BodyID, 1>;
using VelocityField_T = GhostLayerField<Vector3<real_t>, 1>;
const uint_t FieldGhostLayers = 4;
// boundary handling
typedef lbm::NoSlip< LatticeModel_T, flag_t > NoSlip_T;
using NoSlip_T = lbm::NoSlip<LatticeModel_T, flag_t>;
typedef pe_coupling::CurvedLinear< LatticeModel_T, FlagField_T > MO_T;
using MO_T = pe_coupling::CurvedLinear<LatticeModel_T, FlagField_T>;
typedef BoundaryHandling< FlagField_T, Stencil_T, NoSlip_T, MO_T > BoundaryHandling_T;
using BoundaryHandling_T = BoundaryHandling<FlagField_T, Stencil_T, NoSlip_T, MO_T>;
typedef std::tuple<pe::Sphere, pe::Ellipsoid, pe::Plane> BodyTypeTuple;
using BodyTypeTuple = std::tuple<pe::Sphere, pe::Ellipsoid, pe::Plane>;
///////////
// FLAGS //
......@@ -135,8 +135,8 @@ template< typename LatticeModel_T, typename Filter_T >
class VectorGradientRefinement
{
public:
typedef GhostLayerField< Vector3<real_t>, 1 > VectorField_T;
typedef typename LatticeModel_T::Stencil Stencil_T;
using VectorField_T = GhostLayerField<Vector3<real_t>, 1>;
using Stencil_T = typename LatticeModel_T::Stencil;
VectorGradientRefinement( const ConstBlockDataID & fieldID, const Filter_T & filter,
const real_t upperLimit, const real_t lowerLimit, const uint_t maxLevel ) :
......@@ -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,
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();
......@@ -175,7 +175,7 @@ void VectorGradientRefinement< LatticeModel_T, Filter_T >::operator()( std::vect
if( uField == nullptr )
{
it->second = uint_t(0);
minTargetLevel.second = uint_t(0);
continue;
}
......@@ -253,12 +253,12 @@ void VectorGradientRefinement< LatticeModel_T, Filter_T >::operator()( std::vect
if( refine && currentLevelOfBlock < maxLevel_ )
{
WALBERLA_ASSERT( !coarsen );
it->second = currentLevelOfBlock + uint_t(1);
minTargetLevel.second = currentLevelOfBlock + uint_t(1);
}
if( coarsen && currentLevelOfBlock > uint_t(0) )
{
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
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 );
Vector3<bool> periodicity( true, true, false);
......@@ -1375,7 +1375,7 @@ int main( int argc, char **argv )
cr.setRelaxationModel( pe::cr::HardContactSemiImplicitTimesteppingSolvers::ApproximateInelasticCoulombContactByDecoupling );
// 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
......@@ -1452,7 +1452,7 @@ int main( int argc, char **argv )
WALBERLA_LOG_INFO_ON_ROOT("Refreshing blockforest...")
// check refinement criterions and refine/coarsen if necessary
// check refinement criteria and refine/coarsen if necessary
uint_t stampBefore = blocks->getBlockForest().getModificationStamp();
blocks->refresh();
uint_t stampAfter = blocks->getBlockForest().getModificationStamp();
......@@ -1492,19 +1492,19 @@ int main( int argc, char **argv )
LatticeModel_T latticeModel = LatticeModel_T( lbm::collision_model::TRT::constructWithMagicNumber( omega, lbm::collision_model::TRT::threeSixteenth, finestLevel ) );
// add PDF field
BlockDataID pdfFieldID = lbm::addPdfFieldToStorage< LatticeModel_T >( blocks, "pdf field (zyxf)", latticeModel,
BlockDataID pdfFieldID = lbm::addPdfFieldToStorage< LatticeModel_T >( blocks, "pdf field (fzyx)", latticeModel,
Vector3< real_t >( real_t(0) ), real_t(1),
FieldGhostLayers, field::zyxf );
FieldGhostLayers, field::fzyx );
// add flag field
BlockDataID flagFieldID = field::addFlagFieldToStorage<FlagField_T>( blocks, "flag field", FieldGhostLayers );
// add body field
BlockDataID bodyFieldID = field::addToStorage<BodyField_T>( blocks, "body field", nullptr, field::zyxf, FieldGhostLayers );
BlockDataID bodyFieldID = field::addToStorage<BodyField_T>( blocks, "body field", nullptr, field::fzyx, FieldGhostLayers );
// add velocity field and utility
BlockDataID velocityFieldID = field::addToStorage<VelocityField_T>( blocks, "velocity field", Vector3<real_t>(real_t(0)), field::zyxf, uint_t(2) );
BlockDataID velocityFieldID = field::addToStorage<VelocityField_T>( blocks, "velocity field", Vector3<real_t>(real_t(0)), field::fzyx, uint_t(2) );
typedef lbm::VelocityFieldWriter< PdfField_T, VelocityField_T > VelocityFieldWriter_T;
using VelocityFieldWriter_T = lbm::VelocityFieldWriter<PdfField_T, VelocityField_T>;
BlockSweepWrapper< VelocityFieldWriter_T > velocityFieldWriter( blocks, VelocityFieldWriter_T( pdfFieldID, velocityFieldID ) );
......@@ -1525,14 +1525,14 @@ int main( int argc, char **argv )
// force averaging functionality
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);
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));
std::function<void(void)> setForceScalingFactorToOne = std::bind(&pe_coupling::ForceTorqueOnBodiesScaler::resetScalingFactor,forceScaler,real_t(1));
std::function<void(void)> setForceScalingFactorToHalf = std::bind(&pe_coupling::ForceTorqueOnBodiesScaler::resetScalingFactor,forceScaler,real_t(0.5));
std::function<void(void)> setForceScalingFactorToOne = [forceScaler] { forceScaler->resetScalingFactor(real_t(1)); };
std::function<void(void)> setForceScalingFactorToHalf = [forceScaler] { forceScaler->resetScalingFactor(real_t(0.5)); };
if( averageForceTorqueOverTwoTimSteps ) {
bodiesFTContainer2->store();
......@@ -1616,7 +1616,7 @@ int main( int argc, char **argv )
}
else if( loadEvaluationStrategy == "PE" )
{
pe::amr::WeightAssignmentFunctor weightAssignmentFunctor(peInfoCollection, peBlockBaseWeight );
blockforest::WeightAssignmentFunctor weightAssignmentFunctor(peInfoCollection, peBlockBaseWeight );
blockforest.setRefreshPhantomBlockDataAssignmentFunction(weightAssignmentFunctor);
}
else if( loadEvaluationStrategy == "LBM" )
......@@ -1700,7 +1700,7 @@ int main( int argc, char **argv )
}
else if( loadEvaluationStrategy == "PE" )
{
pe::amr::MetisAssignmentFunctor weightAssignmentFunctor(peInfoCollection, peBlockBaseWeight );
blockforest::MetisAssignmentFunctor weightAssignmentFunctor(peInfoCollection, peBlockBaseWeight );
blockforest.setRefreshPhantomBlockDataAssignmentFunction(weightAssignmentFunctor);
}
else if( loadEvaluationStrategy == "LBM" )
......@@ -1743,7 +1743,7 @@ int main( int argc, char **argv )
}
else if( loadEvaluationStrategy == "PE" )
{
pe::amr::WeightAssignmentFunctor weightAssignmentFunctor(peInfoCollection, peBlockBaseWeight );
blockforest::WeightAssignmentFunctor weightAssignmentFunctor(peInfoCollection, peBlockBaseWeight );
blockforest.setRefreshPhantomBlockDataAssignmentFunction(weightAssignmentFunctor);
}
else if( loadEvaluationStrategy == "LBM" )
......@@ -1847,7 +1847,7 @@ int main( int argc, char **argv )
"Body Mapping", finestLevel );
// add sweep for restoring PDFs in cells previously occupied by pe bodies
typedef pe_coupling::EquilibriumReconstructor< LatticeModel_T, BoundaryHandling_T > Reconstructor_T;
using Reconstructor_T = pe_coupling::EquilibriumReconstructor<LatticeModel_T, BoundaryHandling_T>;
Reconstructor_T reconstructor( blocks, boundaryHandlingID, bodyFieldID );
refinementTimestep->addPostStreamVoidFunction(lbm::refinement::SweepAsFunctorWrapper( pe_coupling::PDFReconstruction< LatticeModel_T, BoundaryHandling_T, Reconstructor_T > ( blocks, pdfFieldID,
boundaryHandlingID, bodyStorageID, globalBodyStorage, bodyFieldID, reconstructor, FormerMO_Flag, Fluid_Flag ), blocks ),
......@@ -2090,7 +2090,7 @@ int main( int argc, char **argv )
WALBERLA_LOG_INFO_ON_ROOT("Refreshing blockforest...")
// check refinement criterions and refine/coarsen if necessary
// check refinement criteria and refine/coarsen if necessary
uint_t stampBefore = blocks->getBlockForest().getModificationStamp();
blocks->refresh();
uint_t stampAfter = blocks->getBlockForest().getModificationStamp();
......@@ -2244,4 +2244,4 @@ int main( int argc, char **argv )
int main( int argc, char **argv ){
amr_sediment_settling::main(argc, argv);
}
}
\ No newline at end of file
......@@ -84,25 +84,25 @@ 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 LatticeModel_T = lbm::D3Q19<lbm::collision_model::TRT, false>;
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;
typedef GhostLayerField< pe::BodyID, 1 > BodyField_T;
typedef GhostLayerField< Vector3<real_t>, 1 > VelocityField_T;
using flag_t = walberla::uint8_t;
using FlagField_T = FlagField<flag_t>;
using BodyField_T = GhostLayerField<pe::BodyID, 1>;
using VelocityField_T = GhostLayerField<Vector3<real_t>, 1>;
const uint_t FieldGhostLayers = 4;
// boundary handling
typedef lbm::NoSlip< LatticeModel_T, flag_t > NoSlip_T;
using NoSlip_T = lbm::NoSlip<LatticeModel_T, flag_t>;
typedef pe_coupling::CurvedLinear< LatticeModel_T, FlagField_T > MO_T;
using MO_T = pe_coupling::CurvedLinear<LatticeModel_T, FlagField_T>;
typedef BoundaryHandling< FlagField_T, Stencil_T, NoSlip_T, MO_T > BoundaryHandling_T;
using BoundaryHandling_T = BoundaryHandling<FlagField_T, Stencil_T, NoSlip_T, MO_T>;
typedef std::tuple<pe::Sphere, pe::Ellipsoid, pe::Plane> BodyTypeTuple;
using BodyTypeTuple = std::tuple<pe::Sphere, pe::Ellipsoid, pe::Plane>;
///////////
// FLAGS //
......@@ -128,8 +128,8 @@ template< typename LatticeModel_T, typename Filter_T >
class VectorGradientRefinement
{
public:
typedef GhostLayerField< Vector3<real_t>, 1 > VectorField_T;
typedef typename LatticeModel_T::Stencil Stencil_T;
using VectorField_T = GhostLayerField<Vector3<real_t>, 1>;
using Stencil_T = typename LatticeModel_T::Stencil;
VectorGradientRefinement( const ConstBlockDataID & fieldID, const Filter_T & filter,
const real_t upperLimit, const real_t lowerLimit, const uint_t maxLevel ) :
......@@ -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,
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();
......@@ -168,7 +168,7 @@ void VectorGradientRefinement< LatticeModel_T, Filter_T >::operator()( std::vect
if( uField == nullptr )
{
it->second = uint_t(0);
minTargetLevel.second = uint_t(0);
continue;
}
......@@ -246,12 +246,12 @@ void VectorGradientRefinement< LatticeModel_T, Filter_T >::operator()( std::vect
if( refine && currentLevelOfBlock < maxLevel_ )
{
WALBERLA_ASSERT( !coarsen );
it->second = currentLevelOfBlock + uint_t(1);
minTargetLevel.second = currentLevelOfBlock + uint_t(1);
}
if( coarsen && currentLevelOfBlock > uint_t(0) )
{
WALBERLA_ASSERT( !refine );
it->second = currentLevelOfBlock - uint_t(1);
minTargetLevel.second = currentLevelOfBlock - uint_t(1);
}
}
}
......@@ -307,28 +307,28 @@ private:
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 )
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) );
real_t dxOnLevel = dx * real_c(levelScalingFactor);
AABB blockAABB = block->getAABB();
AABB blockAABB = block.getAABB();
// extend block AABB by ghostlayers
AABB extendedBlockAABB = blockAABB.getExtended( dxOnLevel * real_c(FieldGhostLayers) );
if( extendedBlockAABB.intersects( refinementBox ) )
if( blockLevel < ( levels - uint_t(1) ) )
block->setMarker( true );
block.setMarker( true );
}
}
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->setMemory( numeric_cast< memory_t >(1) );
block.setWorkload( numeric_cast< workload_t >( uint_t(1) << block.getLevel() ) );
block.setMemory( numeric_cast< memory_t >(1) );
}
}
......@@ -378,7 +378,7 @@ static shared_ptr< StructuredBlockForest > createBlockStructure( const AABB & do
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.init( domainAABB, numberOfCoarseBlocksPerDirection[0], numberOfCoarseBlocksPerDirection[1], numberOfCoarseBlocksPerDirection[2], true, true, true );
......@@ -498,13 +498,8 @@ public:
WALBERLA_MPI_SECTION()
{
mpi::allReduceInplace( pos[0], mpi::SUM );
mpi::allReduceInplace( pos[1], mpi::SUM );
mpi::allReduceInplace( pos[2], mpi::SUM );
mpi::allReduceInplace( transVel[0], mpi::SUM );
mpi::allReduceInplace( transVel[1], mpi::SUM );
mpi::allReduceInplace( transVel[2], mpi::SUM );
mpi::allReduceInplace( pos, mpi::SUM );
mpi::allReduceInplace( transVel, mpi::SUM );
}
position_ = pos[2];
......@@ -625,9 +620,9 @@ public:
for( uint_t level = 0; level < numberOfLevels_; ++level)
{
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());
}
......@@ -635,15 +630,14 @@ public:
{
// 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());
}
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());
}
}
......@@ -929,7 +923,7 @@ int main( int argc, char **argv )
if( !useStaticRefinement && refinementCheckFrequency == 0 && numberOfLevels != 1 )
{
// determine check frequency automatically based on maximum admissable velocity and block sizes
// determine check frequency automatically based on maximum admissible velocity and block sizes
real_t uMax = real_t(0.1);
real_t refinementCheckFrequencyFinestLevel = ( overlap + real_c(blockSize) - real_t(2) * real_t(FieldGhostLayers) * dx) / uMax;
refinementCheckFrequency = uint_c( refinementCheckFrequencyFinestLevel / real_t(lbmTimeStepsPerTimeLoopIteration));
......@@ -955,7 +949,7 @@ int main( int argc, char **argv )
pe::cr::DEM cr(globalBodyStorage, blocks->getBlockStoragePointer(), bodyStorageID, ccdID, fcdID, &(*timingTreePE));
// 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
......@@ -982,19 +976,19 @@ int main( int argc, char **argv )
LatticeModel_T latticeModel = LatticeModel_T( lbm::collision_model::TRT::constructWithMagicNumber( omega, lbm::collision_model::TRT::threeSixteenth, finestLevel ) );
// add PDF field
BlockDataID pdfFieldID = lbm::addPdfFieldToStorage< LatticeModel_T >( blocks, "pdf field (zyxf)", latticeModel,
BlockDataID pdfFieldID = lbm::addPdfFieldToStorage< LatticeModel_T >( blocks, "pdf field (fzyx)", latticeModel,
Vector3< real_t >( real_t(0) ), real_t(1),
FieldGhostLayers, field::zyxf );
FieldGhostLayers, field::fzyx );
// add flag field
BlockDataID flagFieldID = field::addFlagFieldToStorage<FlagField_T>( blocks, "flag field", FieldGhostLayers );
// add body field
BlockDataID bodyFieldID = field::addToStorage<BodyField_T>( blocks, "body field", nullptr, field::zyxf, FieldGhostLayers );
BlockDataID bodyFieldID = field::addToStorage<BodyField_T>( blocks, "body field", nullptr, field::fzyx, FieldGhostLayers );
// add velocity field and utility
BlockDataID velocityFieldID = field::addToStorage<VelocityField_T>( blocks, "velocity field", Vector3<real_t>(real_t(0)), field::zyxf, uint_t(2) );
BlockDataID velocityFieldID = field::addToStorage<VelocityField_T>( blocks, "velocity field", Vector3<real_t>(real_t(0)), field::fzyx, uint_t(2) );
typedef lbm::VelocityFieldWriter< PdfField_T, VelocityField_T > VelocityFieldWriter_T;
using VelocityFieldWriter_T = lbm::VelocityFieldWriter<PdfField_T, VelocityField_T>;
BlockSweepWrapper< VelocityFieldWriter_T > velocityFieldWriter( blocks, VelocityFieldWriter_T( pdfFieldID, velocityFieldID ) );
......@@ -1014,12 +1008,12 @@ int main( int argc, char **argv )
// force averaging functionality
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);
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));
std::function<void(void)> setForceScalingFactorToOne = std::bind(&pe_coupling::ForceTorqueOnBodiesScaler::resetScalingFactor,forceScaler,real_t(1));
std::function<void(void)> setForceScalingFactorToHalf = std::bind(&pe_coupling::ForceTorqueOnBodiesScaler::resetScalingFactor,forceScaler,real_t(0.5));
std::function<void(void)> setForceScalingFactorToOne = [forceScaler] { forceScaler->resetScalingFactor(real_t(1)); };
std::function<void(void)> setForceScalingFactorToHalf = [forceScaler] { forceScaler->resetScalingFactor(real_t(0.5)); };
if( averageForceTorqueOverTwoTimSteps ) {
bodiesFTContainer2->store();
......@@ -1177,7 +1171,7 @@ int main( int argc, char **argv )
"Body Mapping", finestLevel );
// add sweep for restoring PDFs in cells previously occupied by pe bodies
typedef pe_coupling::EquilibriumReconstructor< LatticeModel_T, BoundaryHandling_T > Reconstructor_T;
using Reconstructor_T = pe_coupling::EquilibriumReconstructor<LatticeModel_T, BoundaryHandling_T>;
Reconstructor_T reconstructor( blocks, boundaryHandlingID, bodyFieldID );
refinementTimestep->addPostStreamVoidFunction(lbm::refinement::SweepAsFunctorWrapper( pe_coupling::PDFReconstruction< LatticeModel_T, BoundaryHandling_T, Reconstructor_T > ( blocks, pdfFieldID,
boundaryHandlingID, bodyStorageID, globalBodyStorage, bodyFieldID, reconstructor, FormerMO_Flag, Fluid_Flag ), blocks ),
......@@ -1252,7 +1246,7 @@ int main( int argc, char **argv )
(*velocityCommunicationScheme)();
}
// check refinement criterions and refine/coarsen if necessary
// check refinement criteria and refine/coarsen if necessary
uint_t stampBefore = blocks->getBlockForest().getModificationStamp();
blocks->refresh();
uint_t stampAfter = blocks->getBlockForest().getModificationStamp();
......@@ -1336,4 +1330,4 @@ int main( int argc, char **argv )
int main( int argc, char **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 )
......@@ -86,23 +86,23 @@ using namespace walberla;
using walberla::uint_t;
// PDF field, flag field & body field
typedef lbm::D3Q19< lbm::collision_model::TRT, false> LatticeModel_T;
using LatticeModel_T = lbm::D3Q19<lbm::collision_model::TRT, false>;
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;
typedef GhostLayerField< pe::BodyID, 1 > BodyField_T;
using flag_t = walberla::uint8_t;
using FlagField_T = FlagField<flag_t>;
using BodyField_T = GhostLayerField<pe::BodyID, 1>;
const uint_t FieldGhostLayers = 1;
// boundary handling
typedef pe_coupling::CurvedLinear< LatticeModel_T, FlagField_T > MO_CLI_T;
using MO_CLI_T = pe_coupling::CurvedLinear<LatticeModel_T, FlagField_T>;
typedef BoundaryHandling< FlagField_T, Stencil_T, MO_CLI_T > BoundaryHandling_T;
using BoundaryHandling_T = BoundaryHandling<FlagField_T, Stencil_T, MO_CLI_T>;
typedef std::tuple<pe::Sphere, pe::Ellipsoid, pe::Plane> BodyTypeTuple;
using BodyTypeTuple = std::tuple<pe::Sphere, pe::Ellipsoid, pe::Plane>;
///////////
// FLAGS //
......@@ -540,7 +540,7 @@ int main( int argc, char **argv )
// connect to pe
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 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) );
......@@ -682,15 +682,15 @@ int main( int argc, char **argv )
LatticeModel_T latticeModel = LatticeModel_T( lbm::collision_model::TRT::constructWithMagicNumber( omega ) );
// add PDF field
BlockDataID pdfFieldID = lbm::addPdfFieldToStorage< LatticeModel_T >( blocks, "pdf field (zyxf)", latticeModel,
BlockDataID pdfFieldID = lbm::addPdfFieldToStorage< LatticeModel_T >( blocks, "pdf field (fzyx)", latticeModel,
Vector3< real_t >( real_t(0) ), real_t(1),
uint_t(1), field::zyxf );
uint_t(1), field::fzyx );
// add flag field
BlockDataID flagFieldID = field::addFlagFieldToStorage<FlagField_T>( blocks, "flag field" );
// add body field
BlockDataID bodyFieldID = field::addToStorage<BodyField_T>( blocks, "body field", nullptr, field::zyxf );
BlockDataID bodyFieldID = field::addToStorage<BodyField_T>( blocks, "body field", nullptr, field::fzyx );
// add boundary handling & initialize outer domain boundaries
BlockDataID boundaryHandlingID = blocks->addStructuredBlockData< BoundaryHandling_T >(
......@@ -754,18 +754,18 @@ int main( int argc, char **argv )
<< Sweep( pe_coupling::BodyMapping< LatticeModel_T, BoundaryHandling_T >( blocks, pdfFieldID, boundaryHandlingID, bodyStorageID, globalBodyStorage, bodyFieldID, MO_CLI_Flag, FormerMO_Flag, pe_coupling::selectRegularBodies ), "Body Mapping" );
// sweep for restoring PDFs in cells previously occupied by pe bodies
typedef pe_coupling::EquilibriumReconstructor< LatticeModel_T, BoundaryHandling_T > Reconstructor_T;
using Reconstructor_T = pe_coupling::EquilibriumReconstructor<LatticeModel_T, BoundaryHandling_T>;
Reconstructor_T reconstructor( blocks, boundaryHandlingID, bodyFieldID);
timeloop.add()
<< Sweep( pe_coupling::PDFReconstruction< LatticeModel_T, BoundaryHandling_T, Reconstructor_T >
( 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);
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);
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));
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 ) {
bodiesFTContainer2->store();
......@@ -981,4 +981,4 @@ int main( int argc, char **argv )
int main( int argc, char **argv ){
workload_evaluation::main(argc, argv);
}
}
\ No newline at end of file
add_subdirectory( AdaptiveMeshRefinementFluidParticleCoupling )
add_subdirectory( CNT )
add_subdirectory( ComplexGeometry )
add_subdirectory( DEM )
add_subdirectory( FieldCommunication )
add_subdirectory( MeshDistance )
add_subdirectory( CouetteFlow )
add_subdirectory( FreeSurfaceAdvection )
add_subdirectory( FluidizedBed )
add_subdirectory( FluidParticleCoupling )
add_subdirectory( FluidParticleCouplingWithLoadBalancing )
add_subdirectory( ForcesOnSphereNearPlaneInShearFlow )
add_subdirectory(Percolation)
add_subdirectory( GranularGas )
add_subdirectory( IntegratorAccuracy )
add_subdirectory( LennardJones )
add_subdirectory( NonUniformGrid )
add_subdirectory( MotionSingleHeavySphere )
......@@ -14,5 +19,23 @@ add_subdirectory( PoiseuilleChannel )
add_subdirectory( ProbeVsExtraMessage )
add_subdirectory( SchaeferTurek )
add_subdirectory( UniformGrid )
add_subdirectory( UniformGridGPU )
add_subdirectory( UniformGridGenerated )
if ( WALBERLA_BUILD_WITH_PYTHON )
add_subdirectory( FieldCommunication )
if ( WALBERLA_BUILD_WITH_CODEGEN )
add_subdirectory( UniformGridCPU )
add_subdirectory( PhaseFieldAllenCahn )
add_subdirectory( NonUniformGridCPU )
add_subdirectory( TurbulentChannel )
endif()
if ( WALBERLA_BUILD_WITH_CODEGEN AND WALBERLA_BUILD_WITH_GPU_SUPPORT )
add_subdirectory( UniformGridGPU )
add_subdirectory( NonUniformGridGPU )
endif()
endif()