16 #ifndef dealii__mg_level_object_h 17 #define dealii__mg_level_object_h 19 #include <deal.II/base/subscriptor.h> 22 #include <deal.II/base/std_cxx11/shared_ptr.h> 24 DEAL_II_NAMESPACE_OPEN
40 template<
class Object>
49 const unsigned int maxlevel = 0);
59 const Object &
operator[] (
const unsigned int level)
const;
65 void resize (
const unsigned int new_minlevel,
66 const unsigned int new_maxlevel);
105 std::vector<std_cxx11::shared_ptr<Object> >
objects;
112 template<
class Object>
114 const unsigned int max)
122 template<
class Object>
132 template<
class Object>
142 template<
class Object>
145 const unsigned int new_maxlevel)
147 Assert (new_minlevel <= new_maxlevel, ExcInternalError());
155 for (
unsigned int i=0; i<new_maxlevel-new_minlevel+1; ++i)
156 objects.push_back(std_cxx11::shared_ptr<Object> (
new Object));
160 template<
class Object>
164 typename std::vector<std_cxx11::shared_ptr<Object> >::iterator v;
171 template<
class Object>
175 typename std::vector<std_cxx11::shared_ptr<Object> >::iterator v;
181 template<
class Object>
189 template<
class Object>
197 template<
class Object>
201 std::size_t result =
sizeof(*this);
202 typedef typename std::vector<std_cxx11::shared_ptr<Object> >::const_iterator Iter;
203 const Iter end =
objects.end();
204 for (Iter o=
objects.begin(); o!=end; ++o)
205 result += (*o)->memory_consumption();
210 DEAL_II_NAMESPACE_CLOSE
unsigned int max_level() const
Object & operator[](const unsigned int level)
MGLevelObject(const unsigned int minlevel=0, const unsigned int maxlevel=0)
std::size_t memory_consumption() const
unsigned int min_level() const
std::vector< std_cxx11::shared_ptr< Object > > objects
#define Assert(cond, exc)
MGLevelObject< Object > & operator=(const double d)
void resize(const unsigned int new_minlevel, const unsigned int new_maxlevel)