Poster of Linux kernelThe best gift for a Linux geek
DenseSubVector

DenseSubVector

Section: C Library Functions (3) Updated: Thu Apr 7 2011
Local index Up
 

NAME

DenseSubVector -  

SYNOPSIS


#include <dense_subvector.h>

Inherits DenseVectorBase< T >.  

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 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.

Author:

Benjamin S. Kirk, 2003

Definition at line 44 of file dense_subvector.h.  

Member Function Documentation

 

template<typename T> virtual T DenseVectorBase< T >::el (const unsigned inti) const [pure virtual, inherited]Returns:

the (i) element of the vector.

Implemented in DenseVector< T >, and DenseVector< Number >.

Referenced by DenseMatrixBase< T >::condense(), and DofMap::extract_local_vector().  

template<typename T> virtual T& DenseVectorBase< T >::el (const unsigned inti) [pure virtual, inherited]Returns:

the (i) element of the vector as a writeable reference.

Implemented in DenseVector< T >, and DenseVector< Number >.  

template<typename T > void DenseVectorBase< T >::print (std::ostream &os) const [inherited]Pretty-print the vector to stdout.

Definition at line 61 of file dense_vector_base.C.

{  
  for (unsigned int i=0; i<this->size(); i++)
    os << std::setw(8)
       << this->el(i)
       << std::endl;
}
 

template<typename T > void DenseVectorBase< T >::print_scientific (std::ostream &os) const [inherited]Prints the entries of the vector with additional decimal places in scientific notation.

Definition at line 29 of file dense_vector_base.C.

{
#ifndef LIBMESH_BROKEN_IOSTREAM
  
  // save the initial format flags
  std::ios_base::fmtflags os_flags = os.flags();
  
  // Print the vector entries.
  for (unsigned int i=0; i<this->size(); i++)
    os << std::setw(10)
       << std::scientific
       << std::setprecision(8)
       << this->el(i)
       << std::endl;
  
  // reset the original format flags
  os.flags(os_flags);
  
#else
  
  // Print the matrix entries.
  for (unsigned int i=0; i<this->size(); i++)
    os << std::setprecision(8)
       << this->el(i)
       << std::endl;
  
#endif
}
 

template<typename T> virtual unsigned int DenseVectorBase< T >::size () const [pure virtual, inherited]Returns:

the size of the vector.

Implemented in DenseVector< T >, and DenseVector< Number >.

Referenced by DenseMatrixBase< T >::condense(), DofMap::extract_local_vector(), EpetraVector< T >::insert(), PetscVector< T >::insert(), LaspackVector< T >::insert(), and DistributedVector< T >::insert().  

template<typename T> virtual void 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 DenseVector< T >, and DenseVector< Number >.

Referenced by DofMap::extract_local_vector().  

Friends And Related Function Documentation

 

template<typename T> 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 88 of file dense_vector_base.h.

  {
    v.print(os);
    return os;
  }

 

Author

Generated automatically by Doxygen for libMesh from the source code.


 

Index

NAME
SYNOPSIS
Public Member Functions
Friends
Detailed Description
template<typename T> class DenseSubVector< T >
Member Function Documentation
template<typename T> virtual T DenseVectorBase< T >::el (const unsigned inti) const [pure virtual, inherited]Returns:
template<typename T> virtual T& DenseVectorBase< T >::el (const unsigned inti) [pure virtual, inherited]Returns:
template<typename T > void DenseVectorBase< T >::print (std::ostream &os) const [inherited]Pretty-print the vector to stdout.
template<typename T > void DenseVectorBase< T >::print_scientific (std::ostream &os) const [inherited]Prints the entries of the vector with additional decimal places in scientific notation.
template<typename T> virtual unsigned int DenseVectorBase< T >::size () const [pure virtual, inherited]Returns:
template<typename T> virtual void 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.
Friends And Related Function Documentation
template<typename T> 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.
Author

This document was created by man2html, using the manual pages.
Time: 21:44:52 GMT, April 16, 2011