16#ifndef dealii_vector_memory_h
17#define dealii_vector_memory_h
103template <
typename VectorType = ::Vector<
double>>
150 free(
const VectorType *
const) = 0;
162 "You are trying to deallocate a vector from a memory pool, but this "
163 "vector has not actually been allocated by the same pool before.");
188 :
public std::unique_ptr<VectorType, std::function<void(VectorType *)>>
235template <
typename VectorType = ::Vector<
double>>
282 free(
const VectorType *
const v)
override;
312template <
typename VectorType = ::Vector<
double>>
375 free(
const VectorType *
const)
override;
396 using entry_type = std::pair<bool, std::unique_ptr<VectorType>>;
463 namespace GrowingVectorMemoryImplementation
476template <
typename VectorType>
478 :
std::unique_ptr<VectorType,
std::function<void(VectorType *)>>(
480 [&mem](VectorType *v) { mem.
free(v); })
485template <
typename VectorType>
489 return new VectorType();
494template <
typename VectorType>
virtual VectorType * alloc()=0
virtual ~VectorMemory() override=default
virtual void free(const VectorType *const)=0
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
void initialize(const size_type size)
virtual VectorType * alloc() override
virtual void free(const VectorType *const v) override
void release_all_unused_memory()
static void release_unused_memory()
static ::ExceptionBase & ExcNotAllocatedHere()
std::vector< entry_type > * data
Pointer & operator=(Pointer &&p) noexcept=default
Pointer(Pointer &&p) noexcept=default
Pointer(VectorMemory< VectorType > &mem)
static Threads::Mutex mutex
virtual void free(const VectorType *const) override
virtual std::size_t memory_consumption() const
#define DeclExceptionMsg(Exception, defaulttext)
virtual ~GrowingVectorMemory() override
GrowingVectorMemory(const size_type initial_size=0, const bool log_statistics=false)
std::pair< bool, std::unique_ptr< VectorType > > entry_type
virtual VectorType * alloc() override
unsigned int global_dof_index