21 #ifndef OPM_CORE_GRIDHELPERS_HEADER_INCLUDED
22 #define OPM_CORE_GRIDHELPERS_HEADER_INCLUDED
24 #include <dune/common/fvector.hh>
28 #include <opm/grid/utility/OpmParserIncludes.hpp>
30 #include <opm/grid/utility/platform_dependent/disable_warnings.h>
31 #include <boost/range/iterator_range.hpp>
32 #include <opm/grid/utility/platform_dependent/reenable_warnings.h>
37 namespace UgGridHelpers
48 class IntRange :
public boost::iterator_range<const int*>
51 typedef boost::iterator_range<const int*> BaseRowType;
52 typedef BaseRowType::size_type size_type;
53 typedef int value_type;
55 IntRange(
const int* start_arg,
const int* end_arg)
56 : BaseRowType(start_arg, end_arg)
60 typedef boost::iterator_range<const int*>
row_type;
68 : data_(data), offset_(offset), size_(size_arg)
77 return row_type(data_ + offset_[row], data_ + offset_[row+1]);
90 return offset_[size_];
138 typedef const double* IteratorType;
139 typedef const double* ValueType;
168 Dune::FieldVector<double,3> faceAreaNormalEcl(
const UnstructuredGrid& grid,
int face_index);
203 typedef const double* IteratorType;
227 Opm::EclipseGrid createEclipseGrid(
const UnstructuredGrid& grid,
const Opm::EclipseGrid& inputGrid );
253 typedef const double* IteratorType;
254 typedef const double* ValueType;
281 int faceTag(
const UnstructuredGrid& grid, boost::iterator_range<const int*>::const_iterator cell_face);
332 int operator()(
int face_index,
int local_index)
const
334 return face_cells_[2*face_index+local_index];
337 const int* face_cells_;
363 T* increment(T* cc,
int i,
int dim)
372 T increment(
const T& t,
int i,
int)
382 double getCoordinate(T* cc,
int i)
393 double getCoordinate(T t,
int i)
row_type operator[](std::size_t row) const
Get a row of the the table.
Definition: GridHelpers.hpp:74
SparseTableView(int *data, int *offset, std::size_t size_arg)
Creates a sparse table view.
Definition: GridHelpers.hpp:67
Definition: GridHelpers.hpp:48
std::size_t noEntries() const
Get the number of non-zero entries.
Definition: GridHelpers.hpp:88
Traits of the cell centroids of a grid.
Definition: GridHelpers.hpp:131
Allows viewing a sparse table consisting out of C-array.
Definition: GridHelpers.hpp:45
Traits of the face to attached cell mappping of a grid.
Definition: GridHelpers.hpp:345
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
Maps the grid type to the associated type of the cell to faces mapping.
Definition: GridHelpers.hpp:288
Maps the grid type to the associated type of the face to vertices mapping.
Definition: GridHelpers.hpp:303
face_tag
Connection taxonomy.
Definition: preprocess.h:67
std::size_t size() const
Get the size of the table.
Definition: GridHelpers.hpp:82
Traits of the face centroids of a grid.
Definition: GridHelpers.hpp:246
Data structure for an unstructured grid, unstructured meaning that any cell may have an arbitrary num...
Definition: grid.h:98
Definition: GridHelpers.hpp:326
The mapping of the grid type to type of the iterator over the cell volumes.
Definition: GridHelpers.hpp:196
boost::iterator_range< const int * > row_type
The type of the roww.
Definition: GridHelpers.hpp:60