| 1 |
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- |
| 2 |
// vi: set et ts=4 sw=2 sts=2: |
| 3 |
// SPDX-FileCopyrightInfo: Copyright © DUNE Project contributors, see file LICENSE.md in module root |
| 4 |
// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception |
| 5 |
|
| 6 |
#ifndef DUNE_Q1_LOCALFINITEELEMENT_HH |
| 7 |
#define DUNE_Q1_LOCALFINITEELEMENT_HH |
| 8 |
|
| 9 |
#include <dune/geometry/type.hh> |
| 10 |
|
| 11 |
#include <dune/localfunctions/common/localfiniteelementtraits.hh> |
| 12 |
#include <dune/localfunctions/common/localtoglobaladaptors.hh> |
| 13 |
#include <dune/localfunctions/lagrange/lagrangecube.hh> |
| 14 |
|
| 15 |
namespace Dune |
| 16 |
{ |
| 17 |
|
| 18 |
//! Factory for global-valued Q1 elements |
| 19 |
/** |
| 20 |
* \tparam Geometry Type of the geometry. Used to extract the domain field |
| 21 |
* type and the dimension. |
| 22 |
* \tparam RF Range field type. |
| 23 |
*/ |
| 24 |
template<class Geometry, class RF> |
| 25 |
class Q1FiniteElementFactory : |
| 26 |
public ScalarLocalToGlobalFiniteElementAdaptorFactory< |
| 27 |
LagrangeCubeLocalFiniteElement< |
| 28 |
typename Geometry::ctype, RF, Geometry::mydimension, 1 |
| 29 |
>, |
| 30 |
Geometry |
| 31 |
> |
| 32 |
{ |
| 33 |
typedef LagrangeCubeLocalFiniteElement< |
| 34 |
typename Geometry::ctype, RF, Geometry::mydimension, 1 |
| 35 |
> LFE; |
| 36 |
typedef ScalarLocalToGlobalFiniteElementAdaptorFactory<LFE, Geometry> Base; |
| 37 |
|
| 38 |
static const LFE lfe; |
| 39 |
|
| 40 |
public: |
| 41 |
//! default constructor |
| 42 |
Q1FiniteElementFactory() : Base(lfe) {} |
| 43 |
}; |
| 44 |
|
| 45 |
template<class Geometry, class RF> |
| 46 |
const typename Q1FiniteElementFactory<Geometry, RF>::LFE |
| 47 |
Q1FiniteElementFactory<Geometry, RF>::lfe; |
| 48 |
} |
| 49 |
|
| 50 |
#endif |