~ubuntu-branches/ubuntu/trusty/rheolef/trusty-proposed

« back to all changes in this revision

Viewing changes to nfem/basis/numbering.h

  • Committer: Bazaar Package Importer
  • Author(s): Christophe Prud'homme
  • Date: 2010-06-12 09:08:59 UTC
  • Revision ID: james.westby@ubuntu.com-20100612090859-8gpm2gc7j3ab43et
Tags: upstream-5.89
ImportĀ upstreamĀ versionĀ 5.89

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef _RHEO_NUMBERING_H
 
2
#define _RHEO_NUMBERING_H
 
3
///
 
4
/// This file is part of Rheolef.
 
5
///
 
6
/// Copyright (C) 2000-2009 Pierre Saramito <Pierre.Saramito@imag.fr>
 
7
///
 
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.
 
12
///
 
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.
 
17
///
 
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
 
21
/// 
 
22
/// =========================================================================
 
23
#include "rheolef/numbering_rep.h"
 
24
#include "rheolef/smart_pointer.h"
 
25
 
 
26
/*Class:numbering
 
27
NAME: @code{numbering} - global degree of freedom numbering
 
28
@cindex  numbering, global degree of freedom
 
29
@cindex  polynomial basis
 
30
@clindex numbering
 
31
SYNOPSYS:
 
32
  @noindent
 
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.
 
41
 
 
42
AUTHORS:
 
43
    LMC-IMAG, 38041 Grenoble cedex 9, France
 
44
   | Pierre.Saramito@imag.fr
 
45
DATE:   7 january 2004
 
46
End:
 
47
*/
 
48
 
 
49
//<numbering:
 
50
class numbering : public smart_pointer<numbering_rep> {
 
51
public:
 
52
 
 
53
// typedefs:
 
54
 
 
55
    typedef size_t size_type;
 
56
 
 
57
// allocators:
 
58
 
 
59
    numbering (std::string name = "");
 
60
    numbering (numbering_rep* ptr);
 
61
 
 
62
    virtual ~numbering() {}
 
63
 
 
64
// accessors:
 
65
 
 
66
    std::string name() const;
 
67
    virtual
 
68
    size_type ndof (
 
69
              size_type  mesh_map_dimension,
 
70
        const size_type* mesh_n_geo,
 
71
        const size_type* mesh_n_element) const;
 
72
 
 
73
    virtual
 
74
    size_type idof (   
 
75
        const size_type*      mesh_n_geo,
 
76
        const size_type*      mesh_n_element,
 
77
        const geo_element&    K, 
 
78
        size_type             i_dof_local) const;
 
79
 
 
80
    virtual
 
81
    void idof (   
 
82
        const size_type*        mesh_n_geo,
 
83
        const size_type*        mesh_n_element,
 
84
        const geo_element&      K, 
 
85
        std::vector<size_type>& i_dof) const;
 
86
 
 
87
// i/o:
 
88
 
 
89
    void dump(std::ostream& out = std::cerr) const;
 
90
};
 
91
//>numbering:
 
92
// -----------------------------------------------------------
 
93
// inlined
 
94
// -----------------------------------------------------------
 
95
inline
 
96
numbering::numbering(std::string name)
 
97
 : smart_pointer<numbering_rep> (numbering_rep::make_ptr(name))
 
98
{
 
99
}
 
100
inline
 
101
numbering::numbering (numbering_rep* ptr)
 
102
 : smart_pointer<numbering_rep> (ptr)
 
103
{
 
104
}
 
105
inline
 
106
std::string
 
107
numbering::name() const
 
108
{
 
109
  return data().name();
 
110
}
 
111
inline
 
112
void
 
113
numbering::dump(std::ostream& out) const
 
114
{
 
115
    out << "numbering " << name() << std::endl;
 
116
}
 
117
inline
 
118
numbering::size_type
 
119
numbering::ndof (
 
120
               size_type  mesh_map_dimension,
 
121
         const size_type* mesh_n_geo,
 
122
         const size_type* mesh_n_element) const
 
123
{
 
124
    return data().ndof (mesh_map_dimension, mesh_n_geo, mesh_n_element);
 
125
}
 
126
inline
 
127
numbering::size_type 
 
128
numbering::idof (   
 
129
         const size_type*      mesh_n_geo,
 
130
         const size_type*      mesh_n_element,
 
131
         const geo_element&    K, 
 
132
         size_type             i_dof_local) const
 
133
{
 
134
    return data().idof (mesh_n_geo, mesh_n_element, K, i_dof_local);
 
135
}
 
136
inline
 
137
void
 
138
numbering::idof (   
 
139
        const size_type*        mesh_n_geo,
 
140
        const size_type*        mesh_n_element,
 
141
        const geo_element&      K, 
 
142
        std::vector<size_type>& i_dof) const
 
143
{
 
144
    return data().idof (mesh_n_geo, mesh_n_element, K, i_dof);
 
145
}
 
146
#endif // _RHEO_NUMBERING_H