MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
grad::MapVector< N_SIZE > Class Template Reference

#include <gradient.h>

Inheritance diagram for grad::MapVector< N_SIZE >:
Collaboration diagram for grad::MapVector< N_SIZE >:

Public Types

typedef RangeVector
< scalar_deriv_type, N_SIZE > 
RangeVectorType
 
typedef
RangeVectorType::scalar_type 
scalar_type
 
typedef
RangeVectorType::vector_type 
vector_type
 
- Public Types inherited from grad::MapVectorBase
enum  LocalScope { LOCAL }
 
enum  GlobalScope { GLOBAL }
 

Public Member Functions

template<index_type N_SIZE2>
 MapVector (const MapVector< N_SIZE2 > &v)
 
 MapVector (LocalDofMap *pMap=0, index_type iStartLocal=0, index_type iEndLocal=0, LocalScope=LOCAL, scalar_func_type dVal=0.)
 
 MapVector (LocalDofMap *pMap, index_type iLocal, LocalScope, scalar_func_type dVal)
 
 MapVector (LocalDofMap *pMap, index_type iStartGlobal, index_type iEndGlobal, GlobalScope s, scalar_func_type dVal)
 
 MapVector (LocalDofMap *pMap, index_type iGlobal, GlobalScope s, scalar_func_type dVal)
 
void ResizeReset (LocalDofMap *pMap, index_type iStartLocal, index_type iEndLocal, LocalScope, scalar_func_type dVal)
 
void ResizePreserve (LocalDofMap *pMap, index_type iStartLocal, index_type iEndLocal, LocalScope)
 
void ResizeReset (LocalDofMap *pMap, index_type iStartGlobal, index_type iEndGlobal, GlobalScope, scalar_func_type dVal)
 
void Reset ()
 
void Reserve (index_type iSize)
 
scalar_deriv_type dGetGlobalVector (index_type iGlobalDof) const
 
void SetGlobalVector (index_type iGlobalDof, scalar_deriv_type dValue)
 
index_type iGetGlobalDof (index_type iLocalDof) const
 
index_type iGetSize () const
 
index_type iGetSizeVector () const
 
index_type iGetMaxSize () const
 
index_type iGetMaxSizeVector () const
 
scalar_type dGetLocalVector (index_type i) const
 
vector_type dGetLocalVectorVector (index_type i) const
 
const RangeVectorTypeGetLocalVector () const
 
void SetLocalVector (index_type i, scalar_type dValue)
 
void SetLocalVectorVector (index_type i, vector_type dVector)
 
index_type iGetStartIndexLocal () const
 
index_type iGetEndIndexLocal () const
 
index_type iGetStartIndexLocalVector () const
 
index_type iGetEndIndexLocalVector () const
 
LocalDofMappGetDofMap () const
 
bool bUseDynamicMem () const
 

Static Public Attributes

static const index_type iMaxSize = RangeVectorType::iMaxSize
 
static const MapVector Zero
 

Private Attributes

LocalDofMappDofMap
 
RangeVectorType oRange
 

Detailed Description

template<index_type N_SIZE>
class grad::MapVector< N_SIZE >

Definition at line 1154 of file gradient.h.

Member Typedef Documentation

template<index_type N_SIZE>
typedef RangeVector<scalar_deriv_type, N_SIZE> grad::MapVector< N_SIZE >::RangeVectorType

Definition at line 1156 of file gradient.h.

template<index_type N_SIZE>
typedef RangeVectorType::scalar_type grad::MapVector< N_SIZE >::scalar_type

Definition at line 1158 of file gradient.h.

template<index_type N_SIZE>
typedef RangeVectorType::vector_type grad::MapVector< N_SIZE >::vector_type

Definition at line 1159 of file gradient.h.

Constructor & Destructor Documentation

template<index_type N_SIZE>
template<index_type N_SIZE2>
grad::MapVector< N_SIZE >::MapVector ( const MapVector< N_SIZE2 > &  v)
inline

Definition at line 1162 of file gradient.h.

1163  :pDofMap(v.pGetDofMap()), oRange(v.GetLocalVector()) {
1164 
1165  }
LocalDofMap * pDofMap
Definition: gradient.h:1279
RangeVectorType oRange
Definition: gradient.h:1280
template<index_type N_SIZE>
grad::MapVector< N_SIZE >::MapVector ( LocalDofMap pMap = 0,
index_type  iStartLocal = 0,
index_type  iEndLocal = 0,
LocalScope  = LOCAL,
scalar_func_type  dVal = 0. 
)
inline

Definition at line 1167 of file gradient.h.

1168  :pDofMap(pMap), oRange(iStartLocal, iEndLocal, dVal) {
1169  }
LocalDofMap * pDofMap
Definition: gradient.h:1279
RangeVectorType oRange
Definition: gradient.h:1280
template<index_type N_SIZE>
grad::MapVector< N_SIZE >::MapVector ( LocalDofMap pMap,
index_type  iLocal,
LocalScope  ,
scalar_func_type  dVal 
)
inline

Definition at line 1171 of file gradient.h.

1172  :pDofMap(pMap), oRange(iLocal, iLocal + 1, dVal) {
1173  }
LocalDofMap * pDofMap
Definition: gradient.h:1279
RangeVectorType oRange
Definition: gradient.h:1280
template<index_type N_SIZE>
grad::MapVector< N_SIZE >::MapVector ( LocalDofMap pMap,
index_type  iStartGlobal,
index_type  iEndGlobal,
GlobalScope  s,
scalar_func_type  dVal 
)
inline

Definition at line 1175 of file gradient.h.

References grad::MapVector< N_SIZE >::ResizeReset().

1175  {
1176  ResizeReset(pMap, iStartGlobal, iEndGlobal, s, dVal);
1177  }
void ResizeReset(LocalDofMap *pMap, index_type iStartLocal, index_type iEndLocal, LocalScope, scalar_func_type dVal)
Definition: gradient.h:1183

Here is the call graph for this function:

template<index_type N_SIZE>
grad::MapVector< N_SIZE >::MapVector ( LocalDofMap pMap,
index_type  iGlobal,
GlobalScope  s,
scalar_func_type  dVal 
)
inline

Definition at line 1179 of file gradient.h.

References grad::MapVector< N_SIZE >::ResizeReset().

1179  {
1180  ResizeReset(pMap, iGlobal, iGlobal + 1, s, dVal);
1181  }
void ResizeReset(LocalDofMap *pMap, index_type iStartLocal, index_type iEndLocal, LocalScope, scalar_func_type dVal)
Definition: gradient.h:1183

Here is the call graph for this function:

Member Function Documentation

template<index_type N_SIZE>
bool grad::MapVector< N_SIZE >::bUseDynamicMem ( ) const
inline

Definition at line 1275 of file gradient.h.

References grad::RangeVector< T, N_SIZE >::bUseDynamicMem(), and grad::MapVector< N_SIZE >::oRange.

1275 { return oRange.bUseDynamicMem(); }
static bool bUseDynamicMem()
Definition: gradient.h:538
RangeVectorType oRange
Definition: gradient.h:1280

Here is the call graph for this function:

template<index_type N_SIZE>
scalar_deriv_type grad::MapVector< N_SIZE >::dGetGlobalVector ( index_type  iGlobalDof) const
inline

Definition at line 1226 of file gradient.h.

References grad::RangeVector< T, N_SIZE >::GetValue(), GRADIENT_ASSERT, grad::LocalDofMap::iGetLocalIndex(), grad::MapVector< N_SIZE >::iGetMaxSize(), grad::LocalDofMap::INVALID_INDEX, MBDYN_EXCEPT_ARGS, grad::MapVector< N_SIZE >::oRange, and grad::MapVector< N_SIZE >::pDofMap.

1226  {
1227  GRADIENT_ASSERT(pDofMap != 0);
1228  const index_type iLocalDof = pDofMap->iGetLocalIndex(iGlobalDof);
1229 
1230  if (iLocalDof == LocalDofMap::INVALID_INDEX) {
1231  GRADIENT_ASSERT(0);
1233  }
1234 
1235  GRADIENT_ASSERT(iLocalDof >= 0);
1236  GRADIENT_ASSERT(iLocalDof < iGetMaxSize());
1237  return oRange.GetValue(iLocalDof);
1238  }
LocalDofMap * pDofMap
Definition: gradient.h:1279
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
integer index_type
Definition: gradient.h:104
index_type iGetMaxSize() const
Definition: gradient.h:1263
index_type iGetLocalIndex(index_type iGlobal) const
Definition: gradient.h:1074
static const index_type INVALID_INDEX
Definition: gradient.h:1051
scalar_type GetValue(index_type i) const
Definition: gradient.h:502
RangeVectorType oRange
Definition: gradient.h:1280
#define GRADIENT_ASSERT(expr)
Definition: gradient.h:74

Here is the call graph for this function:

template<index_type N_SIZE>
scalar_type grad::MapVector< N_SIZE >::dGetLocalVector ( index_type  i) const
inline

Definition at line 1265 of file gradient.h.

References grad::RangeVector< T, N_SIZE >::GetValue(), and grad::MapVector< N_SIZE >::oRange.

Referenced by testMapVector().

1265 { return oRange.GetValue(i); }
scalar_type GetValue(index_type i) const
Definition: gradient.h:502
RangeVectorType oRange
Definition: gradient.h:1280

Here is the call graph for this function:

template<index_type N_SIZE>
vector_type grad::MapVector< N_SIZE >::dGetLocalVectorVector ( index_type  i) const
inline

Definition at line 1266 of file gradient.h.

References grad::RangeVector< T, N_SIZE >::GetVectorValue(), and grad::MapVector< N_SIZE >::oRange.

1266 { return oRange.GetVectorValue(i); }
vector_type GetVectorValue(index_type i) const
Definition: gradient.h:520
RangeVectorType oRange
Definition: gradient.h:1280

Here is the call graph for this function:

template<index_type N_SIZE>
const RangeVectorType& grad::MapVector< N_SIZE >::GetLocalVector ( ) const
inline

Definition at line 1267 of file gradient.h.

References grad::MapVector< N_SIZE >::oRange.

1267 { return oRange; }
RangeVectorType oRange
Definition: gradient.h:1280
template<index_type N_SIZE>
index_type grad::MapVector< N_SIZE >::iGetEndIndexLocal ( ) const
inline

Definition at line 1271 of file gradient.h.

References grad::RangeVector< T, N_SIZE >::iGetEndIndex(), and grad::MapVector< N_SIZE >::oRange.

Referenced by grad::MapVector< N_SIZE >::iGetGlobalDof(), grad::MapVector< N_SIZE >::SetGlobalVector(), and testMapVector().

1271 { return oRange.iGetEndIndex(); }
RangeVectorType oRange
Definition: gradient.h:1280
index_type iGetEndIndex() const
Definition: gradient.h:494

Here is the call graph for this function:

template<index_type N_SIZE>
index_type grad::MapVector< N_SIZE >::iGetEndIndexLocalVector ( ) const
inline

Definition at line 1273 of file gradient.h.

References grad::RangeVector< T, N_SIZE >::iGetEndIndexVector(), and grad::MapVector< N_SIZE >::oRange.

1273 { return oRange.iGetEndIndexVector(); }
index_type iGetEndIndexVector() const
Definition: gradient.h:498
RangeVectorType oRange
Definition: gradient.h:1280

Here is the call graph for this function:

template<index_type N_SIZE>
index_type grad::MapVector< N_SIZE >::iGetGlobalDof ( index_type  iLocalDof) const
inline

Definition at line 1254 of file gradient.h.

References GRADIENT_ASSERT, grad::MapVector< N_SIZE >::iGetEndIndexLocal(), grad::LocalDofMap::iGetGlobalDof(), grad::MapVector< N_SIZE >::iGetStartIndexLocal(), and grad::MapVector< N_SIZE >::pDofMap.

