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
47 template<
class Object>
71 const unsigned int maxlevel = 0);
84 const Object &
operator[] (
const unsigned int level)
const;
97 void resize (
const unsigned int new_minlevel,
98 const unsigned int new_maxlevel);
118 void clear() DEAL_II_DEPRECATED;
154 std::vector<std_cxx11::shared_ptr<Object> >
objects;
161 template<
class Object>
163 const unsigned int max)
171 template<
class Object>
181 template<
class Object>
191 template<
class Object>
194 const unsigned int new_maxlevel)
204 for (
unsigned int i=0; i<new_maxlevel-new_minlevel+1; ++i)
205 objects.push_back(std_cxx11::shared_ptr<Object> (
new Object));
209 template<
class Object>
213 typename std::vector<std_cxx11::shared_ptr<Object> >::iterator v;
220 template<
class Object>
229 template<
class Object>
233 typename std::vector<std_cxx11::shared_ptr<Object> >::iterator v;
239 template<
class Object>
247 template<
class Object>
255 template<
class Object>
259 std::size_t result =
sizeof(*this);
260 typedef typename std::vector<std_cxx11::shared_ptr<Object> >::const_iterator Iter;
261 const Iter end =
objects.end();
262 for (Iter o=
objects.begin(); o!=end; ++o)
263 result += (*o)->memory_consumption();
268 DEAL_II_NAMESPACE_CLOSE
Object & operator[](const unsigned int level)
MGLevelObject(const unsigned int minlevel=0, const unsigned int maxlevel=0)
std::size_t memory_consumption() const
static::ExceptionBase & ExcIndexRange(int arg1, int arg2, int arg3)
std::vector< std_cxx11::shared_ptr< Object > > objects
#define Assert(cond, exc)
unsigned int max_level() const
MGLevelObject< Object > & operator=(const double d)
unsigned int min_level() const
void resize(const unsigned int new_minlevel, const unsigned int new_maxlevel)
static::ExceptionBase & ExcInternalError()