diff --git a/CHANGELOG.md b/CHANGELOG.md index ab567cc6b..035388d0d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -47,7 +47,7 @@ SPDX-License-Identifier: LGPL-3.0-or-later - The assembler bindings now also accept affordances and `DBCOption`, and they are also renamed to simply `matrix`, `vector` and `scalar`. - The assemblers also export the binding functions to bind the assemblers. -- Rework Python Interface for `DirichletValues` plus adding support to easily fix boundary DOFs of subspacebasis in C++ and Python ([#305](https://github.com/ikarus-project/ikarus/pull/305)) +- Rework the Python Interface for `DirichletValues` plus add support to easily fix boundary DOFs of `Subspacebasis` in C++ and Python ([#305](https://github.com/ikarus-project/ikarus/pull/305)) ## Release v0.4 (Ganymede) diff --git a/docs/website/01_framework/dirichletBCs.md b/docs/website/01_framework/dirichletBCs.md index 45083e31b..22cd30457 100644 --- a/docs/website/01_framework/dirichletBCs.md +++ b/docs/website/01_framework/dirichletBCs.md @@ -24,25 +24,25 @@ The interface of `#!cpp Ikarus::DirichletValues` is represented by the following Ikarus::DirichletValues dirichletValues2(basis); // (1)! void fixBoundaryDOFs(f); // (2)! void fixDOFs(f); // (3)! -void setSingleDOF(i, bool flag); // (4)! +void setSingleDOF(i, flag); // (4)! const auto& basis() const; // (5)! -bool isConstrained(std::size_t i) const; // (6)! +bool isConstrained(i) const; // (6)! auto fixedDOFsize() const; // (7)! auto size() const ; // (8)! auto reset(); // (9)! ``` 1. Create class by inserting a global basis, [@sander2020dune] Chapter 10. -2. Accepts a functor to fix boundary degrees of freedom. `f` is a functor that will be called with the boolean vector of fixed boundary. +2. Accepts a functor to fix boundary degrees of freedom. `f` is a functor that will be called with the Boolean vector of fixed boundary. degrees of freedom and the usual arguments of `Dune::Functions::forEachBoundaryDOF`, as defined on page 388 of the Dune [@sander2020dune] book. -3. A more general version of `fixBoundaryDOFs`. Here, a functor is to be provided that accepts a basis and the corresponding boolean +3. A more general version of `fixBoundaryDOFs`. Here, a functor is to be provided that accepts a basis and the corresponding Boolean 4. A function that helps to fix or unfix the $i$-th degree of freedom vector considering the Dirichlet degrees of freedom. 5. Returns the underlying basis. -6. Indicates whether the degree of freedom `i` is fixed. +6. Indicates whether the degree of freedom $i$ is fixed. 7. Returns the number of fixed degrees of freedom. -8. Returns the number of all dirichlet degrees of freedom. +8. Returns the number of all Dirichlet degrees of freedom. 9. Resets the whole container \bibliography diff --git a/ikarus/python/test/CMakeLists.txt b/ikarus/python/test/CMakeLists.txt index e49554b13..ddcf6e290 100644 --- a/ikarus/python/test/CMakeLists.txt +++ b/ikarus/python/test/CMakeLists.txt @@ -38,7 +38,7 @@ dune_python_add_test( NAME pydirichletvalues SCRIPT - testdirichletvalues.py + dirichletvaluetest.py WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} LABELS diff --git a/ikarus/python/test/testdirichletvalues.py b/ikarus/python/test/dirichletvaluetest.py similarity index 100% rename from ikarus/python/test/testdirichletvalues.py rename to ikarus/python/test/dirichletvaluetest.py diff --git a/ikarus/utils/dirichletvalues.hh b/ikarus/utils/dirichletvalues.hh index 4dc713ce8..75f6687ef 100644 --- a/ikarus/utils/dirichletvalues.hh +++ b/ikarus/utils/dirichletvalues.hh @@ -87,6 +87,8 @@ public: f(dirichletFlagsBackend_, localIndex, localView, intersection); }; Dune::Functions::forEachBoundaryDOF(subspaceBasis(basis_, std::forward(treePath)), lambda); + } else { + static_assert(Dune::AlwaysFalse(), "fixBoundaryDOFs: A function with this signature is not supported"); } } @@ -104,7 +106,7 @@ public: } /** - * \brief Fixes (set boolean value to true) a specific degree of freedom + * \brief Fixes and unfixes (set boolean value to true or false) a specific degree of freedom * * \param i An index indicating the DOF number to be fixed * \param flag Boolean indicating whether the DOF should fixed or not @@ -116,7 +118,7 @@ public: } /** - * \brief Fixes (set boolean value to true) a specific degree of freedom + * \brief Fixes or unfixes (set boolean value to true or flase) a specific degree of freedom * * \param i An index indicating the DOF number to be fixed * \param flag Boolean indicating whether the DOF should fixed or not