libMesh::DenseSubVector< T > Class Template Reference
#include <dense_subvector.h>

Public Member Functions | |
| virtual void | zero ()=0 |
| virtual T | el (const unsigned int i) const =0 |
| virtual T & | el (const unsigned int i)=0 |
| virtual unsigned int | size () const =0 |
| void | print (std::ostream &os) const |
| void | print_scientific (std::ostream &os) const |
Friends | |
| std::ostream & | operator<< (std::ostream &os, const DenseVectorBase< T > &v) |
Detailed Description
template<typename T>
class libMesh::DenseSubVector< T >
Defines a dense subvector for use in Finite Element-type computations. Useful for storing element load vectors before summation into a global vector, particularly when you have systems of equations.
Definition at line 45 of file dense_subvector.h.
Member Function Documentation
| virtual T& libMesh::DenseVectorBase< T >::el | ( | const unsigned int | i | ) | [pure virtual, inherited] |
- Returns:
- the
(i) element of the vector as a writeable reference.
Implemented in libMesh::DenseVector< T >, and libMesh::DenseVector< Number >.
| virtual T libMesh::DenseVectorBase< T >::el | ( | const unsigned int | i | ) | const [pure virtual, inherited] |
- Returns:
- the
(i) element of the vector.
Implemented in libMesh::DenseVector< T >, and libMesh::DenseVector< Number >.
Referenced by libMesh::DenseMatrixBase< T >::condense(), libMesh::DofMap::extract_local_vector(), libMesh::DenseVectorBase< T >::print(), and libMesh::DenseVectorBase< T >::print_scientific().
| void libMesh::DenseVectorBase< T >::print | ( | std::ostream & | os | ) | const [inline, inherited] |
Pretty-print the vector to stdout.
Definition at line 62 of file dense_vector_base.C.
References libMesh::DenseVectorBase< T >::el(), and libMesh::DenseVectorBase< T >::size().
| void libMesh::DenseVectorBase< T >::print_scientific | ( | std::ostream & | os | ) | const [inline, inherited] |
Prints the entries of the vector with additional decimal places in scientific notation.
Definition at line 30 of file dense_vector_base.C.
References libMesh::DenseVectorBase< T >::el(), and libMesh::DenseVectorBase< T >::size().
00031 { 00032 #ifndef LIBMESH_BROKEN_IOSTREAM 00033 00034 // save the initial format flags 00035 std::ios_base::fmtflags os_flags = os.flags(); 00036 00037 // Print the vector entries. 00038 for (unsigned int i=0; i<this->size(); i++) 00039 os << std::setw(10) 00040 << std::scientific 00041 << std::setprecision(8) 00042 << this->el(i) 00043 << std::endl; 00044 00045 // reset the original format flags 00046 os.flags(os_flags); 00047 00048 #else 00049 00050 // Print the matrix entries. 00051 for (unsigned int i=0; i<this->size(); i++) 00052 os << std::setprecision(8) 00053 << this->el(i) 00054 << std::endl; 00055 00056 #endif 00057 }
| virtual unsigned int libMesh::DenseVectorBase< T >::size | ( | ) | const [pure virtual, inherited] |
- Returns:
- the size of the vector.
Implemented in libMesh::DenseVector< T >, and libMesh::DenseVector< Number >.
Referenced by libMesh::DenseMatrixBase< T >::condense(), libMesh::DofMap::extract_local_vector(), libMesh::PetscVector< T >::insert(), libMesh::LaspackVector< T >::insert(), libMesh::DistributedVector< T >::insert(), libMesh::DenseVectorBase< T >::print(), and libMesh::DenseVectorBase< T >::print_scientific().
| virtual void libMesh::DenseVectorBase< T >::zero | ( | ) | [pure virtual, inherited] |
Set every element in the vector to 0. Needs to be pure virtual since the storage method may be different in derived classes.
Implemented in libMesh::DenseVector< T >, and libMesh::DenseVector< Number >.
Referenced by libMesh::DofMap::extract_local_vector().
Friends And Related Function Documentation
| std::ostream& operator<< | ( | std::ostream & | os, | |
| const DenseVectorBase< T > & | v | |||
| ) | [friend, inherited] |
Same as above, but allows you to print using the usual stream syntax.
Definition at line 91 of file dense_vector_base.h.
The documentation for this class was generated from the following file:
Site Created By: libMesh Developers
Last modified: February 05 2013 19:55:13 UTC
Hosted By: