From 686ec0bba3d4c1a4aefa8dfe13e560fb29215c88 Mon Sep 17 00:00:00 2001 From: markus holzer <markus.holzer@fau.de> Date: Tue, 21 Sep 2021 11:26:19 +0200 Subject: [PATCH] Fixed doc --- doc/sphinx/api.rst | 1 + doc/sphinx/enums.rst | 6 ++++++ lbmpy/creationfunctions.py | 16 ++++++++-------- lbmpy/enums.py | 1 - 4 files changed, 15 insertions(+), 9 deletions(-) create mode 100644 doc/sphinx/enums.rst diff --git a/doc/sphinx/api.rst b/doc/sphinx/api.rst index d18e02a9..87920d6d 100644 --- a/doc/sphinx/api.rst +++ b/doc/sphinx/api.rst @@ -5,6 +5,7 @@ API Reference :maxdepth: 1 scenarios.rst + enums.rst kernelcreation.rst methodcreation.rst stencils.rst diff --git a/doc/sphinx/enums.rst b/doc/sphinx/enums.rst new file mode 100644 index 00000000..e84e5918 --- /dev/null +++ b/doc/sphinx/enums.rst @@ -0,0 +1,6 @@ +********* +Enums +********* + +.. automodule:: lbmpy.enums + :members: diff --git a/lbmpy/creationfunctions.py b/lbmpy/creationfunctions.py index 37b1dcfe..efda8944 100644 --- a/lbmpy/creationfunctions.py +++ b/lbmpy/creationfunctions.py @@ -15,11 +15,11 @@ General: This determines the selection and relaxation pattern of moments/cumulants, i.e. which moment/cumulant basis is chosen, and which of the basis vectors are relaxed together - - ``srt``: single relaxation time (:func:`lbmpy.methods.create_srt`) - - ``trt``: two relaxation time, first relaxation rate is for even moments and determines the viscosity (as in SRT), + - ``Method.SRT``: single relaxation time (:func:`lbmpy.methods.create_srt`) + - ``Method.TRT``: two relaxation time, first relaxation rate is for even moments and determines the viscosity (as in SRT), the second relaxation rate is used for relaxing odd moments, and controls the bulk viscosity. (:func:`lbmpy.methods.create_trt`) - - ``mrt``: orthogonal multi relaxation time model, relaxation rates are used in this order for : + - ``Method.MRT``: orthogonal multi relaxation time model, relaxation rates are used in this order for : shear modes, bulk modes, 3rd order modes, 4th order modes, etc. Requires also a parameter 'weighted' that should be True if the moments should be orthogonal w.r.t. weighted scalar product using the lattice weights. If `False` the normal scalar product is used. @@ -28,15 +28,15 @@ General: the same rate. Literature values of this list can be obtained through :func:`lbmpy.methods.creationfunctions.mrt_orthogonal_modes_literature`. See also :func:`lbmpy.methods.create_mrt_orthogonal` - - ``mrt_raw``: non-orthogonal MRT where all relaxation rates can be specified independently i.e. there are as many + - ``Method.MRT_RAW``: non-orthogonal MRT where all relaxation rates can be specified independently i.e. there are as many relaxation rates as stencil entries. Look at the generated method in Jupyter to see which moment<->relaxation rate mapping (:func:`lbmpy.methods.create_mrt_raw`) - - ``trt-kbc-n<N>`` where <N> is 1,2,3 or 4. Special two-relaxation rate method. This is not the entropic method + - ``Method.TRT_KBC_Nx`` where <x> is 1,2,3 or 4. Special two-relaxation rate method. This is not the entropic method yet, only the relaxation pattern. To get the entropic method, see parameters below! (:func:`lbmpy.methods.create_trt_kbc`) - - ``cumulant``: cumulant-based lb method (:func:`lbmpy.methods.create_with_default_polynomial_cumulants`) which + - ``Method.CUMULANT``: cumulant-based lb method (:func:`lbmpy.methods.create_with_default_polynomial_cumulants`) which relaxes groups of polynomial cumulants chosen to optimize rotational invariance. - - ``monomial_cumulant``: cumulant-based lb method (:func:`lbmpy.methods.create_with_monomial_cumulants`) which + - ``Method.MONOMIAL_CUMULANT``: cumulant-based lb method (:func:`lbmpy.methods.create_with_monomial_cumulants`) which relaxes monomial cumulants. - ``relaxation_rates``: sequence of relaxation rates, number depends on selected method. If you specify more rates than @@ -184,7 +184,7 @@ execute this pipeline only up to a certain step. Each function optionally also t Each of those functions is configured with three data classes. One to define the lattice Boltzmann method itself. This class is called `LBMConfig`. The second one determines optimisations which are specific to the LBM. Optimisations like the common supexpression elimination. The config class is called `LBMOptimisation`. The third -data class determines hardware optimisation. This can be found in the pystencils module as `CreateKernelConfig`. +data class determines hardware optimisation. This can be found in the pystencils module as 'CreateKernelConfig'. With this class for example the target of the generated code is specified. For example, to modify the AST one can run:: diff --git a/lbmpy/enums.py b/lbmpy/enums.py index 9bcc68ee..2351b810 100644 --- a/lbmpy/enums.py +++ b/lbmpy/enums.py @@ -25,7 +25,6 @@ class Method(Enum): MONOMIAL_CUMULANT = auto() -# TODO integrate these class ForceModel(Enum): SIMPLE = auto() LUO = auto() -- GitLab