ArrayOfVecDouble Class Reference

#include <arrayofvecdouble.h>

Collaboration diagram for ArrayOfVecDouble:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 ArrayOfVecDouble ()
 ArrayOfVecDouble (const std::vector< dealii::Point< 3 > > &dealpts)
 ArrayOfVecDouble (const std::vector< dealii::Point< 2 > > &dealpts)
void reinit (unsigned size, unsigned vector_size)
void getVecValues (unsigned i, VecDoubleRef *v)
void copyVecValues (unsigned i, VecDouble *v) const
VecDouble operator[] (Index i) const
void getComponent (VecDouble &v, unsigned cmp)
 operator Matrix & ()
 operator const Matrix & () const
double & operator() (Index i, Index j)
unsigned size () const
unsigned vecs_size () const
 ~ArrayOfVecDouble ()
void operator= (const std::vector< dealii::Point< 3 > > &dealpts)
void print ()

Private Attributes

Matrix m_M

Detailed Description

ArrayOfVecDouble

Definition at line 10 of file arrayofvecdouble.h.


Constructor & Destructor Documentation

ArrayOfVecDouble::ArrayOfVecDouble (  )  [inline]

Definition at line 17 of file arrayofvecdouble.h.

00018   {
00019   }

ArrayOfVecDouble::ArrayOfVecDouble ( const std::vector< dealii::Point< 3 > > &  dealpts  )  [inline]

Definition at line 21 of file arrayofvecdouble.h.

00022   {
00023     this->operator=(dealpts);
00024 
00025   }

ArrayOfVecDouble::ArrayOfVecDouble ( const std::vector< dealii::Point< 2 > > &  dealpts  )  [inline]

Definition at line 27 of file arrayofvecdouble.h.

00028   {
00029       if (dealpts.size()==0)
00030       {
00031         reinit(0,0);
00032         return;
00033       }
00034       reinit(dealpts.size(),2);
00035       for (unsigned i=0;i<dealpts.size();i++)
00036       {
00037         operator()(i,0)=dealpts[i][0];
00038         operator()(i,1)=dealpts[i][1];
00039       }
00040 
00041 
00042   }

ArrayOfVecDouble::~ArrayOfVecDouble (  )  [inline]

Definition at line 66 of file arrayofvecdouble.h.

00066 {}


Member Function Documentation

void ArrayOfVecDouble::copyVecValues ( unsigned  i,
VecDouble v 
) const

Definition at line 22 of file arrayofvecdouble.cpp.

00023   {
00024     unsigned vec_size = vecs_size();
00025     assert(v->size() == vec_size);
00026     for (unsigned j=0;j<vec_size;j++)
00027     {
00028       (*v)(j) = m_M(i,j);
00029     }
00030   }

void ArrayOfVecDouble::getComponent ( VecDouble v,
unsigned  cmp 
)

Given a fixed component it returns a VecDouble with the same size of the array of vectors containing for each index i the component cmp of the vector in the position ith of the ArrayOfVecDouble

Parameters:
v To contain the component cmp of each vector in the ArrayOfVecDouble
cmp The component
Returns:

Definition at line 49 of file arrayofvecdouble.cpp.

00050   {
00051     assert(v.size() == this->size());
00052     for (unsigned i=0;i<v.size();i++)
00053     {
00054       v(i) = m_M(i,cmp);
00055     }
00056 
00057   }

void ArrayOfVecDouble::getVecValues ( unsigned  i,
VecDoubleRef v 
)

Get a VecDouble stored in this array.

Parameters:
i Index in the array
v The vector pointer to the vector that will reference the vector of doubles in the position i of the array Pre: Vector v must not be the owner of its own memory and has a size equal to the size of the VecDoubles in the array.
Returns:

Definition at line 15 of file arrayofvecdouble.cpp.

00016   {
00017     assert(!v->is_owner());
00018     assert(v->size() == m_M.n());
00019     v->setData(&(m_M(i,0)));
00020   }

ArrayOfVecDouble::operator const Matrix & (  )  const [inline]

Definition at line 62 of file arrayofvecdouble.h.

00062 {return m_M;}

ArrayOfVecDouble::operator Matrix & (  )  [inline]

Definition at line 61 of file arrayofvecdouble.h.

00061 {return m_M;}

double& ArrayOfVecDouble::operator() ( Index  i,
Index  j 
) [inline]

Definition at line 63 of file arrayofvecdouble.h.

00063 {return m_M(i,j);}

void ArrayOfVecDouble::operator= ( const std::vector< dealii::Point< 3 > > &  dealpts  )  [inline]

Definition at line 68 of file arrayofvecdouble.h.

00069     {
00070       if (dealpts.size()==0)
00071       {
00072         reinit(0,0);
00073         return;
00074       }
00075       reinit(dealpts.size(),3);
00076       for (unsigned i=0;i<dealpts.size();i++)
00077       {
00078         operator()(i,0)=dealpts[i][0];
00079         operator()(i,1)=dealpts[i][1];
00080         operator()(i,2)=dealpts[i][2];
00081       }
00082      }

VecDouble ArrayOfVecDouble::operator[] ( Index  i  )  const

Definition at line 32 of file arrayofvecdouble.cpp.

00033   {
00034     VecDoubleRef ref(vecs_size());
00035     const_cast<ArrayOfVecDouble*>(this)->getVecValues(i,&ref);
00036     return ref;
00037   }

void ArrayOfVecDouble::print (  )  [inline]

Definition at line 83 of file arrayofvecdouble.h.

00084   {
00085     m_M.print_formatted(std::cout);
00086 
00087   }

void ArrayOfVecDouble::reinit ( unsigned  size,
unsigned  vector_size 
) [inline]

Definition at line 46 of file arrayofvecdouble.h.

00047   {
00048     m_M.reinit(size,vector_size);
00049   }

unsigned ArrayOfVecDouble::size (  )  const [inline]

Definition at line 64 of file arrayofvecdouble.h.

00064 {return m_M.m();}

unsigned ArrayOfVecDouble::vecs_size (  )  const [inline]

Definition at line 65 of file arrayofvecdouble.h.

00065 {return m_M.n();}


Member Data Documentation

Definition at line 13 of file arrayofvecdouble.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Generated on Sun Apr 8 23:12:56 2012 for CO2INJECTION by  doxygen 1.6.3