1254  {
1255  GRADIENT_ASSERT(pDofMap != 0);
1256  GRADIENT_ASSERT(iLocalDof >= iGetStartIndexLocal());
1257  GRADIENT_ASSERT(iLocalDof < iGetEndIndexLocal());
1258  return pDofMap->iGetGlobalDof(iLocalDof);
1259  }
LocalDofMap * pDofMap
Definition: gradient.h:1279
index_type iGetEndIndexLocal() const
Definition: gradient.h:1271
index_type iGetStartIndexLocal() const
Definition: gradient.h:1270
index_type iGetGlobalDof(index_type iLocal) const
Definition: gradient.h:1061
#define GRADIENT_ASSERT(expr)
Definition: gradient.h:74

Here is the call graph for this function:

template<index_type N_SIZE>
index_type grad::MapVector< N_SIZE >::iGetMaxSize ( ) const
inline

Definition at line 1263 of file gradient.h.

References grad::RangeVector< T, N_SIZE >::iGetMaxSize(), and grad::MapVector< N_SIZE >::oRange.

Referenced by grad::MapVector< N_SIZE >::dGetGlobalVector().

1263 { return oRange.iGetMaxSize(); }
static index_type iGetMaxSize()
Definition: gradient.h:496
RangeVectorType oRange
Definition: gradient.h:1280

Here is the call graph for this function:

template<index_type N_SIZE>
index_type grad::MapVector< N_SIZE >::iGetMaxSizeVector ( ) const
inline

Definition at line 1264 of file gradient.h.

References grad::RangeVector< T, N_SIZE >::iGetMaxSizeVector(), and grad::MapVector< N_SIZE >::oRange.

1264 { return oRange.iGetMaxSizeVector(); }
static index_type iGetMaxSizeVector()
Definition: gradient.h:500
RangeVectorType oRange
Definition: gradient.h:1280

Here is the call graph for this function:

template<index_type N_SIZE>
index_type grad::MapVector< N_SIZE >::iGetSize ( ) const
inline

Definition at line 1261 of file gradient.h.

References grad::RangeVector< T, N_SIZE >::iGetSize(), and grad::MapVector< N_SIZE >::oRange.

1261 { return oRange.iGetSize(); }
index_type iGetSize() const
Definition: gradient.h:495
RangeVectorType oRange
Definition: gradient.h:1280

Here is the call graph for this function:

template<index_type N_SIZE>
index_type grad::MapVector< N_SIZE >::iGetSizeVector ( ) const
inline

Definition at line 1262 of file gradient.h.

References grad::RangeVector< T, N_SIZE >::iGetSizeVector(), and grad::MapVector< N_SIZE >::oRange.

1262 { return oRange.iGetSizeVector(); }
index_type iGetSizeVector() const
Definition: gradient.h:499
RangeVectorType oRange
Definition: gradient.h:1280

Here is the call graph for this function:

template<index_type N_SIZE>
index_type grad::MapVector< N_SIZE >::iGetStartIndexLocal ( ) const
inline

Definition at line 1270 of file gradient.h.

References grad::RangeVector< T, N_SIZE >::iGetStartIndex(), and grad::MapVector< N_SIZE >::oRange.

Referenced by grad::MapVector< N_SIZE >::iGetGlobalDof(), grad::MapVector< N_SIZE >::SetGlobalVector(), and testMapVector().

1270 { return oRange.iGetStartIndex(); }
index_type iGetStartIndex() const
Definition: gradient.h:493
RangeVectorType oRange
Definition: gradient.h:1280

Here is the call graph for this function:

template<index_type N_SIZE>
index_type grad::MapVector< N_SIZE >::iGetStartIndexLocalVector ( ) const
inline

Definition at line 1272 of file gradient.h.

References grad::RangeVector< T, N_SIZE >::iGetStartIndexVector(), and grad::MapVector< N_SIZE >::oRange.

1272 { return oRange.iGetStartIndexVector(); }
index_type iGetStartIndexVector() const
Definition: gradient.h:497
RangeVectorType oRange
Definition: gradient.h:1280

Here is the call graph for this function:

template<index_type N_SIZE>
LocalDofMap* grad::MapVector< N_SIZE >::pGetDofMap ( ) const
inline

Definition at line 1274 of file gradient.h.

References grad::MapVector< N_SIZE >::pDofMap.

