Public Member Functions | |
void | reorient (std::vector< CellData< 2 > > &quads) |
Private Member Functions | |
void | build_graph (const std::vector< CellData< 2 > > &inquads) |
void | orient () |
void | get_quads (std::vector< CellData< 2 > > &outquads) const |
void | orient_side (const unsigned int quadnum, const unsigned int localsidenum) |
bool | is_fully_oriented_quad (const unsigned int quadnum) const |
bool | is_oriented_side (const unsigned int quadnum, const unsigned int lsn) const |
bool | is_side_default_oriented (const unsigned int qnum, const unsigned int lsn) const |
bool | get_unoriented_quad (unsigned int &UnOrQLoc) const |
bool | get_unoriented_side (const unsigned int quadnum, unsigned int &sidenum) const |
bool | side_hop (unsigned int &qnum, unsigned int &lsn) const |
Private Attributes | |
std::vector< MSide > | sides |
std::vector< MQuad > | mquads |
Implement the 2d algorithm for grid reordering described in the documentation of the GridReordering class.
void internal::GridReordering2d::GridReordering::reorient | ( | std::vector< CellData< 2 > > & | quads | ) |
Do the work intended by this class.
void internal::GridReordering2d::GridReordering::build_graph | ( | const std::vector< CellData< 2 > > & | inquads | ) | [private] |
Sets up the internal data structures so that the we can do side hopping and face switching efficiently. This means we need a whole bunch of connectivity information
void internal::GridReordering2d::GridReordering::orient | ( | ) | [private] |
Orient the internal data into deal.II format The orientation algorith is as follows
1) Find an unoriented quad (A)
2) Orient an un_oriented side (s) of (A)
3) side hop on (s) of (A) to get (B)
4) if opposite side to (s) of (B) is unoriented orient it
5) repeat 3) and 4) until side-hoppong fails (we've reached a boundary) or (s) has already been oriented (we've closed a loop or unoriented sides).
6) Repeat 2), 3) ,4) and 5) on other unoriented sides of (A)
7) Choose a new unoriented A.
void internal::GridReordering2d::GridReordering::get_quads | ( | std::vector< CellData< 2 > > & | outquads | ) | const [private] |
Get the (now correctly oriented if we've called orient) quads.
void internal::GridReordering2d::GridReordering::orient_side | ( | const unsigned int | quadnum, | |
const unsigned int | localsidenum | |||
) | [private] |
Orient_side(qnum,lsn) orients the local side lsn of the quad qnum in the triangulation. If the side opposite lsn is oriented then lsn is oriented to match it. Otherwise it is oriented in the "default" direction for the quad.
bool internal::GridReordering2d::GridReordering::is_fully_oriented_quad | ( | const unsigned int | quadnum | ) | const [private] |
Returns true if all sides of the quad quadnum are oriented.
bool internal::GridReordering2d::GridReordering::is_oriented_side | ( | const unsigned int | quadnum, | |
const unsigned int | lsn | |||
) | const [private] |
Returns true if the side lsn of the quad quadnum is oriented.
bool internal::GridReordering2d::GridReordering::is_side_default_oriented | ( | const unsigned int | qnum, | |
const unsigned int | lsn | |||
) | const [private] |
Returns true is the side is oriented in the "default" direction
bool internal::GridReordering2d::GridReordering::get_unoriented_quad | ( | unsigned int & | UnOrQLoc | ) | const [private] |
Increases UnOrQLoc from it's original value to the next quad with an unoriented side. Returns true if there was another unoriented quad.
bool internal::GridReordering2d::GridReordering::get_unoriented_side | ( | const unsigned int | quadnum, | |
unsigned int & | sidenum | |||
) | const [private] |
Sets sidenum to the local sidenumber of an unoriented side of the quad quadnum. Returns true if such a side exists.
bool internal::GridReordering2d::GridReordering::side_hop | ( | unsigned int & | qnum, | |
unsigned int & | lsn | |||
) | const [private] |
side_hop(&qnum, &lsn) has qnum being the quadnumber of a quad in the triangulation, and a local side number. side_hop then sets qnum to the quadnumber across the other side of the side, and sets lsn so that quads[qnum].sides[lsn] is the same before and after the call. if there is no other quad on the other side of the current quad, then side_hop returns false.
std::vector<MSide> internal::GridReordering2d::GridReordering::sides [private] |
A list of enriched sides/edges of the mesh.
std::vector<MQuad> internal::GridReordering2d::GridReordering::mquads [private] |
A list of enriched quads in the mesh.