DOLFIN
DOLFIN C++ interface
Public Member Functions | Static Public Member Functions | List of all members
dolfin::TriangleCell Class Reference

This class implements functionality for triangular meshes. More...

#include <TriangleCell.h>

Inheritance diagram for dolfin::TriangleCell:
Inheritance graph
[legend]
Collaboration diagram for dolfin::TriangleCell:
Collaboration graph
[legend]

Public Member Functions

 TriangleCell ()
 Specify cell type and facet type.
 
bool is_simplex () const
 Check if cell is a simplex. More...
 
std::size_t dim () const
 Return topological dimension of cell. More...
 
std::size_t num_entities (std::size_t dim) const
 Return number of entities of given topological dimension. More...
 
std::size_t num_vertices (std::size_t dim) const
 Return number of vertices for entity of given topological dimension. More...
 
std::size_t orientation (const Cell &cell) const
 Return orientation of the cell. More...
 
void create_entities (boost::multi_array< unsigned int, 2 > &e, std::size_t dim, const unsigned int *v) const
 Create entities e of given topological dimension from vertices v. More...
 
double volume (const MeshEntity &triangle) const
 Compute (generalized) volume (area) of triangle. More...
 
double circumradius (const MeshEntity &triangle) const
 Compute diameter of triangle. More...
 
double squared_distance (const Cell &cell, const Point &point) const
 Compute squared distance to given point (3D enabled) More...
 
double normal (const Cell &cell, std::size_t facet, std::size_t i) const
 Compute component i of normal of given facet with respect to the cell. More...
 
Point normal (const Cell &cell, std::size_t facet) const
 Compute of given facet with respect to the cell. More...
 
Point cell_normal (const Cell &cell) const
 Compute normal to given cell (viewed as embedded in 3D) More...
 
double facet_area (const Cell &cell, std::size_t facet) const
 Compute the area/length of given facet with respect to the cell. More...
 
void order (Cell &cell, const std::vector< std::int64_t > &local_to_global_vertex_indices) const
 Order entities locally. More...
 
bool collides (const Cell &cell, const Point &point) const
 Check whether given point collides with cell. More...
 
bool collides (const Cell &cell, const MeshEntity &entity) const
 Check whether given entity collides with cell. More...
 
std::string description (bool plural) const
 Return description of cell type. More...
 
std::vector< std::int8_t > vtk_mapping () const
 Mapping of DOLFIN/UFC vertex ordering to VTK/XDMF ordering. More...
 
- Public Member Functions inherited from dolfin::CellType
 CellType (Type cell_type, Type facet_type)
 Constructor.
 
virtual ~CellType ()
 Destructor.
 
Type cell_type () const
 Return type of cell.
 
Type facet_type () const
 Return type of cell for facets.
 
Type entity_type (std::size_t i) const
 Return type of cell for entity of dimension i.
 
virtual bool is_simplex () const =0
 Check if cell is a simplex. More...
 
virtual std::size_t dim () const =0
 Return topological dimension of cell. More...
 
virtual std::size_t num_entities (std::size_t dim) const =0
 Return number of entities of given topological dimension. More...
 
std::size_t num_vertices () const
 Return number of vertices for cell.
 
virtual std::size_t num_vertices (std::size_t dim) const =0
 Return number of vertices for entity of given topological dimension. More...
 
virtual std::size_t orientation (const Cell &cell) const =0
 Return orientation of the cell (assuming flat space) More...
 
std::size_t orientation (const Cell &cell, const Point &up) const
 Return orientation of the cell relative to given up direction.
 
virtual void create_entities (boost::multi_array< unsigned int, 2 > &e, std::size_t dim, const unsigned int *v) const =0
 
virtual double volume (const MeshEntity &entity) const =0
 Compute (generalized) volume of mesh entity. More...
 
virtual double h (const MeshEntity &entity) const
 Compute greatest distance between any two vertices.
 
virtual double circumradius (const MeshEntity &entity) const =0
 Compute circumradius of mesh entity. More...
 
virtual double inradius (const Cell &cell) const
 Compute inradius of cell.
 
virtual double radius_ratio (const Cell &cell) const
 Compute dim*inradius/circumradius for given cell.
 
virtual double squared_distance (const Cell &cell, const Point &point) const =0
 Compute squared distance to given point. More...
 
virtual double normal (const Cell &cell, std::size_t facet, std::size_t i) const =0
 Compute component i of normal of given facet with respect to the cell. More...
 
virtual Point normal (const Cell &cell, std::size_t facet) const =0
 Compute of given facet with respect to the cell. More...
 
virtual Point cell_normal (const Cell &cell) const =0
 Compute normal to given cell (viewed as embedded in 3D) More...
 
virtual double facet_area (const Cell &cell, std::size_t facet) const =0
 Compute the area/length of given facet with respect to the cell. More...
 
virtual void order (Cell &cell, const std::vector< std::int64_t > &local_to_global_vertex_indices) const =0
 Order entities locally. More...
 
bool ordered (const Cell &cell, const std::vector< std::int64_t > &local_to_global_vertex_indices) const
 Check if entities are ordered.
 
virtual bool collides (const Cell &cell, const Point &point) const =0
 Check whether given point collides with cell. More...
 
