16 #ifndef dealii_mg_level_object_h 17 #define dealii_mg_level_object_h 19 #include <deal.II/base/subscriptor.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;
98 resize(
const unsigned int new_minlevel,
const unsigned int new_maxlevel);
156 template <
typename ActionFunctionObjectType>
158 apply(ActionFunctionObjectType action);
182 template <
class Object>
184 const unsigned int max)
191 template <
class Object>
200 template <
class Object>
209 template <
class Object>
212 const unsigned int new_maxlevel)
222 for (
unsigned int i = 0; i < new_maxlevel - new_minlevel + 1; ++i)
223 objects.push_back(std::make_shared<Object>());
227 template <
class Object>
231 typename std::vector<std::shared_ptr<Object>>::iterator v;
238 template <
class Object>
247 template <
class Object>
251 typename std::vector<std::shared_ptr<Object>>::iterator v;
257 template <
class Object>
265 template <
class Object>
272 template <
class Object>
273 template <
typename ActionFunctionObjectType>
279 action(lvl, (*
this)[lvl]);
284 template <
class Object>
288 std::size_t result =
sizeof(*this);
289 using Iter =
typename std::vector<std::shared_ptr<Object>>::const_iterator;
290 const Iter end =
objects.end();
291 for (Iter o =
objects.begin(); o != end; ++o)
292 result += (*o)->memory_consumption();
297 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
std::vector< std::shared_ptr< Object > > objects
void apply(ActionFunctionObjectType action)
static::ExceptionBase & ExcIndexRange(int arg1, int arg2, int arg3)
#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()