Skip to content
Snippets Groups Projects
Commit 2907db6e authored by Adrian Burri's avatar Adrian Burri
Browse files

Made local function work properly again

[[Imported from SVN: r3336]]
parent ff414229
No related branches found
No related tags found
No related merge requests found
......@@ -37,15 +37,16 @@ namespace Dune {
DiscreteFunctionSpaceImp> LocalFunctionImp;
// local function type
typedef LocalFunctionWrapper< DiscreteFunctionType > LocalFunctionType;
typedef LocalFunctionWrapper<
DiscreteFunctionType> LocalFunctionType;
typedef typename DiscreteFunctionSpaceType::RangeFieldType DofType;
typedef typename DiscreteFunctionSpaceType::RangeFieldType RangeFieldType;
typedef typename DiscreteFunctionSpaceType::RangeType RangeType;
typedef typename DiscreteFunctionSpaceType::DomainType DomainType;
typedef typename DiscreteFunctionSpaceType::JacobianRangeType JacobianRangeType;
typedef typename DiscreteFunctionSpaceType::MapperType MapperType;
typedef typename DiscreteFunctionSpaceType::GridType GridType;
typedef typename DiscreteFunctionSpaceType::Traits::RangeFieldType DofType;
typedef typename DiscreteFunctionSpaceType::Traits::RangeFieldType RangeFieldType;
typedef typename DiscreteFunctionSpaceType::Traits::RangeType RangeType;
typedef typename DiscreteFunctionSpaceType::Traits::DomainType DomainType;
typedef typename DiscreteFunctionSpaceType::Traits::JacobianRangeType JacobianRangeType;
typedef typename DiscreteFunctionSpaceType::Traits::MapperType MapperType;
typedef typename DiscreteFunctionSpaceType::Traits::GridType GridType;
typedef DofArray<DofType> DofStorageType;
......@@ -160,6 +161,8 @@ namespace Dune {
using Imp::read_pgm;
private:
//- Forbidden members
const MyType& interface() const { return *this; }
}; // end class AdaptiveDiscreteFunction
// Note: could use Traits class for Barton-Nackman instead
......@@ -387,6 +390,8 @@ namespace Dune {
private:
std::vector<SubSpaceType*> subSpaces_;
const MyType& interface() const { return *this; }
}; // end class AdaptiveDiscreteFunction (specialised for CombinedSpace)
//- class AdaptiveLocalFunction (specialised)
......
......@@ -116,8 +116,7 @@ namespace Dune {
AdaptiveFunctionImplementation<DiscreteFunctionSpaceImp>::
localFunction(const EntityType& en) const
{
typedef AdaptiveDiscreteFunction<DiscreteFunctionSpaceImp> ImplType;
return LocalFunctionType(en, static_cast<ImplType&>(*this));
return LocalFunctionType(en, this->interface());
}
template <class DiscreteFunctionSpaceImp>
......
......@@ -45,6 +45,7 @@ namespace Dune {
typedef typename Traits::GridType GridType;
typedef DofManager<GridType> DofManagerType;
typedef typename Traits::DiscreteFunctionType LeafType;
public:
std::string name() const;
int size() const;
......@@ -56,8 +57,6 @@ namespace Dune {
LocalFunctionType newLocalFunction() DUNE_DEPRECATED;
//! update local function to given entity
template <class EntityType>
void localFunction(const EntityType& en, LocalFunctionType& lf) DUNE_DEPRECATED;
......@@ -96,10 +95,10 @@ namespace Dune {
const DiscreteFunctionSpaceType& spc,
DofStorageType& dofVec);
AdaptiveFunctionImplementation(const ThisType& other);
~AdaptiveFunctionImplementation();
virtual ~AdaptiveFunctionImplementation();
private:
virtual const LeafType& interface() const = 0;
const DiscreteFunctionSpaceType& spc_;
std::string name_;
DofManagerType& dm_;
......
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