|
grid.hh
Go to the documentation of this file.
87 typedef Dune::IntersectionIterator< const Grid, LeafIntersectionIteratorImpl, LeafIntersectionImpl > LeafIntersectionIterator;
88 typedef Dune::IntersectionIterator< const Grid, LevelIntersectionIteratorImpl, LevelIntersectionImpl > LevelIntersectionIterator;
97 typedef Dune::Geometry< dimension-codim, dimensionworld, const Grid, PolyhedralGridGeometry > Geometry;
99 typedef PolyhedralGridLocalGeometry< dimension-codim, dimensionworld, const Grid> LocalGeometryImpl;
100 typedef Dune::Geometry< dimension-codim, dimensionworld, const Grid, PolyhedralGridLocalGeometry > LocalGeometry;
108 //typedef Dune::EntitySeed< const Grid, PolyhedralGridEntitySeed< codim, const Grid > > EntitySeed;
137 typedef Dune::GridView< PolyhedralGridViewTraits< dim, dimworld, ctype, pitype > > LeafGridView;
138 typedef Dune::GridView< PolyhedralGridViewTraits< dim, dimworld, ctype, pitype > > LevelGridView;
187 allocateGrid ( std::size_t nCells, std::size_t nFaces, std::size_t nFaceNodes, std::size_t nCellFaces, std::size_t nNodes )
189 // Note that we here assign a grid of dimension dimworld in order to obtain global coordinates in the correct dimension
190 UnstructuredGridType *grid = allocate_grid( dimworld, nCells, nFaces, nFaceNodes, nCellFaces, nNodes );
340 : gridPtr_ { createGrid(inputGrid, poreVolumes, static_cast<int>(edge_conformal), mergeMinpvCells) }
464 std::cerr << "Warning: codimension " << codim << " not available in PolyhedralGrid" << std::endl;
519 typedef typename Traits::template Codim< codim >::template Partition< pitype >::LeafIteratorImpl Impl;
527 typedef typename Traits::template Codim< codim >::template Partition< pitype >::LeafIteratorImpl Impl;
710 OPM_THROW(std::runtime_error, "switch to distributed view not implemented for polyhedreal grid!");
820 typedef typename Traits::template Codim< EntitySeed::codimension >::EntityPointer EntityPointer;
821 typedef typename Traits::template Codim< EntitySeed::codimension >::EntityPointerImpl EntityPointerImpl;
919 const double z_tolerance = inputGrid.isPinchActive() ? inputGrid.getPinchThresholdThickness() : 0.0;
921 // The keyword PINCH connects the cells across collapsed inactive cells, as it does for the CpGrid. The grid with edge
925 // The cells that MINPV removed, and the cell above and below each of them if they are to be connected
932 // The cells with a pore volume below MINPV are merged into the cell below, or collapsed. The collapsed cells
933 // leave space between the cells above and below, which is connected as the CpGrid does it by default, see below.
935 const bool nogap = ! inputGrid.isPinchActive() || inputGrid.getPinchGapMode() == Opm::PinchMode::NOGAP;
965 // As the CpGrid does it, the bottom face of the cell above the space is the face between the cells.
987 UnstructuredGridType* createGrid( const std::vector< int >& n, const std::vector< double >& dx ) const
1049 center += copyToGlobalCoordinate( grid_.node_coordinates + GlobalCoordinate::dimension * cellVertices_[ cell ][ sideCorners[ side ][ i ] ] );
1076 return copyToGlobalCoordinate( grid_.node_coordinates + GlobalCoordinate::dimension * grid_.face_nodes[ first + i ] );
1139 return copyToGlobalCoordinate( grid_.node_coordinates + GlobalCoordinate :: dimension * faceVertex );
1459 // connectCellsAcrossGaps() gives a cell an extra face with the tag of the top: the bottom face of the cell above.
1462 // The top of the cell has no cell on the other side. A face with the tag of the top that has a cell on both sides is
1465 // The extra face must not be used to find the corners of the cell. It is recognised in the same way if there is space
1476 if( grid_.cell_facetag[ hf ] == 4 && ( grid_.face_cells[ 2*f ] < 0 || grid_.face_cells[ 2*f + 1 ] < 0 ) )
1552 // The face to the cell above the space that MINPV left is a face of that cell, and the cell has its own top
1553 // face. It is not a face of the top of the cell, which the nodes tell: they are not on the sides of the cell.
1600 const bool collapsed = ( sides.count( 0 ) && sides.count( 1 ) ) || ( sides.count( 2 ) && sides.count( 3 ) )
void destroy_grid(struct UnstructuredGrid *g) struct UnstructuredGrid * allocate_grid(size_t ndims, size_t ncells, size_t nfaces, size_t nfacenodes, size_t ncellfaces, size_t nnodes) struct UnstructuredGrid * create_grid_cart2d(int nx, int ny, double dx, double dy) struct UnstructuredGrid * create_grid_hexa3d(int nx, int ny, int nz, double dx, double dy, double dz) Definition: entity.hh:152 Definition: entityseed.hh:16 Definition: geometry.hh:245 Definition: idset.hh:18 Definition: indexset.hh:25 Definition: intersectioniterator.hh:16 Definition: intersection.hh:22 Definition: iterator.hh:21 Definition: geometry.hh:264 Traits::ctype ctype type of vector coordinates (e.g., double) Definition: grid.hh:314 int ghostSize(int, int codim) const obtain size of ghost region for a grid level Definition: grid.hh:654 bool loadBalance(CommDataHandleIF< DataHandle, Data > &) rebalance the load each process has to handle Definition: grid.hh:758 Partition< All_Partition >::LevelGridView LevelGridView View types for All_Partition. Definition: grid.hh:251 Traits::template Codim< EntitySeed::codimension >::EntityPointer entityPointer(const EntitySeed &seed) const obtain EntityPointer from EntitySeed. Definition: grid.hh:818 GlobalCoordinate faceAreaNormalEcl(const int face) const The area normal of a face, defined as for the CpGrid. Definition: grid.hh:1070 Traits::template Codim< EntitySeed::codimension >::Entity entity(const EntitySeed &seed) const obtain EntityPointer from EntitySeed. Definition: grid.hh:829 static void computeGeometry(UnstructuredGridPtr &ug) Definition: grid.hh:197 std::vector< std::vector< int > > cellVertices_ Definition: grid.hh:1935 GlobalCoordinate outerNormal(const EntitySeed &seed, const int i) const Definition: grid.hh:1361 int ghostSize(int codim) const obtain size of ghost region for the leaf grid Definition: grid.hh:634 bool loadBalance(DofManager &) rebalance the load each process has to handle Definition: grid.hh:778 Traits::GlobalIdSet GlobalIdSet type of global id set Definition: grid.hh:289 Codim< codim >::template Partition< pitype >::LeafIterator leafend() const Definition: grid.hh:525 GlobalCoordinate faceCenterEcl(const int cell, const int side) const The center of a side of a cell, defined as for the CpGrid. Definition: grid.hh:1036 Codim< codim >::LevelIterator lbegin(const int) const Definition: grid.hh:532 Traits::LevelIndexSet LevelIndexSet type of level index set Definition: grid.hh:277 LevelGridView levelGridView(int) const View for a grid level for All_Partition. Definition: grid.hh:802 std::unique_ptr< UnstructuredGridType, UnstructuredGridDeleter > UnstructuredGridPtr Definition: grid.hh:184 PolyhedralGrid(const std::vector< int > &n, const std::vector< double > &dx) constructor Definition: grid.hh:356 bool isBoundaryFace(const typename Codim< 1 >::EntitySeed &faceSeed) const Definition: grid.hh:1250 static UnstructuredGridPtr allocateGrid(std::size_t nCells, std::size_t nFaces, std::size_t nFaceNodes, std::size_t nCellFaces, std::size_t nNodes) Definition: grid.hh:187 Codim< codim >::LeafIterator leafbegin() const Definition: grid.hh:504 Codim< codim >::LevelIterator lend(const int) const Definition: grid.hh:538 Partition< pitype >::LeafGridView leafGridView() const View for the leaf grid. Definition: grid.hh:794 void print(std::ostream &out, const UnstructuredGridType &grid) const Definition: grid.hh:1898 int getMark(const typename Codim< 0 >::Entity &) const Definition: grid.hh:586 Traits::HierarchicIterator HierarchicIterator iterator over the grid hierarchy Definition: grid.hh:231 Codim< 0 >::EntitySeed neighbor(const typename Codim< 0 >::EntitySeed &seed, const int i) const Definition: grid.hh:1320 int size(int, int codim) const obtain number of entites on a level Definition: grid.hh:437 Partition< pitype >::LevelGridView levelGridView(int) const View for a grid level. Definition: grid.hh:785 GlobalCoordinate copyToGlobalCoordinate(const double *coords) const Definition: grid.hh:1420 void getIJK(const int c, std::array< int, 3 > &ijk) const Definition: grid.hh:870 PolyhedralGrid(const Opm::EclipseGrid &inputGrid, const std::vector< double > &poreVolumes=std::vector< double >{}, const bool edge_conformal=false, const bool mergeMinpvCells=false) constructor Definition: grid.hh:336 Partition< All_Partition >::LeafGridView LeafGridView Definition: grid.hh:252 void switchToDistributedView() Switch to the distributed view. Definition: grid.hh:708 int overlapSize(int, int) const obtain size of overlap region for a grid level Definition: grid.hh:644 int indexInOutside(const typename Codim< 0 >::EntitySeed &seed, const int i) const Definition: grid.hh:1334 std::vector< std::vector< GeometryType > > geomTypes_ Definition: grid.hh:1934 int size(int codim) const obtain number of leaf entities Definition: grid.hh:448 void scatterData(DataHandle &handle) const Moves data from the global (all data on process) view to the distributed view. Definition: grid.hh:893 int indexInInside(const typename Codim< 0 >::EntitySeed &seed, const int i) const Definition: grid.hh:1308 Codim< codim >::EntitySeed subEntitySeed(const EntitySeedArg &baseSeed, const int i) const Definition: grid.hh:1179 Traits::LocalIdSet LocalIdSet type of local id set Definition: grid.hh:306 typename Traits::Communication Communication communicator with all other processes having some part of the grid Definition: grid.hh:317 std::vector< GlobalCoordinate > unitOuterNormals_ Definition: grid.hh:1937 Codim< codim >::template Partition< pitype >::LeafIterator leafbegin() const Definition: grid.hh:517 int subEntities(const EntitySeed &seed, const int codim) const Definition: grid.hh:1150 UnstructuredGridType * createGrid(const std::vector< int > &n, const std::vector< double > &dx) const Definition: grid.hh:987 const CommunicationType & comm() const obtain CollectiveCommunication object Definition: grid.hh:721 int overlapSize(int) const obtain size of overlap region for the leaf grid Definition: grid.hh:625 const std::vector< GeometryType > & geomTypes(const unsigned int codim) const Definition: grid.hh:1267 Traits::LevelIntersectionIterator LevelIntersectionIterator iterator over intersections with other entities on the same level Definition: grid.hh:235 PolyhedralGrid(UnstructuredGridPtr &&gridPtr) constructor Definition: grid.hh:375 Codim< codim >::EntitySeed subEntitySeed(const typename Codim< 1 >::EntitySeed &faceSeed, const int i) const Definition: grid.hh:1213 Traits::LeafIntersectionIterator LeafIntersectionIterator iterator over intersections with other entities on the leaf level Definition: grid.hh:233 Codim< codim >::template Partition< pitype >::LevelIterator lend(const int) const Definition: grid.hh:552 UnstructuredGrid UnstructuredGridType Definition: grid.hh:172 bool hasBoundaryIntersections(const typename Codim< 0 >::EntitySeed &seed) const Definition: grid.hh:1231 int size(int, GeometryType type) const obtain number of entites on a level Definition: grid.hh:477 void communicate(DataHandle &, InterfaceType, CommunicationDirection) const communicate information on leaf entities Definition: grid.hh:694 Codim< codim >::template Partition< pitype >::LevelIterator lbegin(const int) const Definition: grid.hh:545 size_t numBoundarySegments() const obtain number of leaf entities Definition: grid.hh:497 void switchToGlobalView() Switch to the global view. Definition: grid.hh:702 GeometryType geometryType(const Seed &seed) const Definition: grid.hh:1279 const std::array< int, 3 > & logicalCartesianSize() const Definition: grid.hh:854 bool loadBalance() rebalance the load each process has to handle Definition: grid.hh:737 PolyhedralGrid(const UnstructuredGridType &grid) constructor Definition: grid.hh:394 LeafGridView leafGridView() const View for the leaf grid for All_Partition. Definition: grid.hh:809 int boundarySegmentIndex(const typename Codim< 0 >::EntitySeed &seed, const int face) const Definition: grid.hh:1256 bool isBoundaryFace(const int face) const Definition: grid.hh:1243 GlobalCoordinate faceCenterEcl(const int cell, const int side, const Intersection &) const As above, for use where CpGrid::faceCenterEcl() takes the intersection as well. Definition: grid.hh:1057 int size(GeometryType type) const returns the number of boundary segments within the macro grid Definition: grid.hh:486 bool isFaceAcrossGap(const int cell, const int face) const Definition: grid.hh:1467 int cartesianIndexInInside(const typename Codim< 0 >::EntitySeed &seed, const int i) const Definition: grid.hh:1313 bool mark(int, const typename Codim< 0 >::Entity &) Definition: grid.hh:581 Traits::GlobalCoordinate GlobalCoordinate Definition: grid.hh:320 const LevelIndexSet & levelIndexSet(int) const Definition: grid.hh:567 void communicate(DataHandle &, InterfaceType, CommunicationDirection, int) const communicate information on a grid level Definition: grid.hh:673 GlobalCoordinate unitOuterNormal(const EntitySeed &seed, const int i) const Definition: grid.hh:1376 UnstructuredGridType * createGrid(const Opm::EclipseGrid &inputGrid, const std::vector< double > &poreVolumes, const bool edge_conformal, const bool mergeMinpvCells) const Definition: grid.hh:900 GlobalCoordinate centroids(const EntitySeed &seed) const Definition: grid.hh:1392 Traits::LeafIndexSet LeafIndexSet type of leaf index set Definition: grid.hh:267 GlobalCoordinate corner(const EntitySeed &seed, const int i) const Definition: grid.hh:1123 Transform a corner-point grid ZCORN field to account for MINPV processing. Definition: MinpvProcessor.hpp:35 Result process(const std::vector< double > &thickness, const double z_tolerance, const double max_gap, const std::vector< double > &pv, const std::vector< double > &minpvv, const std::vector< int > &actnum, const bool mergeMinPVCells, double *zcorn, const bool pinchNOGAP=false, const bool pinchOption4ALL=false, const std::vector< double > &permz={}, const std::function< double(int)> &multZ=[](int){ return 0;}, const double tolerance_unique_points=0) const void compute_geometry(struct UnstructuredGrid *g) struct UnstructuredGrid * create_grid_cornerpoint_pinch(const struct grdecl *in, double tol, int edge_conformal, int pinch_active) int connectCellsAcrossGaps(UnstructuredGrid &grid, const std::vector< std::pair< int, int > > &cells) The namespace Dune is the main namespace for all Dune code. Definition: common/CartesianIndexMapper.hpp:10 FieldVector< T, 3 > cross(const FieldVector< T, 3 > &a, const FieldVector< T, 3 > &b) Definition: Volumes.hpp:58 int faceTag(const Dune::CpGrid &grid, const Dune::cpgrid::Cell2FacesRow::iterator &cell_face) Get Eclipse Cartesian tag of a face. int numCells(const Dune::CpGrid &grid) Get the number of cells of a grid. STL namespace. Definition: grid.hh:2008 Traits::template Codim< codim >::template Partition< pitype >::LeafIterator LeafIterator Definition: grid.hh:2011 Traits::template Codim< codim >::template Partition< pitype >::LevelIterator LevelIterator Definition: grid.hh:2014 traits structure containing types for a codimension Definition: grid.hh:1959 Partition< All_Partition >::LeafIterator LeafIterator type of level iterator Definition: grid.hh:2024 Traits::template Codim< codim >::Entity Entity type of entity Definition: grid.hh:1968 Traits::template Codim< codim >::EntityPointer EntityPointer type of entity pointer Definition: grid.hh:1974 Traits::template Codim< codim >::LocalGeometry LocalGeometry type of local geometry Definition: grid.hh:1999 Partition< All_Partition >::LevelIterator LevelIterator type of leaf iterator Definition: grid.hh:2033 Traits::template Codim< codim >::Geometry Geometry type of world geometry Definition: grid.hh:1989 GridFamily::Traits::template Partition< pitype >::LeafGridView LeafGridView Definition: grid.hh:247 GridFamily::Traits::template Partition< pitype >::LevelGridView LevelGridView Definition: grid.hh:246 Definition: grid.hh:176 void operator()(UnstructuredGridType *grdPtr) Definition: grid.hh:177 Definition: grid.hh:113 PolyhedralGridIterator< codim, const Grid, pitype > LeafIteratorImpl Definition: grid.hh:114 Dune::EntityIterator< codim, const Grid, LeafIteratorImpl > LeafIterator Definition: grid.hh:115 LeafIterator LevelIterator Definition: grid.hh:117 Definition: grid.hh:95 Dune::Geometry< dimension-codim, dimensionworld, const Grid, PolyhedralGridLocalGeometry > LocalGeometry Definition: grid.hh:100 PolyhedralGridGeometry< dimension-codim, dimensionworld, const Grid > GeometryImpl Definition: grid.hh:96 Dune::Geometry< dimension-codim, dimensionworld, const Grid, PolyhedralGridGeometry > Geometry Definition: grid.hh:97 Partition< All_Partition >::LeafIterator LeafIterator Definition: grid.hh:120 EntityImpl EntityPointerImpl Definition: grid.hh:105 PolyhedralGridEntitySeed< codim, const Grid > EntitySeed Definition: grid.hh:109 Dune::Entity< codim, dimension, const Grid, PolyhedralGridEntity > Entity Definition: grid.hh:103 PolyhedralGridLocalGeometry< dimension-codim, dimensionworld, const Grid > LocalGeometryImpl Definition: grid.hh:99 Partition< All_Partition >::LevelIterator LevelIterator Definition: grid.hh:121 PolyhedralGridEntity< codim, dimension, const Grid > EntityImpl Definition: grid.hh:102 Definition: grid.hh:136 Dune::GridView< PolyhedralGridViewTraits< dim, dimworld, ctype, pitype > > LeafGridView Definition: grid.hh:137 Dune::GridView< PolyhedralGridViewTraits< dim, dimworld, ctype, pitype > > LevelGridView Definition: grid.hh:138 Definition: grid.hh:63 PolyhedralGridIterator< 0, const Grid, All_Partition > HierarchicIteratorImpl Definition: grid.hh:90 Dune::EntityIterator< 0, const Grid, HierarchicIteratorImpl > HierarchicIterator Definition: grid.hh:91 Dune::IntersectionIterator< const Grid, LevelIntersectionIteratorImpl, LevelIntersectionImpl > LevelIntersectionIterator Definition: grid.hh:88 PolyhedralGridIndexSet< dim, dimworld, ctype > LeafIndexSet Definition: grid.hh:124 Dune::Communication< MPICommunicator > Communication Definition: grid.hh:131 Dune::IntersectionIterator< const Grid, LeafIntersectionIteratorImpl, LeafIntersectionImpl > LeafIntersectionIterator Definition: grid.hh:87 PolyhedralGridIntersection< const Grid > LevelIntersectionImpl Definition: grid.hh:80 PolyhedralGridIntersectionIterator< const Grid > LeafIntersectionIteratorImpl Definition: grid.hh:81 Dune::Intersection< const Grid, LeafIntersectionImpl > LeafIntersection Definition: grid.hh:84 PolyhedralGridIntersectionIterator< const Grid > LevelIntersectionIteratorImpl Definition: grid.hh:82 Partition< All_Partition >::LevelGridView LevelGridView Definition: grid.hh:142 Partition< All_Partition >::LeafGridView LeafGridView Definition: grid.hh:141 PolyhedralGrid< dim, dimworld, coord_t > Grid Definition: grid.hh:64 PolyhedralGridIdSet< dim, dimworld, ctype > GlobalIdSet Definition: grid.hh:127 Dune::FieldVector< ctype, dimensionworld > GlobalCoordinate Definition: grid.hh:77 Dune::Communication< MPICommunicator > CollectiveCommunication Definition: grid.hh:132 static const int dimensionworld Definition: grid.hh:75 PolyhedralGridIntersection< const Grid > LeafIntersectionImpl Definition: grid.hh:79 Dune::MPIHelper::MPICommunicator MPICommunicator Definition: grid.hh:130 Dune::Intersection< const Grid, LevelIntersectionImpl > LevelIntersection Definition: grid.hh:85 PolyhedralGridIndexSet< dim, dimworld, ctype > LevelIndexSet Definition: grid.hh:125 Definition: grid.hh:61 Definition: UnstructuredGrid.h:101 Definition: preprocess.h:56 |