3 #ifndef DUNE_POLYHEDRALGRID_GRID_HH
4 #define DUNE_POLYHEDRALGRID_GRID_HH
10 #include <opm/grid/utility/platform_dependent/disable_warnings.h>
13 #include <dune/common/version.hh>
14 #include <dune/common/array.hh>
17 #include <dune/grid/common/grid.hh>
18 #if DUNE_VERSION_NEWER(DUNE_COMMON,2,3)
19 #include <dune/common/parallel/collectivecommunication.hh>
21 #include <dune/common/collectivecommunication.hh>
25 #include <dune/grid/polyhedralgrid/capabilities.hh>
26 #include <dune/grid/polyhedralgrid/declaration.hh>
27 #include <dune/grid/polyhedralgrid/entity.hh>
28 #include <dune/grid/polyhedralgrid/entityseed.hh>
29 #include <dune/grid/polyhedralgrid/geometry.hh>
30 #include <dune/grid/polyhedralgrid/gridview.hh>
31 #include <dune/grid/polyhedralgrid/idset.hh>
34 #include <opm/grid/utility/platform_dependent/reenable_warnings.h>
36 #include <opm/grid/utility/ErrorMacros.hpp>
39 #include <opm/core/grid/GridManager.hpp>
41 #include <opm/core/grid/MinpvProcessor.hpp>
50 template<
int dim,
int dimworld >
65 static const int dimension = dim;
66 static const int dimensionworld = dimworld;
68 typedef Dune::FieldVector< ctype, dimensionworld > GlobalCoordinate ;
75 #if DUNE_VERSION_NEWER(DUNE_GRID,2,3)
76 typedef Dune::Intersection< const Grid, LeafIntersectionImpl > LeafIntersection;
77 typedef Dune::Intersection< const Grid, LevelIntersectionImpl > LevelIntersection;
79 typedef Dune::IntersectionIterator< const Grid, LeafIntersectionIteratorImpl, LeafIntersectionImpl > LeafIntersectionIterator;
80 typedef Dune::IntersectionIterator< const Grid, LevelIntersectionIteratorImpl, LevelIntersectionImpl > LevelIntersectionIterator;
82 typedef Dune::Intersection< const Grid, PolyhedralGridIntersection > LeafIntersection;
83 typedef Dune::Intersection< const Grid, PolyhedralGridIntersection > LevelIntersection;
85 typedef Dune::IntersectionIterator< const Grid, PolyhedralGridIntersectionIterator, PolyhedralGridIntersection > LeafIntersectionIterator;
86 typedef Dune::IntersectionIterator< const Grid, PolyhedralGridIntersectionIterator, PolyhedralGridIntersection > LevelIntersectionIterator;
90 typedef Dune::EntityIterator< 0, const Grid, HierarchicIteratorImpl > HierarchicIterator;
102 typedef Dune::Entity< codim, dimension, const Grid, PolyhedralGridEntity > Entity;
104 #if DUNE_VERSION_NEWER(DUNE_GRID,2,4)
106 typedef Entity EntityPointer;
109 typedef Dune::EntityPointer< const Grid, EntityPointerImpl > EntityPointer;
115 template< PartitionIteratorType pitype >
119 typedef Dune::EntityIterator< codim, const Grid, LeafIteratorImpl > LeafIterator;
121 typedef LeafIterator LevelIterator;
124 typedef typename Partition< All_Partition >::LeafIterator LeafIterator;
125 typedef typename Partition< All_Partition >::LevelIterator LevelIterator;
134 typedef Dune::CollectiveCommunication< Grid > CollectiveCommunication;
136 template< PartitionIteratorType pitype >
139 typedef Dune::GridView< PolyhedralGridViewTraits< dim, dimworld, pitype > > LeafGridView;
140 typedef Dune::GridView< PolyhedralGridViewTraits< dim, dimworld, pitype > > LevelGridView;
143 typedef typename Partition<All_Partition>::LevelGridView LevelGridView;
144 typedef typename Partition<All_Partition>::LeafGridView LeafGridView;
162 template <
int dim,
int dimworld >
165 :
public GridDefaultImplementation
166 < dim, dimworld, double, PolyhedralGridFamily< dim, dimworld > >
171 typedef GridDefaultImplementation
176 struct UnstructuredGridDeleter
178 inline void operator () ( UnstructuredGridType* grdPtr )
185 typedef PolyhedralGridFamily< dim, dimworld > GridFamily;
191 typedef typename GridFamily::Traits
Traits;
200 template<
int codim >
221 template< PartitionIteratorType pitype >
224 typedef typename GridFamily::Traits::template Partition< pitype >::LevelGridView LevelGridView;
225 typedef typename GridFamily::Traits::template Partition< pitype >::LeafGridView LeafGridView;
230 typedef typename Partition< All_Partition >::LeafGridView LeafGridView;
291 typedef typename Traits::ctype
ctype;
297 typedef typename Traits :: GlobalCoordinate GlobalCoordinate;
311 const std::vector<double>& poreVolumes = std::vector<double> ())
312 : gridPtr_( createGrid( deck, poreVolumes ) ),
315 leafIndexSet_( *this ),
316 globalIdSet_( *this ),
334 leafIndexSet_( *this ),
335 globalIdSet_( *this ),
345 operator const UnstructuredGridType& ()
const {
return grid_; }
372 int size (
int ,
int codim )
const
374 return size( codim );
389 else if ( codim == 1 )
393 else if ( codim == dim )
399 std::cerr <<
"Warning: codimension " << codim <<
" not available in PolyhedralGrid" << std::endl;
412 int size (
int , GeometryType type )
const
414 return size( dim - type.dim() );
421 int size ( GeometryType type )
const
423 return size( dim - type.dim() );
438 template<
int codim >
439 typename Codim< codim >::LeafIterator leafbegin ()
const
441 return leafbegin< codim, All_Partition >();
444 template<
int codim >
445 typename Codim< codim >::LeafIterator leafend ()
const
447 return leafend< codim, All_Partition >();
450 template<
int codim, PartitionIteratorType pitype >
451 typename Codim< codim >::template Partition< pitype >::LeafIterator
454 typedef typename Traits::template Codim< codim >::template Partition< pitype >::LeafIteratorImpl Impl;
455 return Impl( extraData(),
true );
458 template<
int codim, PartitionIteratorType pitype >
459 typename Codim< codim >::template Partition< pitype >::LeafIterator
462 typedef typename Traits::template Codim< codim >::template Partition< pitype >::LeafIteratorImpl Impl;
463 return Impl( extraData(),
false );
466 template<
int codim >
467 typename Codim< codim >::LevelIterator lbegin (
const int )
const
469 return leafbegin< codim, All_Partition >();
472 template<
int codim >
473 typename Codim< codim >::LevelIterator lend (
const int )
const
475 return leafend< codim, All_Partition >();
478 template<
int codim, PartitionIteratorType pitype >
479 typename Codim< codim >::template Partition< pitype >::LevelIterator
480 lbegin (
const int )
const
482 return leafbegin< codim, pitype > ();
485 template<
int codim, PartitionIteratorType pitype >
486 typename Codim< codim >::template Partition< pitype >::LevelIterator
487 lend (
const int )
const
489 return leafend< codim, pitype > ();
504 return leafIndexSet();
509 return leafIndexSet_;
512 void globalRefine (
int )
516 bool mark (
int ,
const typename Codim< 0 >::Entity& )
521 int getMark (
const typename Codim< 0 >::Entity& )
const
542 template<
class DataHandle >
571 return (codim == 0 ) ? 1 : 0;
607 template<
class DataHandle,
class Data >
610 CommunicationDirection ,
628 template<
class DataHandle,
class Data >
631 CommunicationDirection )
const
680 template<
class DataHandle,
class Data >
700 template<
class DofManager >
707 template< PartitionIteratorType pitype >
710 typedef typename Partition< pitype >::LevelGridView View;
711 typedef typename View::GridViewImp ViewImp;
712 return View( ViewImp( *
this ) );
716 template< PartitionIteratorType pitype >
719 typedef typename Traits::template Partition< pitype >::LeafGridView View;
720 typedef typename View::GridViewImp ViewImp;
721 return View( ViewImp( *
this ) );
727 typedef typename LevelGridView::GridViewImp ViewImp;
734 typedef typename LeafGridView::GridViewImp ViewImp;
735 return LeafGridView( ViewImp( *
this ) );
739 template<
class EntitySeed >
740 typename Traits::template Codim< EntitySeed::codimension >::EntityPointer
746 return EntityPointer( EntityPointerImpl( EntityImpl( extraData(), seed ) ) );
750 template<
class EntitySeed >
751 typename Traits::template Codim< EntitySeed::codimension >::Entity
755 return EntityImpl( extraData(), seed );
777 const std::array<int, 3>& logicalCartesianSize()
const
782 const int* globalCell()
const
788 void getIJK(
const int c, std::array<int,3>& ijk)
const
790 int gc = globalCell()[c];
791 ijk[0] = gc % logicalCartesianSize()[0]; gc /= logicalCartesianSize()[0];
792 ijk[1] = gc % logicalCartesianSize()[1];
793 ijk[2] = gc / logicalCartesianSize()[1];
799 UnstructuredGridType* createGrid(
const Opm::Deck& deck,
const std::vector< double >& poreVolumes )
const
801 const int* rawactnum = deck.hasKeyword(
"ACTNUM")
802 ? deck.getKeyword(
"ACTNUM").getIntData().data()
804 const auto eclipseGrid = std::make_shared<Opm::EclipseGrid>(deck, rawactnum);
808 std::vector<double>
coord;
809 std::vector<double>
zcorn;
812 g.dims[0] = eclipseGrid->getNX();
813 g.dims[1] = eclipseGrid->getNY();
814 g.dims[2] = eclipseGrid->getNZ();
816 eclipseGrid->exportMAPAXES( mapaxes );
817 eclipseGrid->exportCOORD( coord );
818 eclipseGrid->exportZCORN( zcorn );
819 eclipseGrid->exportACTNUM( actnum );
821 g.coord = coord.data();
822 g.zcorn = zcorn.data();
823 g.actnum = actnum.data();
824 g.mapaxes = mapaxes.data();
826 if (!poreVolumes.empty() && (eclipseGrid->getMinpvMode() != Opm::MinpvMode::ModeEnum::Inactive)) {
828 const double minpv_value = eclipseGrid->getMinpvValue();
832 mp.process(poreVolumes, minpv_value, actnum, opmfil, zcorn.data());
835 const double z_tolerance = eclipseGrid->isPinchActive() ?
836 eclipseGrid->getPinchThresholdThickness() : 0.0;
839 OPM_THROW(std::runtime_error,
"Failed to construct grid.");
846 using Base::getRealImplementation;
848 typedef typename Traits :: ExtraData ExtraData;
849 ExtraData extraData ()
const {
return this; }
851 template <
class EntitySeed>
852 int corners(
const EntitySeed& seed )
const
854 const int codim = EntitySeed :: codimension;
855 const int index = seed.index();
860 return cellVertices_[ index ].size();
874 template <
class EntitySeed>
876 corner(
const EntitySeed& seed,
const int i )
const
878 const int codim = EntitySeed :: codimension;
883 const int coordIndex = GlobalCoordinate :: dimension * cellVertices_[ seed.index() ][ i ];
889 return copyToGlobalCoordinate( grid_.
node_coordinates + GlobalCoordinate :: dimension * faceVertex );
893 const int coordIndex = GlobalCoordinate :: dimension * seed.index();
897 return GlobalCoordinate( 0 );
900 template <
class EntitySeed>
901 int subEntities(
const EntitySeed& seed,
const int codim )
const
903 const int index = seed.index();
911 return cellVertices_[ index ].size();
916 template <
int codim,
class EntitySeedArg >
917 typename Codim<codim>::EntitySeed
918 subEntitySeed(
const EntitySeedArg& baseSeed,
const int i )
const
920 assert( codim >= EntitySeedArg::codimension );
921 assert( i>= 0 && i<subEntities( baseSeed, codim ) );
922 typedef typename Codim<codim>::EntitySeed EntitySeed;
925 if( codim == EntitySeedArg::codimension )
927 return EntitySeed( baseSeed.index() );
930 if( EntitySeedArg::codimension == 0 )
936 else if ( codim == dim )
938 return EntitySeed( cellVertices_[ baseSeed.index() ][ i ] );
941 else if ( EntitySeedArg::codimension == 1 && codim == dim )
946 DUNE_THROW(NotImplemented,
"codimension not available");
950 const std::vector< GeometryType > &geomTypes (
const unsigned int codim )
const
952 static std::vector< GeometryType > emptyDummy;
953 if (0 <= codim && codim < geomTypes_.size())
955 return geomTypes_[codim];
961 int indexInInside(
const typename Codim<0>::EntitySeed& seed,
const int i )
const
963 return ( grid_.
cell_facetag ) ? cartesianIndexInInside( seed, i ) : i;
966 int cartesianIndexInInside(
const typename Codim<0>::EntitySeed& seed,
const int i )
const
968 assert( i>= 0 && i<subEntities( seed, 1 ) );
972 typename Codim<0>::EntitySeed
973 neighbor(
const typename Codim<0>::EntitySeed& seed,
const int i )
const
975 const int face = this->
template subEntitySeed<1>( seed, i ).index();
977 if( nb == seed.index() )
982 typedef typename Codim<0>::EntitySeed EntitySeed;
983 return EntitySeed( nb );
987 indexInOutside(
const typename Codim<0>::EntitySeed& seed,
const int i )
const
992 const int in_inside = cartesianIndexInInside( seed, i );
993 return in_inside + ((in_inside % 2) ? -1 : 1);
997 typedef typename Codim<0>::EntitySeed EntitySeed;
998 EntitySeed nb = neighbor( seed, i );
999 const int faces = subEntities( seed, 1 );
1000 for(
int face = 0; face<faces; ++ face )
1002 if( neighbor( nb, face ).equals(seed) )
1004 return indexInInside( nb, face );
1007 DUNE_THROW(InvalidStateException,
"inverse intersection not found");
1012 template <
class EntitySeed>
1014 outerNormal(
const EntitySeed& seed,
const int i )
const
1016 const int face = this->
template subEntitySeed<1>( seed, i ).index();
1017 const int normalIdx = face * GlobalCoordinate :: dimension ;
1018 GlobalCoordinate normal = copyToGlobalCoordinate( grid_.
face_normals + normalIdx );
1020 if( nb != seed.index() )
1027 template <
class EntitySeed>
1029 unitOuterNormal(
const EntitySeed& seed,
const int i )
const
1031 const int face = this->
template subEntitySeed<1>( seed, i ).index();
1032 if( seed.index() == grid_.
face_cells[ 2*face ] )
1034 return unitOuterNormals_[ face ];
1038 GlobalCoordinate normal = unitOuterNormals_[ face ];
1044 template <
class EntitySeed>
1045 GlobalCoordinate centroids(
const EntitySeed& seed )
const
1047 const int index = GlobalCoordinate :: dimension * seed.index();
1048 const int codim = EntitySeed::codimension;
1049 assert( index >= 0 && index <
size( codim ) * GlobalCoordinate :: dimension );
1055 else if ( codim == 1 )
1059 else if( codim == dim )
1065 DUNE_THROW(InvalidStateException,
"codimension not implemented");
1066 return GlobalCoordinate( 0 );
1070 GlobalCoordinate copyToGlobalCoordinate(
const double* coords )
const
1072 GlobalCoordinate coordinate;
1073 for(
int i=0; i<GlobalCoordinate::dimension; ++i )
1075 coordinate[ i ] = coords[ i ];
1080 template <
class EntitySeed>
1081 double volumes(
const EntitySeed& seed )
const
1083 const int index = seed.index();
1084 const int codim = EntitySeed::codimension;
1089 else if ( codim == 1 )
1093 else if ( codim == dim )
1099 DUNE_THROW(InvalidStateException,
"codimension not implemented");
1107 for(
int i=0; i<3; ++i )
1109 cartDims_[ i ] = grid_.
cartdims[ i ];
1113 const int numCells =
size( 0 );
1114 cellVertices_.resize( numCells );
1119 typedef Dune::array<int, 3> KeyType;
1120 std::map< const KeyType, const int > vertexFaceTags;
1121 const int vertexFacePattern [8][3] = {
1132 for(
int i=0; i<8; ++i )
1134 KeyType key; key.fill( 4 );
1135 for(
int j=0; j<dim; ++j )
1137 key[ j ] = vertexFacePattern[ i ][ j ];
1140 vertexFaceTags.insert( std::make_pair( key, i ) );
1143 for (
int c = 0; c < numCells; ++c)
1145 typedef std::map<int,int> vertexmap_t;
1146 typedef typename vertexmap_t :: iterator iterator;
1148 std::vector< vertexmap_t > cell_pts( dim*2 );
1157 const int node = grid_.
face_nodes[ nodepos ];
1158 iterator it = cell_pts[ faceTag ].find( node );
1159 if( it == cell_pts[ faceTag ].end() )
1161 cell_pts[ faceTag ].insert( std::make_pair( node, 1 ) );
1171 typedef std::map< int, std::set<int> > vertexlist_t;
1172 vertexlist_t vertexList;
1174 for(
int faceTag = 0; faceTag<6; ++faceTag )
1176 for( iterator it = cell_pts[ faceTag ].begin(),
1177 end = cell_pts[ faceTag ].end(); it != end; ++it )
1180 if( (*it).second == 1 )
1182 vertexList[ (*it).first ].insert( faceTag );
1187 assert(
int(vertexList.size()) == ( dim == 2 ) ? 4 : 8 );
1189 cellVertices_[ c ].resize( vertexList.size() );
1190 for(
auto it = vertexList.begin(), end = vertexList.end(); it != end; ++it )
1192 assert( (*it).second.size() == dim );
1193 KeyType key; key.fill( 4 );
1195 std::copy( (*it).second.begin(), (*it).second.end(), key.begin() );
1196 auto vx = vertexFaceTags.find( key );
1197 assert( vx != vertexFaceTags.end() );
1198 if( vx != vertexFaceTags.end() )
1200 if( (*vx).second >=
int(cellVertices_[ c ].size()) )
1201 cellVertices_[ c ].resize( (*vx).second+1 );
1203 cellVertices_[ c ][ (*vx).second ] = (*it).first ;
1208 geomTypes_.resize(dim + 1);
1210 for (
int codim = 0; codim <= dim; ++codim)
1212 tmp.makeCube(dim - codim);
1213 geomTypes_[codim].push_back(tmp);
1218 for (
int c = 0; c < numCells; ++c)
1220 std::set<int> cell_pts;
1226 cell_pts.insert(fnbeg, fnend);
1229 cellVertices_[ c ].resize( cell_pts.size() );
1230 std::copy(cell_pts.begin(), cell_pts.end(), cellVertices_[ c ].begin() );
1234 geomTypes_.resize(dim + 1);
1236 for (
int codim = 0; codim <= dim; ++codim)
1240 tmp.makeCube(dim - codim);
1244 tmp.makeNone(dim - codim);
1246 geomTypes_[codim].push_back(tmp);
1253 const int normalIdx = face * GlobalCoordinate :: dimension ;
1254 GlobalCoordinate normal = copyToGlobalCoordinate( grid_.
face_normals + normalIdx );
1255 normal /= normal.two_norm();
1257 unitOuterNormals_[ face ] = normal;
1262 std::unique_ptr< UnstructuredGridType, UnstructuredGridDeleter > gridPtr_;
1263 const UnstructuredGridType& grid_;
1266 std::array< int, 3 > cartDims_;
1267 std::vector< std::vector< GeometryType > > geomTypes_;
1268 std::vector< std::vector< int > > cellVertices_;
1270 std::vector< GlobalCoordinate > unitOuterNormals_;
1286 template<
int dim,
int dimworld >
1287 template<
int codim >
1288 struct PolyhedralGrid< dim, dimworld >::Codim
1289 :
public Base::template Codim< codim >
1337 template< PartitionIteratorType pitype >
1341 ::template Partition< pitype >::LeafIterator
1344 ::template Partition< pitype >::LevelIterator
1371 #include <dune/grid/polyhedralgrid/persistentcontainer.hh>
1372 #include <dune/grid/polyhedralgrid/cartesianindexmapper.hh>
1373 #include <dune/grid/polyhedralgrid/gridhelpers.hh>
1375 #endif // #ifndef DUNE_POLYHEDRALGRID_GRID_HH
int * cell_facetag
If non-null, this array contains a number for cell-face adjacency indicating the face's position with...
Definition: grid.h:244
void communicate(CommDataHandleIF< DataHandle, Data > &, InterfaceType, CommunicationDirection, int) const
communicate information on a grid level
Definition: grid.hh:608
int * global_cell
If non-null, this array contains the logical cartesian indices (in a lexicographic ordering) of each ...
Definition: grid.h:214
int size(int codim) const
obtain number of leaf entities
Definition: grid.hh:383
Definition: intersection.hh:19
Definition: geometry.hh:24
Raw corner-point specification of a particular geological model.
Definition: preprocess.h:56
int size(int, GeometryType type) const
obtain number of entites on a level
Definition: grid.hh:412
size_t numBoundarySegments() const
obtain number of leaf entities
Definition: grid.hh:432
Traits::template Codim< codim >::EntityPointer EntityPointer
type of entity pointer
Definition: grid.hh:1305
const int * actnum
Explicit "active" map.
Definition: preprocess.h:60
double * cell_volumes
Exact or approximate cell volumes.
Definition: grid.h:197
Definition: entitypointer.hh:18
double * node_coordinates
Node coordinates, stored consecutively for each node.
Definition: grid.h:160
Traits::LevelIntersectionIterator LevelIntersectionIterator
iterator over intersections with other entities on the same level
Definition: grid.hh:213
double * face_centroids
Exact or approximate face centroids, stored consecutively for each face.
Definition: grid.h:168
Partition< pitype >::LeafGridView leafGridView() const
View for the leaf grid.
Definition: grid.hh:717
int number_of_cells
The number of cells in the grid.
Definition: grid.h:109
int * cell_facepos
For a cell c, cell_facepos[c] contains the starting index for c's faces in the cell_faces array...
Definition: grid.h:152
Partition< pitype >::LevelGridView levelGridView(int) const
View for a grid level.
Definition: grid.hh:708
int overlapSize(int) const
obtain size of overlap region for the leaf grid
Definition: grid.hh:560
PolyhedralGrid(const UnstructuredGridType &grid)
constructor
Definition: grid.hh:330
Traits::HierarchicIterator HierarchicIterator
iterator over the grid hierarchy
Definition: grid.hh:209
bool preAdapt()
Definition: grid.hh:527
Partition< All_Partition >::LevelIterator LevelIterator
type of leaf iterator
Definition: grid.hh:1364
Definition: iterator.hh:19
double * cell_centroids
Exact or approximate cell centroids, stored consecutively for each cell.
Definition: grid.h:192
const CollectiveCommunication & comm() const
obtain CollectiveCommunication object
Definition: grid.hh:644
Traits::LocalIdSet LocalIdSet
type of local id set
Definition: grid.hh:284
double * face_normals
Exact or approximate face normals, stored consecutively for each face.
Definition: grid.h:184
LeafGridView leafGridView() const
View for the leaf grid for All_Partition.
Definition: grid.hh:732
int size(int, int codim) const
obtain number of entites on a level
Definition: grid.hh:372
const double * coord
Pillar end-points.
Definition: preprocess.h:58
const double * mapaxes
6 Element rotation vector - can be NULL.
Definition: preprocess.h:61
Traits::LeafIndexSet LeafIndexSet
type of leaf index set
Definition: grid.hh:245
Traits::LeafIntersectionIterator LeafIntersectionIterator
iterator over intersections with other entities on the leaf level
Definition: grid.hh:211
int number_of_faces
The number of faces in the grid.
Definition: grid.h:111
bool loadBalance(DofManager &)
rebalance the load each process has to handle
Definition: grid.hh:701
Types for GridView.
Definition: grid.hh:222
traits structure containing types for a codimension
Definition: grid.hh:201
bool adapt()
Definition: grid.hh:533
int overlapSize(int, int) const
obtain size of overlap region for a grid level
Definition: grid.hh:579
Traits::template Codim< EntitySeed::codimension >::EntityPointer entityPointer(const EntitySeed &seed) const
obtain EntityPointer from EntitySeed.
Definition: grid.hh:741
bool adapt(DataHandle &)
Definition: grid.hh:543
Traits::template Codim< codim >::LocalGeometry LocalGeometry
type of local geometry
Definition: grid.hh:1330
bool loadBalance(CommDataHandleIF< DataHandle, Data > &)
rebalance the load each process has to handle
Definition: grid.hh:681
int maxLevel() const
obtain maximal grid level
Definition: grid.hh:359
struct UnstructuredGrid * create_grid_cornerpoint(const struct grdecl *in, double tol)
Construct grid representation from corner-point specification of a particular geological model...
Definition: cornerpoint_grid.c:164
Definition: entityseed.hh:17
int size(GeometryType type) const
returns the number of boundary segments within the macro grid
Definition: grid.hh:421
Definition: intersectioniterator.hh:15
identical grid wrapper
Definition: declaration.hh:10
int * face_nodepos
For a face f, face_nodepos[f] contains the starting index for f's nodes in the face_nodes array...
Definition: grid.h:127
Traits::ctype ctype
type of vector coordinates (e.g., double)
Definition: grid.hh:292
Traits::CollectiveCommunication CollectiveCommunication
communicator with all other processes having some part of the grid
Definition: grid.hh:295
const double * zcorn
Corner-point depths.
Definition: preprocess.h:59
int ghostSize(int, int codim) const
obtain size of ghost region for a grid level
Definition: grid.hh:589
Main OPM-Core grid data structure along with helper functions for construction, destruction and readi...
int * face_cells
For a face f, face_cells[2*f] and face_cells[2*f + 1] contain the cell indices of the cells adjacent ...
Definition: grid.h:138
void update()
update grid caches
Definition: grid.hh:771
int * cell_faces
Contains for each cell, the indices of its adjacent faces.
Definition: grid.h:146
Definition: indexset.hh:22
int ghostSize(int codim) const
obtain size of ghost region for the leaf grid
Definition: grid.hh:569
LevelGridView levelGridView(int) const
View for a grid level for All_Partition.
Definition: grid.hh:725
Traits::GlobalIdSet GlobalIdSet
type of global id set
Definition: grid.hh:267
double * face_areas
Exact or approximate face areas.
Definition: grid.h:173
Traits::template Codim< codim >::Entity Entity
type of entity
Definition: grid.hh:1299
void postAdapt()
Definition: grid.hh:549
GridFamily::Traits Traits
type of the grid traits
Definition: grid.hh:192
Partition< All_Partition >::LevelGridView LevelGridView
View types for All_Partition.
Definition: grid.hh:229
Definition: entity.hh:151
void communicate(CommDataHandleIF< DataHandle, Data > &, InterfaceType, CommunicationDirection) const
communicate information on leaf entities
Definition: grid.hh:629
Low-level corner-point processing routines and supporting data structures.
Definition: geometry.hh:25
bool loadBalance()
rebalance the load each process has to handle
Definition: grid.hh:660
Partition< All_Partition >::LeafIterator LeafIterator
type of level iterator
Definition: grid.hh:1355
int * face_nodes
Contains for each face, the indices of its adjacent nodes.
Definition: grid.h:121
Routines to form a complete UnstructuredGrid from a corner-point specification.
Data structure for an unstructured grid, unstructured meaning that any cell may have an arbitrary num...
Definition: grid.h:98
Traits::template Codim< EntitySeed::codimension >::Entity entity(const EntitySeed &seed) const
obtain EntityPointer from EntitySeed.
Definition: grid.hh:752
Traits::LevelIndexSet LevelIndexSet
type of level index set
Definition: grid.hh:255
int number_of_nodes
The number of nodes in the grid.
Definition: grid.h:113
Transform a corner-point grid ZCORN field to account for MINPV processing.
Definition: MinpvProcessor.hpp:32
void destroy_grid(struct UnstructuredGrid *g)
Destroy and deallocate an UnstructuredGrid and all its data.
Definition: grid.c:32
Traits::template Codim< codim >::Geometry Geometry
type of world geometry
Definition: grid.hh:1320
int cartdims[3]
Contains the size of the logical cartesian structure (if any) of the grid.
Definition: grid.h:227