#include <MatrixManagement.hpp>

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 |
Definition at line 63 of file MatrixManagement.hpp.
| MemoryManager::MemoryManager | ( | ) | [inline] |
Definition at line 78 of file MatrixManagement.hpp.
00079 : __mr(*memoryRepository) 00080 { 00081 ; 00082 }
| 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 }

| void MemoryManager::ReserveVector | ( | ReferenceCounting< BaseVector > & | b, | |
| const size_t | dimension, | |||
| const size_t | nbDegreeOfFreefom | |||
| ) |
Definition at line 89 of file MatrixManagement.cpp.
Referenced by SpectralMethod::__discretizeOnConformingMesh(), FiniteElementMethod::__discretizeOnMesh(), FictitiousDomainMethod::__discretizeOnMesh(), and SpectralMethod::__discretizeOnOctreeMesh().
00092 { 00093 b = new Vector<real_t>(nbDegreeOfFreefom); 00094 static_cast<Vector<real_t>&>(*b) = 0; 00095 }
MemoryRepository& MemoryManager::__mr [private] |
1.5.6