sum_shell_matrix.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2018 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 
19 
20 #ifndef LIBMESH_SUM_SHELL_MATRIX_H
21 #define LIBMESH_SUM_SHELL_MATRIX_H
22 
23 // Local includes
24 #include "libmesh/libmesh_common.h"
26 #include "libmesh/libmesh.h"
27 #include "libmesh/shell_matrix.h"
28 
29 // C++ includes
30 #include <vector>
31 
32 namespace libMesh
33 {
34 
43 template <typename T>
44 class SumShellMatrix : public ShellMatrix<T>
45 {
46 public:
55  SumShellMatrix (const Parallel::Communicator & comm_in);
56 
60  explicit
61  SumShellMatrix (const std::vector<ShellMatrix<T> *> & mat,
62  const Parallel::Communicator & comm_in);
63 
67  virtual ~SumShellMatrix ();
68 
69  virtual numeric_index_type m () const override;
70 
71  virtual numeric_index_type n () const override;
72 
73  virtual void vector_mult (NumericVector<T> & dest,
74  const NumericVector<T> & arg) const override;
75 
76  virtual void vector_mult_add (NumericVector<T> & dest,
77  const NumericVector<T> & arg) const override;
78 
79  virtual void get_diagonal (NumericVector<T> & dest) const override;
80 
84  std::vector<ShellMatrix<T> *> matrices;
85 };
86 
87 
88 
89 //-----------------------------------------------------------------------
90 // SumShellMatrix inline members
91 template <typename T>
92 inline
94  ShellMatrix<T>(comm_in),
95  matrices()
96 {}
97 
98 
99 
100 template <typename T>
101 inline
103  const Parallel::Communicator & comm_in):
104  ShellMatrix<T>(comm_in),
105  matrices(mat)
106 {}
107 
108 
109 
110 template <typename T>
111 inline
113 {}
114 
115 
116 } // namespace libMesh
117 
118 
119 #endif // LIBMESH_SUM_SHELL_MATRIX_H
SumShellMatrix(const Parallel::Communicator &comm_in)
Provides a uniform interface to vector storage schemes for different linear algebra libraries...
Definition: diff_context.h:40
virtual numeric_index_type n() const override
virtual numeric_index_type m() const override
virtual void vector_mult_add(NumericVector< T > &dest, const NumericVector< T > &arg) const override
dof_id_type numeric_index_type
Definition: id_types.h:92
std::vector< ShellMatrix< T > * > matrices
virtual void vector_mult(NumericVector< T > &dest, const NumericVector< T > &arg) const override
virtual void get_diagonal(NumericVector< T > &dest) const override