1
#ifndef _RHEO_NUMBERING_V1_H
2
#define _RHEO_NUMBERING_V1_H
4
/// This file is part of Rheolef.
6
/// Copyright (C) 2000-2009 Pierre Saramito <Pierre.Saramito@imag.fr>
8
/// Rheolef is free software; you can redistribute it and/or modify
9
/// it under the terms of the GNU General Public License as published by
10
/// the Free Software Foundation; either version 2 of the License, or
11
/// (at your option) any later version.
13
/// Rheolef is distributed in the hope that it will be useful,
14
/// but WITHOUT ANY WARRANTY; without even the implied warranty of
15
/// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
/// GNU General Public License for more details.
18
/// You should have received a copy of the GNU General Public License
19
/// along with Rheolef; if not, write to the Free Software
20
/// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22
/// =========================================================================
23
#include "rheolef/numbering_rep_v1.h"
24
#include "rheolef/smart_pointer.h"
27
NAME: @code{numbering} - global degree of freedom numbering
28
@cindex numbering, global degree of freedom
29
@cindex polynomial basis
33
The @code{numbering} class defines methods that furnish global
34
numbering of degrees of freedom. This numbering depends upon
35
the degrees of polynoms on elements and upon the continuity
36
requirement at inter-element boundary. For instance the
37
"P1" continuous finite element approximation has one degree
38
of freedom per vertice of the mesh, while its discontinuous
39
counterpart has dim(basis) times the number of elements of the
40
mesh, where dim(basis) is the size of the local finite element basis.
43
LMC-IMAG, 38041 Grenoble cedex 9, France
44
| Pierre.Saramito@imag.fr
51
class numbering : public smart_pointer<numbering_rep> {
55
typedef numbering_rep rep;
56
typedef smart_pointer<numbering_rep> base;
57
typedef size_t size_type;
61
numbering (std::string name = "");
62
numbering (numbering_rep* ptr);
64
virtual ~numbering() {}
68
std::string name() const;
71
size_type mesh_map_dimension,
72
const size_type* mesh_n_geo,
73
const size_type* mesh_n_element) const;
77
const size_type* mesh_n_geo,
78
const size_type* mesh_n_element,
80
size_type i_dof_local) const;
84
const size_type* mesh_n_geo,
85
const size_type* mesh_n_element,
87
std::vector<size_type>& i_dof) const;
89
virtual bool is_continuous() const;
90
virtual bool is_discontinuous() const { return !is_continuous(); }
94
void dump(std::ostream& out = std::cerr) const;
97
// -----------------------------------------------------------
99
// -----------------------------------------------------------
101
numbering::numbering(std::string name)
102
: base (rep::make_ptr(name))
106
numbering::numbering (numbering_rep* ptr)
112
numbering::name() const
114
return data().name();
118
numbering::dump(std::ostream& out) const
120
out << "numbering " << name() << std::endl;
125
size_type mesh_map_dimension,
126
const size_type* mesh_n_geo,
127
const size_type* mesh_n_element) const
129
return data().ndof (mesh_map_dimension, mesh_n_geo, mesh_n_element);
134
const size_type* mesh_n_geo,
135
const size_type* mesh_n_element,
136
const geo_element& K,
137
size_type i_dof_local) const
139
return data().idof (mesh_n_geo, mesh_n_element, K, i_dof_local);
144
const size_type* mesh_n_geo,
145
const size_type* mesh_n_element,
146
const geo_element& K,
147
std::vector<size_type>& i_dof) const
149
return data().idof (mesh_n_geo, mesh_n_element, K, i_dof);
153
numbering::is_continuous () const
155
return data().is_continuous();
158
}// namespace rheolef
159
#endif // _RHEO_NUMBERING_V1_H