~njansson/dolfin/hpc

« back to all changes in this revision

Viewing changes to src/kernel/mesh/dolfin/TopologyComputation.h

  • Committer: Johannes Ring
  • Date: 2008-03-05 22:43:06 UTC
  • Revision ID: johannr@simula.no-20080305224306-2npsdyhfdpl2esji
The BIG commit!

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// Copyright (C) 2006 Anders Logg.
2
 
// Licensed under the GNU LGPL Version 2.1.
3
 
//
4
 
// First added:  2006-06-02
5
 
// Last changed: 2006-06-21
6
 
 
7
 
#ifndef __TOPOLOGY_COMPUTATION_H
8
 
#define __TOPOLOGY_COMPUTATION_H
9
 
 
10
 
#include <dolfin/constants.h>
11
 
 
12
 
namespace dolfin
13
 
{
14
 
 
15
 
  class Mesh;
16
 
  class MeshEntity;
17
 
  class MeshConnectivity;
18
 
 
19
 
  /// This class implements a set of basic algorithms that automate
20
 
  /// the computation of mesh entities and connectivity.
21
 
 
22
 
  class TopologyComputation
23
 
  {
24
 
  public:
25
 
 
26
 
    /// Compute mesh entities of given topological dimension
27
 
    static uint computeEntities(Mesh& mesh, uint dim);
28
 
 
29
 
    /// Compute connectivity for given pair of topological dimensions
30
 
    static void computeConnectivity(Mesh& mesh, uint d0, uint d1);
31
 
 
32
 
  private:
33
 
 
34
 
    /// Compute connectivity from transpose
35
 
    static void computeFromTranspose(Mesh& mesh, uint d0, uint d1);
36
 
 
37
 
    /// Compute connectivity from intersection
38
 
    static void computeFromIntersection(Mesh& mesh, uint d0, uint d1, uint d);
39
 
 
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);
43
 
 
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);
49
 
 
50
 
    /// Check if mesh entity e0 contains mesh entity e1
51
 
    static bool contains(MeshEntity& e0, MeshEntity& e1);
52
 
 
53
 
    /// Check if array v0 contains array v1
54
 
    static bool contains(uint* v0, uint n0, uint* v1, uint n1);
55
 
    
56
 
  };
57
 
 
58
 
}
59
 
 
60
 
#endif