10 #include <dune/common/fvector.hh>
11 #include <dune/common/fmatrix.hh>
12 #include <dune/common/bigunsignedint.hh>
13 #include <dune/common/parallel/collectivecommunication.hh>
14 #include <dune/common/reservedvector.hh>
15 #include <dune/geometry/genericgeometry/topologytypes.hh>
16 #include <dune/geometry/axisalignedcubegeometry.hh>
19 #include <dune/grid/sgrid/numbering.hh>
43 template<
int dim,
int dimworld,
class Gr
idImp>
class SGeometry;
44 template<
int codim,
int dim,
class Gr
idImp>
class SEntity;
47 template<
int codim, PartitionIteratorType,
class Gr
idImp>
class SLevelIterator;
48 template<
int dim,
int dimworld,
class ctype>
class SGrid;
53 namespace FacadeOptions
56 template<
int dim,
int dimworld,
class ctype,
int mydim,
int cdim>
60 static const bool v =
false;
63 template<
int dim,
int dimworld,
class ctype,
int mydim,
int cdim>
67 static const bool v =
false;
103 template<
int mydim,
int cdim,
class Gr
idImp>
105 :
public AxisAlignedCubeGeometry<typename GridImp::ctype,mydim,cdim>
109 typedef typename GridImp::ctype
ctype;
118 void make (
const FieldVector<ctype,cdim>& lower,
119 const FieldMatrix<ctype,mydim,cdim>& A)
123 static_cast< AxisAlignedCubeGeometry<ctype,mydim,cdim> &
>( *this ) = AxisAlignedCubeGeometry<ctype,mydim,cdim>(lower);
128 FieldVector<ctype, cdim> upper = lower;
129 for (
int i=0; i<mydim; i++)
133 std::bitset<cdim> axes;
135 for (
size_t i=0; i<cdim; i++)
136 if ((upper[i] - lower[i]) > 1e-10)
140 static_cast< AxisAlignedCubeGeometry<ctype,mydim,cdim> &
>( *this ) = AxisAlignedCubeGeometry<ctype,mydim,cdim>(lower, upper, axes);
145 : AxisAlignedCubeGeometry<
ctype,mydim,cdim>(FieldVector<
ctype,cdim>(0),FieldVector<
ctype,cdim>(0))
155 template<
int codim,
int dim,
class Gr
idImp,
template<
int,
int,
class>
class EntityImp>
161 enum { dimworld = GridImp::dimensionworld };
163 typedef typename GridImp::Traits::template Codim< codim >::GeometryImpl GeometryImpl;
166 typedef typename GridImp::ctype
ctype;
167 typedef typename GridImp::template Codim<codim>::Geometry
Geometry;
228 void make (GridImp* _grid,
int _l,
int _id);
231 void make (
int _l,
int _id);
239 return grid->persistentIndex(
l, codim,
z);
253 if (codim<dim || l==grid->maxLevel())
258 array<int,dim> coord;
259 for (
int k=0; k<dim; k++)
260 coord[k] =
z[k]*(1<<(
grid->maxLevel()-
l));
263 return grid->n(
grid->maxLevel(),coord);
269 DUNE_THROW(NotImplemented,
"subIndex for entities with codimension > 0 is not implemented");
276 DUNE_THROW(NotImplemented,
"subIndex for entities with codimension > 0 is not implemented");
296 template<
int codim,
int dim,
class Gr
idImp>
334 template<
int dim,
class Gr
idImp>
337 enum { dimworld = GridImp::dimensionworld };
344 typedef typename GridImp::Traits::template Codim< 0 >::GeometryImpl GeometryImpl;
345 typedef typename GridImp::Traits::template Codim< 0 >::LocalGeometryImpl LocalGeometryImpl;
351 typedef typename GridImp::ctype
ctype;
352 typedef typename GridImp::template Codim<0>::Geometry
Geometry;
371 template<
int cc>
int count ()
const;
384 return (this->
grid)->n(this->
l, this->
grid->subz(this->z,i,codim));
394 assert(this->
l == this->
grid->maxLevel());
396 return (this->
grid)->n(this->
l, this->
grid->subz(this->z,i,codim));
404 return this->
grid->persistentIndex(this->
l, codim, this->
grid->subz(this->z,i,codim));
432 return (this->
level()>0);
438 return ( this->
grid->maxLevel() == this->
level() );
452 LocalGeometry geometryInFather ()
const;
467 SEntity (GridImp* _grid,
int _l,
int _index) :
478 void make (GridImp* _grid,
int _l,
int _id)
481 built_father =
false;
488 built_father =
false;
495 mutable bool built_father;
496 mutable int father_index;
497 mutable LocalGeometryImpl in_father_local;
498 void make_father()
const;
519 template<
class Gr
idImp>
520 class SHierarchicIterator :
524 enum { dim = GridImp::dimension };
525 enum { dimworld = GridImp::dimensionworld };
532 typedef typename GridImp::template Codim<0>::Entity
Entity;
533 typedef typename GridImp::ctype
ctype;
546 int _maxLevel,
bool makeend) :
554 orig_l = this->
entity().level();
555 orig_index = _grid->getRealImplementation(this->
entity()).compressedIndex();
559 stack.push(originalElement);
565 push_sons(orig_l,orig_index);
573 int orig_l, orig_index;
576 std::stack<SHierarchicStackElem, Dune::ReservedVector<SHierarchicStackElem,GridImp::MAXL> > stack;
578 void push_sons (
int level,
int fatherid);
588 template<
class Gr
idImp>
589 class SIntersectionIterator
591 enum { dim=GridImp::dimension };
592 enum { dimworld=GridImp::dimensionworld };
594 typedef typename GridImp::Traits::template Codim< 1 >::GeometryImpl GeometryImpl;
595 typedef typename GridImp::Traits::template Codim< 1 >::LocalGeometryImpl LocalGeometryImpl;
600 typedef typename GridImp::template Codim<0>::Entity
Entity;
602 typedef typename GridImp::template Codim<1>::Geometry
Geometry;
611 typedef typename GridImp::ctype
ctype;
642 return grid->boundarySegmentIndex(
self.level(), count, zred);
676 self(*_self), ne(self), grid(_grid),
677 partition(_grid->partition(grid->getRealImplementation(ne).l,_self->z)),
678 zred(_grid->compress(grid->getRealImplementation(ne).l,_self->z)),
686 self(other.self), ne(other.ne), grid(other.grid),
687 partition(other.partition), zred(other.zred),
688 count(other.count), valid_count(other.valid_count),
689 valid_nb(other.valid_nb), is_on_boundary(other.is_on_boundary),
690 built_intersections(false),
698 assert(grid == other.grid);
703 partition = other.partition;
706 valid_count = other.valid_count;
707 valid_nb = other.valid_nb;
708 is_on_boundary = other.is_on_boundary;
711 built_intersections =
false;
717 void make (
int _count)
const;
718 void makeintersections ()
const;
721 const GridImp * grid;
725 mutable bool valid_count;
726 mutable bool valid_nb;
727 mutable bool is_on_boundary;
728 mutable bool built_intersections;
729 mutable LocalGeometryImpl is_self_local;
730 mutable GeometryImpl is_global;
731 mutable LocalGeometryImpl is_nb_local;
735 template<
class Gr
idImp>
738 enum { dim=GridImp::dimension };
739 enum { dimworld=GridImp::dimensionworld };
741 typedef typename GridImp::template Codim<0>::Entity
Entity;
743 typedef typename GridImp::template Codim<1>::Geometry
Geometry;
753 typedef typename GridImp::ctype
ctype;
757 return is.boundary();
763 return is.boundaryId();
769 return is.boundarySegmentIndex();
775 return is.neighbor();
799 return is.geometryInInside();
805 return is.geometryInOutside();
811 return is.geometry();
823 return is.indexInInside();
829 return is.indexInOutside();
842 n *= is.geometry().integrationElement(local);
855 FieldVector<ctype, dimworld> normal(0.0);
856 normal[is.count/2] = (is.count%2) ? 1.0 : -1.0;
864 #ifndef DOXYGEN // doxygen can't handle this recursive usage
880 while(! this->empty())
891 template<
int codim,
class Gr
idImp>
894 enum { dim = GridImp::dimension };
898 typedef typename GridImp::template Codim<codim>::Entity
Entity;
987 grid->getRealImplementation(*e).make(_grid, _l,_id);
1000 template<
int codim,
class Gr
idImp>
1003 enum { dim = GridImp::dimension };
1014 _l(l), _index(index)
1024 int index ()
const {
return this->_index; }
1036 template<
int codim, PartitionIteratorType pitype,
class Gr
idImp>
1037 class SLevelIterator :
1041 enum { dim = GridImp::dimension };
1047 typedef typename GridImp::template Codim<codim>::Entity
Entity;
1065 template<
class Gr
idImp>
1071 enum { dim = GridImp::dimension };
1082 for (
int codim=0; codim<=GridImp::dimension; codim++)
1088 int index (
const typename GridImp::Traits::template Codim<cd>::Entity& e)
const
1090 return grid.getRealImplementation(e).compressedIndex();
1094 int subIndex (
const typename GridImp::Traits::template Codim< cc >::Entity &e,
1095 int i,
unsigned int codim )
const
1098 return grid.getRealImplementation(e).subCompressedIndex(codim, i);
1100 DUNE_THROW( NotImplemented,
"subIndex for higher codimension entity not implemented for SGrid." );
1104 template<
class EntityType >
1107 return (e.level() == level);
1113 return grid.size( level, type );
1119 return grid.size( level, codim );
1123 const std::vector<GeometryType>&
geomTypes (
int codim)
const
1125 return mytypes[codim];
1129 const GridImp& grid;
1131 std::vector<GeometryType> mytypes[GridImp::dimension+1];
1143 template<
class Gr
idImp>
1145 public IdSet<GridImp,SGridGlobalIdSet<GridImp>, typename remove_const<GridImp>::type::PersistentIndexType>
1160 typedef typename remove_const<GridImp>::type::PersistentIndexType
IdType;
1168 IdType id (
const typename remove_const<GridImp>::type::Traits::template Codim<cd>::Entity& e)
const
1170 return GridImp::getRealImplementation(e).persistentIndex();
1178 IdType subId (
const typename remove_const< GridImp >::type::Traits::template Codim< 0 >::Entity &e,
1179 int i,
unsigned int codim )
const
1181 return GridImp::getRealImplementation(e).subPersistentIndex(codim, i);
1186 template<
int dim,
int dimworld,
class ctype>
1201 bigunsignedint<dim*sgrid_dim_bits+sgrid_level_bits+sgrid_codim_bits>,
1203 bigunsignedint<dim*sgrid_dim_bits+sgrid_level_bits+sgrid_codim_bits>,
1204 CollectiveCommunication<Dune::SGrid<dim,dimworld,ctype> >,
1266 template<
int dim,
int dimworld,
typename _ctype = sgr
id_ctype>
1295 SGrid (
const int *
const N_,
const ctype *
const H_);
1304 SGrid (
const int *
const N_,
const ctype *
const L_,
const ctype *
const H_);
1315 SGrid (FieldVector<int,dim> N_, FieldVector<ctype,dim> L_, FieldVector<ctype,dim> H_);
1328 template<
int cd, PartitionIteratorType pitype>
1332 template<
int cd, PartitionIteratorType pitype>
1339 return lbegin<cd,All_Partition>(level);
1346 return lend<cd,All_Partition>(level);
1350 template<
int cd, PartitionIteratorType pitype>
1351 typename Traits::template Codim<cd>::template Partition<pitype>::LeafIterator
leafbegin ()
const;
1354 template<
int cd, PartitionIteratorType pitype>
1355 typename Traits::template Codim<cd>::template Partition<pitype>::LeafIterator
leafend ()
const;
1361 return leafbegin<cd,All_Partition>();
1368 return leafend<cd,All_Partition>();
1372 template <
typename Seed>
1373 typename Traits::template Codim<Seed::codimension>::EntityPointer
1376 enum { codim = Seed::codimension };
1395 template<
class T,
template<
class>
class P,
int codim>
1403 int size (
int level,
int codim)
const;
1414 return (type.isCube()) ?
size(level,dim-type.dim()) : 0;
1426 return boundarysize;
1450 const array<int, dim>&
dims(
int level)
const {
1474 return theglobalidset;
1479 return theglobalidset;
1484 assert(level>=0 && level<=
maxLevel());
1485 return *(indexsets[level]);
1490 return *indexsets.back();
1497 template<
class DataHandle>
1501 template<
class DataHandle>
1505 const CollectiveCommunication<SGrid>&
comm ()
const
1554 template<int codim_, int dim_, class GridImp_, template<int,int,class> class EntityImp_>
1557 template<int codim_, class GridImp_>
1560 template<int codim_, int dim_, class GridImp_, template<int,int,class> class EntityImp_>
1564 FieldVector<ctype, dimworld> pos (int level, array<int,dim>& z) const;
1567 int calc_codim (int level, const array<int,dim>& z) const;
1570 int n (int level, const array<int,dim>& z) const;
1573 array<int,dim> z (int level, int i, int codim) const;
1576 array<int,dim> subz (const array<int,dim> & z, int i, int codim) const;
1579 array<int,dim> compress (int level, const array<int,dim>& z) const;
1582 array<int,dim> expand (int level, const array<int,dim>& r, int b) const;
1587 int partition (int level, const array<int,dim>& z) const;
1590 bool exists (int level, const array<int,dim>& zred) const;
1593 int boundarySegmentIndex (int l, int face, const array<int,dim> & zentity) const
1595 array<int,dim-1> zface;
1599 for (
int i=0; i<dir; i++) zface[i] = zentity[i]/(1<<l);
1600 for (
int i=dir+1; i<dim; i++) zface[i-1] = zentity[i]/(1<<l);
1601 zface = boundarymapper[dir].expand(zface, 0);
1603 int index = boundarymapper[dir].n(zface);
1605 for (
int i=0; i<dir; i++)
1606 index += 2*boundarymapper[i].elements(0);
1607 index += side*boundarymapper[dir].elements(0);
1612 PersistentIndexType persistentIndex (
int l,
int codim,
const array<int,dim> & zentity)
const
1625 for (
int i=dim-1; i>=0; i--)
1637 int trailing = 1000;
1638 for (
int i=0; i<dim; i++)
1642 for (
int j=0; j<l; j++)
1643 if (zentity[i]&(1<<(j+1)))
1647 trailing =
std::min(trailing,zeros);
1651 int level = l-trailing;
1661 for (
int i=dim-1; i>=0; i--)
1673 SGrid & operator = (
const SGrid &) {
return *
this; }
1675 void makeSGrid (
const array<int,dim>& N_,
const FieldVector<ctype, dim>& L_,
const FieldVector<ctype, dim>& H_);
1680 CollectiveCommunication<SGrid> ccobj;
1682 ReservedVector<SGridLevelIndexSet<const SGrid<dim,dimworld> >*,
MAXL> indexsets;
1683 SGridGlobalIdSet<const SGrid<dim,dimworld> > theglobalidset;
1686 FieldVector<ctype, dim> low;
1687 FieldVector<ctype, dim> H;
1688 std::vector<array<int,dim> > N;
1689 std::vector<FieldVector<ctype, dim> > h;
1690 mutable CubeMapper<dim> *mapper;
1693 array<CubeMapper<dim-1>, dim> boundarymapper;
1697 namespace Capabilities
1711 template<
int dim,
int dimw>
1714 static const bool v =
true;
1715 static const unsigned int topologyId = GenericGeometry :: CubeTopology< dim > :: type :: id ;
1721 template<
int dim,
int dimw>
1724 static const bool v =
true;
1730 template<
int dim,
int dimw,
int cdim>
1733 static const bool v =
true;
1739 template<
int dim,
int dimw>
1742 static const bool v =
true;
1748 template<
int dim,
int dimw>
1751 static const bool v =
true;
1758 #include "sgrid/sgrid.cc"
Entity & dereference() const
dereferencing
void make(GridImp *_grid, int _l, int _id)
Reinitialization.
Entity * getEntity(GridImp *_grid, int _l, int _id) const
Definition: sgrid.hh:974
int subCompressedIndex(int codim, int i) const
subentity compressed index
Definition: sgrid.hh:380
implementation of index set
Definition: sgrid.hh:1066
Specialize with 'true' if the grid is a Cartesian grid. Cartesian grids satisfy the following propert...
Definition: common/capabilities.hh:45
GridImp::ctype ctype
Definition: sgrid.hh:351
GeometryType type() const
return the element type identifier
Definition: sgrid.hh:187
A Traits struct that collects all associated types of one implementation.
Definition: common/grid.hh:435
int l
level where element is on
Definition: sgrid.hh:993
Definition: sgrid.hh:1187
const Traits::LocalIdSet & localIdSet() const
Definition: sgrid.hh:1477
int indexInInside() const
local index of codim 1 entity in self where intersection is contained in
GridImp * grid
grid containes mapper, geometry, etc.
Definition: sgrid.hh:282
bool contains(const EntityType &e) const
Definition: sgrid.hh:1105
int indexInOutside() const
local index of codim 1 entity in neighbor where intersection is contained in
int level() const
ask for level of entity
SHierarchicStackElem()
Definition: sgrid.hh:513
static ReturnImplementationType< InterfaceType >::ImplementationType & getRealImplementation(InterfaceType &i)
return real implementation of interface class
Definition: common/grid.hh:1223
Traits::template Codim< cd >::template Partition< All_Partition >::LeafIterator leafend() const
return LeafIterator which points behind the last entity
Definition: sgrid.hh:1366
static const bool v
Definition: common/capabilities.hh:57
SEntityBase(GridImp *_grid, int _l, int _index)
constructor
Definition: sgrid.hh:205
Definition: defaultgridview.hh:223
SGridGlobalIdSet< SGrid< dim, dimworld > > GlobalIdSetType
Definition: sgrid.hh:1276
EntityPointer outside() const
int l
Definition: sgrid.hh:511
const Traits::LeafIndexSet & leafIndexSet() const
Definition: sgrid.hh:1488
SGridLevelIndexSet(const GridImp &g, int l)
constructor stores reference to a grid and level
Definition: sgrid.hh:1076
int size(int codim) const
number of leaf entities per codim in this process
Definition: sgrid.hh:1406
Wrapper class for entities.
Definition: common/entity.hh:56
GridImp::HierarchicIterator HierarchicIterator
Definition: sgrid.hh:361
bool isValid() const
check whether the EntitySeed refers to a valid Entity
Definition: sgrid.hh:1018
Dune::SIntersection< GridImp > IntersectionImp
Definition: sgrid.hh:604
size_t boundarySegmentIndex() const
index of the boundary segment within the macro grid
Definition: sgrid.hh:767
GeometryType
Type representing VTK's entity geometry types.
Definition: common.hh:178
SEntityPointer< codim, GridImp > EntityPointerImp
Definition: sgrid.hh:897
GridImp::template Codim< 0 >::Entity Entity
Definition: sgrid.hh:741
const CollectiveCommunication< SGrid > & comm() const
Definition: sgrid.hh:1505
GlobalCoordinate outerNormal(const LocalCoordinate &local) const
Return an outer normal (length not necessarily 1)
Definition: sgrid.hh:833
int subCompressedIndex(int cd, int i) const
subentity compressed index (not available here)
Definition: sgrid.hh:267
int size(int level, int codim) const
number of grid entities per level and codim
Enables iteration over all codim zero entities in a subtree See also the documentation of Dune::Entit...
Definition: common/hierarchiciterator.hh:31
int overlapSize(int codim) const
return size (= distance in graph) of overlap region
Definition: sgrid.hh:1517
Index Set Interface base class.
Definition: common/grid.hh:359
GridImp::PersistentIndexType PersistentIndexType
Definition: sgrid.hh:168
AutoPtrStack< Entity > EntityStackType
Definition: sgrid.hh:967
IdType id(const typename remove_const< GridImp >::type::Traits::template Codim< cd >::Entity &e) const
get id of an entity
Definition: sgrid.hh:1168
GridImp::template Codim< 0 >::LocalGeometry LocalGeometry
Definition: sgrid.hh:353
a stack of pointers with auto destruction if the stack is destructed
Definition: sgrid.hh:875
const Traits::LevelIndexSet & levelIndexSet(int level) const
Definition: sgrid.hh:1482
SGridLevelIndexSet< SGrid< dim, dimworld > > LeafIndexSetType
Definition: sgrid.hh:1275
GridImp::template Codim< 1 >::LocalGeometry LocalGeometry
Definition: sgrid.hh:746
SIntersectionIterator(GridImp *_grid, const SEntity< 0, dim, GridImp > *_self, int _count)
constructor
Definition: sgrid.hh:675
LocalGeometry geometryInOutside() const
geometrical information about this intersection in local coordinates of the outside() entity...
Definition: sgrid.hh:803
bool adapt()
map adapt to global refine
Definition: sgrid.hh:1465
GlobalCoordinate centerUnitOuterNormal() const
Return unit outer normal (length == 1)
Definition: sgrid.hh:853
SLevelIterator(GridImp *_grid, int _l, int _id)
constructor
Definition: sgrid.hh:1053
SEntity(GridImp *_grid, int _l, int _index)
constructor
Definition: sgrid.hh:467
int boundaryId() const
Definition: sgrid.hh:635
int size(int level, GeometryType type) const
number of entities per level and geometry type in this process
Definition: sgrid.hh:1412
Definition: alugrid/common/declaration.hh:18
Wrapper class for pointers to entities.
Definition: common/entitypointer.hh:91
Traits::template Codim< cd >::template Partition< pitype >::LeafIterator leafend() const
one past the end on the leaf level
SEntity(GridImp *_grid, int _l, int _id)
constructor
Definition: sgrid.hh:304
persistent, globally unique Ids
Definition: sgrid.hh:1144
GridImp::ctype ctype
define type used for coordinates in grid module
Definition: sgrid.hh:109
[ provides Dune::Grid ]
Definition: sgrid.hh:48
static const bool v
Definition: common/capabilities.hh:48
bool operator==(const SHierarchicStackElem &s) const
Definition: sgrid.hh:515
CommunicationDirection
Define a type for communication direction parameter.
Definition: gridenums.hh:164
int size(GeometryType type) const
get number of entities of given type and level (the level is known to the object) ...
Definition: sgrid.hh:1111
remove_const< const Dune::SGrid< dim, dimworld > >::type::PersistentIndexType IdType
Type used to represent an id.
Definition: indexidset.hh:406
int subCompressedLeafIndex(int cd, int i) const
subentity compressed leaf index (not available here)
Definition: sgrid.hh:274
const FieldVector< ctype, dimworld > & lowerLeft() const
Get lower left corner.
Definition: sgrid.hh:1455
void increment()
increment
GridImp::template Codim< 0 >::EntityPointer EntityPointer
Definition: sgrid.hh:742
Wrapper class for geometries.
Definition: common/geometry.hh:101
void globalRefine(int refCount)
Refine mesh globally by one refCount levels.
int subCompressedLeafIndex(int codim, int i) const
Definition: sgrid.hh:390
SEntitySeed(int l, int index)
constructor
Definition: sgrid.hh:1013
bool boundary() const
Definition: sgrid.hh:755
const Traits::GlobalIdSet & globalIdSet() const
Definition: sgrid.hh:1472
void increment()
increment
PartitionType partitionType() const
Definition: sgrid.hh:202
Types for GridView.
Definition: common/grid.hh:418
GridImp::template Codim< 0 >::EntityPointer EntityPointer
Definition: sgrid.hh:601
SEntityPointer(const SEntityPointer< codim, GridImp > &other)
constructor
Definition: sgrid.hh:922
int ghostSize(int level, int codim) const
return size (= distance in graph) of ghost region
Definition: sgrid.hh:1523
Entity * e
virtual entity
Definition: sgrid.hh:995
bool equals(const SIntersectionIterator< GridImp > &i) const
equality
int ghostSize(int codim) const
return size (= distance in graph) of ghost region
Definition: sgrid.hh:1529
Traits class determining whether the Dune::Geometry facade class stores the implementation object by ...
Definition: common/geometry.hh:46
LocalGeometry geometryInInside() const
geometrical information about this intersection in local coordinates of the inside() entity...
Definition: sgrid.hh:797
bool hasFather() const
returns true if father entity exists
Definition: sgrid.hh:430
Specialize with 'true' if implementation guarantees conforming level grids. (default=false) ...
Definition: common/capabilities.hh:86
Provides base classes for index and id sets.
int compressedIndex() const
consecutive, codim-wise, level-wise index
Definition: sgrid.hh:243
bool isLeaf() const
return true if the entity is leaf
Definition: sgrid.hh:436
GridImp::template Codim< 1 >::Geometry Geometry
Definition: sgrid.hh:602
const std::vector< GeometryType > & geomTypes(int codim) const
deliver all geometry types used in this grid
Definition: sgrid.hh:1123
bool equals(const SEntityPointer< codim, GridImp > &i) const
equality
GridImp::ctype ctype
Definition: sgrid.hh:533
Geometry geometry() const
SIntersectionIterator & operator=(const SIntersectionIterator &other)
assignment operator
Definition: sgrid.hh:695
int boundaryId() const
Identifier for boundary segment from macro grid.
Definition: sgrid.hh:761
int global_size(int codim) const
number of grid entities of all level for given codim
int size(int codim) const
return size of set for a given codim
Definition: sgrid.hh:1117
SEntityBase()
empty constructor
Definition: sgrid.hh:213
Geometry::LocalCoordinate LocalCoordinate
Definition: sgrid.hh:744
Entity & entity() const
Definition: sgrid.hh:958
void communicate(T &t, InterfaceType iftype, CommunicationDirection dir, int level)
Definition: sgrid.hh:1396
GridImp::template Codim< codim >::Entity Entity
Definition: sgrid.hh:1047
int overlapSize(int level, int codim) const
return size (= distance in graph) of overlap region
Definition: sgrid.hh:1511
FieldVector< ctype, mydim > LocalCoordinate
type of local coordinates
Definition: common/geometry.hh:133
Traits::template Codim< cd >::template Partition< All_Partition >::LevelIterator lend(int level) const
one past the end on this level
Definition: sgrid.hh:1344
Traits::template Codim< cd >::template Partition< pitype >::LeafIterator leafbegin() const
return LeafIterator which points to the first entity
GridImp::template Codim< codim >::Entity Entity
Definition: sgrid.hh:898
GridImp::template Codim< 0 >::EntityPointer EntityPointer
Definition: sgrid.hh:359
int subIndex(const typename GridImp::Traits::template Codim< cc >::Entity &e, int i, unsigned int codim) const
Definition: sgrid.hh:1094
const array< int, dim > & dims(int level) const
Get number of elements in each coordinate direction.
Definition: sgrid.hh:1450
int index(const typename GridImp::Traits::template Codim< cd >::Entity &e) const
get index of an entity
Definition: sgrid.hh:1088
~SEntityPointer()
destructor pointer
Definition: sgrid.hh:928
int size(GeometryType type) const
number of leaf entities per codim and geometry type in this process
Definition: sgrid.hh:1418
int l
level where element is on
Definition: sgrid.hh:283
IdType subId(const typename remove_const< GridImp >::type::Traits::template Codim< 0 >::Entity &e, int i, unsigned int codim) const
get id of subentity
Definition: sgrid.hh:1178
SEntitySeed< codim, GridImp > seed() const
Return the entity seed which contains sufficient information to generate the entity again and uses as...
Definition: sgrid.hh:182
FieldVector< ctype, cdim > GlobalCoordinate
type of the global coordinates
Definition: common/geometry.hh:136
int indexInInside() const
Local index of codim 1 entity in the inside() entity where intersection is contained in...
Definition: sgrid.hh:821
SEntity< codim, dim, GridImp > & realEntity() const
Definition: sgrid.hh:953
SEntityBase(const SEntityBase &other)
copy constructor
Definition: sgrid.hh:218
int ghostSize(int level, int codim)
return size (= distance in graph) of ghost region
Definition: sgrid.hh:1439
bool operator!=(const SHierarchicStackElem &s) const
Definition: sgrid.hh:516
Default Implementations for EntityImp.
Definition: common/entity.hh:552
int index
my consecutive index
Definition: sgrid.hh:994
PersistentIndexType persistentIndex() const
globally unique, persistent index
Definition: sgrid.hh:237
Geometry geometry() const
geometrical information about the intersection in global coordinates.
Definition: sgrid.hh:809
SEntitySeed()
default constructor (invalid)
Definition: sgrid.hh:1008
~SGrid()
SGrid destructor.
GridImp::ctype ctype
define type used for coordinates in grid module
Definition: sgrid.hh:753
SEntityPointer(GridImp *_grid, int _l, int _index)
constructor
Definition: sgrid.hh:910
static const bool v
Whether to store by reference.
Definition: common/geometry.hh:49
PartitionType
Attributes used in the generic overlap model.
Definition: gridenums.hh:24
Traits::template Codim< cd >::template Partition< pitype >::LevelIterator lend(int level) const
one past the end on this level
Specialize with 'true' if implementation guarantees a conforming leaf grid. (default=false) ...
Definition: common/capabilities.hh:95
bool neighbor() const
return true if intersection is shared with another element.
Definition: sgrid.hh:773
GridImp::template Codim< 0 >::Entity Entity
Definition: sgrid.hh:532
int index() const
Definition: sgrid.hh:1024
GridImp::PersistentIndexType PersistentIndexType
Definition: sgrid.hh:362
SIntersection(const SIntersectionIterator< GridImp > &is_)
constructor
Definition: sgrid.hh:861
int level() const
Definition: sgrid.hh:1023
SGrid()
empty constructor making grid of unit square discretized with one cell
void makegeometry() const
geometry of this entity
const int sgrid_dim_bits
Definition: sgrid.hh:36
Mesh entities of codimension 0 ("elements") allow to visit all intersections with "neighboring" eleme...
Definition: common/grid.hh:358
GridImp::template Codim< codim >::Geometry Geometry
Definition: sgrid.hh:167
GridImp::ctype ctype
Definition: sgrid.hh:166
Traits::template Codim< cd >::template Partition< pitype >::LevelIterator lbegin(int level) const
Iterator to first entity of given codim on level.
PersistentIndexType subPersistentIndex(int codim, int i) const
subentity persistent index
Definition: sgrid.hh:400
void make(GridImp *_grid, int _l, int _id)
Reinitialization.
Definition: sgrid.hh:478
SIntersectionIterator(const SIntersectionIterator &other)
Definition: sgrid.hh:685
A set of traits classes to store static information about grid implementation.
EntityPointer inside() const
return EntityPointer to the Entity on the inside of this intersection.
Definition: sgrid.hh:779
GeometryImpl geo
geometry, is only built on demand
Definition: sgrid.hh:286
GridImp * grid
my grid
Definition: sgrid.hh:992
Definition: sgrid.hh:1005
static const bool v
Definition: common/capabilities.hh:26
LocalGeometry geometryInInside() const
Intersection of a mesh entities of codimension 0 ("elements") with a "neighboring" element or with th...
Definition: albertagrid/dgfparser.hh:26
static const bool v
Definition: common/capabilities.hh:88
static const unsigned int topologyId
Definition: common/capabilities.hh:29
SGridFamily< dim, dimworld, _ctype > GridFamily
Definition: sgrid.hh:1270
int index
my consecutive index
Definition: sgrid.hh:284
EntityPointer inside() const
GlobalCoordinate unitOuterNormal(const LocalCoordinate &local) const
Return unit outer normal (length == 1)
Definition: sgrid.hh:847
int indexInOutside() const
Local index of codim 1 entity in outside() entity where intersection is contained in...
Definition: sgrid.hh:827
bool boundary() const
return true if intersection is with boundary.
Geometry geometry() const
geometry of this entity
Definition: sgrid.hh:194
bigunsignedint< dim *sgrid_dim_bits+sgrid_level_bits+sgrid_codim_bits > PersistentIndexType
Definition: sgrid.hh:1271
_ctype ctype
define type used for coordinates in grid module
Definition: sgrid.hh:1284
void communicate(DataHandle &data, InterfaceType iftype, CommunicationDirection dir) const
Definition: sgrid.hh:1502
int globalIndex() const
global index is calculated from the index and grid size
~AutoPtrStack()
Definition: sgrid.hh:878
Specialize with 'true' for all codims that a grid implements entities for. (default=false) ...
Definition: common/capabilities.hh:55
int boundarySegmentIndex() const
Definition: sgrid.hh:640
Different resources needed by all grid implementations.
A traits struct that collects all associated types of one grid model.
Definition: common/grid.hh:1260
static const bool v
Definition: common/capabilities.hh:97
void make(int _l, int _id)
Reinitialization.
Definition: sgrid.hh:485
Definition: common/geometry.hh:24
SHierarchicStackElem(int _l, int _index)
Definition: sgrid.hh:514
GlobalCoordinate integrationOuterNormal(const LocalCoordinate &local) const
return outer normal scaled with the integration element
Definition: sgrid.hh:839
bool conforming() const
return true if intersection is conform.
Definition: sgrid.hh:791
const int sgrid_codim_bits
Definition: sgrid.hh:38
int index
Definition: sgrid.hh:512
Traits::template Codim< cd >::template Partition< All_Partition >::LeafIterator leafbegin() const
return LeafIterator which points to the first entity
Definition: sgrid.hh:1359
SHierarchicIterator(GridImp *_grid, const Dune::SEntity< 0, GridImp::dimension, GridImp > &_e, int _maxLevel, bool makeend)
Definition: sgrid.hh:544
const int sgrid_level_bits
Definition: sgrid.hh:37
void communicate(DataHandle &data, InterfaceType iftype, CommunicationDirection dir, int level) const
Definition: sgrid.hh:1498
InterfaceType
Parameter to be used for the communication functions.
Definition: gridenums.hh:80
GridImp::template Codim< cd >::EntityPointer EntityPointer
Definition: sgrid.hh:357
LocalGeometry geometryInOutside() const
GridImp::template Codim< 0 >::Geometry Geometry
Definition: sgrid.hh:352
GeometryType type() const
obtain the type of reference element for this intersection
Definition: sgrid.hh:815
SGridFamily< dim, dimworld, _ctype >::Traits Traits
Definition: sgrid.hh:1278
Definition: defaultgridview.hh:23
bool neighbor() const
return true if neighbor on this level exists
remove_const< GridImp >::type::PersistentIndexType IdType
define the type used for persistent indices
Definition: sgrid.hh:1160
size_t numBoundarySegments() const
returns the number of boundary segments within the macro grid
Definition: sgrid.hh:1424
int overlapSize(int level, int codim)
return size (= distance in graph) of overlap region
Definition: sgrid.hh:1433
const Intersection & dereference() const
dereferencing
Definition: sgrid.hh:619
SEntityPointer(const SEntity< codim, dim, GridImp > &_e)
constructor
Definition: sgrid.hh:916
SEntityPointer & operator=(const SEntityPointer &other)
assignment operator
Definition: sgrid.hh:938
GridImp::template Codim< 1 >::LocalGeometry LocalGeometry
Definition: sgrid.hh:603
bool builtgeometry
true if geometry has been constructed
Definition: sgrid.hh:287
Dune::Intersection< const GridImp, Dune::SIntersection< const GridImp > > Intersection
Definition: sgrid.hh:605
Specialize with 'true' for if the codimension 0 entity of the grid has only one possible geometry typ...
Definition: common/capabilities.hh:24
void increment()
increment
GridImp::template Codim< 1 >::Geometry Geometry
Definition: sgrid.hh:743
SGridLevelIndexSet< SGrid< dim, dimworld > > LevelIndexSetType
Definition: sgrid.hh:1274
GridImp::template Codim< 0 >::Entity Entity
Definition: sgrid.hh:600
Dune::Intersection< const GridImp, Dune::SIntersectionIterator< const GridImp > > Intersection
Definition: sgrid.hh:747
GridImp::LeafIntersectionIterator IntersectionIterator
Definition: sgrid.hh:360
Id Set Interface.
Definition: common/grid.hh:360
void make(const FieldVector< ctype, cdim > &lower, const FieldMatrix< ctype, mydim, cdim > &A)
Set up the geometry.
Definition: sgrid.hh:118
static EntityStackType & enStack()
Definition: sgrid.hh:968
Definition: sgrid.hh:1281
int level() const
level of this element
Definition: sgrid.hh:171
GeometryType type() const
obtain the type of reference element for this intersection
Definition: sgrid.hh:663
all interior entities
Definition: gridenums.hh:25
int min(const DofVectorPointer< int > &dofVector)
Definition: dofvector.hh:352
SGeometry()
constructor
Definition: sgrid.hh:144
SEntity(const SEntity &other)
Definition: sgrid.hh:472
array< int, dim > z
my coordinate, number of even components = codim
Definition: sgrid.hh:285
GridImp::ctype ctype
define type used for coordinates in grid module
Definition: sgrid.hh:611
EntityPointer outside() const
return EntityPointer to the Entity on the outside of this intersection.
Definition: sgrid.hh:785
GridTraits< dim, dimworld, Dune::SGrid< dim, dimworld, ctype >, SGeometry, SEntity, SEntityPointer, SLevelIterator, SIntersection, SIntersection, SIntersectionIterator, SIntersectionIterator, SHierarchicIterator, SLevelIterator, SGridLevelIndexSet< const SGrid< dim, dimworld, ctype > >, SGridLevelIndexSet< const SGrid< dim, dimworld, ctype > >, SGridGlobalIdSet< const SGrid< dim, dimworld, ctype > >, bigunsignedint< dim *sgrid_dim_bits+sgrid_level_bits+sgrid_codim_bits >, SGridGlobalIdSet< const SGrid< dim, dimworld, ctype > >, bigunsignedint< dim *sgrid_dim_bits+sgrid_level_bits+sgrid_codim_bits >, CollectiveCommunication< Dune::SGrid< dim, dimworld, ctype > >, DefaultLevelGridViewTraits, DefaultLeafGridViewTraits, SEntitySeed > Traits
Definition: sgrid.hh:1207
double sgrid_ctype
Definition: sgrid.hh:33
Geometry::GlobalCoordinate GlobalCoordinate
Definition: sgrid.hh:745
FieldVector< ctype, dimworld > upperRight() const
Get upper right corner.
Definition: sgrid.hh:1460
Traits::template Codim< Seed::codimension >::EntityPointer entityPointer(const Seed &seed) const
Definition: sgrid.hh:1374
Traits::template Codim< cd >::template Partition< All_Partition >::LevelIterator lbegin(int level) const
Iterator to first entity of given codim on level.
Definition: sgrid.hh:1337
int compressedLeafIndex() const
consecutive, codim-wise, level-wise index
Definition: sgrid.hh:249