Memosa-FVM  0.2
ElecOffDiagonalTensor< T, N > Class Template Reference

#include <ElecOffDiagonalTensor.h>

Collaboration diagram for ElecOffDiagonalTensor< T, N >:

Public Types

enum  { TN = N+1 }
 
typedef ElecOffDiagonalTensor
< T, N > 
This_T
 
typedef NumTypeTraits< T >
::T_Scalar 
T_Scalar
 
typedef NumTypeTraits< T >
::T_BuiltIn 
T_BuiltIn
 

Public Member Functions

 ElecOffDiagonalTensor ()
 
 ElecOffDiagonalTensor (const ElecOffDiagonalTensor &o)
 
 ElecOffDiagonalTensor (const T &o)
 
T & operator[] (int n)
 
const T & operator[] (int n) const
 
void printFromC (ostream &os) const
 
ElecOffDiagonalTensoroperator= (const T &o)
 
ElecOffDiagonalTensoroperator= (const ElecOffDiagonalTensor &o)
 
ElecOffDiagonalTensor operator- ()
 
ElecOffDiagonalTensoroperator+= (const ElecOffDiagonalTensor &o)
 
ElecOffDiagonalTensoroperator+= (const T s)
 
ElecOffDiagonalTensoroperator-= (const ElecOffDiagonalTensor &o)
 
ElecOffDiagonalTensoroperator-= (const T s)
 
ElecOffDiagonalTensoroperator/= (const T s)
 
ElecOffDiagonalTensoroperator/= (const ElecOffDiagonalTensor &o)
 
ElecOffDiagonalTensoroperator*= (const T s)
 
ElecOffDiagonalTensoroperator*= (const ElecOffDiagonalTensor &o)
 
void zero ()
 
mag2 () const
 
bool operator< (const double tolerance) const
 

Static Public Member Functions

static string getTypeName ()
 
static int getDimension ()
 
static void getShape (int *shp)
 
static int getDataSize ()
 
static void write (FILE *fp, const ElecOffDiagonalTensor &x)
 
static ElecOffDiagonalTensor getZero ()
 
static double doubleMeasure (const ElecOffDiagonalTensor &x)
 
static ElecOffDiagonalTensor getNegativeUnity ()
 
static ElecOffDiagonalTensor getUnity ()
 
static void accumulateOneNorm (ElecOffDiagonalTensor &sum, const ElecOffDiagonalTensor &v)
 
static void accumulateDotProduct (ElecOffDiagonalTensor &sum, const ElecOffDiagonalTensor &v0, const ElecOffDiagonalTensor &v1)
 
static void reduceSum (T_Scalar &sum, const This_T &x)
 
static void safeDivide (ElecOffDiagonalTensor &x, const ElecOffDiagonalTensor &y)
 
static void normalize (ElecOffDiagonalTensor &x, const ElecOffDiagonalTensor &y)
 
static void setMax (ElecOffDiagonalTensor &x, const ElecOffDiagonalTensor &y)
 

Private Attributes

_data
 

Detailed Description

template<class T, int N>
class ElecOffDiagonalTensor< T, N >

Definition at line 25 of file ElecOffDiagonalTensor.h.

Member Typedef Documentation

template<class T, int N>
typedef NumTypeTraits<T>::T_BuiltIn ElecOffDiagonalTensor< T, N >::T_BuiltIn

Definition at line 31 of file ElecOffDiagonalTensor.h.

template<class T, int N>
typedef NumTypeTraits<T>::T_Scalar ElecOffDiagonalTensor< T, N >::T_Scalar

Definition at line 30 of file ElecOffDiagonalTensor.h.

template<class T, int N>
typedef ElecOffDiagonalTensor<T,N> ElecOffDiagonalTensor< T, N >::This_T

Definition at line 29 of file ElecOffDiagonalTensor.h.

Member Enumeration Documentation

template<class T, int N>
anonymous enum
Enumerator
TN 

Definition at line 28 of file ElecOffDiagonalTensor.h.

Constructor & Destructor Documentation

template<class T, int N>
ElecOffDiagonalTensor< T, N >::ElecOffDiagonalTensor ( )
inline

Definition at line 33 of file ElecOffDiagonalTensor.h.

34  {}
template<class T, int N>
ElecOffDiagonalTensor< T, N >::ElecOffDiagonalTensor ( const ElecOffDiagonalTensor< T, N > &  o)
inline

Definition at line 36 of file ElecOffDiagonalTensor.h.

References ElecOffDiagonalTensor< T, N >::_data.

37  {
38  _data = o._data;
39  }
template<class T, int N>
ElecOffDiagonalTensor< T, N >::ElecOffDiagonalTensor ( const T &  o)
inline

Definition at line 41 of file ElecOffDiagonalTensor.h.

References ElecOffDiagonalTensor< T, N >::_data.

42  {
43  _data = o;
44  }

Member Function Documentation

template<class T, int N>
static void ElecOffDiagonalTensor< T, N >::accumulateDotProduct ( ElecOffDiagonalTensor< T, N > &  sum,
const ElecOffDiagonalTensor< T, N > &  v0,
const ElecOffDiagonalTensor< T, N > &  v1 
)
inlinestatic

Definition at line 198 of file ElecOffDiagonalTensor.h.

200  {
201  throw CException("elec offdiag accumlateDotProduct is not defined!");
202  for(int i=0; i<N; i++)
203  NumTypeTraits<T>::accumulateDotProduct(sum[i],v0[i],v1[i]);
204  }
template<class T, int N>
static void ElecOffDiagonalTensor< T, N >::accumulateOneNorm ( ElecOffDiagonalTensor< T, N > &  sum,
const ElecOffDiagonalTensor< T, N > &  v 
)
inlinestatic

Definition at line 191 of file ElecOffDiagonalTensor.h.

192  {
193  throw CException("elec offdiag accumlateOneNorm is not defined!");
194  for(int i=0; i<N; i++)
196  }
template<class T, int N>
static double ElecOffDiagonalTensor< T, N >::doubleMeasure ( const ElecOffDiagonalTensor< T, N > &  x)
inlinestatic

Definition at line 170 of file ElecOffDiagonalTensor.h.

171  {
172  return 0.0;
173  }
template<class T, int N>
static int ElecOffDiagonalTensor< T, N >::getDataSize ( )
inlinestatic

Definition at line 57 of file ElecOffDiagonalTensor.h.

58  {
60  }
template<class T, int N>
static int ElecOffDiagonalTensor< T, N >::getDimension ( )
inlinestatic

Definition at line 53 of file ElecOffDiagonalTensor.h.

53 {return 1;}
template<class T, int N>
static ElecOffDiagonalTensor ElecOffDiagonalTensor< T, N >::getNegativeUnity ( )
inlinestatic
template<class T, int N>
static void ElecOffDiagonalTensor< T, N >::getShape ( int *  shp)
inlinestatic
template<class T, int N>
static string ElecOffDiagonalTensor< T, N >::getTypeName ( )
inlinestatic

Definition at line 46 of file ElecOffDiagonalTensor.h.

References intAsString().

47  {
48  return "ElecOffDiagonalTensor<" + NumTypeTraits<T>::getTypeName() +
49  "," + intAsString(N) +
50  ">";
51  }
string intAsString(const int i)
Definition: Vector.h:11
template<class T, int N>
static ElecOffDiagonalTensor ElecOffDiagonalTensor< T, N >::getUnity ( )
inlinestatic
template<class T, int N>
static ElecOffDiagonalTensor ElecOffDiagonalTensor< T, N >::getZero ( )
inlinestatic

Definition at line 163 of file ElecOffDiagonalTensor.h.

References ElecOffDiagonalTensor< T, N >::zero().

164  {
166  z.zero();
167  return z;
168  }
template<class T, int N>
T ElecOffDiagonalTensor< T, N >::mag2 ( ) const
inline

Definition at line 151 of file ElecOffDiagonalTensor.h.

References ElecOffDiagonalTensor< T, N >::_data.

Referenced by ElecOffDiagonalTensor< T, N >::operator<().

152  {
154  r+=_data * _data;
155  return r;
156  }
template<class T, int N>
static void ElecOffDiagonalTensor< T, N >::normalize ( ElecOffDiagonalTensor< T, N > &  x,
const ElecOffDiagonalTensor< T, N > &  y 
)
inlinestatic

Definition at line 220 of file ElecOffDiagonalTensor.h.

221  {
222  throw CException(" elec offdiag normalize is not defined!");
223  for(int i=0; i<N; i++)
224  NumTypeTraits<T>::normalize(x[i],y[i]);
225  }
template<class T, int N>
ElecOffDiagonalTensor& ElecOffDiagonalTensor< T, N >::operator*= ( const T  s)
inline

Definition at line 133 of file ElecOffDiagonalTensor.h.

References ElecOffDiagonalTensor< T, N >::_data.

134  {
135  throw CException("operator not defined for elec offdiag *= s");
136  _data *= s;
137  return *this;
138  }
template<class T, int N>
ElecOffDiagonalTensor& ElecOffDiagonalTensor< T, N >::operator*= ( const ElecOffDiagonalTensor< T, N > &  o)
inline

Definition at line 141 of file ElecOffDiagonalTensor.h.

142  {
143  throw CException("no operator defined for *= elec offdiag");
144  }
template<class T, int N>
ElecOffDiagonalTensor& ElecOffDiagonalTensor< T, N >::operator+= ( const ElecOffDiagonalTensor< T, N > &  o)
inline

Definition at line 95 of file ElecOffDiagonalTensor.h.

References ElecOffDiagonalTensor< T, N >::_data.

96  {
97  _data += o._data;
98  return *this;
99  }
template<class T, int N>
ElecOffDiagonalTensor& ElecOffDiagonalTensor< T, N >::operator+= ( const T  s)
inline

Definition at line 101 of file ElecOffDiagonalTensor.h.

