Skip to content
Snippets Groups Projects
Commit ff4b03f2 authored by Marcel Koch's avatar Marcel Koch
Browse files

Removes pdelab patch, adds instead blockstructured FEM locally

parent 2ddbf203
No related branches found
No related tags found
No related merge requests found
#ifndef DUNE_PERFTOOL_BLOCKSTRUCTUREDQKFEM_HH
#define DUNE_PERFTOOL_BLOCKSTRUCTUREDQKFEM_HH
#include <cstddef>
#include <dune/common/power.hh>
#include <dune/localfunctions/lagrange/qk.hh>
#include <dune/pdelab/finiteelementmap/finiteelementmap.hh>
namespace Dune {
namespace PDELab {
//! wrap up element from local functions
//! \ingroup FiniteElementMap
template<typename GV, typename D, typename R, std::size_t k>
class BlockstructuredQkLocalFiniteElementMap
: public SimpleLocalFiniteElementMap< Dune::QkLocalFiniteElement<D,R,GV::dimension,k> >
{
public:
BlockstructuredQkLocalFiniteElementMap(const GV& gv)
{}
bool fixedSize() const
{
return true;
}
bool hasDOFs(int codim) const
{
switch(k)
{
case 1:
return codim == GV::dimension;
default:
return 1;
}
}
std::size_t size(GeometryType gt) const
{
std::size_t acc = 1;
for(std::size_t i = 0; i < gt.dim(); ++i)
acc *= k-1;
return acc;
}
std::size_t maxLocalSize() const
{
return Dune::StaticPower<k+1,GV::dimension>::power;
}
};
}
}
#endif //DUNE_PERFTOOL_BLOCKSTRUCTUREDQKFEM_HH
From cf3cc167d4940d7c4960bc5646816b6cf6a17326 Mon Sep 17 00:00:00 2001
From: Marcel Koch <marcel.koch@uni-muenster.de>
Date: Mon, 31 Jul 2017 15:45:53 +0200
Subject: [PATCH] Adds Qk for k>2 for structured grids
---
dune/pdelab/finiteelementmap/qkfem.hh | 24 +++++-------------------
1 file changed, 5 insertions(+), 19 deletions(-)
diff --git a/dune/pdelab/finiteelementmap/qkfem.hh b/dune/pdelab/finiteelementmap/qkfem.hh
index b4e8d67..435545e 100644
--- a/dune/pdelab/finiteelementmap/qkfem.hh
+++ b/dune/pdelab/finiteelementmap/qkfem.hh
@@ -35,31 +35,17 @@ namespace Dune {
{
case 1:
return codim == GV::dimension;
- case 2:
- if (GV::dimension != 2 && GV::dimension != 3)
- DUNE_THROW(NotImplemented,"QkLocalFiniteElementMap with k = 2 is only implemented for d = 2,3");
- return 1;
default:
- DUNE_THROW(NotImplemented,"QkLocalFiniteElementMap is only implemented for k <= 2");
+ return 1;
}
}
std::size_t size(GeometryType gt) const
{
- switch (k)
- {
- case 1:
- return gt.isVertex() ? 1 : 0;
- case 2:
- {
- if (GV::dimension != 2 && GV::dimension != 3)
- DUNE_THROW(NotImplemented,"QkLocalFiniteElementMap with k = 2 is only implemented for d = 2,3");
- // Q1 simply attaches a single DOF to each subentity
- return 1;
- }
- default:
- DUNE_THROW(NotImplemented,"QkLocalFiniteElementMap is only implemented for k <= 2");
- }
+ std::size_t acc = 1;
+ for(std::size_t i = 0; i < gt.dim(); ++i)
+ acc *= k-1;
+ return acc;
}
std::size_t maxLocalSize() const
--
2.7.4
...@@ -309,6 +309,9 @@ def typedef_fem(expr, name): ...@@ -309,6 +309,9 @@ def typedef_fem(expr, name):
df = type_domainfield() df = type_domainfield()
r = type_range() r = type_range()
dim = name_dimension() dim = name_dimension()
if get_option("blockstructured"):
include_file("dune/perftool/blockstructured/blockstructuredqkfem.hh", filetag="driver")
return "using {} = Dune::PDELab::BlockstructuredQkLocalFiniteElementMap<{}, {}, {}, {}>;".format(name, gv, df, r, expr._degree)
if isPk(expr): if isPk(expr):
include_file("dune/pdelab/finiteelementmap/pkfem.hh", filetag="driver") include_file("dune/pdelab/finiteelementmap/pkfem.hh", filetag="driver")
return "using {} = Dune::PDELab::PkLocalFiniteElementMap<{}, {}, {}, {}>;".format(name, gv, df, r, expr._degree) return "using {} = Dune::PDELab::PkLocalFiniteElementMap<{}, {}, {}, {}>;".format(name, gv, df, r, expr._degree)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment