Dune Core Modules (2.9.0)
ygrid.hh
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (C) DUNE Project contributors, see file LICENSE.md in module root
109 : _origin(origin), _shift(enclosing.shift()), _coords(enclosing.getCoords()), _size(size), _supersize(enclosing.supersize())
131 YGridComponent (iTupel origin, std::bitset<d> shift, Coordinates* coords, iTupel size, iTupel offset, iTupel supersize)
132 : _origin(origin), _shift(shift), _coords(coords), _size(size), _offset(offset), _supersize(supersize)
535 inline std::ostream& operator<< (std::ostream& s, typename YGridComponent<Coordinates>::Iterator& e)
537 s << "Printing YGridComponent Iterator:" << std::endl << "Iterator at " << e.coord() << " (index ";
806 inline std::ostream& operator<< (std::ostream& s, const YGrid<Coordinates>& e)
822 class YGridList
828 struct Intersection
831 YGridComponent<Coordinates> grid;
833 int rank;
835 int distance;
837 YGrid<Coordinates> yg;
850 Iterator(const YGridList<Coordinates>& ygl, bool end=false) : _end(ygl.dataEnd()), _which(ygl.dataBegin())
923 Iterator begin() const
929 Iterator end() const
935 void setBegin(typename std::array<std::deque<Intersection>, Dune::power(2,dim)>::iterator begin)
941 DAI dataBegin() const
947 DAI dataEnd() const
953 int size() const
962 void finalize(DAI end, const YGrid<Coordinates>& ygrid)
Definition: ygrid.hh:298
Iterator & operator++()
Increment iterator to next cell with position.
Definition: ygrid.hh:379
int superindex() const
Return consecutive index in enclosing grid.
Definition: ygrid.hh:344
bool operator!=(const Iterator &i) const
Return true when two iterators over the same grid are not equal (!).
Definition: ygrid.hh:338
ct lowerleft(int i) const
Return ith component of lower left corner of the entity associated with the current coordinates and s...
Definition: ygrid.hh:403
ct meshsize(int i) const
Return meshsize in direction i.
Definition: ygrid.hh:436
void reinit(const YGridComponent< Coordinates > &r, const iTupel &coord)
reinitialize iterator to given position
Definition: ygrid.hh:317
void move(const iTupel &dist)
move this iterator dist cells in direction i
Definition: ygrid.hh:369
fTupel meshsize() const
Return meshsize of current cell as reference.
Definition: ygrid.hh:442
fTupel lowerleft() const
Return lower left corner of the entity associated with the current coordinates and shift.
Definition: ygrid.hh:409
iTupel _coord
current position in index set
Definition: ygrid.hh:466
const iTupel & coord() const
Return coordinate of the cell as reference (do not modify).
Definition: ygrid.hh:356
void move(int i, int dist)
move this iterator dist cells in direction i
Definition: ygrid.hh:362
Iterator(const YGridComponent< Coordinates > &r)
Make iterator pointing to first cell in a grid.
Definition: ygrid.hh:304
ct upperright(int i) const
Return ith component of upper right corder of the entity associated with the current coordinates and ...
Definition: ygrid.hh:418
int coord(int i) const
Return coordinate of the cell in direction i.
Definition: ygrid.hh:350
fTupel upperright() const
Return upper right corder of the entity associated with the current coordinates and shift.
Definition: ygrid.hh:427
bool operator==(const Iterator &i) const
Return true when two iterators over the same grid are equal (!).
Definition: ygrid.hh:332
Iterator(const YGridComponent< Coordinates > &r, const iTupel &coord)
Make iterator pointing to given cell in a grid.
Definition: ygrid.hh:311
int _superindex
consecutive index in enclosing grid
Definition: ygrid.hh:467
Definition: ygrid.hh:75
int index(const iTupel &coord) const
given a tupel compute its index in the lexicographic numbering
Definition: ygrid.hh:252
int offset(int i) const
Return offset to origin of enclosing grid.
Definition: ygrid.hh:173
YGridComponent< Coordinates > move(iTupel v) const
return grid moved by the vector v
Definition: ygrid.hh:263
YGridComponent< Coordinates > intersection(const YGridComponent< Coordinates > &r) const
Return YGridComponent of supergrid of self which is the intersection of self and another YGridCompone...
Definition: ygrid.hh:271
int min(int i) const
Return minimum index in direction i.
Definition: ygrid.hh:218
YGridComponent(iTupel origin, iTupel size)
make ygrid without coordinate information
Definition: ygrid.hh:99
int totalsize() const
Return total size of index set which is the product of all size per direction.
Definition: ygrid.hh:209
YGridComponent(iTupel origin, iTupel size, const YGridComponent< Coordinates > &enclosing)
make a subgrid by taking coordinates from a larger grid
Definition: ygrid.hh:108
const iTupel & supersize() const
return size of enclosing grid
Definition: ygrid.hh:191
YGridComponent(iTupel origin, std::bitset< d > shift, Coordinates *coords, iTupel size, iTupel offset, iTupel supersize)
Make YGridComponent by giving all parameters.
Definition: ygrid.hh:131
Iterator begin() const
return iterator to first element of index set
Definition: ygrid.hh:487
Iterator begin(const iTupel &co) const
return iterator to given element of index set
Definition: ygrid.hh:493
int origin(int i) const
Return origin in direction i.
Definition: ygrid.hh:144
int supersize(int i) const
return size of enclosing grid
Definition: ygrid.hh:185
int max(int i) const
Return maximum index in direction i.
Definition: ygrid.hh:224
const std::bitset< d > & shift() const
Return shift tupel.
Definition: ygrid.hh:162
bool shift(int i) const
Return shift in direction i.
Definition: ygrid.hh:156
Iterator end() const
return subiterator to last element of index set
Definition: ygrid.hh:499
bool inside(const iTupel &coord) const
given a coordinate, return true if it is in the grid
Definition: ygrid.hh:241
bool empty() const
Return true if YGrid is empty, i.e. has size 0 in all directions.
Definition: ygrid.hh:230
const iTupel & offset() const
Return offset to origin of enclosing grid.
Definition: ygrid.hh:179
const iTupel & origin() const
return reference to origin
Definition: ygrid.hh:150
Iterator over a collection o YGrids A YGrid::Iterator is the heart of an entity in YaspGrid.
Definition: ygrid.hh:594
int which() const
return the current component number
Definition: ygrid.hh:718
void move(int i, int dist)
move the grid, this is only done and needed for codim 0
Definition: ygrid.hh:724
bool operator==(const Iterator &i) const
compare two iterators: component has to match
Definition: ygrid.hh:702
Dune::FieldVector< typename Coordinates::ctype, dim > meshsize() const
return the current meshsize vector
Definition: ygrid.hh:669
Iterator(const YGrid< Coordinates > &yg, const std::array< int, dim > &coords, int which=0)
construct an iterator from coordinates and component
Definition: ygrid.hh:601
std::bitset< dim > shift() const
return the shift vector
Definition: ygrid.hh:681
bool shift(int i) const
return the shift in direction i
Definition: ygrid.hh:675
bool operator!=(const Iterator &i) const
compare two iterators: component has to match
Definition: ygrid.hh:710
const std::array< int, dim > & coord() const
return coordinate array at the current position
Definition: ygrid.hh:637
Iterator & operator++()
increment to the next entity jumping to next component if necessary
Definition: ygrid.hh:694
Coordinates::ctype meshsize(int i) const
return the current meshsize in direction i
Definition: ygrid.hh:663
int coord(int i) const
return coordinate at the current position (direction i)
Definition: ygrid.hh:631
Iterator(const YGrid< Coordinates > &yg, bool end=false)
create an iterator to start or end of the codimension
Definition: ygrid.hh:608
int superindex() const
return the superindex
Definition: ygrid.hh:687
void reinit(const YGrid< Coordinates > &yg, const std::array< int, dim > &coords, int which=0)
reinitializes an iterator, as if it was just constructed.
Definition: ygrid.hh:623
implements a collection of YGridComponents which form a codimension Entities of given codimension c n...
Definition: ygrid.hh:551
int shiftmapping(const std::bitset< dim > &shift) const
get which component belongs to a given shift vector
Definition: ygrid.hh:567
DAI dataBegin() const
get start iterator in the data array
Definition: ygrid.hh:573
Iterator begin() const
return begin iterator for the codimension and partition the ygrid represents
Definition: ygrid.hh:747
void setBegin(DAI begin)
set start iterator in the data array
Definition: ygrid.hh:561
bool inside(const iTupel &coord, const std::bitset< dim > &shift=std::bitset< dim >()) const
decide whether a coordinate is in the grid (depending on the component)
Definition: ygrid.hh:585
Iterator begin(const std::array< int, dim > &coord, int which=0) const
return iterator pointint to a specified position
Definition: ygrid.hh:753
Iterator end() const
return end iterator for the codimension and partition the ygrid represents
Definition: ygrid.hh:759
Implements a vector constructed from a given type representing a field and a compile-time given size.
Some useful basic math stuff.
Implementation of stream operators for std::array and std::tuple.
std::array< int, d > sizeArray(const std::array< std::vector< ct >, d > &v)
Definition: ygrid.hh:29
|
Legal Statements / Impressum |
Hosted by TU Dresden |
generated with Hugo v0.111.3
(Dec 21, 23:30, 2024)