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

optimization of IntersectionIterator.

[[Imported from SVN: r1851]]
parent 07a560ca
No related branches found
No related tags found
No related merge requests found
......@@ -38,6 +38,9 @@ namespace Dune
class ALU3dGridError : public Exception {};
//#undef DUNE_THROW
//#define DUNE_THROW(e,m) assert(false);
enum ALU3dGridElementType { tetra = 4, hexa = 7 };
// i.e. double or float
......@@ -90,6 +93,9 @@ namespace Dune
ALU3dGridMakeableGeometry(bool makeRefelem=false) :
GeometryType (ALU3dGridGeometry<mydim, coorddim,GridImp>(makeRefelem)) {}
ALU3dGridMakeableGeometry(GridImp & grid , int level ) :
GeometryType (ALU3dGridGeometry<mydim, coorddim,GridImp>(false)) {}
//! build geometry out of different ALU3dGrid Geometrys
//! ItemType are HElementType, HFaceType, HEdgeType and VertexType
template <class ItemType>
......@@ -602,6 +608,9 @@ namespace Dune
ALU3dGridMakeableBoundaryEntity () :
GridImp::template codim<0>::BoundaryEntity (ALU3dGridBoundaryEntity<GridImp>()) {};
ALU3dGridMakeableBoundaryEntity (GridImp & grid, int level ) :
GridImp::template codim<0>::BoundaryEntity (ALU3dGridBoundaryEntity<GridImp>()) {};
// set boundary Id, done by IntersectionIterator
void setId ( int id )
{
......@@ -671,7 +680,6 @@ namespace Dune
typedef ALU3dGridMakeableGeometry<dim-1,dimworld,GridImp> GeometryImp;
typedef ALU3dGridMakeableGeometry<dim-1,dimworld,GridImp> LocalGeometryImp;
//! The default Constructor , level tells on which level we want
//! neighbours
ALU3dGridIntersectionIterator(const GridImp & grid, ALU3DSPACE HElementType *el,
......@@ -726,15 +734,15 @@ namespace Dune
//! coordinates for higher order boundary
typedef FieldVector<alu3d_ctype, dimworld> NormalType;
const NormalType & unitOuterNormal (const FieldVector<alu3d_ctype, dim-1>& local) const ;
NormalType unitOuterNormal (const FieldVector<alu3d_ctype, dim-1>& local) const ;
//! return outer normal, this should be dependent on local
//! coordinates for higher order boundary
const NormalType & outerNormal (const FieldVector<alu3d_ctype, dim-1>& local) const;
NormalType outerNormal (const FieldVector<alu3d_ctype, dim-1>& local) const;
//! return outer normal, this should be dependent on local
//! coordinates for higher order boundary
const NormalType & integrationOuterNormal (const FieldVector<alu3d_ctype, dim-1>& local) const;
NormalType integrationOuterNormal (const FieldVector<alu3d_ctype, dim-1>& local) const;
private:
// if neighbour exists , do setup of new neighbour
......@@ -756,9 +764,7 @@ namespace Dune
const GridImp & grid_;
int walkLevel_;
//ALU3DSPACE MemoryPointer < EntityImp , ALU3DSPACE MemoryProvider<EntityImp> > entity_;
EntityImp * entity_; //! neighbour entity
//EntityImp fEntity_; //! neighbour entity
// current element from which we started the intersection iterator
mutable ALU3DSPACE GEOElementType *item_;
......@@ -779,9 +785,6 @@ namespace Dune
mutable bool isBoundary_; //! true if intersection is with boundary
mutable bool isGhost_; //! true if intersection is with internal boundary (only parallel grid)
mutable FieldVector<alu3d_ctype, dimworld> outNormal_; //! outerNormal of current intersection
mutable FieldVector<alu3d_ctype, dimworld> unitOuterNormal_; //! unitOuterNormal of current intersection
mutable bool needSetup_; //! true if setup is needed
mutable bool needNormal_; //! true if normal has to be calculated
......@@ -789,9 +792,9 @@ namespace Dune
mutable ALU3DSPACE NeighbourFaceType neighpair_;
mutable bool initInterGl_; //! true if interSelfGlobal_ was initialized
mutable GeometryImp interSelfGlobal_; //! intersection_self_global
GeometryImp * interSelfGlobal_; //! intersection_self_global
mutable MakeableBndEntityImp bndEntity_; //! boundaryEntity
MakeableBndEntityImp * bndEntity_; //! boundaryEntity
};
//**********************************************************************
......@@ -1234,12 +1237,20 @@ namespace Dune
// the entity codim 0
typedef ALU3dGridMakeableEntity<0,dim,const MyType> EntityImp;
typedef ALU3DSPACE MemoryProvider< EntityImp > EntityProvider;
typedef ALU3DSPACE ALUMemoryProvider< EntityImp > EntityProvider;
typedef ALU3dGridMakeableGeometry<dim-1,dimworld,const MyType> LGeometryImp;
typedef ALU3DSPACE ALUMemoryProvider< LGeometryImp > GeometryProvider;
typedef ALU3dGridMakeableBoundaryEntity<const MyType> BndGeometryImp;
typedef ALU3DSPACE ALUMemoryProvider< BndGeometryImp > BndProvider;
//typedef ALU3dGridMakeableEntity<3,dim,const MyType> VertexImp;
//typedef ALU3DSPACE MemoryProvider< VertexImp > VertexProvider;
mutable GeometryProvider geometryProvider_;
mutable EntityProvider entityProvider_;
mutable BndProvider bndProvider_;
//mutable VertexProvider vertexProvider_;
}; // end Class ALU3dGridGrid
......
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