$extrastylesheet
00001 // The libMesh Finite Element Library. 00002 // Copyright (C) 2002-2014 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner 00003 00004 // This library is free software; you can redistribute it and/or 00005 // modify it under the terms of the GNU Lesser General Public 00006 // License as published by the Free Software Foundation; either 00007 // version 2.1 of the License, or (at your option) any later version. 00008 00009 // This library is distributed in the hope that it will be useful, 00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 // Lesser General Public License for more details. 00013 00014 // You should have received a copy of the GNU Lesser General Public 00015 // License along with this library; if not, write to the Free Software 00016 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00017 00018 00019 00020 #ifndef LIBMESH_TENSOR_SHELL_MATRIX_H 00021 #define LIBMESH_TENSOR_SHELL_MATRIX_H 00022 00023 00024 // Local includes 00025 #include "libmesh/libmesh_common.h" 00026 #include "libmesh/reference_counted_object.h" 00027 #include "libmesh/libmesh.h" 00028 #include "libmesh/shell_matrix.h" 00029 #include "libmesh/numeric_vector.h" 00030 00031 namespace libMesh 00032 { 00033 00041 template <typename T> 00042 class TensorShellMatrix : public ShellMatrix<T> 00043 { 00044 public: 00049 TensorShellMatrix (const NumericVector<T>& v, 00050 const NumericVector<T>& w); 00051 00055 virtual ~TensorShellMatrix (); 00056 00061 virtual numeric_index_type m () const; 00062 00067 virtual numeric_index_type n () const; 00068 00073 virtual void vector_mult (NumericVector<T>& dest, 00074 const NumericVector<T>& arg) const; 00075 00079 virtual void vector_mult_add (NumericVector<T>& dest, 00080 const NumericVector<T>& arg) const; 00081 00085 virtual void get_diagonal (NumericVector<T>& dest) const; 00086 00087 protected: 00091 const NumericVector<T>& _v; 00092 00096 const NumericVector<T>& _w; 00097 00098 }; 00099 00100 00101 00102 //----------------------------------------------------------------------- 00103 // TensorShellMatrix inline members 00104 template <typename T> 00105 inline 00106 TensorShellMatrix<T>::TensorShellMatrix (const NumericVector<T>& v, 00107 const NumericVector<T>& w): 00108 ShellMatrix<T>(v.comm()), 00109 _v(v), 00110 _w(w) 00111 {} 00112 00113 00114 00115 template <typename T> 00116 inline 00117 TensorShellMatrix<T>::~TensorShellMatrix () 00118 {} 00119 00120 00121 00122 template <typename T> 00123 inline 00124 numeric_index_type TensorShellMatrix<T>::m () const 00125 { 00126 return _v.size(); 00127 } 00128 00129 00130 00131 template <typename T> 00132 inline 00133 numeric_index_type TensorShellMatrix<T>::n () const 00134 { 00135 return _w.size(); 00136 } 00137 00138 00139 } // namespace libMesh 00140 00141 00142 #endif // LIBMESH_TENSOR_SHELL_MATRIX_H