Skip to content

Commit

Permalink
Fix clang tidy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
gassmoeller committed Nov 19, 2024
1 parent 06eee5d commit e77050a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
2 changes: 2 additions & 0 deletions contrib/release/release-tasklist.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ and the links are working
git commit -a -m "doxygen formatting, update copyright years"
```

- Make sure all CI workflows on the main branch pass: https://github.com/geodynamics/aspect/actions?query=branch%3Amain

- Create a pull request with the pre release tasks

## Create a release pull-request
Expand Down
2 changes: 1 addition & 1 deletion include/aspect/particle/manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ namespace aspect
* Move constructor. This is required to be able to put instances
* of this class into a std::vector.
*/
Manager(Manager &&);
Manager(Manager &&) noexcept;

/**
* Initialize the particle manager.
Expand Down
6 changes: 3 additions & 3 deletions source/particle/manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ namespace aspect
= default;

template <int dim>
Manager<dim>::Manager(Manager &&other)
Manager<dim>::Manager(Manager &&other) noexcept
: generator(std::move(other.generator)),
integrator(std::move(other.integrator)),
interpolator(std::move(other.interpolator)),
Expand Down Expand Up @@ -467,8 +467,8 @@ namespace aspect
solution_values.end());

EvaluationFlags::EvaluationFlags evaluation_flags_union = EvaluationFlags::nothing;
for (unsigned int i=0; i<evaluation_flags.size(); ++i)
evaluation_flags_union |= evaluation_flags[i];
for (const auto &flag : evaluation_flags)
evaluation_flags_union |= flag;

if (evaluation_flags_union & (EvaluationFlags::values | EvaluationFlags::gradients))
{
Expand Down
14 changes: 7 additions & 7 deletions source/simulator/initial_conditions.cc
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,8 @@ namespace aspect
{
const Particle::Property::Manager<dim> &particle_property_manager = particle_managers[particle_manager].get_property_manager();

particle_property_indices.push_back(std::vector<std::pair<unsigned int, unsigned int>>());
property_mask.push_back(ComponentMask(particle_property_manager.get_data_info().n_components(),false));
particle_property_indices.emplace_back();
property_mask.emplace_back(particle_property_manager.get_data_info().n_components(),false);

for (unsigned int advection_field=0; advection_field<advection_fields.size(); ++advection_field)
{
Expand All @@ -309,7 +309,7 @@ namespace aspect
+ particle_property_and_component.second;

advection_field_has_been_found[advection_field] = true;
particle_property_indices[particle_manager].push_back({advection_field, particle_property_index});
particle_property_indices[particle_manager].emplace_back(advection_field, particle_property_index);
property_mask[particle_manager].set(particle_property_index,true);
}
}
Expand All @@ -327,7 +327,7 @@ namespace aspect
"more fields that are marked as particle advected than particle properties"));

advection_field_has_been_found[advection_field] = true;
particle_property_indices[particle_manager].push_back({advection_field,particle_property_index});
particle_property_indices[particle_manager].emplace_back(advection_field,particle_property_index);
property_mask[particle_manager].set(particle_property_index,true);
}
}
Expand Down Expand Up @@ -411,14 +411,14 @@ namespace aspect
// to the particle field interpolated at these points
cell->get_dof_indices (local_dof_indices);
const unsigned int n_dofs_per_cell = finite_element.base_element(base_element_index).dofs_per_cell;
for (unsigned int j=0; j<particle_property_indices[particle_manager].size(); ++j)
for (const std::pair<unsigned int, unsigned int> &field_and_particle_property: particle_property_indices[particle_manager])
for (unsigned int i=0; i<n_dofs_per_cell; ++i)
{
const unsigned int system_local_dof
= finite_element.component_to_system_index(advection_fields[particle_property_indices[particle_manager][j].first].component_index(introspection),
= finite_element.component_to_system_index(advection_fields[field_and_particle_property.first].component_index(introspection),
/*dof index within component=*/i);

particle_solution(local_dof_indices[system_local_dof]) = particle_properties[i][particle_property_indices[particle_manager][j].second];
particle_solution(local_dof_indices[system_local_dof]) = particle_properties[i][field_and_particle_property.second];
}
}
}
Expand Down

0 comments on commit e77050a

Please sign in to comment.