libMesh
lumped_mass_matrix.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2025 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner
3 
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License, or (at your option) any later version.
8 
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
13 
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 
18 #ifndef LIBMESH_LUMPED_MASS_MATRIX_H
19 #define LIBMESH_LUMPED_MASS_MATRIX_H
20 
21 #include "libmesh/diagonal_matrix.h"
22 
23 namespace libMesh
24 {
25 
34 template <typename T>
36 {
37 public:
50 
54  LumpedMassMatrix(LumpedMassMatrix &&) = default;
56  virtual SparseMatrix<T> & operator=(const SparseMatrix<T> &) override
57  {
58  libmesh_not_implemented();
59  return *this;
60  }
61 
62  virtual std::unique_ptr<SparseMatrix<T>> zero_clone() const override;
63 
64  virtual std::unique_ptr<SparseMatrix<T>> clone() const override;
65 
66  virtual void set(const numeric_index_type i,
67  const numeric_index_type j,
68  const T value) override;
69 
70  virtual void add(const numeric_index_type i,
71  const numeric_index_type j,
72  const T value) override;
73  virtual void add(const T a, const SparseMatrix<T> & X) override;
74 
75 protected:
80 
85 };
86 
87 } // namespace libMesh
88 
89 #endif // LIBMESH_LUMPED_MASS_MATRIX_H
LumpedMassMatrix(const Parallel::Communicator &comm)
Constructor; initializes the matrix to be empty, without any structure, i.e.
virtual void add(const numeric_index_type i, const numeric_index_type j, const T value) override
Add value to the element (i,j).
Provides a uniform interface to vector storage schemes for different linear algebra libraries...
Definition: vector_fe_ex5.C:44
const Parallel::Communicator & comm() const
The libMesh namespace provides an interface to certain functionality in the library.
virtual SparseMatrix< T > & operator=(const SparseMatrix< T > &) override
This looks like a copy assignment operator, but note that, unlike normal copy assignment operators...
Generic sparse matrix.
Definition: vector_fe_ex5.C:46
dof_id_type numeric_index_type
Definition: id_types.h:99
Diagonal matrix class whose underlying storage is a vector.
virtual std::unique_ptr< SparseMatrix< T > > clone() const override
LumpedMassMatrix & operator=(LumpedMassMatrix &&)=default
Template class used to construct a lumped mass matrix.
virtual std::unique_ptr< SparseMatrix< T > > zero_clone() const override
static const bool value
Definition: xdr_io.C:54