21 #ifndef __mast__structural_basis_matrix_h__ 22 #define __mast__structural_basis_matrix_h__ 28 #include "libmesh/shell_matrix.h" 29 #include "libmesh/numeric_vector.h" 36 public libMesh::ShellMatrix<T>
39 BasisMatrix(
const libMesh::Parallel::Communicator &comm_in);
48 virtual libMesh::numeric_index_type
m ()
const {
50 libmesh_assert(
modes.size() > 0);
51 return modes[0]->size();
58 virtual libMesh::numeric_index_type
n ()
const {
60 libmesh_assert(
modes.size() > 0);
61 return (libMesh::numeric_index_type)
modes.size();
69 template <
typename VecType>
71 const VecType& arg)
const {
73 libmesh_assert(
modes.size() > 0);
74 libmesh_assert_equal_to(
m(), dest.size());
75 libmesh_assert_equal_to(
n(), arg.size());
78 for (
unsigned int i=0; i<
n(); i++)
79 dest.add(arg(i), *(
modes[i]));
88 const libMesh::NumericVector<T>& arg)
const {
91 libmesh_assert(
false);
99 template <
typename VecType>
102 const libMesh::NumericVector<T>& arg)
const {
104 libmesh_assert(
modes.size() > 0);
105 libmesh_assert_equal_to(
m(), arg.size());
106 libmesh_assert_equal_to(
n(), dest.size());
109 for (
unsigned int i=0; i<
n(); i++)
110 dest(i) = arg.dot(*(
modes[i]));
120 const libMesh::NumericVector<T>& arg)
const {
123 libmesh_assert(
false);
131 const libMesh::NumericVector<T>& arg)
const {
134 libmesh_assert(
false);
145 libmesh_assert(
false);
153 virtual libMesh::NumericVector<T>&
157 libmesh_assert(
modes.size() > 0);
158 libmesh_assert_less(i,
modes.size());
166 std::vector<libMesh::NumericVector<T>*>
modes;
171 #endif // __mast__structural_basis_matrix_h__ virtual void vector_mult(libMesh::NumericVector< T > &dest, const libMesh::NumericVector< T > &arg) const
Multiplies the matrix with arg and stores the result in dest.
virtual libMesh::numeric_index_type m() const
BasisMatrix(const libMesh::Parallel::Communicator &comm_in)
void vector_mult_transpose(VecType &dest, const libMesh::NumericVector< T > &arg) const
Multiplies the matrix with arg and stores the result in dest.
virtual void vector_mult_transpose(libMesh::NumericVector< T > &dest, const libMesh::NumericVector< T > &arg) const
Multiplies the transpose of matrix with arg and stores the result in dest.
virtual void vector_mult_add(libMesh::NumericVector< T > &dest, const libMesh::NumericVector< T > &arg) const
Multiplies the matrix with arg and adds the result to dest.
virtual libMesh::NumericVector< T > & basis(unsigned int i)
Returns the vector that defines the i^th basis vector.
virtual libMesh::numeric_index_type n() const
void vector_mult(libMesh::NumericVector< T > &dest, const VecType &arg) const
Multiplies the matrix with arg and stores the result in dest.
virtual void get_diagonal(libMesh::NumericVector< T > &dest) const
Copies the diagonal part of the matrix into dest.
std::vector< libMesh::NumericVector< T > * > modes
vector of modes