Commit 97ff151b authored by Santiago Ospina De Los Ríos's avatar Santiago Ospina De Los Ríos 🇨🇴

Adds a fake local function space and a corrected assembler.

Signed-off-by: Santiago Ospina De Los Ríos's avatarSantiago Ospina <>
parent 6718826e
......@@ -10,6 +10,8 @@
#include <dune/common/dynvector.hh>
#include <dune/common/dynmatrix.hh>
#include "raviart_thomas_operator/localfunctionspace.hh"
namespace Dune{
namespace Dorie{
......@@ -657,8 +659,8 @@ private:
const std::shared_ptr<const GFSVSkeleton> pgfsv_skeleton;
/* local function spaces */
typedef Dune::PDELab::LocalFunctionSpace<GFSVVolume, LocalTestSpaceTag> LFSVVolume;
typedef Dune::PDELab::LocalFunctionSpace<GFSVSkeleton, LocalTestSpaceTag> LFSVSkeleton;
typedef Dune::Dorie::FakeLocalFunctionSpace<GFSVVolume, LocalTestSpaceTag> LFSVVolume;
typedef Dune::Dorie::FakeLocalFunctionSpace<GFSVSkeleton, LocalTestSpaceTag> LFSVSkeleton;
// local function spaces in local cell
LFSVVolume lfsv_volume;
#include <dune/localfunctions/common/interfaceswitch.hh>
#include <dune/pdelab/gridfunctionspace/localfunctionspace.hh>
namespace Dune{
namespace Dorie{
/* This is a special local function space for the raviart thomas engine.
* In particular, it is thought to work with one grid function space, that is,
* without composite or vector spaces so that we avoid anything of the type
* tree and ordering nightmare. It is simply not needed here. Indeed we don't
* even need the dof indices since the engine does a local solution and there
* is no need to map to entities. In any case, the reason of this object is
* because the user is expecting a local function space as an argument of the
* local operator (even though no many really know how a local function space
* looks like ¬_¬).
template <class GFS, class TAG=Dune::PDELab::AnySpaceTag>
class FakeLocalFunctionSpace
static_assert(not GFS::Traits::isComposite,
"This local function space does not work with "
"composited or power grid function spaces");
using DOFIndex = typename Dune::PDELab::gfs_to_lfs<GFS>::DOFIndex;
using Traits = typename Dune::PDELab::LocalFunctionSpace<GFS>::Traits;
using FESwitch = Dune::FiniteElementInterfaceSwitch<
typename Traits::FiniteElementType>;
FakeLocalFunctionSpace(std::shared_ptr<const GFS> gfs)
: pgfs(gfs)
FakeLocalFunctionSpace(const GFS & gfs)
: pgfs(stackobject_to_shared_ptr(gfs))
FakeLocalFunctionSpace(const FakeLocalFunctionSpace & lfs) {}
typename Traits::IndexContainer::size_type
localIndex(typename Traits::IndexContainer::size_type index) const
return index;
typename Traits::IndexContainer::size_type size () const
return n;
const typename Traits::DOFIndex&
dofIndex(typename Traits::IndexContainer::size_type index) const
"This local function space never constructs dof indices");
return Traits::DOFIndex();
// This is indeed instantiated as an intersection. Since we don't care about
// the dof intex, a template is is ok to forward it to the finite element
// map. In other cases one whould have to hard code the type.
template<class Entity>
void bind(Entity& e)
FESwitch::setStore(pfe, pgfs->finiteElementMap().find(e));
n = FESwitch::basis(*pfe).size();
//! get finite element
const typename Traits::FiniteElementType& finiteElement () const
return *pfe;
std::shared_ptr<const GFS> pgfs;
typename Traits::IndexContainer::size_type n;
typename FESwitch::Store pfe;
} // namespace Dorie
} // namespace Dune
......@@ -4,6 +4,7 @@
#include "localengeine.hh"
#include "skeleton_fem.hh"
#include "volume_fem.hh"
#include "raviart_thomas_operator/assembler.hh"
#include <dune/pdelab/finiteelementmap/raviartthomasfem.hh>
......@@ -61,6 +62,8 @@ class RaviartThomasFluxReconstruction
using SkeletonFEM = typename Dune::Dorie::SkeletonFEM<DF,RF,dim,order,gt>::type;
using GFSVSkeleton = Dune::PDELab::GridFunctionSpace<ES,SkeletonFEM>;
using LocalRaviartThomasEngine = Dune::Dorie::LocalRaviartThomasAssemblerEngine<LA,GFSVVolume,GFSVSkeleton>;
// using Assember = typename GOP::Assembler;
using Assember = Dune::Dorie::DefaultAssembler<GFSU,GFSW,Dune::PDELab::EmptyTransformation,Dune::PDELab::EmptyTransformation>;
......@@ -99,7 +102,12 @@ public:
MBE mbe(0);
GOP gop(_gfsu,gfsw,local_operator,mbe);
const auto& global_assembler_gop = gop.assembler();
// TODO: send our DefaultAssamber to PDELab so that it can be retrived
// from the grid operator:
// const auto& global_assembler_gop = gop.assembler();
Assember global_assembler_gop(_gfsu,gfsw);
const auto& local_assembler_gop = gop.localAssembler();
......@@ -9,7 +9,7 @@ except NameError:
# paths set by cmake
DORIEDIR = "/home/saospina/Codes/DUNE_INSTALL/Debug/dorie"
DORIEDIR = "/home/saospina/Codes/DUNE_INSTALL/Release/dorie"
MPIEXEC = "/usr/bin/mpiexec"
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment