* 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.
*
/**
* 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.
*/
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."));
}
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);