1274 { return pDofMap; }
LocalDofMap * pDofMap
Definition: gradient.h:1279
template<index_type N_SIZE>
void grad::MapVector< N_SIZE >::Reserve ( index_type  iSize)
inline

Definition at line 1222 of file gradient.h.

References grad::MapVector< N_SIZE >::oRange, and grad::RangeVector< T, N_SIZE >::Reserve().

1222  {
1223  oRange.Reserve(iSize);
1224  }
void Reserve(index_type iMaxSizeNew)
Definition: gradient.h:487
RangeVectorType oRange
Definition: gradient.h:1280

Here is the call graph for this function:

template<index_type N_SIZE>
void grad::MapVector< N_SIZE >::Reset ( void  )
inline

Definition at line 1218 of file gradient.h.

References grad::MapVector< N_SIZE >::oRange, and grad::RangeVector< T, N_SIZE >::Reset().

1218  {
1219  oRange.Reset();
1220  }
RangeVectorType oRange
Definition: gradient.h:1280

Here is the call graph for this function:

template<index_type N_SIZE>
void grad::MapVector< N_SIZE >::ResizePreserve ( LocalDofMap pMap,
index_type  iStartLocal,
index_type  iEndLocal,
LocalScope   
)
inline

Definition at line 1188 of file gradient.h.

References grad::MapVector< N_SIZE >::oRange, grad::MapVector< N_SIZE >::pDofMap, and grad::RangeVector< T, N_SIZE >::ResizePreserve().

1188  {
1189  pDofMap = pMap;
1190  oRange.ResizePreserve(iStartLocal, iEndLocal);
1191  }
LocalDofMap * pDofMap
Definition: gradient.h:1279
RangeVectorType oRange
Definition: gradient.h:1280
void ResizePreserve(index_type iStartNew, index_type iEndNew)
Definition: gradient.h:461

Here is the call graph for this function:

template<index_type N_SIZE>
void grad::MapVector< N_SIZE >::ResizeReset ( LocalDofMap pMap,
index_type  iStartLocal,
index_type  iEndLocal,
LocalScope  ,
scalar_func_type  dVal 
)
inline

Definition at line 1183 of file gradient.h.

References grad::MapVector< N_SIZE >::oRange, grad::MapVector< N_SIZE >::pDofMap, and grad::RangeVector< T, N_SIZE >::ResizeReset().

Referenced by grad::MapVector< N_SIZE >::MapVector().

1183  {
1184  pDofMap = pMap;
1185  oRange.ResizeReset(iStartLocal, iEndLocal, dVal);
1186  }
LocalDofMap * pDofMap
Definition: gradient.h:1279
void ResizeReset(index_type iStartNew, index_type iEndNew, const T &dVal)
Definition: gradient.h:451
RangeVectorType oRange
Definition: gradient.h:1280

Here is the call graph for this function:

template<index_type N_SIZE>
void grad::MapVector< N_SIZE >::ResizeReset ( LocalDofMap pMap,
index_type  iStartGlobal,
index_type  iEndGlobal,
GlobalScope  ,
scalar_func_type  dVal 
)
inline

Definition at line 1193 of file gradient.h.

References grad::LocalDofMap::AllocateLocalDof(), GRADIENT_ASSERT, grad::MapVector< N_SIZE >::oRange, grad::MapVector< N_SIZE >::pDofMap, and grad::RangeVector< T, N_SIZE >::ResizeReset().

1193  {
1194  pDofMap = pMap;
1195 
1196  GRADIENT_ASSERT(pDofMap != 0);
1197  GRADIENT_ASSERT(iEndGlobal >= iStartGlobal);
1198 
1199  index_type iFirstIndex = std::numeric_limits<index_type>::max(), iLastIndex = 0;
1200 
1201  for (index_type iGlobal = iStartGlobal; iGlobal < iEndGlobal; ++iGlobal) {
1202  index_type iLocal = pDofMap->AllocateLocalDof(iGlobal);
1203 
1204  if (iLocal < iFirstIndex) {
1205  iFirstIndex = iLocal;
1206  }
1207 
1208  if (iLocal > iLastIndex) {
1209  iLastIndex = iLocal;
1210  }
1211  }
1212 
1213  GRADIENT_ASSERT(iLastIndex >= iFirstIndex);
1214 
1215  oRange.ResizeReset(iFirstIndex, iLastIndex + 1, dVal);
1216  }
LocalDofMap * pDofMap
Definition: gradient.h:1279
integer index_type
Definition: gradient.h:104
void ResizeReset(index_type iStartNew, index_type iEndNew, const T &dVal)
Definition: gradient.h:451
index_type AllocateLocalDof(index_type iGlobal)
Definition: gradient.h:1091
RangeVectorType oRange
Definition: gradient.h:1280
#define GRADIENT_ASSERT(expr)
Definition: gradient.h:74

