Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement MGLevelObject::n_levels() #13529

Merged
merged 1 commit into from
Mar 11, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 14 additions & 0 deletions include/deal.II/base/mg_level_object.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,12 @@ class MGLevelObject : public Subscriptor
unsigned int
max_level() const;

/**
* Number of levels, i.e., `max_level()-min_level()+1`.
*/
unsigned int
n_levels() const;

/**
* Apply the action @p action to every object stored in here. The
* parameter @p action is expected to be a function object that accepts
Expand Down Expand Up @@ -280,6 +286,14 @@ MGLevelObject<Object>::max_level() const
return minlevel + objects.size() - 1;
}


template <class Object>
unsigned int
MGLevelObject<Object>::n_levels() const
{
return objects.size();
}

template <class Object>
template <typename ActionFunctionObjectType>
void
Expand Down