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

minor change.

[[Imported from SVN: r4235]]
parent 5b17e4cf
Branches
Tags
No related merge requests found
......@@ -409,9 +409,9 @@ namespace Dune {
values_ (),
dofVec_ ( dofVec ),
baseSet_(0),
init_(false),
id_(-1),
idSet_(f.grid().localIdSet())
init_(false)
//,id_(-1),
//idSet_(f.grid().localIdSet())
{}
......@@ -496,13 +496,7 @@ namespace Dune {
bSet.eval(i, quad,quadPoint, tmp_);
tmp_*= (*values_[i]);
ret += tmp_;
/*
for (int l = 0; l < dimRange; ++l) {
ret[l] += (*values_[i]) * tmp_[l];
}
*/
}
// evaluateLocal(en, quad.point(quadPoint), ret);
}
// hier noch evaluate mit Quadrature Regel einbauen
......@@ -529,16 +523,10 @@ namespace Dune {
tmpGrad_ *= *values_[i];
tmp += tmpGrad_;
/*
for (int l = 0; l < dimRange; ++l) {
tmpGrad_[l] *= *values_[i];
// * umtv or umv?
}
*/
}
for (int l = 0; l < dimRange; ++l)
jti.umv(tmp[l],ret[l]);
// jacobianLocal(en, quad.point(quadPoint), ret);
}
template<class DiscreteFunctionSpaceType>
......@@ -548,11 +536,15 @@ namespace Dune {
JacobianRangeType& ret) const
{
assert(init_);
assert( en.geometry().checkInside(x) );
enum { dim = EntityType::dimension };
enum { dimRange = DiscreteFunctionSpaceType::DimRange };
ret *= 0.0;
const BaseFunctionSetType& bSet = getBaseFunctionSet();
typedef FieldMatrix<DofType, dim, dim> JacobianInverseType;
const JacobianInverseType& jti =
en.geometry().jacobianInverseTransposed(x);
for (int i = 0; i < numDofs(); ++i) {
tmpGrad_ *= 0.0;
......@@ -561,7 +553,7 @@ namespace Dune {
for (int l = 0; l < dimRange; ++l) {
tmpGrad_[l] *= *values_[i];
// * umtv or umv?
en.geometry().jacobianInverseTransposed(x).umv(tmpGrad_[l], ret[l]);
jti.umv(tmpGrad_[l], ret[l]);
}
}
}
......@@ -591,12 +583,15 @@ namespace Dune {
inline void LocalFunctionAdapt < DiscreteFunctionSpaceType>::
init (const EntityType &en ) const
{
// if (id_==idSet_.id(en))
// return;
// if(!uniform_ || !init_)
if(geoType_!=en.geometry().type() || !init_)
// if id of element is the same, then no init has to be done
// NOTE: this might fail for adaptive grids, unless
// a method of the grid tells wether the grid is new or not
//if( id_ == idSet_.id(en) ) return;
if( (geoType_ != en.geometry().type()) ||
(!init_) )
{
baseSet_ = &fSpace_.getBaseFunctionSet(en);
baseSet_ = &fSpace_.getBaseFunctionSet(en);
numOfDof_ = baseSet_->numBaseFunctions();
if(numOfDof_ > this->values_.size())
......@@ -606,9 +601,10 @@ namespace Dune {
geoType_ = en.geometry().type();
}
// id_=idSet_.id(en);
assert( geoType_ == en.geometry().type() );
//id_=idSet_.id(en);
for(int i=0; i<numOfDof_; i++)
for(int i=0; i<numOfDof_; ++i)
values_ [i] = &(this->dofVec_[ fSpace_.mapToGlobal ( en , i) ]);
return;
......@@ -625,5 +621,4 @@ namespace Dune {
}
} // end namespace
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment