MemoryManager Class Reference

#include <MatrixManagement.hpp>

Collaboration diagram for MemoryManager:

Collaboration graph
[legend]

List of all members.

Public Member Functions

bool ReserveMatrix (ReferenceCounting< BaseMatrix > &A, const size_t dimension, const size_t nbDegreeOfFreefom)
void ReserveVector (ReferenceCounting< BaseVector > &b, const size_t dimension, const size_t nbDegreeOfFreefom)
 MemoryManager ()

Private Attributes

MemoryRepository__mr
GetParameter
< MemoryManagerOptions
__options


Detailed Description

Definition at line 63 of file MatrixManagement.hpp.


Constructor & Destructor Documentation

MemoryManager::MemoryManager (  )  [inline]

Definition at line 78 of file MatrixManagement.hpp.

00079     : __mr(*memoryRepository)
00080   {
00081     ;
00082   } 


Member Function Documentation

bool MemoryManager::ReserveMatrix ( ReferenceCounting< BaseMatrix > &  A,
const size_t  dimension,
const size_t  nbDegreeOfFreefom 
)

returns true if the matrix is new. So if the assembling is to perform.

keepMatrix != -1 means that the matrix is stored or to be stored.

Definition at line 60 of file MatrixManagement.cpp.

References __mr, __options, MemoryRepository::getMatrix(), MemoryManagerOptions::matrixType(), MemoryManagerOptions::none, MemoryManagerOptions::sparse, MemoryRepository::stored(), and GetParameter< T >::value().

Referenced by SpectralMethod::__discretizeOnConformingMesh(), FiniteElementMethod::__discretizeOnMesh(), FictitiousDomainMethod::__discretizeOnMesh(), SpectralMethod::__discretizeOnOctreeMesh(), and SpectralFEMPreconditioner::Internal::__solveFEM().

00063 {
00064   int keepMatrix = -1;
00066   if ((keepMatrix == -1) || (!__mr.stored(keepMatrix))) {
00067     switch (__options.value().matrixType()) {
00068     case (MemoryManagerOptions::none): {
00069       A = new UnAssembledMatrix(nbDegreeOfFreefom);
00070       break;
00071     }
00072     case (MemoryManagerOptions::sparse): {
00073       A = new DoubleHashedMatrix(nbDegreeOfFreefom, nbDegreeOfFreefom);
00074       break;
00075     }
00076     default: {
00077       A = new DoubleHashedMatrix(nbDegreeOfFreefom, nbDegreeOfFreefom);
00078       break;
00079     }
00080     }
00081     return true;
00082   } else {
00083     A = __mr.getMatrix(keepMatrix);
00084     return false;
00085   }
00086 }

Here is the call graph for this function:

void MemoryManager::ReserveVector ( ReferenceCounting< BaseVector > &  b,
const size_t  dimension,
const size_t  nbDegreeOfFreefom 
)


Member Data Documentation

Definition at line 66 of file MatrixManagement.hpp.

Referenced by ReserveMatrix().

Definition at line 68 of file MatrixManagement.hpp.

Referenced by ReserveMatrix().


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

Generated on Wed Nov 19 00:08:47 2008 for FreeFEM3D (aka ff3d) by  doxygen 1.5.6