Reference documentation for deal.II version 9.0.0
|
Classes | |
class | IteratorRange< Iterator > |
Functions | |
template<typename FunctionObjectType > | |
auto | Threads::new_thread (FunctionObjectType function_object) -> Thread< decltype(function_object())> |
template<typename FunctionObjectType > | |
auto | Threads::new_task (FunctionObjectType function_object) -> Task< decltype(function_object())> |
template<typename BaseIterator , typename Predicate > | |
IteratorRange< FilteredIterator< BaseIterator > > | filter_iterators (IteratorRange< BaseIterator > i, const Predicate &p) |
template<typename BaseIterator , typename Predicate , typename... Targs> | |
IteratorRange< typename internal::FilteredIteratorImplementation::NestFilteredIterators< BaseIterator, std::tuple< Predicate, Targs... > >::type > | filter_iterators (IteratorRange< BaseIterator > i, const Predicate &p, const Targs... args) |
template<typename BaseIterator , typename Predicate > | |
IteratorRange< FilteredIterator< BaseIterator > > | filter_iterators (IteratorRange< BaseIterator > i, const Predicate &p) |
template<typename BaseIterator , typename Predicate , typename... Targs> | |
IteratorRange< typename internal::FilteredIteratorImplementation::NestFilteredIterators< BaseIterator, std::tuple< Predicate, Targs... > >::type > | filter_iterators (IteratorRange< BaseIterator > i, const Predicate &p, const Targs... args) |
Cell iterator functions returning ranges of iterators | |
IteratorRange< cell_iterator > | DoFHandler< dim, spacedim >::cell_iterators () const |
IteratorRange< active_cell_iterator > | DoFHandler< dim, spacedim >::active_cell_iterators () const |
IteratorRange< level_cell_iterator > | DoFHandler< dim, spacedim >::mg_cell_iterators () const |
IteratorRange< cell_iterator > | DoFHandler< dim, spacedim >::cell_iterators_on_level (const unsigned int level) const |
IteratorRange< active_cell_iterator > | DoFHandler< dim, spacedim >::active_cell_iterators_on_level (const unsigned int level) const |
IteratorRange< level_cell_iterator > | DoFHandler< dim, spacedim >::mg_cell_iterators_on_level (const unsigned int level) const |
Cell iterator functions returning ranges of iterators | |
IteratorRange< cell_iterator > | Triangulation< dim, spacedim >::cell_iterators () const |
IteratorRange< active_cell_iterator > | Triangulation< dim, spacedim >::active_cell_iterators () const |
IteratorRange< cell_iterator > | Triangulation< dim, spacedim >::cell_iterators_on_level (const unsigned int level) const |
IteratorRange< active_cell_iterator > | Triangulation< dim, spacedim >::active_cell_iterators_on_level (const unsigned int level) const |
Cell iterator functions returning ranges of iterators | |
IteratorRange< cell_iterator > | hp::DoFHandler< dim, spacedim >::cell_iterators () const |
IteratorRange< active_cell_iterator > | hp::DoFHandler< dim, spacedim >::active_cell_iterators () const |
IteratorRange< cell_iterator > | hp::DoFHandler< dim, spacedim >::cell_iterators_on_level (const unsigned int level) const |
IteratorRange< active_cell_iterator > | hp::DoFHandler< dim, spacedim >::active_cell_iterators_on_level (const unsigned int level) const |
Since version 9.0, deal.II requires a compiler that supports at least C++11. As part of this, many places in the internal implementation of deal.II are now using features that were only introduced in C++11. That said, deal.II also has functions and classes that make using it with C++11 features easier.
One example is support for C++11 range-based for loops. deal.II-based codes often have many loops of the kind
Using C++11's range-based for loops, you can now write this as follows:
This relies on functions such as Triangulation::active_cell_iterators(), and equivalents in the DoF handler classes, DoFHandler::active_cell_iterators(), hp::DoFHandler::active_cell_iterators(). There are variants of these functions that provide iterator ranges for all cells (not just the active ones) and for cells on individual levels.
|
inline |
Overload of the new_thread() function for objects that can be called like a function object without arguments. In particular, this function allows calling Threads::new_thread() with either objects that result from using std::bind, or using lambda functions. For example, this function is called when writing code such as
Here, we run the sequence of functions do_this()
and then_do_that()
on a separate thread, by making the lambda function declared here the function to execute on the thread. The lambda function then returns 42 (which is a bit pointless here, but it could of course be some computed number), and this is going to be the returned value you can later retrieve via thread.return_value()
once the thread (i.e., the body of the lambda function) has completed.
decltype
statement used in the declaration of this function, and it is then used as the template argument of the Threads::Thread object returned by the current function. In the example above, because the lambda function returns 42 (which in C++ has data type int
), the inferred type is int
and the task object will have type Task<int>
. In other words, it is not necessary to explicitly specify in user code what that return type of the lambda or std::bind expression will be, though it is possible to explicitly do so by (entirely equivalently) writing Definition at line 1236 of file thread_management.h.
|
inline |
Overload of the new_task function for objects that can be called like a function object without arguments. In particular, this function allows calling Threads::new_task() with either objects that result from using std::bind, or using lambda functions. For example, this function is called when writing code such as
Here, we schedule the call to the sequence of functions do_this()
and then_do_that()
on a separate task, by making the lambda function declared here the function to execute on the task. The lambda function then returns 42 (which is a bit pointless here, but it could of course be some computed number), and this is going to be the returned value you can later retrieve via task.return_value()
once the task (i.e., the body of the lambda function) has completed.
decltype
statement used in the declaration of this function, and it is then used as the template argument of the Threads::Task object returned by the current function. In the example above, because the lambda function returns 42 (which in C++ has data type int
), the inferred type is int
and the task object will have type Task<int>
. In other words, it is not necessary to explicitly specify in user code what that return type of the lambda or std::bind expression will be, though it is possible to explicitly do so by (entirely equivalently) writing Definition at line 1911 of file thread_management.h.
IteratorRange< typename DoFHandler< dim, spacedim >::cell_iterator > DoFHandler< dim, spacedim >::cell_iterators | ( | ) | const |
Return an iterator range that contains all cells (active or not) that make up this DoFHandler. Such a range is useful to initialize range-based for loops as supported by C++11. See the example in the documentation of active_cell_iterators().
Definition at line 820 of file dof_handler.cc.
IteratorRange< typename DoFHandler< dim, spacedim >::active_cell_iterator > DoFHandler< dim, spacedim >::active_cell_iterators | ( | ) | const |
Return an iterator range that contains all active cells that make up this DoFHandler. Such a range is useful to initialize range-based for loops as supported by C++11, see also C++11 standard.
Range-based for loops are useful in that they require much less code than traditional loops (see here for a discussion of how they work). An example is that without range-based for loops, one often writes code such as the following:
Using C++11's range-based for loops, this is now entirely equivalent to the following:
[this->begin_active(), this->end())
Definition at line 830 of file dof_handler.cc.
IteratorRange< typename DoFHandler< dim, spacedim >::level_cell_iterator > DoFHandler< dim, spacedim >::mg_cell_iterators | ( | ) | const |
Return an iterator range that contains all cells (active or not) that make up this DoFHandler in their level-cell form. Such a range is useful to initialize range-based for loops as supported by C++11. See the example in the documentation of active_cell_iterators().
[this->begin_mg(), this->end_mg())
Definition at line 841 of file dof_handler.cc.
IteratorRange< typename DoFHandler< dim, spacedim >::cell_iterator > DoFHandler< dim, spacedim >::cell_iterators_on_level | ( | const unsigned int | level | ) | const |
Return an iterator range that contains all cells (active or not) that make up the given level of this DoFHandler. Such a range is useful to initialize range-based for loops as supported by C++11. See the example in the documentation of active_cell_iterators().
[in] | level | A given level in the refinement hierarchy of this triangulation. |
[this->begin(level), this->end(level))
Definition at line 853 of file dof_handler.cc.
IteratorRange< typename DoFHandler< dim, spacedim >::active_cell_iterator > DoFHandler< dim, spacedim >::active_cell_iterators_on_level | ( | const unsigned int | level | ) | const |
Return an iterator range that contains all active cells that make up the given level of this DoFHandler. Such a range is useful to initialize range-based for loops as supported by C++11. See the example in the documentation of active_cell_iterators().
[in] | level | A given level in the refinement hierarchy of this triangulation. |
[this->begin_active(level), this->end(level))
Definition at line 864 of file dof_handler.cc.
IteratorRange< typename DoFHandler< dim, spacedim >::level_cell_iterator > DoFHandler< dim, spacedim >::mg_cell_iterators_on_level | ( | const unsigned int | level | ) | const |
Return an iterator range that contains all cells (active or not) that make up the given level of this DoFHandler in their level-cell form. Such a range is useful to initialize range-based for loops as supported by C++11. See the example in the documentation of active_cell_iterators().
[in] | level | A given level in the refinement hierarchy of this triangulation. |
[this->begin_mg(level), this->end_mg(level))
Definition at line 875 of file dof_handler.cc.
IteratorRange< FilteredIterator< BaseIterator > > filter_iterators | ( | IteratorRange< BaseIterator > | i, |
const Predicate & | p | ||
) |
Filter the given range of iterators using a Predicate. This allows to replace:
by:
Definition at line 838 of file filtered_iterator.h.
IteratorRange< typename internal::FilteredIteratorImplementation::NestFilteredIterators< BaseIterator, std::tuple< Predicate, Targs... > >::type > filter_iterators | ( | IteratorRange< BaseIterator > | i, |
const Predicate & | p, | ||
const Targs... | args | ||
) |
Filter the given range of iterators through an arbitrary number of Predicates. This allows to replace:
by:
Definition at line 887 of file filtered_iterator.h.
IteratorRange< typename Triangulation< dim, spacedim >::cell_iterator > Triangulation< dim, spacedim >::cell_iterators | ( | ) | const |
Return an iterator range that contains all cells (active or not) that make up this triangulation. Such a range is useful to initialize range- based for loops as supported by C++11. See the example in the documentation of active_cell_iterators().
IteratorRange< typename Triangulation< dim, spacedim >::active_cell_iterator > Triangulation< dim, spacedim >::active_cell_iterators | ( | ) | const |
Return an iterator range that contains all active cells that make up this triangulation. Such a range is useful to initialize range-based for loops as supported by C++11, see also C++11 standard.
Range-based for loops are useful in that they require much less code than traditional loops (see here for a discussion of how they work). An example is that without range-based for loops, one often writes code such as the following (assuming for a moment that our goal is setting the user flag on every active cell):
Using C++11's range-based for loops, this is now entirely equivalent to the following:
[this->begin_active(), this->end())
IteratorRange< typename Triangulation< dim, spacedim >::cell_iterator > Triangulation< dim, spacedim >::cell_iterators_on_level | ( | const unsigned int | level | ) | const |
Return an iterator range that contains all cells (active or not) that make up the given level of this triangulation. Such a range is useful to initialize range-based for loops as supported by C++11. See the example in the documentation of active_cell_iterators().
[in] | level | A given level in the refinement hierarchy of this triangulation. |
[this->begin(level), this->end(level))
IteratorRange< typename Triangulation< dim, spacedim >::active_cell_iterator > Triangulation< dim, spacedim >::active_cell_iterators_on_level | ( | const unsigned int | level | ) | const |
Return an iterator range that contains all active cells that make up the given level of this triangulation. Such a range is useful to initialize range-based for loops as supported by C++11. See the example in the documentation of active_cell_iterators().
[in] | level | A given level in the refinement hierarchy of this triangulation. |
[this->begin_active(level), this->end(level))
IteratorRange< typename DoFHandler< dim, spacedim >::cell_iterator > DoFHandler< dim, spacedim >::cell_iterators | ( | ) | const |
Return an iterator range that contains all cells (active or not) that make up this DoFHandler. Such a range is useful to initialize range- based for loops as supported by C++11. See the example in the documentation of active_cell_iterators().
Definition at line 1054 of file dof_handler.cc.
IteratorRange< typename DoFHandler< dim, spacedim >::active_cell_iterator > DoFHandler< dim, spacedim >::active_cell_iterators | ( | ) | const |
Return an iterator range that contains all active cells that make up this DoFHandler. Such a range is useful to initialize range-based for loops as supported by C++11, see also C++11 standard.
Range-based for loops are useful in that they require much less code than traditional loops (see here for a discussion of how they work). An example is that without range-based for loops, one often writes code such as the following:
Using C++11's range-based for loops, this is now entirely equivalent to the following:
[this->begin_active(), this->end())
Definition at line 1064 of file dof_handler.cc.
IteratorRange< typename DoFHandler< dim, spacedim >::cell_iterator > DoFHandler< dim, spacedim >::cell_iterators_on_level | ( | const unsigned int | level | ) | const |
Return an iterator range that contains all cells (active or not) that make up the given level of this DoFHandler. Such a range is useful to initialize range-based for loops as supported by C++11. See the example in the documentation of active_cell_iterators().
[in] | level | A given level in the refinement hierarchy of this triangulation. |
[this->begin(level), this->end(level))
Definition at line 1075 of file dof_handler.cc.
IteratorRange< typename DoFHandler< dim, spacedim >::active_cell_iterator > DoFHandler< dim, spacedim >::active_cell_iterators_on_level | ( | const unsigned int | level | ) | const |
Return an iterator range that contains all active cells that make up the given level of this DoFHandler. Such a range is useful to initialize range-based for loops as supported by C++11. See the example in the documentation of active_cell_iterators().
[in] | level | A given level in the refinement hierarchy of this triangulation. |
[this->begin_active(level), this->end(level))
Definition at line 1086 of file dof_handler.cc.
|
related |
Filter the given range of iterators using a Predicate. This allows to replace:
by:
Definition at line 838 of file filtered_iterator.h.
|
related |
Filter the given range of iterators through an arbitrary number of Predicates. This allows to replace:
by:
Definition at line 887 of file filtered_iterator.h.