~ubuntu-branches/ubuntu/raring/rheolef/raring-proposed

« back to all changes in this revision

Viewing changes to nfem/lib/numbering_v1.h

  • Committer: Package Import Robot
  • Author(s): Pierre Saramito
  • Date: 2012-04-06 09:12:21 UTC
  • mfrom: (1.1.5)
  • Revision ID: package-import@ubuntu.com-20120406091221-m58me99p1nxqui49
Tags: 6.0-1
* New upstream release 6.0 (major changes):
  - massively distributed and parallel support
  - full FEM characteristic method (Lagrange-Gakerkin method) support
  - enhanced users documentation 
  - source code supports g++-4.7 (closes: #667356)
* debian/control: dependencies for MPI distributed solvers added
* debian/rules: build commands simplified
* debian/librheolef-dev.install: man1/* to man9/* added
* debian/changelog: package description rewritted (closes: #661689)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef _RHEO_NUMBERING_V1_H
 
2
#define _RHEO_NUMBERING_V1_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_v1.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
namespace rheolef { 
 
50
//<numbering:
 
51
class numbering : public smart_pointer<numbering_rep> {
 
52
public:
 
53
 
 
54
// typedefs:
 
55
    typedef numbering_rep                rep;
 
56
    typedef smart_pointer<numbering_rep> base;
 
57
    typedef size_t                       size_type;
 
58
 
 
59
// allocators:
 
60
 
 
61
    numbering (std::string name = "");
 
62
    numbering (numbering_rep* ptr);
 
63
 
 
64
    virtual ~numbering() {}
 
65
 
 
66
// accessors:
 
67
 
 
68
    std::string name() const;
 
69
    virtual
 
70
    size_type ndof (
 
71
              size_type  mesh_map_dimension,
 
72
        const size_type* mesh_n_geo,
 
73
        const size_type* mesh_n_element) const;
 
74
 
 
75
    virtual
 
76
    size_type idof (   
 
77
        const size_type*      mesh_n_geo,
 
78
        const size_type*      mesh_n_element,
 
79
        const geo_element&    K, 
 
80
        size_type             i_dof_local) const;
 
81
 
 
82
    virtual
 
83
    void idof (   
 
84
        const size_type*        mesh_n_geo,
 
85
        const size_type*        mesh_n_element,
 
86
        const geo_element&      K, 
 
87
        std::vector<size_type>& i_dof) const;
 
88
 
 
89
    virtual bool is_continuous() const;
 
90
    virtual bool is_discontinuous() const { return !is_continuous(); }
 
91
 
 
92
// i/o:
 
93
 
 
94
    void dump(std::ostream& out = std::cerr) const;
 
95
};
 
96
//>numbering:
 
97
// -----------------------------------------------------------
 
98
// inlined
 
99
// -----------------------------------------------------------
 
100
inline
 
101
numbering::numbering(std::string name)
 
102
 : base (rep::make_ptr(name))
 
103
{
 
104
}
 
105
inline
 
106
numbering::numbering (numbering_rep* ptr)
 
107
 : base (ptr)
 
108
{
 
109
}
 
110
inline
 
111
std::string
 
112
numbering::name() const
 
113
{
 
114
  return data().name();
 
115
}
 
116
inline
 
117
void
 
118
numbering::dump(std::ostream& out) const
 
119
{
 
120
    out << "numbering " << name() << std::endl;
 
121
}
 
122
inline
 
123
numbering::size_type
 
124
numbering::ndof (
 
125
               size_type  mesh_map_dimension,
 
126
         const size_type* mesh_n_geo,
 
127
         const size_type* mesh_n_element) const
 
128
{
 
129
    return data().ndof (mesh_map_dimension, mesh_n_geo, mesh_n_element);
 
130
}
 
131
inline
 
132
numbering::size_type 
 
133
numbering::idof (   
 
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
 
138
{
 
139
    return data().idof (mesh_n_geo, mesh_n_element, K, i_dof_local);
 
140
}
 
141
inline
 
142
void
 
143
numbering::idof (   
 
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
 
148
{
 
149
    return data().idof (mesh_n_geo, mesh_n_element, K, i_dof);
 
150
}
 
151
inline
 
152
bool
 
153
numbering::is_continuous () const   
 
154
{
 
155
    return data().is_continuous();
 
156
}
 
157
 
 
158
}// namespace rheolef
 
159
#endif // _RHEO_NUMBERING_V1_H