Commit edcac37f authored by Carsten Gräser's avatar Carsten Gräser

Allow ReferenceElement::size(i,c,cc) for cc<c

While subEntity(i,c,j,cc) is surely not allowed for
cc<c because there's no viable j, there's no reason
to not allow this case for size(i,c,cc). Actually the
implementation works nicely in this case and returns
the correct number size zero. Any grid-specific
ReferenceElement implementation should simply return
zero in this case.

Allowing this case gives the possibility to seamlessly test
for(int j=0; j < re.size(i,c,cc); ++j)
for all 0<=c<=dim and 0<=cc<=dim.
parent e28ffc25
Pipeline #7955 passed with stage
in 11 minutes and 7 seconds
......@@ -103,11 +103,11 @@ namespace Dune {
* Denote by E the i-th subentity of codimension c of the current
* reference element. This method returns the number of subentities
* of codimension cc of the current reference element, that are also
* a subentity of E.
* a subentity of E. If cc<c this number is zero.
*
* \param[in] i number of subentity E (0 <= i < size( c ))
* \param[in] c codimension of subentity E
* \param[in] cc codimension whose size is desired (c <= cc <= dim)
* \param[in] c codimension of subentity E (0 <= c <= dim)
* \param[in] cc codimension whose size is desired (0 <= cc <= dim)
*/
int size(int i, int c, int cc) const
{
......
......@@ -423,11 +423,11 @@ namespace Dune
* Denote by E the i-th subentity of codimension c of the current
* reference element. This method returns the number of subentities
* of codimension cc of the current reference element, that are also
* a subentity of E.
* a subentity of E. If cc<c this number is zero.
*
* \param[in] i number of subentity E (0 <= i < size( c ))
* \param[in] c codimension of subentity E
* \param[in] cc codimension whose size is desired (c <= cc <= dim)
* \param[in] c codimension of subentity E (0 <= c <= dim)
* \param[in] cc codimension whose size is desired (0 <= cc <= dim)
*/
int size ( int i, int c, int cc ) const
{
......@@ -635,7 +635,7 @@ namespace Dune
int size ( int cc ) const
{
assert( (cc >= codim()) && (cc <= dim) );
assert( (cc >= 0) && (cc <= dim) );
return (offset_[ cc+1 ] - offset_[ cc ]);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment