Skip to content
Snippets Groups Projects
Commit f60508ff authored by Peter Bastian's avatar Peter Bastian
Browse files

- implemented ownersFather and positionInOwnersFather (at least partly ...)

[[Imported from SVN: r2999]]
parent e704ae7c
No related branches found
No related tags found
No related merge requests found
......@@ -369,3 +369,10 @@ UGGridEntity < 0, dim, GridImp>::father() const
it.setToTarget(UG_NS<dim>::EFather(target_));
return it;
}
template<int dim, class GridImp>
inline UGGridGeometry<dim,dim,GridImp>& UGGridEntity < 0, dim, GridImp>::father_relative_local()
{
DUNE_THROW(GridError,"father_relative_local not implemented");
return fatherReLocal_;
}
......@@ -18,6 +18,8 @@ namespace Dune {
class UGGridEntity;
template<int dim, int dimworld>
class UGGrid;
template<int codim, class GridImp>
class UGGridEntityPointer;
template<int codim, PartitionIteratorType pitype, class GridImp>
class UGGridLevelIterator;
template<class GridImp>
......@@ -136,8 +138,17 @@ namespace Dune {
//! geometry of this entity
const Geometry& geometry () const;
UGGridLevelIterator<0,All_Partition,GridImp> ownersFather() const {
DUNE_THROW(NotImplemented, "ownersFather");
UGGridEntityPointer<0,GridImp> ownersFather() const
{
UGGridEntityPointer<0,GridImp> myfather;
if (UG_NS<dim>::NFather(target_)!=0)
if (UG_NS<dim>::myLevel(UG_NS<dim>::NFather(target_)) == this->level()-1)
{
myfather.setToTarget(UG_NS<dim>::NFather(target_), this->level()-1);
return myfather;
}
DUNE_THROW(NotImplemented, "ownersFather for anything else than new vertices");
return myfather;
}
/** \brief Location of this vertex within a mesh entity of codimension 0 on the coarse grid.
......@@ -145,8 +156,16 @@ namespace Dune {
This can speed up on-the-fly interpolation for linear conforming elements
Possibly this is sufficient for all applications we want on-the-fly.
*/
FieldVector<UGCtype, dim>& positionInOwnersFather() const {
DUNE_THROW(NotImplemented, "positionInOwnersFather");
FieldVector<UGCtype, dim>& positionInOwnersFather() const
{
if (UG_NS<dim>::NFather(target_)!=0)
if (UG_NS<dim>::myLevel(UG_NS<dim>::NFather(target_)) == this->level()-1)
{
UG_NS<dim>::PositionInFather(target_,pos_);
return pos_;
}
DUNE_THROW(NotImplemented, "positionInOwnersFather for anything else than new vertices");
return pos_;
}
......@@ -167,6 +186,9 @@ namespace Dune {
int level_;
typename TargetType<codim,dim>::T* target_;
mutable FieldVector<UGCtype, dim> pos_;
};
//***********************
......
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