Skip to content
Snippets Groups Projects
Commit 876d5968 authored by Oliver Sander's avatar Oliver Sander
Browse files

bugfix and some cosmetics; the test runs now

[[Imported from SVN: r1952]]
parent ce93b359
No related branches found
No related tags found
No related merge requests found
......@@ -104,11 +104,7 @@ namespace Dune {
this->realEntity.setToTarget(target);
}
#if 0
void setToTarget(typename TargetType<codim,dim>::T* target, int level) {
this->realEntity.setToTarget(target, level);
}
#endif
OneDEntityImp<dim-codim>* target() {return this->realEntity.target_;}
};
......@@ -284,12 +280,12 @@ namespace Dune {
is provided using iterators. This allows meshes to be nonmatching. Returns iterator
referencing the first neighbor. */
IntersectionIterator ibegin () const {
return OneDGridIntersectionIterator<GridImp>(target_);
return OneDGridIntersectionIterator<GridImp>(target_, 0);
}
//! Reference to one past the last neighbor
IntersectionIterator iend () const {
return IntersectionIterator(NULL);
return OneDGridIntersectionIterator<GridImp>(target_, 2);
}
//! returns true if Entity has no children
......
......@@ -45,8 +45,7 @@ namespace Dune {
//! prefix increment
void increment() {
this->target_ = this->target_->succ_;
this->virtualEntity_.setToTarget(this->target_);
this->virtualEntity_.setToTarget(this->virtualEntity_.target()->succ_);
}
};
......
......@@ -33,11 +33,10 @@ namespace Dune {
friend class OneDGridEntity<0,dim,GridImp>;
//! Constructor for a given grid entity
OneDGridIntersectionIterator(const OneDEntityImp<1>* center) : center_(center), neighbor_(0)
{}
//! The default Constructor makes empty Iterator
OneDGridIntersectionIterator();
OneDGridIntersectionIterator(OneDEntityImp<1>* center, int nb) : center_(center), neighbor_(nb)
{
this->virtualEntity_.setToTarget(target());
}
public:
......@@ -50,14 +49,20 @@ namespace Dune {
//! prefix increment
void increment() {
if (center_ && neighbor_==0) {
neighbor_ = 1;
} else if (center_ && neighbor_==1) {
center_ = NULL;
neighbor_ = -1;
}
neighbor_++;
this->virtualEntity_.setToTarget(target());
}
OneDEntityImp<1>* target() const {
const bool isValid = center_ && (neighbor_==0 || neighbor_==1);
if (!isValid)
return center_;
else if (!neighbor())
return NULL;
else
return (neighbor_==0) ? center_->pred_ : center_->succ_;
}
//! return true if intersection is with boundary.
bool boundary () const {
......@@ -171,7 +176,7 @@ namespace Dune {
// private methods
//**********************************************************
const OneDEntityImp<1>* center_;
OneDEntityImp<1>* center_;
//! vector storing the outer normal
FieldVector<OneDCType, dimworld> outerNormal_;
......
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