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

started writing poiseuille channel example

parent ae170a28
No related merge requests found
_sphinx_build
# Minimal makefile for Sphinx documentation
#
# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _sphinx_build
ZIPPED_EXAMPLES := zipped-examples
MKDIR := mkdir -p
dir_guard = $(MKDIR) $(@D)
# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
.PHONY: help html clean Makefile ZipExamples
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
html: Makefile ZipExamples
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
clean:
@echo "Removing generated downloadable files"
@rm -rf $(ZIPPED_EXAMPLES)
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
ZipExamples: $(ZIPPED_EXAMPLES)/PoiseuilleChannel.zip
$(ZIPPED_EXAMPLES)/PoiseuilleChannel.zip: PoiseuilleChannel/*
@$(dir_guard)
@echo Zipping $(<D)
@zip -r $@ $(<D)
waLBerla_link_files_to_builddir( Channel.prm )
add_executable( Ex_PoiseuilleChannel )
target_sources( Ex_PoiseuilleChannel PRIVATE PoiseuilleChannel.cpp )
pystencilssfg_generate_target_sources( Ex_PoiseuilleChannel
SCRIPTS LbmAlgorithms.py
)
target_link_libraries(
Ex_PoiseuilleChannel
PRIVATE
core stencil blockforest geometry vtk sfg_walberla
)
# Force-Driven Poiseuille Channel
This example aims to illustrate the basic code generation features of `sfg-walberla`
by building a force-driven channel flow application.
## Files
{download}`PoiseuilleChannel.zip </zipped-examples/PoiseuilleChannel.zip>`.
This example comprises the following files:
- `PoiseuilleChannel.cpp`: The main simulation application;
- `LbmAlgorithms.py`: The code generation script producing the lattice Boltzmann algorithms;
- `CMakeLists.txt`: The CMake build system configuration;
- `Channel.prm`: the parameter file describing the channel.
## CMake Target Definition
:::{card} `CMakeLists.txt`
::::{literalinclude} CMakeLists.txt
:language: CMake
::::
:::
The CMake target setup for this example is quite straight-forward.
We create a new executable called `Ex_PoiseuilleChannel`
and add to it the single C++ source file `PoiseuilleChannel.cpp`.
Then, we register our code generator script `LbmAlgorithms.py` via the
[`pystencilssfg_generate_target_sources`][sfg_add_gen_scripts] CMake function.
[sfg_add_gen_scripts]: https://pycodegen.pages.i10git.cs.fau.de/pystencils-sfg/usage/project_integration.html#add-generator-scripts "pystencils-sfg Documentation"
\ No newline at end of file
# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
project = 'waLBerla codegen by example'
copyright = '2024, Frederik Hennig'
author = 'Frederik Hennig'
# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
extensions = [
"myst_parser",
"sphinx_design",
"sphinx_copybutton",
]
# templates_path = ['_templates']
exclude_patterns = ["build"]
myst_enable_extensions = [
"colon_fence",
"dollarmath",
"attrs_inline"
]
# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
html_theme = 'sphinx_book_theme'
html_static_path = ['zipped-examples']
html_title = "waLBerla codegen by example"
File added
# waLBerla Code Generation by Example
:::{toctree}
:caption: Fundamentals
:maxdepth: 1
PoiseuilleChannel/PoiseuilleChannel
:::
\ No newline at end of file
File added
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment