sum_shell_matrix.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2014 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 
35 
36 
44 template <typename T>
45 class SumShellMatrix : public ShellMatrix<T>
46 {
47 public:
55  LIBMESH_CAN_DEFAULT_TO_COMMWORLD);
56 
60  explicit
61  SumShellMatrix (const std::vector<ShellMatrix<T>*>& mat,
62  const Parallel::Communicator &comm_in
63  LIBMESH_CAN_DEFAULT_TO_COMMWORLD);
64 
68  virtual ~SumShellMatrix ();
69 
74  virtual numeric_index_type m () const;
75 
80  virtual numeric_index_type n () const;
81 
86  virtual void vector_mult (NumericVector<T>& dest,
87  const NumericVector<T>& arg) const;
88 
92  virtual void vector_mult_add (NumericVector<T>& dest,
93  const NumericVector<T>& arg) const;
94 
98  virtual void get_diagonal (NumericVector<T>& dest) const;
99 
103  std::vector<ShellMatrix<T>*> matrices;
104 
105 };
106 
107 
108 
109 //-----------------------------------------------------------------------
110 // SumShellMatrix inline members
111 template <typename T>
112 inline
114  ShellMatrix<T>(comm_in),
115  matrices()
116 {}
117 
118 
119 
120 template <typename T>
121 inline
122 SumShellMatrix<T>::SumShellMatrix (const std::vector<ShellMatrix<T>*>& mat,
123  const Parallel::Communicator &comm_in):
124  ShellMatrix<T>(comm_in),
125  matrices(mat)
126 {}
127 
128 
129 
130 template <typename T>
131 inline
133 {}
134 
135 
136 } // namespace libMesh
137 
138 
139 #endif // LIBMESH_SUM_SHELL_MATRIX_H

Site Created By: libMesh Developers
Last modified: February 07 2014 16:57:07 UTC

Hosted By:
SourceForge.net Logo