class AdvectionProblem
{
public:
- AdvectionProblem(Settings settings);
+ AdvectionProblem(const Settings &settings);
void run();
private:
template <int dim>
- AdvectionProblem<dim>::AdvectionProblem(Settings settings)
+ AdvectionProblem<dim>::AdvectionProblem(const Settings &settings)
: triangulation(Triangulation<dim>::limit_level_difference_at_vertices)
, dof_handler(triangulation)
, fe(settings.fe_degree)
void
GeneralDataStorage::print_info(Stream &os)
{
- for (auto it : any_data)
+ for (const auto &it : any_data)
{
os << it.first << '\t' << '\t'
<< boost::core::demangle(it.second.type().name()) << std::endl;
* are passed to the SourceClass constructor.
*/
template <typename... Args>
- ParameterAcceptorProxy(const std::string section_name, Args... args);
+ ParameterAcceptorProxy(const std::string §ion_name, Args... args);
/**
* Overloads the ParameterAcceptor::declare_parameters function, by calling
template <class SourceClass>
template <typename... Args>
ParameterAcceptorProxy<SourceClass>::ParameterAcceptorProxy(
- const std::string section_name,
+ const std::string §ion_name,
Args... args)
: SourceClass(args...)
, ParameterAcceptor(section_name)
}
static void
- import(const ::dealii::LinearAlgebra::ReadWriteVector<Number> &V,
- ::dealii::VectorOperation::values operation,
- std::shared_ptr<const ::dealii::Utilities::MPI::Partitioner>
- communication_pattern,
- const IndexSet &locally_owned_elem,
- ::dealii::MemorySpace::
- MemorySpaceData<Number, ::dealii::MemorySpace::Host> &data)
+ import(
+ const ::dealii::LinearAlgebra::ReadWriteVector<Number> &V,
+ ::dealii::VectorOperation::values operation,
+ const std::shared_ptr<const ::dealii::Utilities::MPI::Partitioner>
+ & communication_pattern,
+ const IndexSet &locally_owned_elem,
+ ::dealii::MemorySpace::MemorySpaceData<Number,
+ ::dealii::MemorySpace::Host>
+ &data)
{
Assert(
(operation == ::dealii::VectorOperation::add) ||
// check the different possibilities
- for (std::vector<std::string>::const_iterator test_string =
- split_names.begin();
- test_string != split_names.end();
- ++test_string)
+ for (const auto &test_string : split_names)
{
bool string_found = false;
tmp = sequence;
while (tmp.find('|') != std::string::npos)
{
- if (*test_string == std::string(tmp, 0, tmp.find('|')))
+ if (test_string == std::string(tmp, 0, tmp.find('|')))
{
// string found, quit
// loop. don't change
}
// check last choice, not finished by |
if (!string_found)
- if (*test_string == tmp)
+ if (test_string == tmp)
string_found = true;
if (!string_found)
// finally copy the list into the mask
std::fill(master_dof_mask.begin(), master_dof_mask.end(), false);
- for (std::vector<types::global_dof_index>::const_iterator i =
- master_dof_list.begin();
- i != master_dof_list.end();
- ++i)
- master_dof_mask[*i] = true;
+ for (const auto dof : master_dof_list)
+ master_dof_mask[dof] = true;
}
{
Assert(rows == cols, ExcNotQuadratic());
- // loop over all elements presently
- // in the sparsity pattern and add
- // the transpose element. note:
+ // loop over all elements presently in the sparsity pattern and add the
+ // transpose element. note:
//
- // 1. that the sparsity pattern
- // changes which we work on, but
- // not the present row
+ // 1. that the sparsity pattern changes which we work on, but not the present
+ // row
//
- // 2. that the @p{add} function can
- // be called on elements that
- // already exist without any harm
+ // 2. that the @p{add} function can be called on elements that already exist
+ // without any harm
for (size_type row = 0; row < lines.size(); ++row)
{
const size_type rowindex =
rowset.size() == 0 ? row : rowset.nth_index_in_set(row);
- for (std::vector<size_type>::const_iterator j =
- lines[row].entries.begin();
- j != lines[row].entries.end();
- ++j)
- // add the transpose entry if
- // this is not the diagonal
- if (rowindex != *j)
- add(*j, rowindex);
+ for (const size_type row_entry : lines[row].entries)
+ // add the transpose entry if this is not the diagonal
+ if (rowindex != row_entry)
+ add(row_entry, rowindex);
}
}