Skip to content
Snippets Groups Projects
Commit da7d3fde authored by Frederik Hennig's avatar Frederik Hennig
Browse files

Tutorial Text stub

parent fafd5368
Branches
No related tags found
No related merge requests found
namespace walberla{
/**
\page tutorial_codegen02 Tutorial - Code Generation 2: Lattice Model Generation with lbmpy
\section overview Overview
This tutorial demonstrates how to use <a href="https://pycodegen.pages.i10git.cs.fau.de/lbmpy/notebooks/00_tutorial_lbmpy_walberla_overview.html" target="_blank">lbmpy</a> in conjunction with waLBerla to generate efficient implementations of various Lattice Boltzmann Methods to be included in large-scale distributed memory fluid flow simulations. While waLBerla provides an advanced framework for setting up and running complex fluid simulations, it only implements a small set of Lattice Boltzmann collision operators. Writing an efficient C++ implementation of an advanced Lattice-Boltzmann method can be very cumbersome. For this reason, lbmpy has been developed. It is a Python framework which allows to define a set of LB equations at different levels of abstraction, and then generate a highly optimized C implementation of these equations. An introduction to lbmpy can be found <a href="https://pycodegen.pages.i10git.cs.fau.de/lbmpy/notebooks/00_tutorial_lbmpy_walberla_overview.html" target="_blank">here</a>.
As in the previous tutorial (\ref tutorial_codegen01), we will first define the numeric methods and set up code generation in a Python script. We will then include the generated code in a waLBerla application to simulate a two-dimensional shear flow in a periodic domain. Additionally, it will be shown how a waLBerla simulation with complex initial conditions can be initialized using parameter files.
\section lbmpy_codegen_script The Code Generation Script
\section lbmpy_simulation_app The Simulation application
\subsection lbmpy_codegen_inclusion Inclusion of the generated code
\subsection lbmpy_shear_flow_init Initialization of the Shear Flow
\tableofcontents
*/
}
\ No newline at end of file
......@@ -103,7 +103,7 @@ struct ShearFlowInit
public:
ShearFlowInit(const shared_ptr< StructuredBlockForest >& blocks, const Config::BlockHandle& setup)
: exprInitFunc_(blocks), noiseMagnitude_(setup.getParameter< real_t >("u_y_noise_magnitude")),
rng_(setup.getParameter< std::mt19937::result_type >("noise_seed"))
rng_(setup.getParameter< std::mt19937::result_type >("noise_seed", 42))
{
if (!exprInitFunc_.parse(setup)) { WALBERLA_ABORT("Shear Flow Setup was incomplete."); }
}
......
......@@ -43,10 +43,12 @@ all the basic data strcutures and concepts of the framework.
- \ref tutorial_lbm04 \n
A LBM simulation with complex geometries is built.
\subsection codegen Code Generation with pystencils
\subsection codegen Code Generation
- \ref tutorial_codegen01 \n
This tutorial shows how to use pystencils to generate waLBerla sweeps from symbolic descriptions.
- \ref tutorial_codegen02 \n
\section further_info Further information
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment