DUNE PDELab (git)

mimeticfem.hh
1// -*- tab-width: 4; indent-tabs-mode: nil -*-
2#ifndef DUNE_PDELAB_FINITEELEMENTMAP_MIMETICFEM_HH
3#define DUNE_PDELAB_FINITEELEMENTMAP_MIMETICFEM_HH
4
5#include<vector>
7#include<dune/localfunctions/mimetic.hh>
8#include"finiteelementmap.hh"
9
10namespace Dune {
11 namespace PDELab {
12
13 template<typename IIS, typename D, typename R, int dim>
14 class MimeticLocalFiniteElementMap :
15 public Dune::PDELab::LocalFiniteElementMapInterface<Dune::PDELab::LocalFiniteElementMapTraits< MimeticLocalFiniteElement<D,R,dim> >,
16 MimeticLocalFiniteElementMap<IIS,D,R,dim> >
17 {
18 typedef MimeticLocalFiniteElement<D,R,dim> FE;
19
20 public:
23
25 MimeticLocalFiniteElementMap (const IIS& iis_, Dune::GeometryType::BasicType basicType)
26 : iis(iis_), bt(basicType)
27
28 {
29 // create a standard number of variants
30 variant.resize(20);
31 for (int i=0; i<20; i++) variant[i] = FE(bt,i);
32 }
33
35 template<class EntityType>
36 const typename Traits::FiniteElementType& find (const EntityType& e) const
37 {
38 size_t n = static_cast<size_t>(iis.size(e));
39 if (n<variant.size())
40 return variant[n];
41 else
42 {
43 size_t old_n = variant.size();
44 variant.resize(n+1);
45 for (size_t i=old_n; i<n+1; i++) variant[i] = FE(bt,i);
46 return variant[n];
47 }
48 }
49
50 private:
51 const IIS& iis;
53 mutable std::vector<FE> variant;
54 };
55
56 }
57}
58
59#endif // DUNE_PDELAB_FINITEELEMENTMAP_MIMETICFEM_HH
BasicType
Each entity can be tagged by one of these basic types plus its space dimension.
Definition: type.hh:120
interface for a finite element map
Definition: finiteelementmap.hh:43
Dune namespace.
Definition: alignedallocator.hh:13
T FiniteElementType
Type of finite element from local functions.
Definition: finiteelementmap.hh:30
collect types exported by a finite element map
Definition: finiteelementmap.hh:38
A unique label for each type of element that can occur in a grid.
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Nov 23, 23:29, 2024)