annotate src/fem_init_mesh.cc @ 79:3e49ef16d74a

The methods of the mesh class are implemented in the file where they are needed. * fem_get_mesh.cc: implement the method for extracting the matrix. * fem_init_mesh.cc: implement the constructor * This is done to avoid conflict of multiple definition functions.
author gedeone-octave <marcovass89@hotmail.it>
date Sat, 03 Aug 2013 14:32:33 +0200
parents fca8c3d75036
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
10
277b60c6618a New function: create a mesh
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
1 /*
277b60c6618a New function: create a mesh
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
2 Copyright (C) 2013 Marco Vassallo
277b60c6618a New function: create a mesh
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
3
277b60c6618a New function: create a mesh
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
4 This program is free software; you can redistribute it and/or modify it under
277b60c6618a New function: create a mesh
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
5 the terms of the GNU General Public License as published by the Free Software
277b60c6618a New function: create a mesh
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
6 Foundation; either version 2 of the License, or (at your option) any later
277b60c6618a New function: create a mesh
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
7 version.
277b60c6618a New function: create a mesh
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
8
277b60c6618a New function: create a mesh
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
9 This program is distributed in the hope that it will be useful, but WITHOUT
277b60c6618a New function: create a mesh
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
10 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
277b60c6618a New function: create a mesh
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
11 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
277b60c6618a New function: create a mesh
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
12 details.
277b60c6618a New function: create a mesh
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
13
277b60c6618a New function: create a mesh
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
14 You should have received a copy of the GNU General Public License along with
277b60c6618a New function: create a mesh
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
15 this program; if not, see <http://www.gnu.org/licenses/>.
277b60c6618a New function: create a mesh
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
16 */
277b60c6618a New function: create a mesh
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
17
277b60c6618a New function: create a mesh
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
18 #include "mesh.h"
277b60c6618a New function: create a mesh
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
19
16
448e01d4411f Introduce the use of boost::shared_ptr for class members
gedeone-octave <marco.vassallo@outlook.com>
parents: 12
diff changeset
20 DEFUN_DLD (fem_init_mesh, args, ,"-*- texinfo -*-\n\
448e01d4411f Introduce the use of boost::shared_ptr for class members
gedeone-octave <marco.vassallo@outlook.com>
parents: 12
diff changeset
21 @deftypefn {Function File} {[@var{mesh_out}]} = \
448e01d4411f Introduce the use of boost::shared_ptr for class members
gedeone-octave <marco.vassallo@outlook.com>
parents: 12
diff changeset
22 fem_get_mesh (@var{mesh_in}) \n\
448e01d4411f Introduce the use of boost::shared_ptr for class members
gedeone-octave <marco.vassallo@outlook.com>
parents: 12
diff changeset
23 The @var{mesh_in} should be either\n\
448e01d4411f Introduce the use of boost::shared_ptr for class members
gedeone-octave <marco.vassallo@outlook.com>
parents: 12
diff changeset
24 @itemize @bullet \n\
448e01d4411f Introduce the use of boost::shared_ptr for class members
gedeone-octave <marco.vassallo@outlook.com>
parents: 12
diff changeset
25 @item a string containing the name of the file where the mesh is stored\
448e01d4411f Introduce the use of boost::shared_ptr for class members
gedeone-octave <marco.vassallo@outlook.com>
parents: 12
diff changeset
26 (compatible formats are the ones which are compatible with Fenics\n\
448e01d4411f Introduce the use of boost::shared_ptr for class members
gedeone-octave <marco.vassallo@outlook.com>
parents: 12
diff changeset
27 @item a a PDE-tool like structure with matrix fields (p,e,t)\n\
448e01d4411f Introduce the use of boost::shared_ptr for class members
gedeone-octave <marco.vassallo@outlook.com>
parents: 12
diff changeset
28 @end itemize\n\
448e01d4411f Introduce the use of boost::shared_ptr for class members
gedeone-octave <marco.vassallo@outlook.com>
parents: 12
diff changeset
29 fem_init_mesh().\n\
448e01d4411f Introduce the use of boost::shared_ptr for class members
gedeone-octave <marco.vassallo@outlook.com>
parents: 12
diff changeset
30 The output @var{mesh_out} is a representation of the\n\
448e01d4411f Introduce the use of boost::shared_ptr for class members
gedeone-octave <marco.vassallo@outlook.com>
parents: 12
diff changeset
31 @var{mesh_in} which is compatible with fem-fenics\n\
448e01d4411f Introduce the use of boost::shared_ptr for class members
gedeone-octave <marco.vassallo@outlook.com>
parents: 12
diff changeset
32 @seealso{fem_get_mesh}\n\
448e01d4411f Introduce the use of boost::shared_ptr for class members
gedeone-octave <marco.vassallo@outlook.com>
parents: 12
diff changeset
33 @end deftypefn")
10
277b60c6618a New function: create a mesh
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
34 {
277b60c6618a New function: create a mesh
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
35 int nargin = args.length ();
277b60c6618a New function: create a mesh
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
36 octave_value retval = 0;
277b60c6618a New function: create a mesh
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
37
277b60c6618a New function: create a mesh
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
38 if (nargin < 1 || nargin > 1)
277b60c6618a New function: create a mesh
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
39 print_usage ();
277b60c6618a New function: create a mesh
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
40 else
277b60c6618a New function: create a mesh
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
41 {
277b60c6618a New function: create a mesh
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
42 if (!error_state)
277b60c6618a New function: create a mesh
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
43 {
12
b7c74c0bdabd New functions which get a (p,e,t) matrix from a mesh object
gedeone-octave <marco.vassallo@outlook.com>
parents: 10
diff changeset
44 if (args(0).is_string () == true)
10
277b60c6618a New function: create a mesh
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
45 {
12
b7c74c0bdabd New functions which get a (p,e,t) matrix from a mesh object
gedeone-octave <marco.vassallo@outlook.com>
parents: 10
diff changeset
46 std::string filename = args(0).string_value ();
b7c74c0bdabd New functions which get a (p,e,t) matrix from a mesh object
gedeone-octave <marco.vassallo@outlook.com>
parents: 10
diff changeset
47 //if the filename is not valid, dolfin takes care of it
44
fca8c3d75036 register_type is called before every type is used.
gedeone-octave <marco.vassallo@outlook.com>
parents: 16
diff changeset
48
fca8c3d75036 register_type is called before every type is used.
gedeone-octave <marco.vassallo@outlook.com>
parents: 16
diff changeset
49 if (! mesh_type_loaded)
fca8c3d75036 register_type is called before every type is used.
gedeone-octave <marco.vassallo@outlook.com>
parents: 16
diff changeset
50 {
fca8c3d75036 register_type is called before every type is used.
gedeone-octave <marco.vassallo@outlook.com>
parents: 16
diff changeset
51 mesh::register_type ();
fca8c3d75036 register_type is called before every type is used.
gedeone-octave <marco.vassallo@outlook.com>
parents: 16
diff changeset
52 mesh_type_loaded = true;
fca8c3d75036 register_type is called before every type is used.
gedeone-octave <marco.vassallo@outlook.com>
parents: 16
diff changeset
53 mlock ();
fca8c3d75036 register_type is called before every type is used.
gedeone-octave <marco.vassallo@outlook.com>
parents: 16
diff changeset
54 }
12
b7c74c0bdabd New functions which get a (p,e,t) matrix from a mesh object
gedeone-octave <marco.vassallo@outlook.com>
parents: 10
diff changeset
55 retval = new mesh (filename);
b7c74c0bdabd New functions which get a (p,e,t) matrix from a mesh object
gedeone-octave <marco.vassallo@outlook.com>
parents: 10
diff changeset
56 }
10
277b60c6618a New function: create a mesh
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
57
44
fca8c3d75036 register_type is called before every type is used.
gedeone-octave <marco.vassallo@outlook.com>
parents: 16
diff changeset
58 else
fca8c3d75036 register_type is called before every type is used.
gedeone-octave <marco.vassallo@outlook.com>
parents: 16
diff changeset
59 {
fca8c3d75036 register_type is called before every type is used.
gedeone-octave <marco.vassallo@outlook.com>
parents: 16
diff changeset
60 octave_scalar_map a = args(0).scalar_map_value ();
fca8c3d75036 register_type is called before every type is used.
gedeone-octave <marco.vassallo@outlook.com>
parents: 16
diff changeset
61 Array<double> p = a.contents ("p").matrix_value ();
fca8c3d75036 register_type is called before every type is used.
gedeone-octave <marco.vassallo@outlook.com>
parents: 16
diff changeset
62 Array<octave_idx_type> t = a.contents ("t").matrix_value ();
fca8c3d75036 register_type is called before every type is used.
gedeone-octave <marco.vassallo@outlook.com>
parents: 16
diff changeset
63 Array<octave_idx_type> e = a.contents ("e").matrix_value ();
12
b7c74c0bdabd New functions which get a (p,e,t) matrix from a mesh object
gedeone-octave <marco.vassallo@outlook.com>
parents: 10
diff changeset
64
44
fca8c3d75036 register_type is called before every type is used.
gedeone-octave <marco.vassallo@outlook.com>
parents: 16
diff changeset
65 if (! error_state)
fca8c3d75036 register_type is called before every type is used.
gedeone-octave <marco.vassallo@outlook.com>
parents: 16
diff changeset
66 {
fca8c3d75036 register_type is called before every type is used.
gedeone-octave <marco.vassallo@outlook.com>
parents: 16
diff changeset
67 if (! mesh_type_loaded)
fca8c3d75036 register_type is called before every type is used.
gedeone-octave <marco.vassallo@outlook.com>
parents: 16
diff changeset
68 {
fca8c3d75036 register_type is called before every type is used.
gedeone-octave <marco.vassallo@outlook.com>
parents: 16
diff changeset
69 mesh::register_type ();
fca8c3d75036 register_type is called before every type is used.
gedeone-octave <marco.vassallo@outlook.com>
parents: 16
diff changeset
70 mesh_type_loaded = true;
fca8c3d75036 register_type is called before every type is used.
gedeone-octave <marco.vassallo@outlook.com>
parents: 16
diff changeset
71 mlock ();
fca8c3d75036 register_type is called before every type is used.
gedeone-octave <marco.vassallo@outlook.com>
parents: 16
diff changeset
72 }
fca8c3d75036 register_type is called before every type is used.
gedeone-octave <marco.vassallo@outlook.com>
parents: 16
diff changeset
73
fca8c3d75036 register_type is called before every type is used.
gedeone-octave <marco.vassallo@outlook.com>
parents: 16
diff changeset
74 retval = new mesh (p, e, t);
fca8c3d75036 register_type is called before every type is used.
gedeone-octave <marco.vassallo@outlook.com>
parents: 16
diff changeset
75 }
fca8c3d75036 register_type is called before every type is used.
gedeone-octave <marco.vassallo@outlook.com>
parents: 16
diff changeset
76 else
fca8c3d75036 register_type is called before every type is used.
gedeone-octave <marco.vassallo@outlook.com>
parents: 16
diff changeset
77 error ("fem_init_mesh: the argument you provide is invalid");
fca8c3d75036 register_type is called before every type is used.
gedeone-octave <marco.vassallo@outlook.com>
parents: 16
diff changeset
78 }
10
277b60c6618a New function: create a mesh
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
79 }
277b60c6618a New function: create a mesh
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
80 }
277b60c6618a New function: create a mesh
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
81 return retval;
277b60c6618a New function: create a mesh
gedeone-octave <marco.vassallo@outlook.com>
parents:
diff changeset
82 }
79
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
83
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
84 mesh::mesh (Array<double>& p, Array<octave_idx_type>& e,
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
85 Array<octave_idx_type>& t)
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
86 {
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
87
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
88 std::size_t D = p.rows ();
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
89 if (D < 2 || D > 3)
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
90 error ("mesh constructor: only 2D or 3D meshes are supported");
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
91 else
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
92 {
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
93 dolfin::MeshEditor editor;
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
94 dolfin::Mesh msh;
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
95 editor.open (msh, D, D);
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
96 editor.init_vertices (p.cols ());
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
97 editor.init_cells (t.cols ());
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
98
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
99 if (D == 2)
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
100 {
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
101 for (uint i = 0; i < p.cols (); ++i)
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
102 editor.add_vertex (i, p.xelem (0, i), p.xelem (1, i));
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
103
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
104 for (uint i = 0; i < t.cols (); ++i)
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
105 editor.add_cell (i, t.xelem (0, i) - 1,
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
106 t.xelem (1, i) - 1, t.xelem (2, i) - 1);
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
107 }
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
108
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
109 if (D == 3)
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
110 {
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
111 for (uint i = 0; i < p.cols (); ++i)
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
112 editor.add_vertex (i, p.xelem (0, i),
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
113 p.xelem (1, i), p.xelem (2, i));
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
114
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
115 for (uint i = 0; i < t.cols (); ++i)
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
116 editor.add_cell (i, t.xelem (0, i) - 1, t.xelem (1, i) - 1,
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
117 t.xelem (2, i) - 1, t.xelem (3, i) - 1);
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
118 }
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
119
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
120 editor.close ();
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
121
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
122 // store information associated with e
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
123 msh.init (D - 1);
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
124 dolfin::MeshValueCollection<std::size_t> facet (D - 1);
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
125 std::size_t num_side_edges = e.cols ();
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
126
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
127 if (D == 2)
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
128 {
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
129 for (uint i = 0; i < num_side_edges; ++i)
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
130 {
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
131 dolfin::Vertex v (msh, e.xelem (0, i) - 1);
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
132 for (dolfin::FacetIterator f (v); ! f.end (); ++f)
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
133 {
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
134 if ((*f).entities(0)[0] == e.xelem (0, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
135 && (*f).entities(0)[1] == e.xelem (1, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
136 || (*f).entities(0)[0] == e.xelem (1, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
137 && (*f).entities(0)[1] == e.xelem (0, i) - 1)
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
138 {
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
139 facet.set_value ((*f).index (), e.xelem (4, i), msh);
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
140 break;
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
141 }
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
142 }
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
143 }
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
144 }
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
145
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
146
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
147
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
148 if (D == 3)
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
149 {
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
150 for (uint i = 0; i < num_side_edges; ++i)
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
151 {
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
152 dolfin::Vertex v (msh, e.xelem (0, i) - 1);
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
153 for (dolfin::FacetIterator f (v); ! f.end (); ++f)
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
154 {
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
155 if ((*f).entities(0)[0] == e(0, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
156 && (*f).entities(0)[1] == e.xelem (1, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
157 && (*f).entities(0)[2] == e.xelem (2, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
158 || (*f).entities(0)[0] == e.xelem (0, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
159 && (*f).entities(0)[1] == e.xelem (2, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
160 && (*f).entities(0)[2] == e.xelem (1, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
161 || (*f).entities(0)[0] == e.xelem (1, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
162 && (*f).entities(0)[1] == e.xelem (0, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
163 && (*f).entities(0)[2] == e.xelem (2, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
164 || (*f).entities(0)[0] == e.xelem (1, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
165 && (*f).entities(0)[1] == e.xelem (2, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
166 && (*f).entities(0)[2] == e.xelem (0, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
167 || (*f).entities(0)[0] == e.xelem (2, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
168 && (*f).entities(0)[1] == e.xelem (0, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
169 && (*f).entities(0)[2] == e.xelem (1, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
170 || (*f).entities(0)[0] == e.xelem (2, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
171 && (*f).entities(0)[1] == e.xelem (1, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
172 && (*f).entities(0)[2] == e.xelem (0, i) - 1)
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
173 {
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
174 facet.set_value ((*f).index (), e.xelem (9, i), msh);
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
175 break;
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
176 }
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
177 }
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
178 }
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
179 }
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
180
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
181 *(msh.domains ().markers (D - 1)) = facet;
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
182
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
183 // store information associated with t
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
184 dolfin::MeshValueCollection<std::size_t> cell (D);
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
185 std::size_t num_cells = t.cols ();
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
186
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
187 if (D == 2)
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
188 {
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
189 for (uint i = 0; i < num_cells; ++i)
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
190 {
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
191 dolfin::Vertex v (msh, t.xelem (0, i) - 1);
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
192 for (dolfin::CellIterator f (v); ! f.end (); ++f)
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
193 {
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
194 if ((*f).entities(0)[0] == t.xelem (0, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
195 && (*f).entities(0)[1] == t.xelem (1, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
196 && (*f).entities(0)[2] == t.xelem (2, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
197 || (*f).entities(0)[0] == t.xelem (0, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
198 && (*f).entities(0)[1] == t.xelem (2, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
199 && (*f).entities(0)[2] == t.xelem (1, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
200 || (*f).entities(0)[0] == t.xelem (1, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
201 && (*f).entities(0)[1] == t.xelem (0, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
202 && (*f).entities(0)[2] == t.xelem (2, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
203 || (*f).entities(0)[0] == t.xelem (1, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
204 && (*f).entities(0)[1] == t.xelem (2, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
205 && (*f).entities(0)[2] == t.xelem (0, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
206 || (*f).entities(0)[0] == t.xelem (2, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
207 && (*f).entities(0)[1] == t.xelem (0, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
208 && (*f).entities(0)[2] == t.xelem (1, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
209 || (*f).entities(0)[0] == t.xelem (2, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
210 && (*f).entities(0)[1] == t.xelem (1, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
211 && (*f).entities(0)[2] == t.xelem (0, i) - 1)
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
212 {
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
213 cell.set_value ((*f).index (), t.xelem (3, i), msh);
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
214 break;
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
215 }
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
216 }
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
217 }
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
218 }
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
219
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
220
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
221
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
222 if (D == 3)
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
223 {
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
224 for (uint i = 0; i < num_cells; ++i)
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
225 {
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
226 dolfin::Vertex v (msh, t.xelem (0, i) - 1);
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
227 for (dolfin::CellIterator f (v); ! f.end (); ++f)
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
228 {
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
229 if ((*f).entities(0)[0] == t.xelem (0, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
230 && (*f).entities(0)[1] == t.xelem (1, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
231 && (*f).entities(0)[2] == t.xelem (2, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
232 && (*f).entities(0)[3] == t.xelem (3, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
233 || (*f).entities(0)[0] == t.xelem (0, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
234 && (*f).entities(0)[1] == t.xelem (1, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
235 && (*f).entities(0)[2] == t.xelem (3, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
236 && (*f).entities(0)[3] == t.xelem (2, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
237 || (*f).entities(0)[0] == t.xelem (0, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
238 && (*f).entities(0)[1] == t.xelem (2, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
239 && (*f).entities(0)[2] == t.xelem (1, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
240 && (*f).entities(0)[3] == t.xelem (3, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
241 || (*f).entities(0)[0] == t.xelem (0, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
242 && (*f).entities(0)[1] == t.xelem (2, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
243 && (*f).entities(0)[2] == t.xelem (3, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
244 && (*f).entities(0)[3] == t.xelem (1, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
245 || (*f).entities(0)[0] == t.xelem (0, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
246 && (*f).entities(0)[1] == t.xelem (3, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
247 && (*f).entities(0)[2] == t.xelem (1, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
248 && (*f).entities(0)[3] == t.xelem (2, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
249 || (*f).entities(0)[0] == t.xelem (0, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
250 && (*f).entities(0)[1] == t.xelem (3, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
251 && (*f).entities(0)[2] == t.xelem (2, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
252 && (*f).entities(0)[3] == t.xelem (1, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
253
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
254 || (*f).entities(0)[0] == t.xelem (1, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
255 && (*f).entities(0)[1] == t.xelem (0, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
256 && (*f).entities(0)[2] == t.xelem (2, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
257 && (*f).entities(0)[3] == t.xelem (3, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
258 || (*f).entities(0)[0] == t.xelem (1, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
259 && (*f).entities(0)[1] == t.xelem (0, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
260 && (*f).entities(0)[2] == t.xelem (3, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
261 && (*f).entities(0)[3] == t.xelem (2, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
262 || (*f).entities(0)[0] == t.xelem (1, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
263 && (*f).entities(0)[1] == t.xelem (2, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
264 && (*f).entities(0)[2] == t.xelem (0, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
265 && (*f).entities(0)[3] == t.xelem (3, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
266 || (*f).entities(0)[0] == t.xelem (1, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
267 && (*f).entities(0)[1] == t.xelem (2, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
268 && (*f).entities(0)[2] == t.xelem (3, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
269 && (*f).entities(0)[3] == t.xelem (0, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
270 || (*f).entities(0)[0] == t.xelem (1, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
271 && (*f).entities(0)[1] == t.xelem (3, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
272 && (*f).entities(0)[2] == t.xelem (0, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
273 && (*f).entities(0)[3] == t.xelem (2, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
274 || (*f).entities(0)[0] == t.xelem (1, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
275 && (*f).entities(0)[1] == t.xelem (3, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
276 && (*f).entities(0)[2] == t.xelem (2, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
277 && (*f).entities(0)[3] == t.xelem (0, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
278
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
279 || (*f).entities(0)[0] == t.xelem (2, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
280 && (*f).entities(0)[1] == t.xelem (0, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
281 && (*f).entities(0)[2] == t.xelem (1, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
282 && (*f).entities(0)[3] == t.xelem (3, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
283 || (*f).entities(0)[0] == t.xelem (2, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
284 && (*f).entities(0)[1] == t.xelem (0, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
285 && (*f).entities(0)[2] == t.xelem (3, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
286 && (*f).entities(0)[3] == t.xelem (1, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
287 || (*f).entities(0)[0] == t.xelem (2, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
288 && (*f).entities(0)[1] == t.xelem (1, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
289 && (*f).entities(0)[2] == t.xelem (0, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
290 && (*f).entities(0)[3] == t.xelem (3, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
291 || (*f).entities(0)[0] == t.xelem (2, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
292 && (*f).entities(0)[1] == t.xelem (1, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
293 && (*f).entities(0)[2] == t.xelem (3, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
294 && (*f).entities(0)[3] == t.xelem (0, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
295 || (*f).entities(0)[0] == t.xelem (2, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
296 && (*f).entities(0)[1] == t.xelem (3, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
297 && (*f).entities(0)[2] == t.xelem (0, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
298 && (*f).entities(0)[3] == t.xelem (1, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
299 || (*f).entities(0)[0] == t.xelem (2, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
300 && (*f).entities(0)[1] == t.xelem (3, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
301 && (*f).entities(0)[2] == t.xelem (1, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
302 && (*f).entities(0)[3] == t.xelem (0, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
303
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
304 || (*f).entities(0)[0] == t.xelem (3, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
305 && (*f).entities(0)[1] == t.xelem (0, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
306 && (*f).entities(0)[2] == t.xelem (1, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
307 && (*f).entities(0)[3] == t.xelem (2, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
308 || (*f).entities(0)[0] == t.xelem (3, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
309 && (*f).entities(0)[1] == t.xelem (0, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
310 && (*f).entities(0)[2] == t.xelem (2, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
311 && (*f).entities(0)[3] == t.xelem (1, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
312 || (*f).entities(0)[0] == t.xelem (3, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
313 && (*f).entities(0)[1] == t.xelem (1, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
314 && (*f).entities(0)[2] == t.xelem (0, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
315 && (*f).entities(0)[3] == t.xelem (2, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
316 || (*f).entities(0)[0] == t.xelem (3, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
317 && (*f).entities(0)[1] == t.xelem (1, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
318 && (*f).entities(0)[2] == t.xelem (2, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
319 && (*f).entities(0)[3] == t.xelem (0, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
320 || (*f).entities(0)[0] == t.xelem (3, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
321 && (*f).entities(0)[1] == t.xelem (2, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
322 && (*f).entities(0)[2] == t.xelem (0, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
323 && (*f).entities(0)[3] == t.xelem (1, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
324 || (*f).entities(0)[0] == t.xelem (3, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
325 && (*f).entities(0)[1] == t.xelem (2, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
326 && (*f).entities(0)[2] == t.xelem (1, i) - 1
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
327 && (*f).entities(0)[3] == t.xelem (0, i) - 1)
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
328 {
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
329 cell.set_value ((*f).index (), t.xelem (4, i), msh);
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
330 break;
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
331 }
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
332 }
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
333 }
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
334 }
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
335
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
336 *(msh.domains ().markers (D)) = cell;
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
337
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
338 boost::shared_ptr<const dolfin::Mesh> my_m (new dolfin::Mesh (msh));
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
339 pmsh = my_m;
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
340 }
3e49ef16d74a The methods of the mesh class are implemented in the file where they are needed.
gedeone-octave <marcovass89@hotmail.it>
parents: 44
diff changeset
341 }