Skip to content
Snippets Groups Projects
Commit 423480b8 authored by Robert Klöfkorn's avatar Robert Klöfkorn
Browse files

When space is created, then for all geom types of the given index set the

base function set is created.

[[Imported from SVN: r4231]]
parent 9aa792b3
Branches
Tags
No related merge requests found
......@@ -30,24 +30,20 @@ namespace Dune {
//std::cout << "Constructor of LagrangeDiscreteFunctionSpace! \n";
// search the macro grid for diffrent element types
typedef typename GridType :: template Codim<0> :: Entity EntityType;
IteratorType endit = gridPart.template end<0>();
for(IteratorType it = gridPart.template begin<0>(); it != endit; ++it) {
GeometryType geo = (*it).geometry().type(); // Hack
int dimension = static_cast<int>( EntityType::mydimension);
const std::vector<GeometryType>& geomTypes =
gridPart.indexSet().geomTypes(0) ;
for(size_t i=0; i<geomTypes.size(); ++i)
{
GeometryIdentifier::IdentifierType id =
GeometryIdentifier::fromGeo(dimension, geo);
GeometryIdentifier::fromGeo(geomTypes[i]);
if(baseFuncSet_[id] == 0 ) {
baseFuncSet_[id] = setBaseFuncSetPointer(*it);
baseFuncSet_[id] = setBaseFuncSetPointer(geomTypes[i]);
mapper_ = new typename
Traits::MapperType(const_cast<IndexSetType&>(gridPart.indexSet()),
baseFuncSet_[id]->numBaseFunctions());
}
}
// for empty functions space which can happen for BSGrid
//if(!mapper_) makeBaseSet<line,0> (gridPart.indexSet());
//assert(mapper_);
}
template <class FunctionSpaceImp, class GridPartImp, int polOrd>
......@@ -130,18 +126,34 @@ namespace Dune {
return *mapper_;
}
/*
template <class FunctionSpaceImp, class GridPartImp, int polOrd>
template <class EntityType>
typename LagrangeDiscreteFunctionSpace<FunctionSpaceImp, GridPartImp, polOrd>::
BaseFunctionSetType*
LagrangeDiscreteFunctionSpace<FunctionSpaceImp, GridPartImp, polOrd>::
setBaseFuncSetPointer(EntityType& en)
{
typedef typename ToScalarFunctionSpace<
typename Traits::FunctionSpaceType>::Type ScalarFunctionSpaceType;
LagrangeBaseFunctionFactory<
ScalarFunctionSpaceType, polOrd> fac(en.geometry().type());
return new BaseFunctionSetType(fac);
}
*/
template <class FunctionSpaceImp, class GridPartImp, int polOrd>
template <class EntityType>
typename LagrangeDiscreteFunctionSpace<FunctionSpaceImp, GridPartImp, polOrd>::
BaseFunctionSetType*
LagrangeDiscreteFunctionSpace<FunctionSpaceImp, GridPartImp, polOrd>::
setBaseFuncSetPointer(EntityType& en)
setBaseFuncSetPointer(GeometryType type)
{
typedef typename ToScalarFunctionSpace<
typename Traits::FunctionSpaceType>::Type ScalarFunctionSpaceType;
LagrangeBaseFunctionFactory<
ScalarFunctionSpaceType, polOrd> fac(en.geometry().type());
ScalarFunctionSpaceType, polOrd> fac(type);
return new BaseFunctionSetType(fac);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment