concepts::Triangle Class Reference
A triangle in the topology. More...
#include <topology.hh>
Public Member Functions | |
const Attribute & | attrib () const |
Returns the attribute of the connector. More... | |
virtual const Triangle * | child (uint i) const |
virtual Triangle * | child (uint i, bool mode=0) |
Returns a child. More... | |
Triangle * | clone (Edge &edg0, Edge &edg1, Edge &edg2) const |
Returns the pointer of a new Triangle with the same attribute, the same key and the same rho but NO children and sibling. More... | |
Edge * | edge (uint i) const |
Returns a 1D component: edge. More... | |
const Key & | key () const |
Returns the key of the connector. More... | |
int | operator== (const Connector &cntr) const |
Comparison operator. More... | |
int | related (const Connector &conn) const |
Checks if this connector is related to conn . More... | |
Z2 | rho (int i) const |
Returns the orientation of an edge. More... | |
void | setAttrib (uint attrb) |
Triangle (Edge &edg0, Edge &edg1, Edge &edg2, const Attribute attrib=Attribute()) | |
Constructor. More... | |
Vertex * | vertex (uint i) const |
Returns a 0D component: vertex A 2D element consists of 1D and 0D elements, the vertices can be queried here. More... | |
virtual | ~Triangle () |
Protected Member Functions | |
virtual std::ostream & | info (std::ostream &os) const |
Returns information in an output stream. More... | |
Protected Attributes | |
Attribute | attrib_ |
Attribute. More... | |
Key | key_ |
Unique key of the connector. More... | |
Static Protected Attributes | |
static uint | cnt_ |
Counter for the connectors. More... | |
Private Member Functions | |
Triangle (Edge &edg0, Edge &edg1, Edge &edg2, const Attribute attrib, const Key &key, const Z2 rho[]) | |
Constructor used by clone() More... | |
Private Attributes | |
Triangle * | chld_ |
Pointer to the first child. More... | |
Edge * | edg_ [3] |
Array of the edges. More... | |
Triangle * | lnk_ |
Pointer to a sibling. More... | |
Z2 | rho_ [3] |
Array of the orientation flags for the edges. More... | |
Detailed Description
A triangle in the topology.
Implements the abstract methods from the parent classes to query the children, the vertices and the edges of the triangle.
Every edge can have two different orientations in the triangle, this orientation is stored in the array rho.
- Examples
- meshes.cc.
Definition at line 193 of file topology.hh.
Constructor & Destructor Documentation
◆ Triangle() [1/2]
concepts::Triangle::Triangle | ( | Edge & | edg0, |
Edge & | edg1, | ||
Edge & | edg2, | ||
const Attribute | attrib = Attribute() |
||
) |
Constructor.
Creates a triangle out of three edges. The edges must form a triangle: the 1st and the 2nd edge, the 2nd and the 3rd edge and the 3rd and the 1st edge must have a common vertex. The edges can have an arbitrary orientation. The orientation is detected and stored in rho_.
- Parameters
-
edg0 1st edge. edg1 2nd edge. edg2 3rd edge. attrib Attribute of the triangle
◆ ~Triangle()
|
virtual |
◆ Triangle() [2/2]
|
private |
Constructor used by clone()
Member Function Documentation
◆ attrib()
|
inlineinherited |
Returns the attribute of the connector.
Definition at line 108 of file connector.hh.
◆ child() [1/2]
|
virtual |
Implements concepts::Connector2.
◆ child() [2/2]
|
virtual |
Returns a child.
If children are created, four new children are created (with the same attributes as this one). The triangle is cut into four new triangles by joining the midpoints of its edges.
- Parameters
-
i Index of the child to be returned. mode mode = 1: No children are created
mode = 0: If no children exist, four new children are created.
Implements concepts::Connector2.
◆ clone()
Returns the pointer of a new Triangle with the same attribute, the same key and the same rho but NO children and sibling.
Definition at line 258 of file topology.hh.
◆ edge()
|
inlinevirtual |
Returns a 1D component: edge.
A 2D element consists of 1D and 0D elements, the edges can be queried here.
- Parameters
-
i Index of the edge
Implements concepts::Connector2.
Definition at line 224 of file topology.hh.
◆ info()
|
protectedvirtual |
Returns information in an output stream.
Reimplemented from concepts::Connector.
◆ key()
|
inlineinherited |
Returns the key of the connector.
Definition at line 105 of file connector.hh.
◆ operator==()
|
inlineinherited |
Comparison operator.
Definition at line 102 of file connector.hh.
◆ related()
|
inherited |
Checks if this connector is related to conn
.
It is being checked if one of the two is an ancestor of the other.
- Parameters
-
conn Other connector
- Returns
- An integer i.
i=0 if there is no relationship or the connectors are identical
i>0 ifconn
is an ancestor of this connector
i<0 ifconn
is a descendant of this connector
|i| gives the number of generations between the connectors
◆ rho()
|
inline |
Returns the orientation of an edge.
- Parameters
-
i Index of the edge.
Definition at line 230 of file topology.hh.
◆ setAttrib()
|
inlineinherited |
Definition at line 111 of file connector.hh.
◆ vertex()
|
inlinevirtual |
Returns a 0D component: vertex A 2D element consists of 1D and 0D elements, the vertices can be queried here.
- Parameters
-
i Index of the vertex
Implements concepts::Connector2.
Definition at line 225 of file topology.hh.
Member Data Documentation
◆ attrib_
|
protectedinherited |
Definition at line 132 of file connector.hh.
◆ chld_
|
private |
Pointer to the first child.
The children are stored in a linked list.
Definition at line 249 of file topology.hh.
◆ cnt_
|
staticprotectedinherited |
Counter for the connectors.
This counter is used to create the unique key of the connector.
Definition at line 263 of file connector.hh.
◆ edg_
|
private |
Array of the edges.
Definition at line 252 of file topology.hh.
◆ key_
|
protectedinherited |
Unique key of the connector.
Definition at line 129 of file connector.hh.
◆ lnk_
|
private |
Pointer to a sibling.
Definition at line 244 of file topology.hh.
◆ rho_
|
private |
Array of the orientation flags for the edges.
Definition at line 255 of file topology.hh.
The documentation for this class was generated from the following file:
- geometry/topology.hh