21 #ifndef OPM_AUTODIFF_GRIDHELPERS_HEADER_INCLUDED
22 #define OPM_AUTODIFF_GRIDHELPERS_HEADER_INCLUDED
26 #include <opm/core/grid.h>
27 #include <opm/core/grid/GridHelpers.hpp>
29 #include <opm/common/utility/platform_dependent/disable_warnings.h>
31 #include <Eigen/Eigen>
32 #include <Eigen/Sparse>
34 #include <boost/range/iterator_range.hpp>
37 #include <dune/grid/CpGrid.hpp>
38 #include <dune/grid/cpgrid/GridHelpers.hpp>
39 #include <dune/grid/polyhedralgrid.hh>
42 #include <opm/common/utility/platform_dependent/reenable_warnings.h>
48 namespace AutoDiffGrid
60 Eigen::Array<double, Eigen::Dynamic, 1>
61 cellCentroidsZToEigen(
const UnstructuredGrid& grid);
66 :
public Opm::UgGridHelpers::Cell2FacesTraits<T>
74 void extractInternalFaces(
const UnstructuredGrid& grid,
75 Eigen::Array<int, Eigen::Dynamic, 1>& internal_faces,
76 Eigen::Array<int, Eigen::Dynamic, 2, Eigen::RowMajor>& nbi);
85 namespace AutoDiffGrid
90 Eigen::Array<double, Eigen::Dynamic, 1>
91 cellCentroidsZToEigen(
const Dune::CpGrid& grid);
94 struct ADCell2FacesTraits<Dune::CpGrid>
96 typedef Dune::cpgrid::Cell2FacesContainer Type;
103 void extractInternalFaces(
const Dune::CpGrid& grid,
104 Eigen::Array<int, Eigen::Dynamic, 1>& internal_faces,
105 Eigen::Array<int, Eigen::Dynamic, 2, Eigen::RowMajor>& nbi);
108 struct ADFaceCellTraits<Dune::CpGrid>
109 :
public Opm::UgGridHelpers::FaceCellTraits<Dune::CpGrid>
112 ADFaceCellTraits<Dune::CpGrid>::Type
113 faceCellsToEigen(
const Dune::CpGrid& grid);
120 namespace AutoDiffGrid
123 using Opm::UgGridHelpers::SparseTableView;
124 using Opm::UgGridHelpers::numCells;
125 using Opm::UgGridHelpers::faceCells;
126 using Opm::UgGridHelpers::numFaces;
127 using Opm::UgGridHelpers::dimensions;
128 using Opm::UgGridHelpers::cartDims;
129 using Opm::UgGridHelpers::globalCell;
130 using Opm::UgGridHelpers::cell2Faces;
131 using Opm::UgGridHelpers::increment;
132 using Opm::UgGridHelpers::getCoordinate;
133 using Opm::UgGridHelpers::numCellFaces;
134 using Opm::UgGridHelpers::beginFaceCentroids;
135 using Opm::UgGridHelpers::beginCellCentroids;
136 using Opm::UgGridHelpers::cellCentroid;
137 using Opm::UgGridHelpers::faceCentroid;
138 using Opm::UgGridHelpers::beginCellVolumes;
139 using Opm::UgGridHelpers::cellVolume;
144 typedef Eigen::Array<int, Eigen::Dynamic, 2, Eigen::RowMajor> Type;
149 template<
int dim,
int dimworld >
158 ADFaceCellTraits<UnstructuredGrid>::Type
159 faceCellsToEigen(
const UnstructuredGrid& grid);
Mapps a grid type to the corresponding face to cell mapping.
Definition: GridHelpers.hpp:55
Mapping of the grid type to the type of the cell to faces mapping.
Definition: GridHelpers.hpp:65