$extrastylesheet
libMesh::RawAccessor< FieldType > Class Template Reference

#include <raw_accessor.h>

List of all members.

Public Member Functions

 RawAccessor (FieldType &data, const unsigned int dim)
 ~RawAccessor ()
RawFieldType< FieldType >::type & operator() (unsigned int i)
const RawFieldType< FieldType >
::type & 
operator() (unsigned int i) const
template<>
Numberoperator() (unsigned int libmesh_dbg_var(i))
template<>
Numberoperator() (unsigned int i)
template<>
Numberoperator() (unsigned int k)
template<>
Realoperator() (unsigned int i)
template<>
Realoperator() (unsigned int i)
template<>
Realoperator() (unsigned int k)

Private Member Functions

 RawAccessor ()

Private Attributes

FieldType & _data
const unsigned int _dim

Detailed Description

template<typename FieldType>
class libMesh::RawAccessor< FieldType >

This class provides single index access to FieldType (i.e. Number, Gradient, Tensor, etc.).

Definition at line 93 of file raw_accessor.h.


Constructor & Destructor Documentation

template<typename FieldType>
libMesh::RawAccessor< FieldType >::RawAccessor ( FieldType &  data,
const unsigned int  dim 
) [inline]

Definition at line 97 of file raw_accessor.h.

    : _data(data),
      _dim(dim)
  {}
template<typename FieldType>
libMesh::RawAccessor< FieldType >::~RawAccessor ( ) [inline]

Definition at line 102 of file raw_accessor.h.

{}
template<typename FieldType>
libMesh::RawAccessor< FieldType >::RawAccessor ( ) [private]

Member Function Documentation

template<typename FieldType>
RawFieldType<FieldType>::type& libMesh::RawAccessor< FieldType >::operator() ( unsigned int  i)
template<typename FieldType>
const RawFieldType<FieldType>::type& libMesh::RawAccessor< FieldType >::operator() ( unsigned int  i) const
template<>
Number & libMesh::RawAccessor< Number >::operator() ( unsigned int   libmesh_dbg_vari) [inline]

Definition at line 117 of file raw_accessor.h.

{
  libmesh_assert_equal_to (i, 0);
  return this->_data;
}
template<>
Number & libMesh::RawAccessor< Gradient >::operator() ( unsigned int  i) [inline]

Definition at line 125 of file raw_accessor.h.

{
  libmesh_assert_less (i, this->_dim);
  return this->_data(i);
}
template<>
Number & libMesh::RawAccessor< Tensor >::operator() ( unsigned int  k) [inline]

Definition at line 133 of file raw_accessor.h.

{
  libmesh_assert_less (k, this->_dim*this->_dim);

  // For tensors, each row is filled first, i.e. for 2-D
  // [ 0 1; 2 3]
  // Thus, k(i,j) = j + i*dim
  unsigned int ii = k/_dim;
  unsigned int jj = k - ii*_dim;

  return this->_data(ii,jj);
}
template<>
Real & libMesh::RawAccessor< Real >::operator() ( unsigned int  i) [inline]

Definition at line 181 of file raw_accessor.h.

{
  libmesh_assert_equal_to (i, 0);
  return this->_data;
}
template<>
Real & libMesh::RawAccessor< RealGradient >::operator() ( unsigned int  i) [inline]

Definition at line 189 of file raw_accessor.h.

{
  libmesh_assert_less (i, this->_dim);
  return this->_data(i);
}
template<>
Real & libMesh::RawAccessor< RealTensor >::operator() ( unsigned int  k) [inline]

Definition at line 197 of file raw_accessor.h.

{
  libmesh_assert_less (k, this->_dim*this->_dim);

  // For tensors, each row is filled first, i.e. for 2-D
  // [ 0 1; 2 3]
  // Thus, k(i,j) = i + j*dim
  unsigned int jj = k/_dim;
  unsigned int ii = k - jj*_dim;

  return this->_data(ii,jj);
}

Member Data Documentation

template<typename FieldType>
FieldType& libMesh::RawAccessor< FieldType >::_data [private]

Definition at line 110 of file raw_accessor.h.

template<typename FieldType>
const unsigned int libMesh::RawAccessor< FieldType >::_dim [private]

Definition at line 111 of file raw_accessor.h.


The documentation for this class was generated from the following file: