CpGridData.hpp
Go to the documentation of this file.
116void fieldProp_check(const Dune::CpGrid& grid, Opm::EclipseGrid eclGrid, const std::string& deck_string);
166 void ::fieldProp_check(const Dune::CpGrid& grid, Opm::EclipseGrid eclGrid, const std::string& deck_string);
194 };
201 explicit CpGridData(MPIHelper::MPICommunicator comm, std::vector<std::shared_ptr<CpGridData>>& data);
231 void readEclipseFormat(const std::string& filename, bool periodic_extension, bool turn_normals = false);
242 void processEclipseFormat(const Opm::Deck& deck, bool periodic_extension, bool turn_normals = false, bool clip_z = false,
342 bool disjointPatches(const std::vector<std::array<int,3>>& startIJK_vec, const std::vector<std::array<int,3>>& endIJK_vec) const;
352 getPatchesCells(const std::vector<std::array<int,3>>& startIJK_vec, const std::vector<std::array<int,3>>& endIJK_vec) const;
364 void validStartEndIJKs(const std::vector<std::array<int,3>>& startIJK_vec, const std::vector<std::array<int,3>>& endIJK_vec) const;
374 bool patchesShareFace(const std::vector<std::array<int,3>>& startIJK_vec, const std::vector<std::array<int,3>>& endIJK_vec) const;
376 int sharedFaceTag(const std::vector<std::array<int,3>>& startIJK_2Patches, const std::vector<std::array<int,3>>& endIJK_2Patches) const;
435 std::array<Dune::FieldVector<double,3>,8> getReferenceRefinedCorners(int idx_in_parent_cell, const std::array<int,3>& cells_per_dim) const;
444 std::array<int,3> getPatchDim(const std::array<int,3>& startIJK, const std::array<int,3>& endIJK) const;
453 std::vector<int> getPatchCorners(const std::array<int,3>& startIJK, const std::array<int,3>& endIJK) const;
462 std::vector<int> getPatchFaces(const std::array<int,3>& startIJK, const std::array<int,3>& endIJK) const;
471 std::vector<int> getPatchCells(const std::array<int,3>& startIJK, const std::array<int,3>& endIJK) const;
480 std::vector<int> getPatchBoundaryCorners(const std::array<int,3>& startIJK, const std::array<int,3>& endIJK) const;
489 std::array<std::vector<int>,6> getBoundaryPatchFaces(const std::array<int,3>& startIJK, const std::array<int,3>& endIJK) const;
492 std::array<std::vector<double>,3> getWidthsLengthsHeights(const std::array<int,3>& startIJK, const std::array<int,3>& endIJK) const;
522 // Not the nicest way of checking if "this" points at the leaf grid view of a mixed grid (with coarse and refined cells).
523 // 1. When the grid has been refined at least onece, level_data_ptr_ ->size() >1. Therefore, there is a chance of "this" pointing at the leaf grid view.
524 // 2. Unfortunately, level_ is default initialized by 0. This implies, in particular, that if someone wants to check the value of
525 // "this->level_" when "this" points at the leaf grid view of a grid that has been refined, this value is - unfortunately - equal to 0.
526 // 3. Due to 2. we need an extra bool value to distinguish between the actual level 0 grid and such a leaf grid view (with incorrect level_ == 0). For this
527 // reason we check if child_to_parent_cells_.empty() [true for actual level 0 grid, false for the leaf grid view].
579 const std::vector<std::array<int,2>>, // parent_to_refined_corners(~boundary_old_to_new_corners)
580 const std::vector<std::tuple<int,std::vector<int>>>, // parent_to_children_faces (~boundary_old_to_new_faces)
605 refinePatch(const std::array<int,3>& cells_per_dim, const std::array<int,3>& startIJK, const std::array<int,3>& endIJK) const;
825 void communicateCodim(Entity2IndexDataHandle<DataHandle, codim>& data, CommunicationDirection dir,
837 void communicateCodim(Entity2IndexDataHandle<DataHandle, codim>& data, CommunicationDirection dir,
906 std::vector<int> level_to_leaf_cells_; // In entry 'level cell index', we store 'leafview cell index' // {level LGR, {child0, child1, ...}}
908 std::vector<std::tuple<int,std::vector<int>>> parent_to_children_cells_; // {# children in x-direction, ... y-, ... z-}
1008void CpGridData::communicateCodim(Entity2IndexDataHandle<DataHandle, codim>& data, CommunicationDirection dir,
1015void CpGridData::communicateCodim(Entity2IndexDataHandle<DataHandle, codim>& data_wrapper, CommunicationDirection dir,
void refinePatch_and_check(const std::array< int, 3 > &, const std::array< int, 3 > &, const std::array< int, 3 > &) void testInactiveCellsLgrs(const std::string &, const std::vector< std::array< int, 3 > > &, const std::vector< std::array< int, 3 > > &, const std::vector< std::array< int, 3 > > &, const std::vector< std::string > &) void fieldProp_check(const Dune::CpGrid &grid, Opm::EclipseGrid eclGrid, const std::string &deck_string) void check_global_refine(const Dune::CpGrid &, const Dune::CpGrid &) void refine_and_check(const Dune::cpgrid::Geometry< 3, 3 > &, const std::array< int, 3 > &, bool) Struct that hods all the data needed to represent a Cpgrid. Definition: CpGridData.hpp:138 void postAdapt() Clean up refinement/coarsening markers - set every element to the mark 0 which represents 'doing noth... const cpgrid::LevelGlobalIdSet & globalIdSet() const Get the global index set. Definition: CpGridData.hpp:666 CpGridDataTraits::CommunicationType CommunicationType type of OwnerOverlap communication for cells Definition: CpGridData.hpp:716 @ MAX_DATA_PER_CELL The maximum data items allowed per cell (DUNE < 2.5.2) Definition: CpGridData.hpp:186 void computePointPartitionType() CpGridDataTraits::ParallelIndexSet ParallelIndexSet The type of the parallel index set. Definition: CpGridData.hpp:719 std::vector< int > getPatchesCells(const std::vector< std::array< int, 3 > > &startIJK_vec, const std::vector< std::array< int, 3 > > &endIJK_vec) const Compute cell indices of selected patches of cells (Cartesian grid required). int sharedFaceTag(const std::vector< std::array< int, 3 > > &startIJK_2Patches, const std::vector< std::array< int, 3 > > &endIJK_2Patches) const int size(GeometryType type) const number of leaf entities per geometry type in this process Definition: CpGridData.hpp:217 const std::array< int, 3 > & logicalCartesianSize() const Definition: CpGridData.hpp:674 void communicate(DataHandle &data, InterfaceType iftype, CommunicationDirection dir) communicate objects for all codims on a given level Definition: CpGridData.hpp:1028 bool uniqueBoundaryIds() const Definition: CpGridData.hpp:629 const std::tuple< int, std::vector< int > > & getChildrenLevelAndIndexList(int elemIdx) const Retrieves the level and child indices of a given parent cell. Definition: CpGridData.hpp:550 std::array< double, 3 > computeEclCentroid(const Entity< 0 > &elem) const std::array< int, 3 > getIJK(int idx_in_parent_cell, const std::array< int, 3 > &cells_per_dim) const Extract Cartesian index triplet (i,j,k) given an index between 0 and NXxNYxNZ -1 where NX,... Definition: CpGridData.hpp:322 void computeCommunicationInterfaces(int noexistingPoints) RemoteIndices & cellRemoteIndices() Definition: CpGridData.hpp:750 bool patchesShareFace(const std::vector< std::array< int, 3 > > &startIJK_vec, const std::vector< std::array< int, 3 > > &endIJK_vec) const Determine if a finite amount of patches (of cells) share a face. int size(int codim) const number of leaf entities per codim in this process CpGridDataTraits::CollectiveCommunication CollectiveCommunication Definition: CpGridData.hpp:704 const std::vector< int > & globalCell() const Definition: CpGridData.hpp:311 void readEclipseFormat(const std::string &filename, bool periodic_extension, bool turn_normals=false) CpGridDataTraits::InterfaceMap InterfaceMap The type of the map describing communication interfaces. Definition: CpGridData.hpp:713 CpGridDataTraits::Communication Communication The type of the collective communication. Definition: CpGridData.hpp:703 const std::vector< std::tuple< int, std::vector< int > > > & getParentToChildren() const Definition: CpGridData.hpp:554 void computeUniqueBoundaryIds() void getIJK(int c, std::array< int, 3 > &ijk) const Extract Cartesian index triplet (i,j,k) of an active cell. Definition: CpGridData.hpp:290 CpGridData()=delete CommunicationType & cellCommunication() Get the owner-overlap-copy communication for cells. Definition: CpGridData.hpp:727 std::tuple< std::shared_ptr< CpGridData >, const std::vector< std::array< int, 2 > >, const std::vector< std::tuple< int, std::vector< int > > >, const std::vector< std::tuple< int, std::vector< int > > >, const std::vector< std::tuple< int, std::vector< int > > >, const std::vector< std::array< int, 2 > >, const std::vector< std::array< int, 2 > > > refinePatch(const std::array< int, 3 > &cells_per_dim, const std::array< int, 3 > &startIJK, const std::array< int, 3 > &endIJK) const Refine a (connected block-shaped) patch of cells. Based on the patch, a Geometry<3,... CpGridDataTraits::RemoteIndices RemoteIndices The type of the remote indices information. Definition: CpGridData.hpp:722 ParallelIndexSet & cellIndexSet() Definition: CpGridData.hpp:740 int getMark(const cpgrid::Entity< 0 > &element) const Return refinement mark for entity. const ParallelIndexSet & cellIndexSet() const Definition: CpGridData.hpp:745 CpGridDataTraits::MPICommunicator MPICommunicator The type of the mpi communicator. Definition: CpGridData.hpp:701 void processEclipseFormat(const grdecl &input_data, std::array< std::set< std::pair< int, int > >, 2 > &nnc, bool remove_ij_boundary, bool turn_normals, bool pinchActive, double tolerance_unique_points) CpGridData(std::vector< std::shared_ptr< CpGridData > > &data) Constructor. std::tuple< const std::shared_ptr< CpGridData >, const std::vector< std::array< int, 2 > >, const std::vector< std::tuple< int, std::vector< int > > >, const std::tuple< int, std::vector< int > >, const std::vector< std::array< int, 2 > >, const std::vector< std::array< int, 2 > > > refineSingleCell(const std::array< int, 3 > &cells_per_dim, const int &parent_idx) const Refine a single cell and return a shared pointer of CpGridData type. void distributeGlobalGrid(CpGrid &grid, const CpGridData &view_data, const std::vector< int > &cell_part) Redistribute a global grid. const std::vector< std::shared_ptr< Dune::cpgrid::CpGridData > > & levelData() const Add doc/or remove method and replace it with better approach. Definition: CpGridData.hpp:535 const std::vector< double > & zcornData() const Definition: CpGridData.hpp:647 void setUniqueBoundaryIds(bool uids) Definition: CpGridData.hpp:636 bool preAdapt() Set mightVanish flags for elements that will be refined in the next adapt() call Need to be called af... int getGridIdx() const Add doc/or remove method and replace it with better approach. Definition: CpGridData.hpp:521 bool hasNNCs(const std::vector< int > &cellIndices) const Check all cells selected for refinement have no NNCs (no neighbor connections). Assumption: all grid ... bool mark(int refCount, const cpgrid::Entity< 0 > &element) Mark entity for refinement or coarsening. const CommunicationType & cellCommunication() const Get the owner-overlap-copy communication for cells. Definition: CpGridData.hpp:735 int cellFace(int cell, int local_index) const Definition: CpGridData.hpp:295 const cpgrid::IdSet & localIdSet() const Get the local index set. Definition: CpGridData.hpp:660 bool adapt() TO DO: Documentation. Triggers the grid refinement process - Currently, returns preAdapt() int faceToCellSize(int face) const Definition: CpGridData.hpp:300 void computeCellPartitionType() void checkCuboidShape(const std::vector< int > &cellIdx_vec) const Check that every cell to be refined has cuboid shape. CpGridDataTraits::Communicator Communicator The type of the Communicator. Definition: CpGridData.hpp:710 bool disjointPatches(const std::vector< std::array< int, 3 > > &startIJK_vec, const std::vector< std::array< int, 3 > > &endIJK_vec) const Determine if a finite amount of patches (of cells) are disjoint, namely, they do not share any corner... std::array< double, 3 > computeEclCentroid(const int idx) const const std::vector< int > & sortedNumAquiferCells() const Get sorted active cell indices of numerical aquifer. Definition: CpGridData.hpp:762 void validStartEndIJKs(const std::vector< std::array< int, 3 > > &startIJK_vec, const std::vector< std::array< int, 3 > > &endIJK_vec) const Check startIJK and endIJK of each patch of cells to be refined are valid, i.e. startIJK and endIJK ve... const RemoteIndices & cellRemoteIndices() const Definition: CpGridData.hpp:755 CpGridData(MPIHelper::MPICommunicator comm, std::vector< std::shared_ptr< CpGridData > > &data) Definition: DefaultGeometryPolicy.hpp:53 const EntityVariable< cpgrid::Geometry< 3 - codim, 3 >, codim > & geomVector() const Definition: DefaultGeometryPolicy.hpp:86 Wrapper that turns a data handle suitable for dune-grid into one based on integers instead of entitie... Definition: Entity2IndexDataHandle.hpp:56 Represents an entity of a given codim, with positive or negative orientation. Definition: EntityRep.hpp:99 Only needs to provide interface for doing nothing. Definition: Iterators.hpp:108 Definition: Indexsets.hpp:199 Definition: Indexsets.hpp:56 Definition: Intersection.hpp:66 Definition: Indexsets.hpp:350 int size() const Returns the number of rows in the table. Definition: SparseTable.hpp:121 Definition: PartitionTypeIndicator.hpp:50 Definition: CpGridData.hpp:1062 The namespace Dune is the main namespace for all Dune code. Definition: common/CartesianIndexMapper.hpp:10 Dune::cpgrid::Cell2FacesContainer cell2Faces(const Dune::CpGrid &grid) Get the cell to faces mapping of a grid. MPIHelper::MPICommunicator MPICommunicator The type of the collective communication. Definition: CpGridDataTraits.hpp:56 Dune::VariableSizeCommunicator<> Communicator The type of the Communicator. Definition: CpGridDataTraits.hpp:71 Dune::RemoteIndices< ParallelIndexSet > RemoteIndices The type of the remote indices information. Definition: CpGridDataTraits.hpp:83 typename CommunicationType::ParallelIndexSet ParallelIndexSet The type of the parallel index set. Definition: CpGridDataTraits.hpp:80 Dune::Communication< MPICommunicator > CollectiveCommunication Definition: CpGridDataTraits.hpp:59 Dune::OwnerOverlapCopyCommunication< int, int > CommunicationType type of OwnerOverlap communication for cells Definition: CpGridDataTraits.hpp:77 Dune::Communication< MPICommunicator > Communication Definition: CpGridDataTraits.hpp:58 AttributeSet The type of the set of the attributes. Definition: CpGridDataTraits.hpp:66 Communicator::InterfaceMap InterfaceMap The type of the map describing communication interfaces. Definition: CpGridDataTraits.hpp:74 Definition: CpGridData.hpp:1093 void moveData(const E &from, const E &to) Definition: CpGridData.hpp:1098 MoveBuffer< typename DataHandle::DataType > buffer Definition: CpGridData.hpp:1107 Definition: CpGridData.hpp:1113 void operator()(std::size_t from_cell_index, std::size_t to_cell_index) Definition: CpGridData.hpp:1119 CpGridData * scatterView_ Definition: CpGridData.hpp:1126 CpGridData * gatherView_ Definition: CpGridData.hpp:1125 Mover(DataHandle &data, CpGridData *gatherView, CpGridData *scatterView) Definition: CpGridData.hpp:1114 Definition: CpGridData.hpp:1131 Mover(DataHandle &data, CpGridData *gatherView, CpGridData *scatterView) Definition: CpGridData.hpp:1132 CpGridData * gatherView_ Definition: CpGridData.hpp:1149 CpGridData * scatterView_ Definition: CpGridData.hpp:1150 void operator()(std::size_t from_cell_index, std::size_t to_cell_index) Definition: CpGridData.hpp:1137 Definition: CpGridData.hpp:1155 CpGridData * scatterView_ Definition: CpGridData.hpp:1173 CpGridData * gatherView_ Definition: CpGridData.hpp:1172 Mover(DataHandle &data, CpGridData *gatherView, CpGridData *scatterView) Definition: CpGridData.hpp:1156 void operator()(std::size_t from_cell_index, std::size_t to_cell_index) Definition: CpGridData.hpp:1160 Definition: CpGridData.hpp:1088 Definition: preprocess.h:56 |