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

« back to all changes in this revision

Viewing changes to nfem/pform_element/lumped_mass.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_LUMPED_MASS_H
 
2
#define _RHEO_LUMPED_MASS_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/form_element.h"
 
24
 
 
25
namespace rheolef { 
 
26
 
 
27
/*Class:
 
28
NAME: @code{lumped_mass} -- lumped L2 scalar product
 
29
@bfindex lumped mass
 
30
@apindex P0
 
31
@apindex P1d
 
32
@apindex bubble
 
33
@cindex  lumped mass procedure
 
34
SYNOPSIS:
 
35
    @example
 
36
        form(const space& V, const space& V, "lumped_mass");
 
37
        form(const space& M, const space& V, "lumped_mass");
 
38
        form (const space& V, const space& V, "lumped_mass", const domain& gamma);
 
39
        form_diag(const space& V, "mass");
 
40
    @end example
 
41
EXAMPLE:
 
42
  The use of lumped mass form write:
 
43
  @example
 
44
        form m(V, "lumped_mass");
 
45
  @end example
 
46
  or (see also @ref{mass form}):
 
47
  @example
 
48
        form_diag md(V, "mass");
 
49
  @end example
 
50
  The lumped procedure sums all extra-diagonal terms on the diagonal:
 
51
  let us denote M the original mass matrix, then, the lumped mass matrix
 
52
  is the diagonal matrix defined by: 
 
53
  @example
 
54
                    n
 
55
                   ----
 
56
                   \
 
57
        M1(i,i) =  /    M(i,j)
 
58
                   ----
 
59
                    j=1
 
60
  @end example
 
61
AUTHOR: 
 
62
    LMC-IMAG, 38041 Grenoble cedex 9, France
 
63
    | Pierre.Saramito@imag.fr
 
64
End:
 
65
*/
 
66
template<class T, class M>
 
67
class lumped_mass: public form_element_rep<T,M> {
 
68
public:
 
69
    typedef form_element_rep<T,M>       base;
 
70
    typedef typename base::size_type    size_type;
 
71
    typedef typename base::geo_type     geo_type;
 
72
    typedef typename base::space_type   space_type;
 
73
 
 
74
    lumped_mass (const space_type& X, const space_type& Y, const geo_type& omega,
 
75
        const quadrature_option_type& qopt)
 
76
        : form_element_rep<T,M> (X,Y,omega,qopt) { base::initialize_all(); }
 
77
 
 
78
    void operator() (const geo_element& K, ublas::matrix<T>& m) const;
 
79
    void initialize () const;
 
80
    bool is_symmetric () const { return true; }
 
81
};
 
82
 
 
83
}// namespace rheolef
 
84
#endif // _RHEOLEF_MASS_H