diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000000000000000000000000000000000000..2aaf0e39557ece48add0ffeb74722b3f42ec8026 --- /dev/null +++ b/.clang-format @@ -0,0 +1,148 @@ +Language: Cpp +AccessModifierOffset: -2 +AlignAfterOpenBracket: Align +AlignConsecutiveAssignments: true +AlignConsecutiveDeclarations: false +AlignEscapedNewlines: DontAlign +AlignOperands: true +AlignTrailingComments: true +AllowAllParametersOfDeclarationOnNextLine: false +AllowShortBlocksOnASingleLine: true +AllowShortCaseLabelsOnASingleLine: false +AllowShortFunctionsOnASingleLine: All +AllowShortIfStatementsOnASingleLine: true +AllowShortLoopsOnASingleLine: false +AlwaysBreakAfterReturnType: None +AlwaysBreakBeforeMultilineStrings: false +AlwaysBreakTemplateDeclarations: true +BinPackArguments: true +BinPackParameters: true +BraceWrapping: + AfterClass: true + AfterControlStatement: true + AfterEnum: false + AfterFunction: true + AfterNamespace: true + AfterObjCDeclaration: false + AfterStruct: true + AfterUnion: true + AfterExternBlock: true + BeforeCatch: false + BeforeElse: true + IndentBraces: false + SplitEmptyFunction: false + SplitEmptyRecord: false + SplitEmptyNamespace: false +BreakBeforeBinaryOperators: None +BreakBeforeBraces: Custom +BreakBeforeInheritanceComma: false +BreakBeforeTernaryOperators: false +BreakConstructorInitializers: BeforeColon +BreakStringLiterals: true +ColumnLimit: 120 +CommentPragmas: '^ IWYU pragma:' +CompactNamespaces: false +ConstructorInitializerAllOnOneLineOrOnePerLine: false +ConstructorInitializerIndentWidth: 3 +ContinuationIndentWidth: 3 +Cpp11BracedListStyle: false +DerivePointerAlignment: false +DisableFormat: false +ExperimentalAutoDetectBinPacking: false +FixNamespaceComments: true +ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ] +IncludeBlocks: Regroup +IncludeCategories: + - Regex: '^"blockforest/' + Priority: 1 + - Regex: '^"boundary/' + Priority: 2 + - Regex: '^"communication/' + Priority: 3 + - Regex: '^"core/' + Priority: 4 + - Regex: '^"domain_decomposition/' + Priority: 5 + - Regex: '^"executiontree/' + Priority: 6 + - Regex: '^"fft/' + Priority: 7 + - Regex: '^"field/' + Priority: 8 + - Regex: '^"gather/' + Priority: 9 + - Regex: '^"geometry/' + Priority: 10 + - Regex: '^"gpu/' + Priority: 11 + - Regex: '^"gpu/' + Priority: 12 + - Regex: '^"lbm/' + Priority: 13 + - Regex: '^"lbm_mesapd_coupling/' + Priority: 14 + - Regex: '^"mesh/' + Priority: 15 + - Regex: '^"mesa_pd/' + Priority: 16 + - Regex: '^"pde/' + Priority: 17 + - Regex: '^"pe/' + Priority: 18 + - Regex: '^"pe_coupling/' + Priority: 19 + - Regex: '^"postprocessing/' + Priority: 20 + - Regex: '^"python_coupling/' + Priority: 21 + - Regex: '^"simd/' + Priority: 22 + - Regex: '^"sqlite/' + Priority: 23 + - Regex: '^"stencil/' + Priority: 24 + - Regex: '^"timeloop/' + Priority: 25 + - Regex: '^"vtk/' + Priority: 26 + - Regex: '^<boost/' + Priority: 27 + - Regex: '^<' + Priority: 28 +IndentCaseLabels: false +IndentPPDirectives: AfterHash +IndentWidth: 3 +IndentWrappedFunctionNames: true +KeepEmptyLinesAtTheStartOfBlocks: false +MacroBlockBegin: '' +MacroBlockEnd: '' +MaxEmptyLinesToKeep: 1 +NamespaceIndentation: None +ObjCBlockIndentWidth: 2 +ObjCSpaceAfterProperty: false +ObjCSpaceBeforeProtocolList: true +PenaltyBreakAssignment: 2 +PenaltyBreakBeforeFirstCallParameter: 19 +PenaltyBreakComment: 300 +PenaltyBreakFirstLessLess: 120 +PenaltyBreakString: 1000 +PenaltyExcessCharacter: 1000000 +PenaltyReturnTypeOnItsOwnLine: 60 +PointerAlignment: Left +ReflowComments: true +SortIncludes: true +SortUsingDeclarations: true +SpaceAfterCStyleCast: true +SpaceAfterTemplateKeyword: false +SpaceBeforeAssignmentOperators: true +SpaceBeforeParens: ControlStatements +SpaceInEmptyParentheses: false +SpacesBeforeTrailingComments: 1 +SpacesInAngles: true +SpacesInContainerLiterals: true +SpacesInCStyleCastParentheses: false +SpacesInParentheses: false +SpacesInSquareBrackets: false +Standard: Cpp11 +TabWidth: 3 +UseTab: Never \ No newline at end of file diff --git a/codegen-requirements.txt b/codegen-requirements.txt index d123706a2914a702ec849cef4e57ae8da97ea2ad..a676a8e9ceb7cc26b149e238ca69622f5307f5e0 100644 --- a/codegen-requirements.txt +++ b/codegen-requirements.txt @@ -4,5 +4,5 @@ git+https://i10git.cs.fau.de/pycodegen/pystencils.git@v2.0-dev # lbmpy: feature branch for pystencils-2.0 compatibility git+https://i10git.cs.fau.de/pycodegen/lbmpy.git@fhennig/pystencils2.0-compat -# pystencils-sfg: latest supported revision -git+https://i10git.cs.fau.de/pycodegen/pystencils-sfg.git@8949bedba3a8704dff520580202fc273fb0202de +# pystencils-sfg: GPU dev branch +git+https://i10git.cs.fau.de/pycodegen/pystencils-sfg.git@fhennig/cuda-invoke diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 0ff9363a6f146e933622f513f66a3f777794e90f..15a074a65fa21730c5f252a3df0371ceff487b12 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -3,7 +3,7 @@ add_library( walberla::experimental ALIAS walberla_experimental ) target_sources( walberla_experimental INTERFACE - walberla/experimental/field/SparseIndexList.hpp + walberla/experimental/sweep/SparseIndexList.hpp walberla/experimental/lbm/GenericHbbBoundary.hpp walberla/experimental/lbm/IrregularFreeSlip.hpp ) diff --git a/tests/BasicLbmScenarios/CMakeLists.txt b/tests/BasicLbmScenarios/CMakeLists.txt index 94d46f2d04ccb3e63a716e59e065a4995e42759b..468ce070fb92a174dc6a697bec7457852a559edb 100644 --- a/tests/BasicLbmScenarios/CMakeLists.txt +++ b/tests/BasicLbmScenarios/CMakeLists.txt @@ -1,6 +1,6 @@ -add_executable( TestIrregularFreeSlip TestIrregularFreeSlip.cpp ) -walberla_generate_sources( TestIrregularFreeSlip SCRIPTS IrregularFreeSlip.py ) -target_link_libraries( TestIrregularFreeSlip PRIVATE walberla::core walberla::blockforest walberla::field walberla::geometry walberla::experimental ) -add_test( NAME TestIrregularFreeSlip COMMAND TestIrregularFreeSlip ) +add_executable( TestBasicLbmScenarios TestBasicLbmScenarios.cpp ) +walberla_generate_sources( TestBasicLbmScenarios SCRIPTS LbmAlgorithms.py ) +target_link_libraries( TestBasicLbmScenarios PRIVATE walberla::core walberla::blockforest walberla::field walberla::geometry walberla::experimental ) +add_test( NAME TestBasicLbmScenarios COMMAND TestBasicLbmScenarios ) -add_dependencies( SfgTests TestIrregularFreeSlip ) +add_dependencies( SfgTests TestBasicLbmScenarios ) diff --git a/tests/BasicLbmScenarios/IrregularFreeSlip.py b/tests/BasicLbmScenarios/LbmAlgorithms.py similarity index 61% rename from tests/BasicLbmScenarios/IrregularFreeSlip.py rename to tests/BasicLbmScenarios/LbmAlgorithms.py index b197a32229659ce9a398851300bcac20fa02efcb..66c5add1a8c6b7eb797034e7cd66be5c2b4bf3a0 100644 --- a/tests/BasicLbmScenarios/IrregularFreeSlip.py +++ b/tests/BasicLbmScenarios/LbmAlgorithms.py @@ -5,12 +5,12 @@ from pystencils import fields, Field from lbmpy import LBStencil, Stencil, LBMConfig, LBMOptimisation, create_lb_update_rule from lbmpy.macroscopic_value_kernels import macroscopic_values_setter - from walberla.codegen import Sweep from walberla.codegen.boundaries import FreeSlip + with SourceFileGenerator() as sfg: - sfg.namespace("TestIrregularFreeSlip::gen") + sfg.namespace("BasicLbmScenarios::gen") stencil = LBStencil(Stencil.D3Q19) d, q = stencil.D, stencil.Q @@ -36,19 +36,22 @@ with SourceFileGenerator() as sfg: lb_update = create_lb_update_rule(lbm_config=lbm_config, lbm_optimisation=lbm_opt) assert lb_update is not None - lb_update_sweep = Sweep("LbStreamCollide", lb_update) - lb_update_sweep.swap_fields(f, f_tmp) - sfg.generate(lb_update_sweep) - - lb_init = macroscopic_values_setter( - lb_update.method, - density=sp.Symbol("density"), - velocity=u.center_vector, - pdfs=f, - ) - lb_init_sweep = Sweep("LbInit", lb_init) - sfg.generate(lb_init_sweep) - - irreg_freeslip = FreeSlip("FreeSlipIrregular", lb_update.method, f, wall_normal=FreeSlip.IRREGULAR) - sfg.generate(irreg_freeslip) - + with sfg.namespace("bulk"): + lb_update_sweep = Sweep("LbStreamCollide", lb_update) + lb_update_sweep.swap_fields(f, f_tmp) + sfg.generate(lb_update_sweep) + + lb_init = macroscopic_values_setter( + lb_update.method, + density=sp.Symbol("density"), + velocity=u.center_vector, + pdfs=f, + ) + lb_init_sweep = Sweep("LbInit", lb_init) + sfg.generate(lb_init_sweep) + + with sfg.namespace("bc_sparse"): + irreg_freeslip = FreeSlip( + "FreeSlipIrregular", lb_update.method, f, wall_normal=FreeSlip.IRREGULAR + ) + sfg.generate(irreg_freeslip) diff --git a/tests/BasicLbmScenarios/SimDomain.hpp b/tests/BasicLbmScenarios/SimDomain.hpp new file mode 100644 index 0000000000000000000000000000000000000000..b3693e5c86ec419d5b626c144ff12d1810469f23 --- /dev/null +++ b/tests/BasicLbmScenarios/SimDomain.hpp @@ -0,0 +1,85 @@ +#pragma once + +#include "blockforest/all.h" + +#include "core/all.h" + +#include "field/all.h" + +#include <memory> + +#include "gen/LbmAlgorithms.hpp" + +namespace BasicLbmScenarios +{ + +using namespace walberla; + +using PdfField_T = field::GhostLayerField< real_t, gen::LbStencil::Q >; +using ScalarField_T = field::GhostLayerField< real_t, 1 >; +using VectorField_T = field::GhostLayerField< real_t, gen::LbStencil::D >; +using FlagField_T = FlagField< uint8_t >; +using CommScheme = blockforest::communication::UniformBufferedScheme< gen::LbStencil >; +using PdfsPackInfo = field::communication::StencilRestrictedPackInfo< PdfField_T, gen::LbStencil >; + +struct SimDomain +{ + const std::shared_ptr< StructuredBlockForest > blocks; + + struct + { + const BlockDataID pdfsId; + const BlockDataID rhoId; + const BlockDataID uId; + const BlockDataID flagFieldId; + } cpuFields; + + CommScheme comm; + +#if defined(WALBERLA_BUILD_WITH_GPU_SUPPORT) + struct + { + const BlockDataID pdfsId; + const BlockDataID rhoId; + const BlockDataID uId; + } gpuFields; + +#endif +}; + +struct SimDomainBuilder +{ + std::array< uint_t, 3 > blocks; + std::array< uint_t, 3 > cellsPerBlock; + std::array< bool, 3 > periodic; + + SimDomain build() + { + auto sbfs = + blockforest::createUniformBlockGrid(blocks[0], blocks[1], blocks[2], cellsPerBlock[0], cellsPerBlock[1], + cellsPerBlock[2], 1.0, true, periodic[0], periodic[1], periodic[2]); + + const BlockDataID pdfsId = field::addToStorage< PdfField_T >(sbfs, "f", real_c(0.0)); + const BlockDataID rhoId = field::addToStorage< ScalarField_T >(sbfs, "rho", real_c(0.0)); + const BlockDataID uId = field::addToStorage< VectorField_T >(sbfs, "u", real_c(0.0)); + const BlockDataID flagFieldId = field::addFlagFieldToStorage< FlagField_T >(sbfs, "flagField"); + + CommScheme comm{ sbfs }; + auto pdfsPackInfo = std::make_shared< PdfsPackInfo >(pdfsId); + comm.addPackInfo(pdfsPackInfo); + + return + { + .blocks = sbfs, // + .cpuFields = { // + .pdfsId = pdfsId, + .rhoId = rhoId, + .uId = uId, + .flagFieldId = flagFieldId + }, // + .comm = comm + }; + } +}; + +} // namespace BasicLbmScenarios diff --git a/tests/BasicLbmScenarios/TestBasicLbmScenarios.cpp b/tests/BasicLbmScenarios/TestBasicLbmScenarios.cpp new file mode 100644 index 0000000000000000000000000000000000000000..04413de31eb8a6f0f271842f919e64860f4e095a --- /dev/null +++ b/tests/BasicLbmScenarios/TestBasicLbmScenarios.cpp @@ -0,0 +1,132 @@ + +#include "blockforest/all.h" + +#include "core/all.h" + +#include "field/all.h" +#include "field/communication/PackInfo.h" +#include "field/communication/StencilRestrictedPackInfo.h" + +#include "geometry/all.h" + +#include "vtk/all.h" + +#include <array> + +#include "SimDomain.hpp" + +namespace BasicLbmScenarios +{ +using namespace walberla; + +/** + * Pipe flow with circular cross-section and free-slip walls. + * The pipe flow is initialized with a constant velocity in x-direction. + * As free-slip walls do not impose any friction, velocity should remain constant in time. + */ +void freeSlipPipe(Environment& env) +{ + SimDomain dom{ SimDomainBuilder{ + .blocks = { 1, 1, 1 }, .cellsPerBlock = { 4, 32, 32 }, .periodic = { true, false, false } } + .build() }; + + const FlagUID fluidFlagUid{ "Fluid" }; + const FlagUID freeSlipFlagUID{ "FreeSlip" }; + + const CellInterval allCells{ { 0, 0, 0 }, + { dom.blocks->getNumberOfXCellsPerBlock() - 1, + dom.blocks->getNumberOfYCellsPerBlock() - 1, + dom.blocks->getNumberOfZCellsPerBlock() - 1 } }; + const CellInterval allCellsWithGl{ { -1, 0, 0 }, + { dom.blocks->getNumberOfXCellsPerBlock(), + dom.blocks->getNumberOfYCellsPerBlock() - 1, + dom.blocks->getNumberOfZCellsPerBlock() - 1 } }; + + const real_t pipeRadius{ 14.0 }; + const Vector3< real_t > pipeAnchor{ 0.0, 16.0, 16.0 }; + const real_t maxVelocity{ 0.02 }; + + for (auto& block : *dom.blocks) + { + FlagField_T& flagField = *block.getData< FlagField_T >(dom.cpuFields.flagFieldId); + const uint8_t freeSlipFlag{ flagField.getOrRegisterFlag(freeSlipFlagUID) }; + + VectorField_T& velField = *block.getData< VectorField_T >(dom.cpuFields.uId); + + for (Cell c : allCellsWithGl) + { + Cell globalCell{ c }; + dom.blocks->transformBlockLocalToGlobalCell(globalCell, block); + Vector3< real_t > cellCenter{ dom.blocks->getCellCenter(globalCell) }; + cellCenter[0] = 0.0; + + Vector3< real_t > initVelocity; + real_t radialDistance = (cellCenter - pipeAnchor).length(); + if (radialDistance > pipeRadius) + { + flagField.addFlag(c, freeSlipFlag); + initVelocity = Vector3< real_t >{ NAN }; + } + else { initVelocity = Vector3< real_t >{ maxVelocity, 0., 0. }; } + + velField.get(c, 0) = initVelocity[0]; + velField.get(c, 1) = initVelocity[1]; + velField.get(c, 2) = initVelocity[2]; + } + } + + geometry::setNonBoundaryCellsToDomain< FlagField_T >(*dom.blocks, dom.cpuFields.flagFieldId, fluidFlagUid); + + auto flagsOutput = field::createVTKOutput< FlagField_T >(dom.cpuFields.flagFieldId, *dom.blocks, "flags"); + flagsOutput(); + + gen::bulk::LbInit initialize{ dom.cpuFields.pdfsId, dom.cpuFields.uId, 1.0 }; + + for (auto& b : *dom.blocks) + { + initialize(&b); + } + + gen::bc_sparse::FreeSlipIrregular freeSlip{ + gen::bc_sparse::FreeSlipIrregularFactory(dom.blocks, dom.cpuFields.pdfsId) + .fromFlagField< FlagField_T >(dom.cpuFields.flagFieldId, freeSlipFlagUID, fluidFlagUid) + }; + + gen::bulk::LbStreamCollide streamCollide{ dom.cpuFields.pdfsId, dom.cpuFields.rhoId, dom.cpuFields.uId, 1.0 }; + + auto velOutput = field::createVTKOutput< VectorField_T >(dom.cpuFields.uId, *dom.blocks, "vel"); + + for (uint_t i = 0; i < 10; ++i) + { + dom.comm(); + for (auto& block : *dom.blocks) + { + velOutput(); + freeSlip(&block); + streamCollide(&block); + + VectorField_T& velField = *block.getData< VectorField_T >(dom.cpuFields.uId); + FlagField_T& flagField = *block.getData< FlagField_T >(dom.cpuFields.flagFieldId); + uint8_t fluidFlag = flagField.getFlag(fluidFlagUid); + + for (Cell c : allCells) + { + if (flagField.isFlagSet(c, fluidFlag)) + { + WALBERLA_CHECK_FLOAT_EQUAL(velField.get(c, 0), maxVelocity); + WALBERLA_CHECK_FLOAT_EQUAL(velField.get(c, 1), 0.); + WALBERLA_CHECK_FLOAT_EQUAL(velField.get(c, 2), 0.); + } + } + } + } + + velOutput(); +} +} // namespace BasicLbmScenarios + +int main(int argc, char** argv) +{ + walberla::Environment env{ argc, argv }; + BasicLbmScenarios::freeSlipPipe(env); +} diff --git a/tests/BasicLbmScenarios/TestIrregularFreeSlip.cpp b/tests/BasicLbmScenarios/TestIrregularFreeSlip.cpp deleted file mode 100644 index c08df34308cc4e8c64d02717cfe1c091c0ecb5a4..0000000000000000000000000000000000000000 --- a/tests/BasicLbmScenarios/TestIrregularFreeSlip.cpp +++ /dev/null @@ -1,147 +0,0 @@ - -#include "core/all.h" -#include "blockforest/all.h" - -#include "field/all.h" -#include "field/communication/PackInfo.h" -#include "field/communication/StencilRestrictedPackInfo.h" - -#include "geometry/all.h" - -#include "vtk/all.h" - -#include <array> - -#include "gen/IrregularFreeSlip.hpp" - -namespace TestIrregularFreeSlip -{ - using namespace walberla; - - using PdfField_T = field::GhostLayerField<real_t, gen::LbStencil::Q>; - using ScalarField_T = field::GhostLayerField<real_t, 1>; - using VectorField_T = field::GhostLayerField<real_t, gen::LbStencil::D>; - using FlagField_T = FlagField<uint8_t>; - using CommScheme = blockforest::communication::UniformBufferedScheme<gen::LbStencil>; - using PdfsPackInfo = field::communication::StencilRestrictedPackInfo<PdfField_T, gen::LbStencil>; - - /** - * Pipe flow with circular cross-section and free-slip walls. - * The pipe flow is initialized with a constant velocity in x-direction. - * As free-slip walls do not impose any friction, velocity should remain constant in time. - */ - void freeSlipPipe(Environment &env) - { - std::array<uint_t, 3> blocks{1, 1, 1}; - std::array<uint_t, 3> cpb{4, 32, 32}; - std::array<bool, 3> periodic{true, false, false}; - - auto sbfs = blockforest::createUniformBlockGrid( - blocks[0], blocks[1], blocks[2], - cpb[0], cpb[1], cpb[2], - 1.0, - true, - periodic[0], periodic[1], periodic[2] - ); - - BlockDataID pdfsId = field::addToStorage<PdfField_T>(sbfs, "f", real_c(0.0)); - BlockDataID rhoId = field::addToStorage<ScalarField_T>(sbfs, "rho", real_c(0.0)); - BlockDataID uId = field::addToStorage<VectorField_T>(sbfs, "u", real_c(0.0)); - - const BlockDataID flagFieldId = field::addFlagFieldToStorage<FlagField_T>(sbfs, "flagField"); - const FlagUID fluidFlagUid{"Fluid"}; - const FlagUID freeSlipFlagUID{"FreeSlip"}; - - const CellInterval allCells{{0, 0, 0}, {sbfs->getNumberOfXCellsPerBlock() - 1, sbfs->getNumberOfYCellsPerBlock() - 1, sbfs->getNumberOfZCellsPerBlock() - 1}}; - const CellInterval allCellsWithGl{{-1, 0, 0}, {sbfs->getNumberOfXCellsPerBlock(), sbfs->getNumberOfYCellsPerBlock() - 1, sbfs->getNumberOfZCellsPerBlock() - 1}}; - - const real_t pipeRadius{14.0}; - const Vector3<real_t> pipeAnchor{0.0, 16.0, 16.0}; - const real_t maxVelocity{0.02}; - - for (auto &block : *sbfs) - { - FlagField_T &flagField = *block.getData<FlagField_T>(flagFieldId); - const uint8_t freeSlipFlag{flagField.getOrRegisterFlag(freeSlipFlagUID)}; - - VectorField_T &velField = *block.getData<VectorField_T>(uId); - - for (Cell c : allCellsWithGl) - { - Cell globalCell{c}; - sbfs->transformBlockLocalToGlobalCell(globalCell, block); - Vector3<real_t> cellCenter{sbfs->getCellCenter(globalCell)}; - cellCenter[0] = 0.0; - - Vector3<real_t> initVelocity; - real_t radialDistance = (cellCenter - pipeAnchor).length(); - if (radialDistance > pipeRadius) - { - flagField.addFlag(c, freeSlipFlag); - initVelocity = Vector3<real_t>{NAN}; - } - else - { - initVelocity = Vector3<real_t>{maxVelocity, 0., 0.}; - } - - velField.get(c, 0) = initVelocity[0]; - velField.get(c, 1) = initVelocity[1]; - velField.get(c, 2) = initVelocity[2]; - } - } - - geometry::setNonBoundaryCellsToDomain<FlagField_T>(*sbfs, flagFieldId, fluidFlagUid); - - auto flagsOutput = field::createVTKOutput<FlagField_T>(flagFieldId, *sbfs, "flags"); - flagsOutput(); - - gen::LbInit initialize { pdfsId, uId, 1.0 }; - - for(auto& b : *sbfs){ - initialize(&b); - } - - gen::FreeSlipIrregular freeSlip{ - gen::FreeSlipIrregularFactory(sbfs, pdfsId).fromFlagField<FlagField_T>(flagFieldId, freeSlipFlagUID, fluidFlagUid) - }; - - gen::LbStreamCollide streamCollide { pdfsId, rhoId, uId, 1.0 }; - - CommScheme comm{sbfs}; - auto pdfsPackInfo = std::make_shared<PdfsPackInfo>(pdfsId); - comm.addPackInfo(pdfsPackInfo); - - auto velOutput = field::createVTKOutput<VectorField_T>(uId, *sbfs, "vel"); - - for(uint_t i = 0; i < 10; ++i){ - comm(); - for (auto &block : *sbfs) - { - velOutput(); - freeSlip(&block); - streamCollide(&block); - - VectorField_T & velField = *block.getData< VectorField_T >(uId); - FlagField_T & flagField = *block.getData< FlagField_T >(flagFieldId); - uint8_t fluidFlag = flagField.getFlag(fluidFlagUid); - - for(Cell c : allCells){ - if( flagField.isFlagSet(c, fluidFlag) ){ - WALBERLA_CHECK_FLOAT_EQUAL( velField.get(c, 0), maxVelocity ); - WALBERLA_CHECK_FLOAT_EQUAL( velField.get(c, 1), 0. ); - WALBERLA_CHECK_FLOAT_EQUAL( velField.get(c, 2), 0. ); - } - } - } - } - - velOutput(); - } -} - -int main(int argc, char **argv) -{ - walberla::Environment env{argc, argv}; - TestIrregularFreeSlip::freeSlipPipe(env); -}