References ElecOffDiagonalTensor< T, N >::_data.

102  {
103  _data += s;
104  return *this;
105  }
template<class T, int N>
ElecOffDiagonalTensor ElecOffDiagonalTensor< T, N >::operator- ( )
inline
template<class T, int N>
ElecOffDiagonalTensor& ElecOffDiagonalTensor< T, N >::operator-= ( const ElecOffDiagonalTensor< T, N > &  o)
inline

Definition at line 107 of file ElecOffDiagonalTensor.h.

References ElecOffDiagonalTensor< T, N >::_data.

108  {
109  _data -= o._data;
110  return *this;
111  }
template<class T, int N>
ElecOffDiagonalTensor& ElecOffDiagonalTensor< T, N >::operator-= ( const T  s)
inline

Definition at line 113 of file ElecOffDiagonalTensor.h.

References ElecOffDiagonalTensor< T, N >::_data.

114  {
115  _data -= s;
116  return *this;
117  }
template<class T, int N>
ElecOffDiagonalTensor& ElecOffDiagonalTensor< T, N >::operator/= ( const T  s)
inline

Definition at line 119 of file ElecOffDiagonalTensor.h.

References ElecOffDiagonalTensor< T, N >::_data.

120  {
121  throw CException("operator not defined for elec offdiag /= s");
122  _data /= s;
123  return *this;
124  }
template<class T, int N>
ElecOffDiagonalTensor& ElecOffDiagonalTensor< T, N >::operator/= ( const ElecOffDiagonalTensor< T, N > &  o)
inline

Definition at line 127 of file ElecOffDiagonalTensor.h.

128  {
129  throw CException("no operator defined for /= elec offdiag");
130  }
template<class T, int N>
bool ElecOffDiagonalTensor< T, N >::operator< ( const double  tolerance) const
inline

Definition at line 158 of file ElecOffDiagonalTensor.h.

References ElecOffDiagonalTensor< T, N >::mag2().

159  {
160  return mag2() < tolerance*tolerance;
161  }
template<class T, int N>
ElecOffDiagonalTensor& ElecOffDiagonalTensor< T, N >::operator= ( const T &  o)
inline

Definition at line 76 of file ElecOffDiagonalTensor.h.

References ElecOffDiagonalTensor< T, N >::_data.

77  {
78  _data = o;
79  return *this;
80  }
template<class T, int N>
ElecOffDiagonalTensor& ElecOffDiagonalTensor< T, N >::operator= ( const ElecOffDiagonalTensor< T, N > &  o)
inline

Definition at line 82 of file ElecOffDiagonalTensor.h.

References ElecOffDiagonalTensor< T, N >::_data.

83  {
84  _data = o._data;
85  return *this;
86  }
template<class T, int N>
T& ElecOffDiagonalTensor< T, N >::operator[] ( int  n)
inline
template<class T, int N>
const T& ElecOffDiagonalTensor< T, N >::operator[] ( int  n) const
inline
template<class T, int N>
void ElecOffDiagonalTensor< T, N >::printFromC ( ostream &  os) const
inline

Definition at line 66 of file ElecOffDiagonalTensor.h.

References ElecOffDiagonalTensor< T, N >::_data.

Referenced by operator<<().

67  {
68  os << "[ " << _data << " " << "]";
69  }
template<class T, int N>
static void ElecOffDiagonalTensor< T, N >::reduceSum ( T_Scalar sum,
const This_T x 
)
inlinestatic

Definition at line 206 of file ElecOffDiagonalTensor.h.

207  {
208  throw CException(" elec offdiag reduceSume is not defined!");
209  for(int i=0; i<N; i++)
210  NumTypeTraits<T>::reduceSum(sum,x[i]);
211  }
template<class T, int N>
static void ElecOffDiagonalTensor< T, N >::safeDivide ( ElecOffDiagonalTensor< T, N > &  x,
const ElecOffDiagonalTensor< T, N > &  y 
)
inlinestatic

Definition at line 213 of file ElecOffDiagonalTensor.h.

214  {
215  throw CException(" elec offdiag safeDivide is not defined!");
216  for(int i=0; i<N; i++)
217  NumTypeTraits<T>::safeDivide(x[i],y[i]);
218  }
template<class T, int N>
static void ElecOffDiagonalTensor< T, N >::setMax ( ElecOffDiagonalTensor< T, N > &  x,
const ElecOffDiagonalTensor< T, N > &  y 
)
inlinestatic

Definition at line 227 of file ElecOffDiagonalTensor.h.

228  {
229  throw CException(" elec offdiag setMax is not defined!");
230  for(int i=0; i<N; i++)
231  NumTypeTraits<T>::setMax(x[i],y[i]);
232  }
template<class T, int N>
static void ElecOffDiagonalTensor< T, N >::write ( FILE *  fp,
const ElecOffDiagonalTensor< T, N > &  x 
)
inlinestatic
template<class T, int N>
void ElecOffDiagonalTensor< T, N >::zero ( )
inline

Member Data Documentation


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