virtual bool collides (const Cell &cell, const MeshEntity &entity) const =0
 Check whether given entity collides with cell. More...
 
virtual std::string description (bool plural) const =0
 Return description of cell type. More...
 
virtual std::vector< std::int8_t > vtk_mapping () const =0
 Mapping of DOLFIN/UFC vertex ordering to VTK/XDMF ordering. More...
 

Static Public Member Functions

static double squared_distance (const Point &point, const Point &a, const Point &b, const Point &c)
 
- Static Public Member Functions inherited from dolfin::CellType
static CellTypecreate (Type type)
 Create cell type from type (factory function)
 
static CellTypecreate (std::string type)
 Create cell type from string (factory function)
 
static Type string2type (std::string type)
 Convert from string to cell type.
 
static std::string type2string (Type type)
 Convert from cell type to string.
 

Additional Inherited Members

- Public Types inherited from dolfin::CellType
enum class  Type : int {
  point , interval , triangle , quadrilateral ,
  tetrahedron , hexahedron
}
 Enum for different cell types.
 
- Static Protected Member Functions inherited from dolfin::CellType
static void sort_entities (std::size_t num_vertices, unsigned int *vertices, const std::vector< std::int64_t > &local_to_global_vertex_indices)
 Sort vertices based on global entity indices.
 
- Protected Attributes inherited from dolfin::CellType
Type _cell_type
 
Type _facet_type
 

Detailed Description

This class implements functionality for triangular meshes.

Member Function Documentation

◆ cell_normal()

Point TriangleCell::cell_normal ( const Cell cell) const
virtual

Compute normal to given cell (viewed as embedded in 3D)

Implements dolfin::CellType.

◆ circumradius()

double TriangleCell::circumradius ( const MeshEntity triangle) const
virtual

Compute diameter of triangle.

Implements dolfin::CellType.

◆ collides() [1/2]

bool TriangleCell::collides ( const Cell cell,
const MeshEntity entity 
) const
virtual

Check whether given entity collides with cell.

Implements dolfin::CellType.

◆ collides() [2/2]

bool TriangleCell::collides ( const Cell cell,
const Point point 
) const
virtual

Check whether given point collides with cell.

Implements dolfin::CellType.

◆ create_entities()

void TriangleCell::create_entities ( boost::multi_array< unsigned int, 2 > &  e,
std::size_t  dim,
const unsigned int *  v 
) const
virtual

Create entities e of given topological dimension from vertices v.

Implements dolfin::CellType.

◆ description()

std::string TriangleCell::description ( bool  plural) const
virtual

Return description of cell type.

Implements dolfin::CellType.

◆ dim()

std::size_t TriangleCell::dim ( ) const
virtual

Return topological dimension of cell.

Implements dolfin::CellType.

◆ facet_area()

double TriangleCell::facet_area ( const Cell cell,
std::size_t  facet 
) const
virtual

Compute the area/length of given facet with respect to the cell.

Implements dolfin::CellType.

◆ is_simplex()

bool dolfin::TriangleCell::is_simplex ( ) const
inlinevirtual

Check if cell is a simplex.

Implements dolfin::CellType.

◆ normal() [1/2]

Point TriangleCell::normal ( const Cell cell,
std::size_t  facet 
) const
virtual

Compute of given facet with respect to the cell.

Implements dolfin::CellType.

◆ normal() [2/2]

double TriangleCell::normal ( const Cell cell,
std::size_t  facet,
std::size_t  i 
) const
virtual

Compute component i of normal of given facet with respect to the cell.

Implements dolfin::CellType.

◆ num_entities()

std::size_t TriangleCell::num_entities ( std::size_t  dim) const
virtual

Return number of entities of given topological dimension.

Implements dolfin::CellType.

◆ num_vertices()

std::size_t TriangleCell::num_vertices ( std::size_t  dim) const
virtual

Return number of vertices for entity of given topological dimension.

Implements dolfin::CellType.

◆ order()

void TriangleCell::order ( Cell cell,
const std::vector< std::int64_t > &  local_to_global_vertex_indices 
) const
virtual

Order entities locally.

Implements dolfin::CellType.

◆ orientation()

std::size_t TriangleCell::orientation ( const Cell cell) const
virtual

Return orientation of the cell.

Implements dolfin::CellType.

◆ squared_distance() [1/2]

double TriangleCell::squared_distance ( const Cell cell,
const Point point 
) const
virtual

Compute squared distance to given point (3D enabled)

Implements dolfin::CellType.

◆ squared_distance() [2/2]

double TriangleCell::squared_distance ( const Point point,
const Point a,
const Point b,
const Point c 
)
static

Compute squared distance to given point. This version takes the three vertex coordinates as 3D points. This makes it possible to reuse this function for computing the (squared) distance to a tetrahedron.

◆ volume()

double TriangleCell::volume ( const MeshEntity triangle) const
virtual

Compute (generalized) volume (area) of triangle.

Implements dolfin::CellType.

◆ vtk_mapping()

std::vector< std::int8_t > dolfin::TriangleCell::vtk_mapping ( ) const
inlinevirtual

Mapping of DOLFIN/UFC vertex ordering to VTK/XDMF ordering.

Implements dolfin::CellType.


The documentation for this class was generated from the following files: