1
#ifndef _RHEO_LUMPED_MASS_H
2
#define _RHEO_LUMPED_MASS_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/form_element.h"
28
NAME: @code{lumped_mass} -- lumped L2 scalar product
33
@cindex lumped mass procedure
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");
42
The use of lumped mass form write:
44
form m(V, "lumped_mass");
46
or (see also @ref{mass form}):
48
form_diag md(V, "mass");
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:
62
LMC-IMAG, 38041 Grenoble cedex 9, France
63
| Pierre.Saramito@imag.fr
66
template<class T, class M>
67
class lumped_mass: public form_element_rep<T,M> {
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;
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(); }
78
void operator() (const geo_element& K, ublas::matrix<T>& m) const;
79
void initialize () const;
80
bool is_symmetric () const { return true; }
84
#endif // _RHEOLEF_MASS_H