Dune-Fufem 2.11-git
Loading...
Searching...
No Matches
refinedfehelper.hh
Go to the documentation of this file.
1// -*- tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2// vi: set et ts=8 sw=4 sts=4:
3
4// SPDX-FileCopyrightText: Copyright © DUNE-FUFEM Project contributors, see file AUTHORS.md
5// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
6
7#ifndef DUNE_FUFEM_REFINED_FE_HELPER_HH
8#define DUNE_FUFEM_REFINED_FE_HELPER_HH
9
12
15
17template <class LocalFiniteElementType>
19{
20 static bool value(const LocalFiniteElementType&)
21 {
22 return false;
23 }
24};
25
26template <class T>
27struct IsRefinedLocalFiniteElement<typename Dune::template LocalFiniteElementVirtualInterface<T> >
28{
30
31 static bool value(const LocalFiniteElementType& fe)
32 {
34 using DT = typename Traits::DomainFieldType;
35 using RT = typename Traits::RangeFieldType;
36 static constexpr int dim = Traits::dimDomain;
37
40
41 if (dynamic_cast<const Dune::LocalFiniteElementVirtualImp<RP1FE>*>(&fe))
42 return true;
43 if (dynamic_cast<const Dune::LocalFiniteElementVirtualImp<RP0FE>*>(&fe))
44 return true;
45 return false;
46 }
47};
48
49template <class ctype, class RT, int dim>
50struct IsRefinedLocalFiniteElement<Dune::RefinedP1LocalFiniteElement<ctype, RT, dim> >
51{
53 {
54 return true;
55 }
56};
57
58template <class ctype, class RT, int dim>
59struct IsRefinedLocalFiniteElement<Dune::RefinedP0LocalFiniteElement<ctype, RT, dim> >
60{
62 {
63 return true;
64 }
65};
66
67
68
69#endif
70
size_type dim() const
Method to detect if a finite element is a refined finite element.
Definition refinedfehelper.hh:19
static bool value(const LocalFiniteElementType &)
Definition refinedfehelper.hh:20
static bool value(const LocalFiniteElementType &fe)
Definition refinedfehelper.hh:31
static bool value(const Dune::RefinedP1LocalFiniteElement< ctype, RT, dim > &)
Definition refinedfehelper.hh:52
static bool value(const Dune::RefinedP0LocalFiniteElement< ctype, RT, dim > &)
Definition refinedfehelper.hh:61