comparison src/meshfunction.h @ 258:ab35a8b0deef

Support storage of mesh markers via meshfunction
author Eugenio Gianniti <eugenio.gianniti@mail.polimi.it>
date Fri, 01 Aug 2014 18:59:18 +0200
parents
children 598c5e9e0a9e
comparison
equal deleted inserted replaced
257:fb67b636616f 258:ab35a8b0deef
1 /*
2 Copyright (C) 2014 Eugenio Gianniti <eugenio.gianniti@mail.polimi.it>
3
4 This program is free software; you can redistribute it and/or modify it under
5 the terms of the GNU General Public License as published by the Free Software
6 Foundation; either version 3 of the License, or (at your option) any later
7 version.
8
9 This program is distributed in the hope that it will be useful, but WITHOUT
10 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
12 details.
13
14 You should have received a copy of the GNU General Public License along with
15 this program; if not, see <http://www.gnu.org/licenses/>.
16 */
17
18 #ifndef _MESHFUNCTION_OCTAVE_
19 #define _MESHFUNCTION_OCTAVE_
20
21 #include <dolfin.h>
22 #include <octave/oct.h>
23 #include "dolfin_compat.h"
24
25 class meshfunction : public octave_base_value
26 {
27 public:
28
29 meshfunction (void)
30 : octave_base_value () {}
31
32 meshfunction (dolfin::MeshFunction <std::size_t> const & _mf)
33 : octave_base_value (), pmf (new dolfin::MeshFunction <std::size_t> (_mf)) {}
34
35 bool
36 is_defined (void) const
37 { return true; }
38
39 dolfin::MeshFunction <std::size_t> const &
40 get_mf (void) const
41 { return *pmf; }
42
43 SHARED_PTR <dolfin::MeshFunction <std::size_t> const> const &
44 get_pmf (void) const
45 { return pmf; }
46
47 private:
48
49 SHARED_PTR <dolfin::MeshFunction <std::size_t> const> pmf;
50
51 DECLARE_OCTAVE_ALLOCATOR;
52 DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA;
53 };
54
55 static bool meshfunction_type_loaded = false;
56
57 DEFINE_OCTAVE_ALLOCATOR (meshfunction);
58 DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (meshfunction, "meshfunction", "meshfunction");
59
60 #endif