38#ifndef OPM_CPGRID_HEADER
39#define OPM_CPGRID_HEADER
44#include <unordered_set>
45#include <opm/grid/utility/ErrorMacros.hpp>
48#include <opm/grid/utility/platform_dependent/disable_warnings.h>
50#include <dune/common/version.hh>
53#if DUNE_VERSION_NEWER(DUNE_GRID, 2, 7)
54#include <dune/common/parallel/variablesizecommunicator.hh>
56#include <opm/grid/utility/VariableSizeCommunicator.hpp>
60#include <dune/grid/common/capabilities.hh>
61#include <dune/grid/common/grid.hh>
62#include <dune/grid/common/gridenums.hh>
64#include <opm/grid/utility/platform_dependent/reenable_warnings.h>
66#include "cpgrid/Intersection.hpp"
67#include "cpgrid/Entity.hpp"
68#include "cpgrid/Geometry.hpp"
69#include "cpgrid/Iterators.hpp"
70#include "cpgrid/Indexsets.hpp"
71#include "cpgrid/DefaultGeometryPolicy.hpp"
72#include "common/GridEnums.hpp"
73#include "common/Volumes.hpp"
76#include <opm/grid/utility/OpmParserIncludes.hpp>
142 template <PartitionIteratorType pitype>
154 template <PartitionIteratorType pitype>
160 typedef Dune::GridView<DefaultLeafGridViewTraits<CpGrid> >
LeafGridView;
167 typedef Dune::GridView<DefaultLeafGridViewTraits<CpGrid> >
LeafGridView;
181#if DUNE_VERSION_NEWER(DUNE_GRID, 2, 7)
182 using Communication = Dune::Communication<MPICommunicator>;
183 using CollectiveCommunication = Communication;
185 using CollectiveCommunication = Dune::CollectiveCommunication<MPICommunicator>;
186 using Communication = Dune::CollectiveCommunication<MPICommunicator>;
209 :
public GridDefaultImplementation<3, 3, double, CpGridFamily >
266 Opm::EclipseState* ecl_state,
267 bool periodic_extension,
bool turn_normals,
bool clip_z,
290 Opm::EclipseState* ecl_state,
291 bool periodic_extension,
bool turn_normals =
false,
bool clip_z =
false);
312 const std::array<double, 3>& cellsize);
319 return current_view_data_->logical_cartesian_size_;
331 return current_view_data_->global_cell_;
341 void getIJK(
const int c, std::array<int,3>& ijk)
const
343 current_view_data_->
getIJK(c, ijk);
386 typename Traits::template Codim<codim>::LevelIterator
lbegin (
int level)
const
389 DUNE_THROW(GridError,
"levelIndexSet of nonexisting level " << level <<
" requested!");
396 typename Traits::template Codim<codim>::LevelIterator
lend (
int level)
const
399 DUNE_THROW(GridError,
"levelIndexSet of nonexisting level " << level <<
" requested!");
406 template<
int codim, PartitionIteratorType PiType>
407 typename Traits::template Codim<codim>::template Partition<PiType>::LevelIterator
lbegin (
int level)
const
410 DUNE_THROW(GridError,
"levelIndexSet of nonexisting level " << level <<
" requested!");
416 template<
int codim, PartitionIteratorType PiType>
417 typename Traits::template Codim<codim>::template Partition<PiType>::LevelIterator
lend (
int level)
const
420 DUNE_THROW(GridError,
"levelIndexSet of nonexisting level " << level <<
" requested!");
427 typename Traits::template Codim<codim>::LeafIterator
leafbegin()
const
435 typename Traits::template Codim<codim>::LeafIterator
leafend()
const
442 template<
int codim, PartitionIteratorType PiType>
443 typename Traits::template Codim<codim>::template Partition<PiType>::LeafIterator
leafbegin()
const
450 template<
int codim, PartitionIteratorType PiType>
451 typename Traits::template Codim<codim>::template Partition<PiType>::LeafIterator
leafend()
const
458 int size (
int level,
int codim)
const
461 DUNE_THROW(GridError,
"levelIndexSet of nonexisting level " << level <<
" requested!");
469 return current_view_data_->
size(codim);
474 int size (
int level, GeometryType type)
const
477 DUNE_THROW(GridError,
"levelIndexSet of nonexisting level " << level <<
" requested!");
483 int size (GeometryType type)
const
485 return current_view_data_->
size(type);
492 return global_id_set_;
499 return global_id_set_;
507 DUNE_THROW(GridError,
"levelIndexSet of nonexisting level " << level <<
" requested!");
508 return *current_view_data_->index_set_;
515 return *current_view_data_->index_set_;
522 std::cout <<
"Warning: Global refinement not implemented, yet." << std::endl;
525 const std::vector< Dune :: GeometryType >& geomTypes(
const int codim )
const
610 return current_view_data_->unique_boundary_ids_.size();
614 unsigned int numBndSegs = 0;
616 for (
int i = 0; i < num_faces; ++i) {
618 if (current_view_data_->face_to_cell_[face].
size() == 1) {
626 void setZoltanParams(
const std::map<std::string,std::string>& params)
628 zoltanParams = params;
641 return get<0>(scatterGrid(
defaultTransEdgeWgt,
false,
nullptr,
false,
nullptr,
true, overlapLayers, useZoltan ));
665 std::pair<bool, std::vector<std::pair<std::string,bool> > >
667 const double* transmissibilities =
nullptr,
668 int overlapLayers=1,
bool useZoltan=
true)
670 return scatterGrid(
defaultTransEdgeWgt,
false, wells,
false, transmissibilities,
false, overlapLayers, useZoltan);
698 std::pair<bool, std::vector<std::pair<std::string,bool> > >
700 const double* transmissibilities =
nullptr,
bool ownersFirst=
false,
701 bool addCornerCells=
false,
int overlapLayers=1,
702 bool useZoltan =
true)
704 return scatterGrid(method, ownersFirst, wells,
false, transmissibilities, addCornerCells, overlapLayers, useZoltan);
726 template<
class DataHandle>
727 std::pair<bool, std::vector<std::pair<std::string,bool> > >
729 const std::vector<cpgrid::OpmWellType> * wells,
730 const double* transmissibilities =
nullptr,
731 int overlapLayers=1,
bool useZoltan =
true)
733 auto ret =
loadBalance(wells, transmissibilities, overlapLayers, useZoltan);
770 template<
class DataHandle>
771 std::pair<bool, std::vector<std::pair<std::string,bool> > >
773 const std::vector<cpgrid::OpmWellType> * wells,
774 bool serialPartitioning,
775 const double* transmissibilities =
nullptr,
bool ownersFirst=
false,
776 bool addCornerCells=
false,
int overlapLayers=1,
bool useZoltan =
true,
777 double zoltanImbalanceTol = 1.1,
778 bool allowDistributedWells =
false)
780 auto ret = scatterGrid(method, ownersFirst, wells, serialPartitioning, transmissibilities,
781 addCornerCells, overlapLayers, useZoltan, zoltanImbalanceTol, allowDistributedWells);
806 template<
class DataHandle>
807 std::pair<bool, std::vector<std::pair<std::string,bool> > >
809 const std::vector<cpgrid::OpmWellType> * wells,
810 bool ownersFirst=
false,
811 bool addCornerCells=
false,
int overlapLayers=1)
817 addCornerCells, overlapLayers,
false,
835 template<
class DataHandle>
837#
if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 7)
838 decltype(data.fixedSize(0,0)) overlapLayers=1,
bool useZoltan =
true)
840 decltype(data.fixedsize(0,0)) overlapLayers=1,
bool useZoltan =
true)
864 bool loadBalance(
const std::vector<int>& parts,
bool ownersFirst=
false,
865 bool addCornerCells=
false,
int overlapLayers=1)
871 addCornerCells, overlapLayers,
false,
888 template<
class DataHandle>
889 bool loadBalance(DataHandle& data,
const std::vector<int>& parts,
bool ownersFirst=
false,
890 bool addCornerCells=
false,
int overlapLayers=1)
892 bool ret =
loadBalance(parts, ownersFirst, addCornerCells, overlapLayers);
906 const double* transmissibilities,
int numParts,
907 const double zoltanImbalanceTol);
916 template<
class DataHandle>
917 void communicate (DataHandle& data, InterfaceType iftype, CommunicationDirection dir,
int )
const
929 template<
class DataHandle>
930 void communicate (DataHandle& data, InterfaceType iftype, CommunicationDirection dir)
const
932 current_view_data_->
communicate(data, iftype, dir);
936 const typename CpGridTraits::Communication&
comm ()
const
938 return current_view_data_->ccobj_;
952 typedef Dune::FieldVector<double, 3> Vector;
955 const std::vector<double>& zcornData()
const {
964 return current_view_data_->cell_to_face_.
size();
969 return current_view_data_->face_to_cell_.
size();
974 return current_view_data_->geomVector<3>().
size();
992 return current_view_data_->cell_to_face_[
cpgrid::EntityRep<0>(cell,
true)][local_index].index();
1018 bool a = (local_index == 0);
1019 bool b = r[0].orientation();
1020 bool use_first = a ? b : !b;
1022 int r_size = r.size();
1025 if(r[0].index()==std::numeric_limits<int>::max()){
1030 if(r.size()>1 && r[1].index()==std::numeric_limits<int>::max())
1036 return use_first ? r[0].index() : r[1].index();
1038 return use_first ? r[index].index() : -1;
1049 return current_view_data_->cell_to_face_.
dataSize();
1051 int numFaceVertices(
int face)
const
1053 return current_view_data_->face_to_point_[face].
size();
1061 return current_view_data_->face_to_point_[face][local_index];
1070 const int nv = current_view_data_->cell_to_point_[cell_index].size();
1072 for (
int i=0; i<nv; ++i) {
1073 zz +=
vertexPosition(current_view_data_->cell_to_point_[cell_index][i])[nd-1];
1078 const Vector faceCenterEcl(
int cell_index,
int face)
const
1093 static const int faceVxMap[ 6 ][ 4 ] = { {0, 2, 4, 6},
1102 assert (current_view_data_->cell_to_point_[cell_index].size() == 8);
1104 for(
int i=0; i<4; ++i )
1106 center +=
vertexPosition(current_view_data_->cell_to_point_[cell_index][ faceVxMap[ face ][ i ] ]);
1109 for (
int i=0; i<3; ++i) {
1116 const Vector faceAreaNormalEcl(
int face)
const
1119 const int nd = Vector::dimension;
1120 const int nv = numFaceVertices(face);
1134 Vector areaNormal =
cross(a,b);
1135 for (
int i=0; i<nd; ++i) {
1145 Vector areaNormal =
cross(a,b);
1153 int k = (nv % 2) ? 0 : nv - 1;
1155 Vector areaNormal(0.0);
1157 for (
int i = 1; i < h; ++i)
1159 Vector a =
vertexPosition(current_view_data_->face_to_point_[face][2*i]) -
vertexPosition(current_view_data_->face_to_point_[face][0]);
1160 Vector b =
vertexPosition(current_view_data_->face_to_point_[face][2*i+1]) -
vertexPosition(current_view_data_->face_to_point_[face][2*i-1]);
1161 areaNormal +=
cross(a,b);
1165 Vector a =
vertexPosition(current_view_data_->face_to_point_[face][2*h]) -
vertexPosition(current_view_data_->face_to_point_[face][0]);
1166 Vector b =
vertexPosition(current_view_data_->face_to_point_[face][k]) -
vertexPosition(current_view_data_->face_to_point_[face][2*h-1]);
1167 areaNormal +=
cross(a,b);
1202 return current_view_data_->face_normals_.get(face);
1221 :
public RandomAccessIteratorFacade<CentroidIterator<codim>,
1222 FieldVector<double, 3>,
1223 const FieldVector<double, 3>&, int>
1227 typedef typename std::vector<
cpgrid::Geometry<3-codim, 3> >::const_iterator
1235 const FieldVector<double, 3>& dereference()
const
1237 return iter_->center();
1243 const FieldVector<double, 3>& elementAt(
int n)
1245 return iter_[n]->center();
1281 int boundaryId(
int face)
const
1290 if (current_view_data_->face_to_cell_[f].
size() == 1) {
1293 ret = current_view_data_->unique_boundary_ids_[f];
1296 const bool normal_is_in =
1297 !(current_view_data_->face_to_cell_[f][0].orientation());
1298 enum face_tag tag = current_view_data_->face_tag_[f];
1302 ret = normal_is_in ? 1 : 2;
1306 ret = normal_is_in ? 3 : 4;
1311 ret = normal_is_in ? 5 : 6;
1316 OPM_THROW(std::logic_error,
"NNC face at boundary. This should never happen!");
1329 template<
class Cell2FacesRowIterator>
1331 faceTag(
const Cell2FacesRowIterator& cell_face)
const
1342 const int cell = cell_face.getCellIndex();
1343 const int face = *cell_face;
1344 assert (0 <= cell); assert (cell <
numCells());
1345 assert (0 <= face); assert (face <
numFaces());
1350 const F2C& f2c = current_view_data_->face_to_cell_[f];
1351 const face_tag tag = current_view_data_->face_tag_[f];
1353 assert ((f2c.size() == 1) || (f2c.size() == 2));
1355 int inside_cell = 0;
1357 if ( f2c.size() == 2 )
1359 if ( f2c[1].index() == cell )
1364 const bool normal_is_in = ! f2c[inside_cell].orientation();
1369 return normal_is_in ? 0 : 1;
1372 return normal_is_in ? 2 : 3;
1376 return normal_is_in ? 4 : 5;
1381 OPM_THROW(std::logic_error,
"Unhandled face tag. This should never happen!");
1405 template<
class DataHandle>
1409 if(distributed_data_.empty())
1410 OPM_THROW(std::runtime_error,
"Moving Data only allowed with a load balanced grid!");
1425 template<
class DataHandle>
1429 if(distributed_data_.empty())
1430 OPM_THROW(std::runtime_error,
"Moving Data only allowed with a load balance grid!");
1431 distributed_data_[0]->gatherData(handle, data_[0].get(), distributed_data_[0].get());
1438#if DUNE_VERSION_NEWER(DUNE_GRID, 2, 7)
1440 using InterfaceMap = VariableSizeCommunicator<>::InterfaceMap;
1443 using InterfaceMap = Opm::VariableSizeCommunicator<>::InterfaceMap;
1483 return *cell_scatter_gather_interfaces_;
1490 return *point_scatter_gather_interfaces_;
1496 current_view_data_=data_[0].get();
1502 if (distributed_data_.empty())
1503 OPM_THROW(std::logic_error,
"No distributed view available in grid");
1504 current_view_data_=distributed_data_[0].get();
1510 typedef cpgrid::CpGridData::ParallelIndexSet ParallelIndexSet;
1512 typedef cpgrid::CpGridData::RemoteIndices RemoteIndices;
1515 using CommunicationType = cpgrid::CpGridData::CommunicationType;
1520 const CommunicationType& cellCommunication()
const
1522 return current_view_data_->cellCommunication();
1525 ParallelIndexSet& getCellIndexSet()
1527 return current_view_data_->cellIndexSet();
1530 RemoteIndices& getCellRemoteIndices()
1532 return current_view_data_->cellRemoteIndices();
1535 const ParallelIndexSet& getCellIndexSet()
const
1537 return current_view_data_->cellIndexSet();
1540 const RemoteIndices& getCellRemoteIndices()
const
1542 return current_view_data_->cellRemoteIndices();
1579 std::pair<bool, std::vector<std::pair<std::string,bool> > >
1582 const std::vector<cpgrid::OpmWellType> * wells,
1583 bool serialPartitioning,
1584 const double* transmissibilities,
1585 bool addCornerCells,
1587 bool useZoltan =
true,
1588 double zoltanImbalanceTol = 1.1,
1589 bool allowDistributedWells =
true,
1590 const std::vector<int>& input_cell_part = {});
1596 std::vector<std::shared_ptr<cpgrid::CpGridData>> data_;
1598 cpgrid::CpGridData* current_view_data_;
1600 std::vector<std::shared_ptr<cpgrid::CpGridData>> distributed_data_;
1606 std::shared_ptr<InterfaceMap> cell_scatter_gather_interfaces_;
1612 std::shared_ptr<InterfaceMap> point_scatter_gather_interfaces_;
1616 cpgrid::GlobalIdSet global_id_set_;
1621 std::map<std::string,std::string> zoltanParams;
1627 namespace Capabilities
1633 static const bool v =
true;
1640 static const bool v =
true;
1646 static const bool v =
true;
1652 static const bool v =
true;
1659 static const bool v =
false;
1673#include <opm/grid/cpgrid/PersistentContainer.hpp>
1674#include <opm/grid/cpgrid/CartesianIndexMapper.hpp>
An iterator over the centroids of the geometry of the entities.
Definition: CpGrid.hpp:1224
CentroidIterator(GeometryIterator iter)
Constructs a new iterator from an iterator over the geometries.
Definition: CpGrid.hpp:1231
std::vector< cpgrid::Geometry< 3-codim, 3 > >::const_iterator GeometryIterator
The type of the iterator over the codim geometries.
Definition: CpGrid.hpp:1228
[ provides Dune::Grid ]
Definition: CpGrid.hpp:210
std::string name() const
Get the grid name.
Definition: CpGrid.hpp:370
CentroidIterator< 0 > beginCellCentroids() const
Get an iterator over the cell centroids positioned at the first one.
Definition: CpGrid.hpp:1269
std::pair< bool, std::vector< std::pair< std::string, bool > > > loadBalance(EdgeWeightMethod method, const std::vector< cpgrid::OpmWellType > *wells, const double *transmissibilities=nullptr, bool ownersFirst=false, bool addCornerCells=false, int overlapLayers=1, bool useZoltan=true)
Distributes this grid over the available nodes in a distributed machine.
Definition: CpGrid.hpp:699
void switchToGlobalView()
Switch to the global view.
Definition: CpGrid.hpp:1494
void readSintefLegacyFormat(const std::string &grid_prefix)
Read the Sintef legacy grid format ('topogeom').
Definition: CpGrid.cpp:527
unsigned int numBoundarySegments() const
returns the number of boundary segments within the macro grid
Definition: CpGrid.hpp:606
CpGridFamily GridFamily
Family typedef, why is this not defined by Grid<>?
Definition: CpGrid.hpp:221
Traits::template Codim< codim >::LevelIterator lbegin(int level) const
Iterator to first entity of given codim on level.
Definition: CpGrid.hpp:386
void gatherData(DataHandle &handle) const
Moves data from the distributed view to the global (all data on process) view.
Definition: CpGrid.hpp:1426
CentroidIterator< 1 > beginFaceCentroids() const
Get an iterator over the face centroids positioned at the first one.
Definition: CpGrid.hpp:1275
void globalRefine(int)
global refinement
Definition: CpGrid.hpp:520
int size(GeometryType type) const
number of leaf entities per geometry type in this process
Definition: CpGrid.hpp:483
int faceTag(const Cell2FacesRowIterator &cell_face) const
Get the cartesian tag associated with a face tag.
Definition: CpGrid.hpp:1331
void setUniqueBoundaryIds(bool uids)
Set whether we want to have unique boundary ids.
Definition: CpGrid.hpp:357
Traits::template Codim< codim >::LeafIterator leafend() const
one past the end of the sequence of leaf entities
Definition: CpGrid.hpp:435
void processEclipseFormat(const grdecl &input_data, bool remove_ij_boundary, bool turn_normals=false)
Read the Eclipse grid format ('grdecl').
Definition: CpGrid.cpp:572
unsigned int overlapSize(int) const
Size of the overlap on the leaf level.
Definition: CpGrid.hpp:583
Traits::template Codim< codim >::LevelIterator lend(int level) const
one past the end on this level
Definition: CpGrid.hpp:396
int numCellFaces() const
Get the sum of all faces attached to all cells.
Definition: CpGrid.hpp:1047
const std::vector< int > & globalCell() const
Retrieve mapping from internal ("compressed") active grid cells to external ("uncompressed") cells.
Definition: CpGrid.hpp:329
std::pair< bool, std::vector< std::pair< std::string, bool > > > loadBalance(DataHandle &data, const std::vector< int > &parts, const std::vector< cpgrid::OpmWellType > *wells, bool ownersFirst=false, bool addCornerCells=false, int overlapLayers=1)
Distributes this grid over the available nodes in a distributed machine.
Definition: CpGrid.hpp:808
const Traits::LocalIdSet & localIdSet() const
Access to the LocalIdSet.
Definition: CpGrid.hpp:497
int maxLevel() const
Return maximum level defined in this grid.
Definition: CpGrid.hpp:378
const CpGridTraits::Communication & comm() const
Get the collective communication object.
Definition: CpGrid.hpp:936
double faceArea(int face) const
Get the area of a face.
Definition: CpGrid.hpp:1187
const Vector & vertexPosition(int vertex) const
Get the Position of a vertex.
Definition: CpGrid.hpp:1181
int size(int level, int codim) const
Number of grid entities per level and codim.
Definition: CpGrid.hpp:458
const std::array< int, 3 > & logicalCartesianSize() const
The logical cartesian size of the global grid.
Definition: CpGrid.hpp:317
int faceVertex(int face, int local_index) const
Get the index identifying a vertex of a face.
Definition: CpGrid.hpp:1059
bool loadBalance(int overlapLayers=1, bool useZoltan=true)
Distributes this grid over the available nodes in a distributed machine.
Definition: CpGrid.hpp:638
std::vector< int > zoltanPartitionWithoutScatter(const std::vector< cpgrid::OpmWellType > *wells, const double *transmissibilities, int numParts, const double zoltanImbalanceTol)
Partitions the grid using Zoltan without decomposing and distributing it among processes.
Definition: CpGrid.cpp:139
bool loadBalance(DataHandle &data, decltype(data.fixedsize(0, 0)) overlapLayers=1, bool useZoltan=true)
Distributes this grid and data over the available nodes in a distributed machine.
Definition: CpGrid.hpp:836
const Vector & faceCentroid(int face) const
Get the coordinates of the center of a face.
Definition: CpGrid.hpp:1193
unsigned int ghostSize(int, int) const
Size of the ghost cell layer on a given level.
Definition: CpGrid.hpp:601
const InterfaceMap & cellScatterGatherInterface() const
Get an interface for gathering/scattering data attached to cells with communication.
Definition: CpGrid.hpp:1481
int numVertices() const
Get The number of vertices.
Definition: CpGrid.hpp:972
void getIJK(const int c, std::array< int, 3 > &ijk) const
Extract Cartesian index triplet (i,j,k) of an active cell.
Definition: CpGrid.hpp:341
int cellFace(int cell, int local_index) const
Get a specific face of a cell.
Definition: CpGrid.hpp:990
bool uniqueBoundaryIds() const
Is the grid currently using unique boundary ids?
Definition: CpGrid.hpp:350
std::pair< bool, std::vector< std::pair< std::string, bool > > > loadBalance(const std::vector< cpgrid::OpmWellType > *wells, const double *transmissibilities=nullptr, int overlapLayers=1, bool useZoltan=true)
Distributes this grid over the available nodes in a distributed machine.
Definition: CpGrid.hpp:666
Traits::template Codim< codim >::template Partition< PiType >::LevelIterator lend(int level) const
one past the end on this level
Definition: CpGrid.hpp:417
std::pair< bool, std::vector< std::pair< std::string, bool > > > loadBalance(DataHandle &data, EdgeWeightMethod method, const std::vector< cpgrid::OpmWellType > *wells, bool serialPartitioning, const double *transmissibilities=nullptr, bool ownersFirst=false, bool addCornerCells=false, int overlapLayers=1, bool useZoltan=true, double zoltanImbalanceTol=1.1, bool allowDistributedWells=false)
Distributes this grid over the available nodes in a distributed machine.
Definition: CpGrid.hpp:772
void createCartesian(const std::array< int, 3 > &dims, const std::array< double, 3 > &cellsize)
Create a cartesian grid.
Definition: CpGrid.cpp:469
const Traits::GlobalIdSet & globalIdSet() const
Access to the GlobalIdSet.
Definition: CpGrid.hpp:490
cpgrid::Entity< codim > entity(const cpgrid::Entity< codim > &seed) const
given an EntitySeed (or EntityPointer) return an entity object
Definition: CpGrid.hpp:532
int faceCell(int face, int local_index) const
Get the index identifying a cell attached to a face.
Definition: CpGrid.hpp:1011
int numCellFaces(int cell) const
Get the number of faces of a cell.
Definition: CpGrid.hpp:982
Traits::template Codim< codim >::template Partition< PiType >::LeafIterator leafbegin() const
Iterator to first leaf entity of given codim.
Definition: CpGrid.hpp:443
unsigned int overlapSize(int, int) const
Size of the overlap on a given level.
Definition: CpGrid.hpp:595
void writeSintefLegacyFormat(const std::string &grid_prefix) const
Write the Sintef legacy grid format ('topogeom').
Definition: CpGrid.cpp:537
unsigned int ghostSize(int) const
Size of the ghost cell layer on the leaf level.
Definition: CpGrid.hpp:589
void communicate(DataHandle &data, InterfaceType iftype, CommunicationDirection dir) const
The new communication interface.
Definition: CpGrid.hpp:930
const Vector & cellCentroid(int cell) const
Get the coordinates of the center of a cell.
Definition: CpGrid.hpp:1212
std::pair< bool, std::vector< std::pair< std::string, bool > > > loadBalance(DataHandle &data, const std::vector< cpgrid::OpmWellType > *wells, const double *transmissibilities=nullptr, int overlapLayers=1, bool useZoltan=true)
Distributes this grid and data over the available nodes in a distributed machine.
Definition: CpGrid.hpp:728
Traits::template Codim< codim >::LeafIterator leafbegin() const
Iterator to first leaf entity of given codim.
Definition: CpGrid.hpp:427
const Vector & faceNormal(int face) const
Get the unit normal of a face.
Definition: CpGrid.hpp:1200
CpGrid()
Default constructor.
Definition: CpGrid.cpp:119
Traits::template Codim< codim >::template Partition< PiType >::LevelIterator lbegin(int level) const
Iterator to first entity of given codim on level.
Definition: CpGrid.hpp:407
const std::vector< int > & sortedNumAquiferCells() const
Get sorted active cell indices of numerical aquifer.
Definition: CpGrid.hpp:1548
void switchToDistributedView()
Switch to the distributed view.
Definition: CpGrid.hpp:1500
bool loadBalance(DataHandle &data, const std::vector< int > &parts, bool ownersFirst=false, bool addCornerCells=false, int overlapLayers=1)
Distributes this grid and data over the available nodes in a distributed machine.
Definition: CpGrid.hpp:889
const Traits::LeafIndexSet & leafIndexSet() const
Access to the LeafIndexSet.
Definition: CpGrid.hpp:513
const cpgrid::OrientedEntityTable< 0, 1 >::row_type cellFaceRow(int cell) const
Get a list of indices identifying all faces of a cell.
Definition: CpGrid.hpp:997
int numCells() const
Get the number of cells.
Definition: CpGrid.hpp:962
bool loadBalance(const std::vector< int > &parts, bool ownersFirst=false, bool addCornerCells=false, int overlapLayers=1)
Distributes this grid over the available nodes in a distributed machine.
Definition: CpGrid.hpp:864
int size(int level, GeometryType type) const
number of entities per level and geometry type in this process
Definition: CpGrid.hpp:474
int numFaces() const
Get the number of faces.
Definition: CpGrid.hpp:967
double cellCenterDepth(int cell_index) const
Get vertical position of cell center ("zcorn" average).
Definition: CpGrid.hpp:1065
void communicate(DataHandle &data, InterfaceType iftype, CommunicationDirection dir, int) const
The new communication interface.
Definition: CpGrid.hpp:917
const Traits::LevelIndexSet & levelIndexSet(int level) const
Access to the LevelIndexSets.
Definition: CpGrid.hpp:504
int size(int codim) const
number of leaf entities per codim in this process
Definition: CpGrid.hpp:467
const InterfaceMap & pointScatterGatherInterface() const
Get an interface for gathering/scattering data attached to points with communication.
Definition: CpGrid.hpp:1488
Traits::template Codim< codim >::template Partition< PiType >::LeafIterator leafend() const
one past the end of the sequence of leaf entities
Definition: CpGrid.hpp:451
double cellVolume(int cell) const
Get the volume of the cell.
Definition: CpGrid.hpp:1206
void scatterData(DataHandle &handle) const
Moves data from the global (all data on process) view to the distributed view.
Definition: CpGrid.hpp:1406
std::map< int, std::list< int > > InterfaceMap
The type of the map describing communication interfaces.
Definition: CpGrid.hpp:1450
Struct that hods all the data needed to represent a Cpgrid.
Definition: CpGridData.hpp:123
void communicate(DataHandle &data, InterfaceType iftype, CommunicationDirection dir)
communicate objects for all codims on a given level
Definition: CpGridData.hpp:614
bool uniqueBoundaryIds() const
Is the grid currently using unique boundary ids?
Definition: CpGridData.hpp:249
int size(int codim) const
number of leaf entities per codim in this process
Definition: CpGridData.cpp:144
void getIJK(int c, std::array< int, 3 > &ijk) const
Extract Cartesian index triplet (i,j,k) of an active cell.
Definition: CpGridData.hpp:235
const std::vector< double > & zcornData() const
Return the internalized zcorn copy from the grid processing, if no cells were adjusted during the min...
Definition: CpGridData.hpp:267
void setUniqueBoundaryIds(bool uids)
Set whether we want to have unique boundary ids.
Definition: CpGridData.hpp:256
const std::vector< int > & sortedNumAquiferCells() const
Get sorted active cell indices of numerical aquifer.
Definition: CpGridData.hpp:368
Represents an entity of a given codim, with positive or negative orientation.
Definition: EntityRep.hpp:98
This class encapsulates geometry for both vertices, intersections and cells.
Definition: Geometry.hpp:71
The global id set for Dune.
Definition: Indexsets.hpp:325
Only needs to provide interface for doing nothing.
Definition: Iterators.hpp:104
Definition: Indexsets.hpp:54
Definition: Intersection.hpp:288
Definition: Intersection.hpp:66
Iterator intended to be used as LeafIterator and LevelIterator (no difference due to no adaptivity) f...
Definition: Iterators.hpp:56
A class used as a row type for OrientedEntityTable.
Definition: OrientedEntityTable.hpp:55
int size() const
Returns the number of rows in the table.
Definition: SparseTable.hpp:121
int dataSize() const
Returns the number of data elements.
Definition: SparseTable.hpp:141
int size() const
Returns the number of rows in the table.
Definition: SparseTable.hpp:121
Copyright 2019 Equinor AS.
Definition: CartesianIndexMapper.hpp:10
FieldVector< T, 3 > cross(const FieldVector< T, 3 > &a, const FieldVector< T, 3 > &b)
Definition: Volumes.hpp:58
EdgeWeightMethod
enum for choosing Methods for weighting graph-edges correspoding to cell interfaces in Zoltan's graph...
Definition: GridEnums.hpp:34
@ defaultTransEdgeWgt
Use the transmissibilities as edge weights.
Definition: GridEnums.hpp:38
Low-level corner-point processing routines and supporting data structures.
face_tag
Connection taxonomy.
Definition: preprocess.h:66
@ K_FACE
Connection topologically normal to I-J plane.
Definition: preprocess.h:69
@ J_FACE
Connection topologically normal to I-K plane.
Definition: preprocess.h:68
@ NNC_FACE
Arbitrary non-neighbouring connection.
Definition: preprocess.h:70
@ I_FACE
Connection topologically normal to J-K plane.
Definition: preprocess.h:67
Definition: CpGrid.hpp:197
Traits associated with a specific grid partition type.
Definition: CpGrid.hpp:144
cpgrid::Iterator< cd, pitype > LevelIterator
The type of the iterator over the level entities of this codim on this partition.
Definition: CpGrid.hpp:146
cpgrid::Iterator< cd, pitype > LeafIterator
The type of the iterator over the leaf entities of this codim on this partition.
Definition: CpGrid.hpp:148
Traits associated with a specific codim.
Definition: CpGrid.hpp:120
cpgrid::Entity< cd > Entity
The type of the entity.
Definition: CpGrid.hpp:129
cpgrid::Geometry< 3-cd, 3 > Geometry
The type of the geometry associated with the entity.
Definition: CpGrid.hpp:123
cpgrid::Geometry< 3-cd, 3 > LocalGeometry
The type of the local geometry associated with the entity.
Definition: CpGrid.hpp:126
cpgrid::Iterator< cd, All_Partition > LeafIterator
The type of the iterator over all leaf entities of this codim.
Definition: CpGrid.hpp:135
cpgrid::Iterator< cd, All_Partition > LevelIterator
The type of the iterator over all level entities of this codim.
Definition: CpGrid.hpp:132
cpgrid::Entity< cd > EntitySeed
The type of the entity pointer for entities of this codim.
Definition: CpGrid.hpp:138
Traits associated with a specific grid partition type.
Definition: CpGrid.hpp:156
Dune::GridView< DefaultLeafGridViewTraits< CpGrid > > LeafGridView
The type of the leaf grid view associated with this partition type.
Definition: CpGrid.hpp:160
Dune::GridView< DefaultLevelGridViewTraits< CpGrid > > LevelGridView
The type of the level grid view associated with this partition type.
Definition: CpGrid.hpp:158
Definition: CpGrid.hpp:100
cpgrid::IndexSet LevelIndexSet
The type of the level index set.
Definition: CpGrid.hpp:170
cpgrid::IntersectionIterator LeafIntersectionIterator
The type of the intersection iterator at the leafs of the grid.
Definition: CpGrid.hpp:109
Dune::GridView< DefaultLeafGridViewTraits< CpGrid > > LeafGridView
The type of the leaf grid view associated with this partition type.
Definition: CpGrid.hpp:167
Dune::GridView< DefaultLevelGridViewTraits< CpGrid > > LevelGridView
The type of the level grid view associated with this partition type.
Definition: CpGrid.hpp:165
cpgrid::GlobalIdSet GlobalIdSet
The type of the global id set.
Definition: CpGrid.hpp:174
cpgrid::IntersectionIterator LevelIntersectionIterator
The type of the intersection iterator at the levels of the grid.
Definition: CpGrid.hpp:111
cpgrid::IndexSet LeafIndexSet
The type of the leaf index set.
Definition: CpGrid.hpp:172
GlobalIdSet LocalIdSet
The type of the local id set.
Definition: CpGrid.hpp:176
Dune::MPIHelper::MPICommunicator MPICommunicator
The type of the collective communication.
Definition: CpGrid.hpp:180
cpgrid::HierarchicIterator HierarchicIterator
The type of the hierarchic iterator.
Definition: CpGrid.hpp:114
cpgrid::Intersection LevelIntersection
The type of the intersection at the levels of the grid.
Definition: CpGrid.hpp:107
cpgrid::Intersection LeafIntersection
The type of the intersection at the leafs of the grid.
Definition: CpGrid.hpp:105
CpGrid Grid
The type that implements the grid.
Definition: CpGrid.hpp:102
Raw corner-point specification of a particular geological model.
Definition: preprocess.h:56