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

Added some stuff for functionspace with const basis functions.

[[Imported from SVN: r171]]
parent 9276b6e6
No related branches found
No related tags found
No related merge requests found
......@@ -117,11 +117,13 @@ namespace Dune {
{
typedef typename FunctionSpaceType::RangeField RangeField;
RangeField factor[3];
int baseNum_;
public:
LagrangeBaseFunction ( FunctionSpaceType & f , int baseNum )
: BaseFunctionInterface<FunctionSpaceType> (f)
{
baseNum_ = baseNum;
if(baseNum == 2)
{ // 1 - x - y
factor[0] = -1.0;
......@@ -566,7 +568,6 @@ namespace Dune {
Vec < numOfBaseFct , LagrangeBaseFunctionType *> baseFuncList_;
};
//************************************************************************
//
// --LagrangeMapper
......@@ -595,10 +596,32 @@ namespace Dune {
int mapToGlobal (EntityType &en, int localNum ) const
{
enum { codim = EntityType::dimension };
// return vertex number , very slow
return (*en.entity<codim>( localNum )).index();
//int num = (*en.entity<codim>( localNum )).index();
//return num;
// get global vertex number
return en.subIndex<codim>(localNum);
};
};
class LagrangeMapper<0>
: public MapperDefault < LagrangeMapper <0> >
{
public:
//! default is Lagrange with polOrd = 1
template <class GridType>
int size (const GridType &grid , int level ) const
{
// return number of vertices
return grid.size( level , 0 );
};
//! map Entity an local Dof number to global Dof number
//! for Lagrange with polOrd = 1
template <class EntityType>
int mapToGlobal (EntityType &en, int localNum ) const
{
// return entity index
return en.index();
};
};
......@@ -630,7 +653,7 @@ namespace Dune {
< FunctionSpaceType , GridType , polOrd > LagrangeDiscreteFunctionSpaceType;
typedef BaseFunctionSetType FastBaseFunctionSetType;
// id is neighbor of the beast
//! id is neighbor of the beast
static const IdentifierType id = 665;
// Lagrange 1 , to be revised in this matter
......@@ -642,6 +665,8 @@ namespace Dune {
LagrangeDiscreteFunctionSpace ( GridType & g ) :
DiscreteFunctionSpaceType (g,id) // ,baseFuncSet_(*this) { };
{
// g.globalRefine ( maxLevel );
//std::cout << "Constructor of LagrangeDiscreteFunctionSpace! \n";
for(int i=0; i<numOfDiffBase_; i++)
baseFuncSet_(i) = NULL;
......@@ -672,6 +697,19 @@ namespace Dune {
return (*baseFuncSet_.get( type ));
};
//! get maximal global polynom order
int polynomOrder ( ) const
{
return polOrd;
}
//! get local polynom order on entity
template <class EntityType>
int localPolynomOrder ( EntityType &en ) const
{
return polOrd;
}
//! length of the dof vector
//! size knows the correct way to calculate the size of the functionspace
int size ( int level ) const
......
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