From: wolf Date: Tue, 24 Sep 2002 14:26:41 +0000 (+0000) Subject: Add a rather complicated assertion. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=edb5c95cec4b251ddddf9f6780529a009e2d912d;p=dealii-svn.git Add a rather complicated assertion. git-svn-id: https://svn.dealii.org/trunk@6501 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/include/fe/fe_base.h b/deal.II/deal.II/include/fe/fe_base.h index f40a7e25cc..271eb47321 100644 --- a/deal.II/deal.II/include/fe/fe_base.h +++ b/deal.II/deal.II/include/fe/fe_base.h @@ -1495,9 +1495,68 @@ FiniteElementBase::face_system_to_component_index (const unsigned int index { Assert(index < face_system_to_component_table.size(), ExcIndexRange(index, 0, face_system_to_component_table.size())); -//TODO: check for primitivity of this shape function. this needs the global dof index -// Assert (is_primitive (face_to_cell_index(index)), -// typename FiniteElementBase::ExcShapeFunctionNotPrimitive(index)); + + // in debug mode, check whether the + // function is primitive, since + // otherwise the result may have no + // meaning + // + // since the primitivity tables are + // all geared towards cell dof + // indices, rather than face dof + // indices, we have to work a + // little bit... + // + // in 1d, the face index is equal + // to the cell index + Assert (((dim == 1) && is_primitive(index)) + || + // in 2d, construct it like + // this: + ((dim == 2) && + is_primitive (index < (GeometryInfo<2>::vertices_per_face * + this->dofs_per_vertex) + ? + index + : + GeometryInfo<2>::vertices_per_cell * + this->dofs_per_vertex + + (index - + GeometryInfo<2>::vertices_per_face * + this->dofs_per_vertex))) + || + // likewise in 3d, but more + // complicated + ((dim == 3) && + is_primitive (index < (GeometryInfo<3>::vertices_per_face * + this->dofs_per_vertex) + ? + index + : + (index < (GeometryInfo<3>::vertices_per_face * + this->dofs_per_vertex + + + GeometryInfo<3>::lines_per_face * + this->dofs_per_line) + ? + GeometryInfo<3>::vertices_per_cell * + this->dofs_per_vertex + + (index - + GeometryInfo<3>::vertices_per_face * + this->dofs_per_vertex) + : + GeometryInfo<3>::vertices_per_cell * + this->dofs_per_vertex + + GeometryInfo<3>::lines_per_cell * + this->dofs_per_line + + (index - + GeometryInfo<3>::vertices_per_face * + this->dofs_per_vertex + - + GeometryInfo<3>::lines_per_face * + this->dofs_per_line)))), + typename FiniteElementBase::ExcShapeFunctionNotPrimitive(index)); + return face_system_to_component_table[index]; }