1
// Copyright (C) 2006 Anders Logg.
2
// Licensed under the GNU LGPL Version 2.1.
4
// First added: 2006-06-02
5
// Last changed: 2006-06-21
7
#ifndef __TOPOLOGY_COMPUTATION_H
8
#define __TOPOLOGY_COMPUTATION_H
10
#include <dolfin/constants.h>
17
class MeshConnectivity;
19
/// This class implements a set of basic algorithms that automate
20
/// the computation of mesh entities and connectivity.
22
class TopologyComputation
26
/// Compute mesh entities of given topological dimension
27
static uint computeEntities(Mesh& mesh, uint dim);
29
/// Compute connectivity for given pair of topological dimensions
30
static void computeConnectivity(Mesh& mesh, uint d0, uint d1);
34
/// Compute connectivity from transpose
35
static void computeFromTranspose(Mesh& mesh, uint d0, uint d1);
37
/// Compute connectivity from intersection
38
static void computeFromIntersection(Mesh& mesh, uint d0, uint d1, uint d);
40
/// Count how many of the given entities that are new
41
static uint countEntities(Mesh& mesh, MeshEntity& cell,
42
uint** vertices, uint m, uint n, uint dim);
44
/// Add entities that are new
45
static void addEntities(Mesh& mesh, MeshEntity& cell,
46
uint** vertices, uint m, uint n, uint dim,
47
MeshConnectivity& ce, MeshConnectivity& ev,
48
uint& current_entity);
50
/// Check if mesh entity e0 contains mesh entity e1
51
static bool contains(MeshEntity& e0, MeshEntity& e1);
53
/// Check if array v0 contains array v1
54
static bool contains(uint* v0, uint n0, uint* v1, uint n1);