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

Implementation of localFunction moved to adaptiveimp.hh,cc

[[Imported from SVN: r3329]]
parent 7f2daf14
No related branches found
No related tags found
No related merge requests found
......@@ -16,7 +16,8 @@ namespace Dune {
dofVec_(dofVec),
values_(),
tmp_(0.0),
tmpGrad_(0.0)
tmpGrad_(0.0),
init_(false)
{}
template <class DiscreteFunctionSpaceImp>
......@@ -26,7 +27,8 @@ namespace Dune {
dofVec_(other.dofVec_),
values_(),
tmp_(0.0),
tmpGrad_(0.0)
tmpGrad_(0.0),
init_(false)
{}
template <class DiscreteFunctionSpaceImp>
......@@ -38,6 +40,7 @@ namespace Dune {
AdaptiveLocalFunction<DiscreteFunctionSpaceImp >::
operator[] (int num)
{
assert(init_);
assert(num >= 0 && num < numDofs());
return (* (values_[num]));
}
......@@ -47,6 +50,7 @@ namespace Dune {
AdaptiveLocalFunction<DiscreteFunctionSpaceImp >::
operator[] (int num) const
{
assert(init_);
assert(num >= 0 && num < numDofs());
return (* (values_[num]));
}
......@@ -78,6 +82,7 @@ namespace Dune {
void AdaptiveLocalFunction<DiscreteFunctionSpaceImp >::
evaluateLocal(EntityType& en, const DomainType& x, RangeType& ret) const
{
assert(init_);
assert(en.geometry().checkInside(x));
ret *= 0.0;
const BaseFunctionSetType& bSet = spc_.getBaseFunctionSet(en);
......@@ -108,6 +113,7 @@ namespace Dune {
const DomainType& x,
JacobianRangeType& ret) const
{
assert(init_);
enum { dim = EntityType::dimension };
ret *= 0.0;
......@@ -148,6 +154,8 @@ namespace Dune {
for (int i = 0; i < numOfDof; ++i) {
values_[i] = &(this->dofVec_[spc_.mapToGlobal(en, i)]);
}
init_ = true;
}
//- AdaptiveDiscreteFunction (specialisation)
template <class ContainedFunctionSpaceImp, int N, DofStoragePolicy p>
......
......@@ -149,8 +149,8 @@ namespace Dune {
//! return empty local function
LocalFunctionType newLocalFunction () DUNE_DEPRECATED { return LocalFunctionType(*this); }
//! return local function for given entity
template <class EntityType>
LocalFunctionType localFunction (const EntityType &en) { return LocalFunctionType(en,*this); }
//template <class EntityType>
//LocalFunctionType localFunction (const EntityType &en) { return LocalFunctionType(en,*this); }
using Imp::localFunction;
using Imp::write_xdr;
using Imp::read_xdr;
......@@ -275,7 +275,7 @@ namespace Dune {
private:
//- Forbidden methods
//! Copy constructor
//! assignment operator
ThisType& operator=(const ThisType& other);
template <class EntityType>
......@@ -289,6 +289,8 @@ namespace Dune {
mutable RangeType tmp_;
mutable JacobianRangeType tmpGrad_;
mutable bool init_;
}; // end class AdaptiveLocalFunction
//- Specialisations
......
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