~njansson/dolfin/hpc

« back to all changes in this revision

Viewing changes to dolfin/mesh/UnitSquare.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) 2005-2006 Anders Logg.
 
2
// Licensed under the GNU LGPL Version 2.1.
 
3
//
 
4
// First added:  2005-12-02
 
5
// Last changed: 2006-08-07
 
6
 
 
7
#ifndef __UNIT_SQUARE_H
 
8
#define __UNIT_SQUARE_H
 
9
 
 
10
#include "Mesh.h"
 
11
 
 
12
namespace dolfin
 
13
{
 
14
 
 
15
  /// Triangular mesh of the 2D unit square (0,1) x (0,1). 
 
16
  /// Given the number of cells (nx, ny) in each direction,
 
17
  /// the total number of triangles will be 2*nx*ny and the
 
18
  /// total number of vertices will be (nx + 1)*(ny + 1).
 
19
 
 
20
  /// The Type is an enumerater taking values in {left, right or
 
21
  /// crisscross} indicating the direction of the diagonals for
 
22
  /// left/right or both == crisscross. The default is right.
 
23
 
 
24
  class UnitSquare : public Mesh
 
25
  {
 
26
  public:
 
27
    enum Type {right, left, crisscross};
 
28
    
 
29
    UnitSquare(uint nx, uint ny, Type type = right);
 
30
 
 
31
  };
 
32
  
 
33
}
 
34
 
 
35
#endif