21 #ifndef OPM_AUTODIFF_GRIDHELPERS_HEADER_INCLUDED
22 #define OPM_AUTODIFF_GRIDHELPERS_HEADER_INCLUDED
26 #include <boost/range/iterator_range.hpp>
27 #include <opm/core/grid.h>
28 #include <opm/core/grid/GridHelpers.hpp>
30 #include <opm/common/utility/platform_dependent/disable_warnings.h>
32 #include <Eigen/Eigen>
33 #include <Eigen/Sparse>
35 #ifdef HAVE_DUNE_CORNERPOINT
36 #include <dune/grid/CpGrid.hpp>
37 #include <dune/grid/cpgrid/GridHelpers.hpp>
38 #include <dune/grid/polyhedralgrid.hh>
41 #include <opm/common/utility/platform_dependent/reenable_warnings.h>
47 namespace AutoDiffGrid
59 Eigen::Array<double, Eigen::Dynamic, 1>
65 :
public Opm::UgGridHelpers::Cell2FacesTraits<T>
74 Eigen::Array<int, Eigen::Dynamic, 1>& internal_faces,
75 Eigen::Array<int, Eigen::Dynamic, 2, Eigen::RowMajor>& nbi);
80 #ifdef HAVE_DUNE_CORNERPOINT
84 namespace AutoDiffGrid
89 Eigen::Array<double, Eigen::Dynamic, 1>
93 struct ADCell2FacesTraits<Dune::CpGrid>
95 typedef Dune::cpgrid::Cell2FacesContainer Type;
103 Eigen::Array<int, Eigen::Dynamic, 1>& internal_faces,
104 Eigen::Array<int, Eigen::Dynamic, 2, Eigen::RowMajor>& nbi);
107 struct ADFaceCellTraits<Dune::CpGrid>
108 :
public Opm::UgGridHelpers::FaceCellTraits<Dune::CpGrid>
111 ADFaceCellTraits<Dune::CpGrid>::Type
119 namespace AutoDiffGrid
122 using Opm::UgGridHelpers::SparseTableView;
123 using Opm::UgGridHelpers::numCells;
124 using Opm::UgGridHelpers::faceCells;
125 using Opm::UgGridHelpers::numFaces;
126 using Opm::UgGridHelpers::dimensions;
127 using Opm::UgGridHelpers::cartDims;
128 using Opm::UgGridHelpers::globalCell;
129 using Opm::UgGridHelpers::cell2Faces;
130 using Opm::UgGridHelpers::increment;
131 using Opm::UgGridHelpers::getCoordinate;
132 using Opm::UgGridHelpers::numCellFaces;
133 using Opm::UgGridHelpers::beginFaceCentroids;
134 using Opm::UgGridHelpers::beginCellCentroids;
135 using Opm::UgGridHelpers::cellCentroid;
136 using Opm::UgGridHelpers::faceCentroid;
137 using Opm::UgGridHelpers::beginCellVolumes;
138 using Opm::UgGridHelpers::cellVolume;
143 typedef Eigen::Array<int, Eigen::Dynamic, 2, Eigen::RowMajor>
Type;
146 #ifdef HAVE_DUNE_CORNERPOINT
148 template<
int dim,
int dimworld >
Definition: AdditionalObjectDeleter.hpp:22
Eigen::Array< int, Eigen::Dynamic, 2, Eigen::RowMajor > Type
Definition: GridHelpers.hpp:143
Mapps a grid type to the corresponding face to cell mapping.
Definition: GridHelpers.hpp:54
ADFaceCellTraits< UnstructuredGrid >::Type faceCellsToEigen(const UnstructuredGrid &grid)
Get the face to cell mapping of a grid.
Mapping of the grid type to the type of the cell to faces mapping.
Definition: GridHelpers.hpp:64
Eigen::Array< double, Eigen::Dynamic, 1 > cellCentroidsZToEigen(const UnstructuredGrid &grid)
Get the z coordinates of the cell centroids of a grid.
void extractInternalFaces(const UnstructuredGrid &grid, Eigen::Array< int, Eigen::Dynamic, 1 > &internal_faces, Eigen::Array< int, Eigen::Dynamic, 2, Eigen::RowMajor > &nbi)
extracts the internal faces of a grid.