Here is the call graph for this function:

template<index_type N_SIZE>
void grad::MapVector< N_SIZE >::SetGlobalVector ( index_type  iGlobalDof,
scalar_deriv_type  dValue 
)
inline

Definition at line 1240 of file gradient.h.

References GRADIENT_ASSERT, grad::MapVector< N_SIZE >::iGetEndIndexLocal(), grad::LocalDofMap::iGetLocalIndex(), grad::MapVector< N_SIZE >::iGetStartIndexLocal(), grad::LocalDofMap::INVALID_INDEX, MBDYN_EXCEPT_ARGS, grad::MapVector< N_SIZE >::oRange, grad::MapVector< N_SIZE >::pDofMap, and grad::RangeVector< T, N_SIZE >::SetValue().

1240  {
1241  GRADIENT_ASSERT(pDofMap != 0);
1242  const index_type iLocalDof = pDofMap->iGetLocalIndex(iGlobalDof);
1243 
1244  if (iLocalDof == LocalDofMap::INVALID_INDEX) {
1245  GRADIENT_ASSERT(0);
1247  }
1248 
1249  GRADIENT_ASSERT(iLocalDof >= iGetStartIndexLocal());
1250  GRADIENT_ASSERT(iLocalDof < iGetEndIndexLocal());
1251  oRange.SetValue(iLocalDof, dValue);
1252  }
LocalDofMap * pDofMap
Definition: gradient.h:1279
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
index_type iGetEndIndexLocal() const
Definition: gradient.h:1271
integer index_type
Definition: gradient.h:104
index_type iGetStartIndexLocal() const
Definition: gradient.h:1270
index_type iGetLocalIndex(index_type iGlobal) const
Definition: gradient.h:1074
static const index_type INVALID_INDEX
Definition: gradient.h:1051
RangeVectorType oRange
Definition: gradient.h:1280
#define GRADIENT_ASSERT(expr)
Definition: gradient.h:74
void SetValue(index_type i, const scalar_type &d)
Definition: gradient.h:511

Here is the call graph for this function:

template<index_type N_SIZE>
void grad::MapVector< N_SIZE >::SetLocalVector ( index_type  i,
scalar_type  dValue 
)
inline

Definition at line 1268 of file gradient.h.

References grad::MapVector< N_SIZE >::oRange, and grad::RangeVector< T, N_SIZE >::SetValue().

1268 { oRange.SetValue(i, dValue); }
RangeVectorType oRange
Definition: gradient.h:1280
void SetValue(index_type i, const scalar_type &d)
Definition: gradient.h:511

Here is the call graph for this function:

template<index_type N_SIZE>
void grad::MapVector< N_SIZE >::SetLocalVectorVector ( index_type  i,
vector_type  dVector 
)
inline

Definition at line 1269 of file gradient.h.

References grad::MapVector< N_SIZE >::oRange, and grad::RangeVector< T, N_SIZE >::SetVectorValue().

1269 { oRange.SetVectorValue(i, dVector); }
void SetVectorValue(index_type i, const vector_type &d)
Definition: gradient.h:529
RangeVectorType oRange
Definition: gradient.h:1280

Here is the call graph for this function:

Member Data Documentation

template<index_type N_SIZE>
const index_type grad::MapVector< N_SIZE >::iMaxSize = RangeVectorType::iMaxSize
static

Definition at line 1157 of file gradient.h.

template<index_type N_SIZE>
const MapVector grad::MapVector< N_SIZE >::Zero
static

Definition at line 1276 of file gradient.h.


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