]> https://gitweb.dealii.org/ - dealii.git/commitdiff
fix typos, improve doc
authorMichał Wichrowski <mtwichrowski@gmail.com>
Thu, 17 Apr 2025 11:45:39 +0000 (13:45 +0200)
committerMichał Wichrowski <mtwichrowski@gmail.com>
Thu, 17 Apr 2025 11:45:39 +0000 (13:45 +0200)
include/deal.II/numerics/matrix_creator.h
source/numerics/matrix_creator.cc

index 1745ca76e35ff39bacd84292c0decee81e9f2987..864d2818bd8476b11b5a2f10c81f78965a5a8314 100644 (file)
@@ -612,11 +612,12 @@ namespace MatrixCreator
    * element size).
    *
    * @param include_endpoints A pair of booleans indicating whether to include
-   * the first and last dof in the matrix. Setting either one to false only
-   * makes sense if the idexing of DoF in the matrix is lexicographic, i.e. for
-   * FE_Q numbering is required while FE_DGQ can be precessed as it is.
+   * the first and last dof in the matrix. By excluding those DoFs, one can set
+   * a Dirichlet BC on either side. Setting either one to false only makes sense
+   * if the indexing of DoFs in the matrix is lexicographic, i.e., for FE_Q
+   * numbering is required, while FE_DGQ can be processed as it is.
    *
-   * @param numbering  A vector of unsigned integers representing the
+   * @param numbering A vector of unsigned integers representing the
    * numbering of the degrees of freedom. If empty, the
    * numbering of the finite element is used.
    *
@@ -634,17 +635,19 @@ namespace MatrixCreator
 
   /**
    * Computes a 1D cell derivative matrix for a given finite element.
+   *
    * @param fe The finite element object defining the shape functions.
    *
-   * @param h  The cell size used to scale the integration (typically the
+   * @param h The cell size used to scale the integration (typically the
    * element size).
    *
    * @param include_endpoints A pair of booleans indicating whether to include
-   * the first and last dof in the matrix. Setting either one to false only
-   * makes sense if the idexing of DoF in the matrix is lexicographic, i.e. for
-   * FE_Q numbering is required while FE_DGQ can be precessed as it is.
+   * the first and last dof in the matrix. By excluding those DoFs, one can set
+   * a Dirichlet BC on either side. Setting either one to false only makes sense
+   * if the indexing of DoFs in the matrix is lexicographic, i.e., for FE_Q
+   * numbering is required, while FE_DGQ can be processed as it is.
    *
-   * @param numbering  A vector of unsigned integers representing the
+   * @param numbering A vector of unsigned integers representing the
    * numbering of the degrees of freedom. If empty, the
    * numbering of the finite element is used.
    */
index 425abd8eacd68f09f75d3e40ed7ba839626fd058..fbb997286453c0dfc95323f8269dae515c3ce6f5 100644 (file)
@@ -40,7 +40,7 @@ namespace MatrixCreator
         Assert(
           include_endpoints.first == true && include_endpoints.second == true,
           ExcMessage(
-            "You tried to genereate a 1D mass matrix with excluding boundary "
+            "You tried to generate a 1D mass matrix with excluding boundary "
             "dofs for a non-DGQ element without providing a numbering."));
       }
 
@@ -82,6 +82,16 @@ namespace MatrixCreator
     const std::pair<bool, bool> include_endpoints,
     std::vector<unsigned int>   numbering)
   {
+    if (dynamic_cast<const FE_DGQ<1> *>(&fe) == nullptr &&
+        numbering.size() == 0)
+      {
+        Assert(
+          include_endpoints.first == true && include_endpoints.second == true,
+          ExcMessage(
+            "You tried to generate a 1D derivative matrix with excluding boundary "
+            "dofs for a non-DGQ element without providing a numbering."));
+      }
+
     if (numbering.size() == 0)
       {
         numbering.resize(fe.dofs_per_cell);

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.