Skip to content

Commit

Permalink
Convert to range based for loops (idaholab#8444)
Browse files Browse the repository at this point in the history
  • Loading branch information
lindsayad authored and rwcarlsen committed Feb 24, 2017
1 parent b5fea5f commit aa12a2b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
13 changes: 7 additions & 6 deletions framework/include/base/MooseObjectWarehouseBase.h
Expand Up @@ -530,11 +530,8 @@ void
MooseObjectWarehouseBase<T>::updateBoundaryMatPropDependency(std::set<unsigned int> & needed_mat_props, THREAD_ID tid/* = 0*/) const
{
if (hasActiveBoundaryObjects(tid))
{
typename std::map<BoundaryID, std::vector<std::shared_ptr<T>>>::const_iterator it;
for (it = _active_boundary_objects[tid].begin(); it != _active_boundary_objects[tid].end(); ++it)
updateMatPropDependencyHelper(needed_mat_props, it->second);
}
for (auto & active_bnd_object : _active_boundary_objects[tid])
updateMatPropDependencyHelper(needed_mat_props, active_bnd_object.second);
}


Expand All @@ -551,9 +548,13 @@ template<typename T>
void
MooseObjectWarehouseBase<T>::updateMatPropDependencyHelper(std::set<unsigned int> & needed_mat_props, const std::vector<std:shared_ptr<T>> & objects)
{
<<<<<<< HEAD
for (typename std::vector<std:shared_ptr<T>> ::const_iterator it = objects.begin(); it != objects.end(); ++it)
=======
for (auto & object : objects)
>>>>>>> 5225638... Convert to range based for loops (#8444)
{
const std::set<unsigned int> & mp_deps = (*it)->getMatPropDependencies();
const std::set<unsigned int> & mp_deps = object->getMatPropDependencies();
needed_mat_props.insert(mp_deps.begin(), mp_deps.end());
}
}
Expand Down
4 changes: 3 additions & 1 deletion framework/include/base/SubProblem.h
Expand Up @@ -400,8 +400,10 @@ class SubProblem : public Problem
/* This needs to remain <unsigned int> for threading purposes */
std::vector<unsigned int> _has_active_elemental_moose_variables;

std::vector<std::set<unsigned int> > _active_material_property_ids;
/// Set of material property ids that determine whether materials get reinited
std::vector<std::set<unsigned int>> _active_material_property_ids;

/// True if _active_material_property_ids is not empty
std::vector<unsigned int> _has_active_material_property_ids;

/// nonlocal coupling requirement flag
Expand Down
1 change: 1 addition & 0 deletions framework/include/materials/MaterialPropertyInterface.h
Expand Up @@ -251,6 +251,7 @@ class MaterialPropertyInterface
*/
void addMatPropDependency(unsigned int mat_prop_id) { _material_property_dependencies.insert(mat_prop_id); }

/// The set of material properties (as given by their IDs) that _this_ object depends on
std::set<unsigned int> _material_property_dependencies;

private:
Expand Down

0 comments on commit aa12a2b

Please sign in to comment.