 |
Reference documentation for deal.II version 9.1.1
|
\(\newcommand{\dealcoloneq}{\mathrel{\vcenter{:}}=}\)
16 #ifndef dealii_vector_memory_h
17 #define dealii_vector_memory_h
20 #include <deal.II/base/config.h>
22 #include <deal.II/base/logstream.h>
23 #include <deal.II/base/smartpointer.h>
24 #include <deal.II/base/thread_management.h>
26 #include <deal.II/lac/vector.h>
32 DEAL_II_NAMESPACE_OPEN
106 template <
typename VectorType = ::Vector<
double>>
153 free(
const VectorType *
const) = 0;
165 "You are trying to deallocate a vector from a memory pool, but this "
166 "vector has not actually been allocated by the same pool before.");
193 :
public std::unique_ptr<VectorType, std::function<void(VectorType *)>>
240 template <
typename VectorType = ::Vector<
double>>
287 free(
const VectorType *
const v)
override;
319 template <
typename VectorType = ::Vector<
double>>
382 free(
const VectorType *
const)
override;
403 using entry_type = std::pair<bool, std::unique_ptr<VectorType>>;
472 namespace GrowingVectorMemoryImplementation
475 release_all_unused_memory();
485 template <
typename VectorType>
487 : std::unique_ptr<VectorType, std::function<void(VectorType *)>>(
489 [&mem](VectorType *v) { mem.
free(v); })
494 template <
typename VectorType>
498 return new VectorType();
503 template <
typename VectorType>
514 DEAL_II_NAMESPACE_CLOSE
#define DeclExceptionMsg(Exception, defaulttext)
virtual ~GrowingVectorMemory() override
virtual void free(const VectorType *const) override
virtual VectorType * alloc() override
types::global_dof_index size_type
static void release_unused_memory()
virtual VectorType * alloc()=0
virtual std::size_t memory_consumption() const
virtual void free(const VectorType *const v) override
GrowingVectorMemory(const size_type initial_size=0, const bool log_statistics=false)
virtual void free(const VectorType *const)=0
virtual ~VectorMemory() override=default
std::pair< bool, std::unique_ptr< BlockVector< number > > > entry_type
virtual VectorType * alloc() override
std::vector< entry_type > * data
static ::ExceptionBase & ExcNotAllocatedHere()
unsigned int global_dof_index
static Threads::Mutex mutex
Pointer & operator=(Pointer &&p) noexcept=default
void initialize(const size_type size)