Reference documentation for deal.II version 9.2.0
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
property_pool.cc
Go to the documentation of this file.
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2017 - 2018 by the deal.II authors
4 //
5 // This file is part of the deal.II library.
6 //
7 // The deal.II library is free software; you can use it, redistribute
8 // it, and/or modify it under the terms of the GNU Lesser General
9 // Public License as published by the Free Software Foundation; either
10 // version 2.1 of the License, or (at your option) any later version.
11 // The full text of the license can be found in the file LICENSE.md at
12 // the top level directory of deal.II.
13 //
14 // ---------------------------------------------------------------------
15 
16 
18 
20 
21 namespace Particles
22 {
24 
25 
26  PropertyPool::PropertyPool(const unsigned int n_properties_per_slot)
27  : n_properties(n_properties_per_slot)
28  {}
29 
30 
31 
34  {
36  if (n_properties > 0)
37  handle = new double[n_properties];
38 
39  return handle;
40  }
41 
42 
43 
44  void
46  {
47  delete[] handle;
48  }
49 
50 
51 
54  {
55  return ArrayView<double>(handle, n_properties);
56  }
57 
58 
59 
60  void
61  PropertyPool::reserve(const std::size_t size)
62  {
63  (void)size;
64  }
65 
66 
67 
68  unsigned int
70  {
71  return n_properties;
72  }
73 } // namespace Particles
ArrayView
Definition: array_view.h:77
Particles::PropertyPool::get_properties
ArrayView< double > get_properties(const Handle handle)
Definition: property_pool.cc:53
Particles
Definition: data_out.h:27
Particles::PropertyPool::n_properties
const unsigned int n_properties
Definition: property_pool.h:103
Particles::PropertyPool::invalid_handle
static const Handle invalid_handle
Definition: property_pool.h:56
Particles::PropertyPool::PropertyPool
PropertyPool(const unsigned int n_properties_per_slot)
Definition: property_pool.cc:26
double
DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:358
Particles::PropertyPool::n_properties_per_slot
unsigned int n_properties_per_slot() const
Definition: property_pool.cc:69
property_pool.h
Particles::PropertyPool::Handle
double * Handle
Definition: property_pool.h:51
Particles::PropertyPool::allocate_properties_array
Handle allocate_properties_array()
Definition: property_pool.cc:33
Particles::PropertyPool::deallocate_properties_array
void deallocate_properties_array(const Handle handle)
Definition: property_pool.cc:45
Particles::PropertyPool::reserve
void reserve(const std::size_t size)
Definition: property_pool.cc:61
DEAL_II_NAMESPACE_CLOSE
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:359