Skip to content
Snippets Groups Projects
Commit e4253f1f authored by graeser's avatar graeser
Browse files

Adjust to refactoring of reference elements

You can no longer be sure that the reference elements
are of the type Dune::ReferenceElement<ctype,dim>. While
this syntax is still supported, template argument deduction
fails for this, because it's only a template alias.
parent 383aa6c2
Branches
No related tags found
No related merge requests found
......@@ -153,8 +153,8 @@ const auto& referenceElement(const Entity& entity)
*
* This should (maybe) be a member of ReferenceElement.
*/
template<class ctype, int dim>
std::size_t size(const Dune::ReferenceElement<ctype, dim>& referenceElement, DynamicCodim codim)
template<class ReferenceElementType>
std::size_t referenceElementSize(const ReferenceElementType& referenceElement, DynamicCodim codim)
{
return referenceElement.size(codim);
}
......@@ -166,8 +166,8 @@ std::size_t size(const Dune::ReferenceElement<ctype, dim>& referenceElement, Dyn
*
* This should (maybe) be a member of ReferenceElement.
*/
template<class ctype, int dim>
Dune::GeometryType type(const Dune::ReferenceElement<ctype, dim>& referenceElement, DynamicSubEntity subEntity)
template<class ReferenceElementType>
Dune::GeometryType type(const ReferenceElementType& referenceElement, DynamicSubEntity subEntity)
{
return referenceElement.type(subEntity.index(), subEntity.codim());
}
......@@ -179,8 +179,8 @@ Dune::GeometryType type(const Dune::ReferenceElement<ctype, dim>& referenceEleme
*
* This should (maybe) be a member of ReferenceElement.
*/
template<class ctype, int dim>
std::size_t size(const Dune::ReferenceElement<ctype, dim>& referenceElement, DynamicSubEntity subEntity, DynamicCodim subSubEntityCodim)
template<class ReferenceElementType>
std::size_t referenceElementSize(const ReferenceElementType& referenceElement, DynamicSubEntity subEntity, DynamicCodim subSubEntityCodim)
{
return referenceElement.size(subEntity.index(), subEntity.codim(), subSubEntityCodim);
}
......@@ -195,8 +195,8 @@ std::size_t size(const Dune::ReferenceElement<ctype, dim>& referenceElement, Dyn
* functionality is often misunderstood and you normaly
* need all subsubentities anyway.
*/
template<class ctype, int dim>
auto subEntity(const Dune::ReferenceElement<ctype, dim>& referenceElement, DynamicSubEntity se, DynamicSubEntity subSubEntity)
template<class ReferenceElementType>
auto subEntity(const ReferenceElementType& referenceElement, DynamicSubEntity se, DynamicSubEntity subSubEntity)
{
return subEntity(subSubEntity.codim(), referenceElement.subEntity(se.index(), se.codim(), subSubEntity.index(), subSubEntity.codim()));
}
......@@ -208,11 +208,12 @@ auto subEntity(const Dune::ReferenceElement<ctype, dim>& referenceElement, Dynam
*
* This should (maybe) be a member of ReferenceElement.
*/
template<class ctype, int dim>
auto subEntities(const Dune::ReferenceElement<ctype, dim>& referenceElement, const DynamicSubEntity subEntityTag, DynamicCodim codim)
template<class ReferenceElementType>
auto subEntities(const ReferenceElementType& referenceElement, const DynamicSubEntity subEntityTag, DynamicCodim codim)
{
static const std::size_t maxSubEntityCount = Dune::StaticPower<2,dim>::power;
std::size_t subEntityCount = size(referenceElement, subEntityTag, codim);
static constexpr int dimension = ReferenceElementType::dimension;
static const std::size_t maxSubEntityCount = Dune::StaticPower<2,dimension>::power;
std::size_t subEntityCount = referenceElementSize(referenceElement, subEntityTag, codim);
// Todo: This could be replaced by an on-the fly range by doing a
// transformation to an index range. Unfortunately these range tools
......@@ -232,8 +233,8 @@ auto subEntities(const Dune::ReferenceElement<ctype, dim>& referenceElement, con
*
* This should (maybe) be a member of ReferenceElement.
*/
template<class ctype, int dim>
auto subEntities(const Dune::ReferenceElement<ctype, dim>& referenceElement, DynamicCodim cd)
template<class ReferenceElementType>
auto subEntities(const ReferenceElementType& referenceElement, DynamicCodim cd)
{
return subEntities(referenceElement, subEntity(codim(0), 0), cd);
}
......@@ -243,10 +244,11 @@ auto subEntities(const Dune::ReferenceElement<ctype, dim>& referenceElement, Dyn
/**
* \brief Get index-range of vertices of given subentity within the ReferenceElement
*/
template<class ctype, int dim>
auto subVertices(const Dune::ReferenceElement<ctype, dim>& referenceElement, const DynamicSubEntity subEntityTag)
template<class ReferenceElementType>
auto subVertices(const ReferenceElementType& referenceElement, const DynamicSubEntity subEntityTag)
{
return subEntities(referenceElement, subEntityTag, codim(dim));
static constexpr int dimension = ReferenceElementType::dimension;
return subEntities(referenceElement, subEntityTag, codim(dimension));
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment