A triangle in the topology. More...

#include <topology.hh>

Inheritance diagram for concepts::Triangle:
concepts::Connector2 concepts::Connector concepts::OutputOperator

Public Member Functions

const Attributeattrib () const
 Returns the attribute of the connector. More...
 
virtual const Trianglechild (uint i) const
 
virtual Trianglechild (uint i, bool mode=0)
 Returns a child. More...
 
Triangleclone (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...
 
Edgeedge (uint i) const
 Returns a 1D component: edge. More...
 
const Keykey () 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...
 
Vertexvertex (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

Trianglechld_
 Pointer to the first child. More...
 
Edgeedg_ [3]
 Array of the edges. More...
 
Trianglelnk_
 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
edg01st edge.
edg12nd edge.
edg23rd edge.
attribAttribute of the triangle

◆ ~Triangle()

virtual concepts::Triangle::~Triangle ( )
virtual

◆ Triangle() [2/2]

concepts::Triangle::Triangle ( Edge edg0,
Edge edg1,
Edge edg2,
const Attribute  attrib,
const Key key,
const Z2  rho[] 
)
private

Constructor used by clone()

Member Function Documentation

◆ attrib()

const Attribute& concepts::Connector::attrib ( ) const
inlineinherited

Returns the attribute of the connector.

Definition at line 108 of file connector.hh.

◆ child() [1/2]

virtual const Triangle* concepts::Triangle::child ( uint  i) const
virtual

Implements concepts::Connector2.

◆ child() [2/2]

virtual Triangle* concepts::Triangle::child ( uint  i,
bool  mode = 0 
)
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
iIndex of the child to be returned.
modemode = 1: No children are created
mode = 0: If no children exist, four new children are created.

Implements concepts::Connector2.

◆ clone()

Triangle * concepts::Triangle::clone ( Edge edg0,
Edge edg1,
Edge edg2 
) const
inline

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()

Edge* concepts::Triangle::edge ( uint  i) const
inlinevirtual

Returns a 1D component: edge.

A 2D element consists of 1D and 0D elements, the edges can be queried here.

Parameters
iIndex of the edge

Implements concepts::Connector2.

Definition at line 224 of file topology.hh.

◆ info()

virtual std::ostream& concepts::Triangle::info ( std::ostream &  os) const
protectedvirtual

Returns information in an output stream.

Reimplemented from concepts::Connector.

◆ key()

const Key& concepts::Connector::key ( ) const
inlineinherited

Returns the key of the connector.

Definition at line 105 of file connector.hh.

◆ operator==()

int concepts::Connector::operator== ( const Connector cntr) const
inlineinherited

Comparison operator.

Definition at line 102 of file connector.hh.

◆ related()

int concepts::Connector::related ( const Connector conn) const
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
connOther connector
Returns
An integer i.
i=0 if there is no relationship or the connectors are identical
i>0 if conn is an ancestor of this connector
i<0 if conn is a descendant of this connector
|i| gives the number of generations between the connectors

◆ rho()

Z2 concepts::Triangle::rho ( int  i) const
inline

Returns the orientation of an edge.

Parameters
iIndex of the edge.

Definition at line 230 of file topology.hh.

◆ setAttrib()

void concepts::Connector::setAttrib ( uint  attrb)
inlineinherited

Definition at line 111 of file connector.hh.

◆ vertex()

Vertex* concepts::Triangle::vertex ( uint  i) const
inlinevirtual

Returns a 0D component: vertex A 2D element consists of 1D and 0D elements, the vertices can be queried here.

Parameters
iIndex of the vertex

Implements concepts::Connector2.

Definition at line 225 of file topology.hh.

Member Data Documentation

◆ attrib_

Attribute concepts::Connector::attrib_
protectedinherited

Attribute.

Definition at line 132 of file connector.hh.

◆ chld_

Triangle* concepts::Triangle::chld_
private

Pointer to the first child.

The children are stored in a linked list.

Definition at line 249 of file topology.hh.

◆ cnt_

uint concepts::Connector2::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_

Edge* concepts::Triangle::edg_[3]
private

Array of the edges.

Definition at line 252 of file topology.hh.

◆ key_

Key concepts::Connector::key_
protectedinherited

Unique key of the connector.

Definition at line 129 of file connector.hh.

◆ lnk_

Triangle* concepts::Triangle::lnk_
private

Pointer to a sibling.

Definition at line 244 of file topology.hh.

◆ rho_

Z2 concepts::Triangle::rho_[3]
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:
Page URL: http://wiki.math.ethz.ch/bin/view/Concepts/WebHome
21 August 2020
© 2020 Eidgenössische Technische Hochschule Zürich