DOLFIN
DOLFIN C++ interface
IntervalMesh.h
1 // Copyright (C) 2007 Kristian B. Oelgaard
2 //
3 // This file is part of DOLFIN.
4 //
5 // DOLFIN is free software: you can redistribute it and/or modify
6 // it under the terms of the GNU Lesser General Public License as published by
7 // the Free Software Foundation, either version 3 of the License, or
8 // (at your option) any later version.
9 //
10 // DOLFIN is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU Lesser General Public License for more details.
14 //
15 // You should have received a copy of the GNU Lesser General Public License
16 // along with DOLFIN. If not, see <http://www.gnu.org/licenses/>.
17 
18 #ifndef __INTERVAL_MESH_H
19 #define __INTERVAL_MESH_H
20 
21 #include <array>
22 #include <cstddef>
23 #include <dolfin/common/MPI.h>
24 #include <dolfin/mesh/Mesh.h>
25 
26 namespace dolfin
27 {
28 
32 
33  class IntervalMesh : public Mesh
34  {
35  public:
36 
49  static Mesh create(std::size_t n, std::array<double, 2> x)
50  { return create(MPI_COMM_WORLD, n, x); }
51 
66  static Mesh create(MPI_Comm comm, std::size_t n, std::array<double, 2> x)
67  {
68  Mesh mesh(comm);
69  build(mesh, n, x);
70  return mesh;
71  }
72 
87  IntervalMesh(std::size_t n, double a, double b);
88 
105  IntervalMesh(MPI_Comm comm, std::size_t n, double a, double b);
106 
107  private:
108 
109  // Build mesh
110  static void build(Mesh& mesh, std::size_t n, std::array<double, 2> x);
111 
112  };
113 
114 }
115 
116 #endif
Definition: adapt.h:29
static Mesh create(std::size_t n, std::array< double, 2 > x)
Definition: IntervalMesh.h:49
Definition: IntervalMesh.h:33
IntervalMesh(std::size_t n, double a, double b)
Definition: IntervalMesh.cpp:29
static Mesh create(MPI_Comm comm, std::size_t n, std::array< double, 2 > x)
Definition: IntervalMesh.h:66
Definition: Mesh.h:82