Skip to content

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
gassmoeller committed Jan 12, 2017
1 parent 06947d0 commit e62a3ae
Show file tree
Hide file tree
Showing 15 changed files with 41 additions and 40 deletions.
6 changes: 3 additions & 3 deletions include/aspect/utilities.h
Expand Up @@ -369,10 +369,10 @@ namespace aspect
std::string parenthesize_if_nonempty (const std::string &s);

/**
* Returns if a vector of strings @p list_of_strings only contains unique
* strings.
* Returns if a vector of strings @p strings only contains unique
* entries.
*/
bool list_is_unique (const std::vector<std::string> &list_of_strings);
bool has_unique_entries (const std::vector<std::string> &strings);

/**
* AsciiDataLookup reads in files containing input data in ascii format.
Expand Down
6 changes: 3 additions & 3 deletions source/heating_model/interface.cc
Expand Up @@ -171,10 +171,10 @@ namespace aspect
model_names
= Utilities::split_string_list(prm.get("List of model names"));

AssertThrow(Utilities::list_is_unique(model_names),
AssertThrow(Utilities::has_unique_entries(model_names),
ExcMessage("The list of strings for the parameter "
"'Heating model/List of model names' is not unique. "
"Please check your parameter file."));
"'Heating model/List of model names' contains entries more than once. "
"This is not allowed. Please check your parameter file."));

const std::string model_name = prm.get ("Model name");

Expand Down
6 changes: 3 additions & 3 deletions source/mesh_refinement/interface.cc
Expand Up @@ -452,10 +452,10 @@ namespace aspect
plugin_names
= Utilities::split_string_list(prm.get("Strategy"));

AssertThrow(Utilities::list_is_unique(plugin_names),
AssertThrow(Utilities::has_unique_entries(plugin_names),
ExcMessage("The list of strings for the parameter "
"'Mesh refinement/Strategy' is not unique. "
"Please check your parameter file."));
"'Mesh refinement/Strategy' contains entries more than once. "
"This is not allowed. Please check your parameter file."));

normalize_criteria = prm.get_bool ("Normalize individual refinement criteria");

Expand Down
6 changes: 3 additions & 3 deletions source/particle/property/interface.cc
Expand Up @@ -483,10 +483,10 @@ namespace aspect
{
// now also see which derived quantities we are to compute
prop_names = Utilities::split_string_list(prm.get("List of tracer properties"));
AssertThrow(Utilities::list_is_unique(prop_names),
AssertThrow(Utilities::has_unique_entries(prop_names),
ExcMessage("The list of strings for the parameter "
"'Postprocess/Tracers/List of tracer properties' is not unique. "
"Please check your parameter file."));
"'Postprocess/Tracers/List of tracer properties' contains entries more than once. "
"This is not allowed. Please check your parameter file."));

// see if 'all' was selected (or is part of the list). if so
// simply replace the list with one that contains all names
Expand Down
6 changes: 3 additions & 3 deletions source/particle/world.cc
Expand Up @@ -1634,10 +1634,10 @@ namespace aspect
update_ghost_particles = prm.get_bool("Update ghost particles");

const std::vector<std::string> strategies = Utilities::split_string_list(prm.get ("Load balancing strategy"));
AssertThrow(Utilities::list_is_unique(strategies),
AssertThrow(Utilities::has_unique_entries(strategies),
ExcMessage("The list of strings for the parameter "
"'Postprocess/Tracers/Load balancing strategy' is not unique. "
"Please check your parameter file."));
"'Postprocess/Tracers/Load balancing strategy' contains entries more than once. "
"This is not allowed. Please check your parameter file."));

particle_load_balancing = ParticleLoadBalancing::no_balancing;

Expand Down
6 changes: 3 additions & 3 deletions source/postprocess/depth_average.cc
Expand Up @@ -356,10 +356,10 @@ namespace aspect
n_depth_zones = prm.get_integer ("Number of zones");

output_variables = Utilities::split_string_list(prm.get("List of output variables"));
AssertThrow(Utilities::list_is_unique(output_variables),
AssertThrow(Utilities::has_unique_entries(output_variables),
ExcMessage("The list of strings for the parameter "
"'Postprocess/Depth average/List of output variables' is not unique. "
"Please check your parameter file."));
"'Postprocess/Depth average/List of output variables' contains entries more than once. "
"This is not allowed. Please check your parameter file."));

if ( std::find( output_variables.begin(), output_variables.end(), "all") != output_variables.end())
output_all_variables = true;
Expand Down
6 changes: 3 additions & 3 deletions source/postprocess/interface.cc
Expand Up @@ -209,10 +209,10 @@ namespace aspect
{
postprocessor_names
= Utilities::split_string_list(prm.get("List of postprocessors"));
AssertThrow(Utilities::list_is_unique(postprocessor_names),
AssertThrow(Utilities::has_unique_entries(postprocessor_names),
ExcMessage("The list of strings for the parameter "
"'Postprocess/List of postprocessors' is not unique. "
"Please check your parameter file."));
"'Postprocess/List of postprocessors' contains entries more than once. "
"This is not allowed. Please check your parameter file."));
}
prm.leave_subsection();

Expand Down
6 changes: 3 additions & 3 deletions source/postprocess/visualization.cc
Expand Up @@ -851,10 +851,10 @@ namespace aspect

// now also see which derived quantities we are to compute
viz_names = Utilities::split_string_list(prm.get("List of output variables"));
AssertThrow(Utilities::list_is_unique(viz_names),
AssertThrow(Utilities::has_unique_entries(viz_names),
ExcMessage("The list of strings for the parameter "
"'Postprocess/Visualization/List of output variables' is not unique. "
"Please check your parameter file."));
"'Postprocess/Visualization/List of output variables' contains entries more than once. "
"This is not allowed. Please check your parameter file."));

// see if 'all' was selected (or is part of the list). if so
// simply replace the list with one that contains all names
Expand Down
5 changes: 3 additions & 2 deletions source/postprocess/visualization/material_properties.cc
Expand Up @@ -226,10 +226,11 @@ namespace aspect
{
// Get property names and compare against variable names
property_names = Utilities::split_string_list(prm.get ("List of material properties"));
AssertThrow(Utilities::list_is_unique(property_names),
AssertThrow(Utilities::has_unique_entries(property_names),
ExcMessage("The list of strings for the parameter "
"'Postprocess/Visualization/Material properties/List of material properties' "
"is not unique. Please check your parameter file."));
"contains entries more than once. This is not allowed. "
"Please check your parameter file."));

for (std::vector<std::string>::const_iterator p = variable_names.begin();
p != variable_names.end(); ++p)
Expand Down
6 changes: 3 additions & 3 deletions source/postprocess/visualization/melt.cc
Expand Up @@ -197,10 +197,10 @@ namespace aspect
prm.enter_subsection("Melt material properties");
{
property_names = Utilities::split_string_list(prm.get ("List of properties"));
AssertThrow(Utilities::list_is_unique(property_names),
AssertThrow(Utilities::has_unique_entries(property_names),
ExcMessage("The list of strings for the parameter "
"'Postprocess/Visualization/Melt material properties/List of properties' is not unique. "
"Please check your parameter file."));
"'Postprocess/Visualization/Melt material properties/List of properties' contains entries more than once. "
"This is not allowed. Please check your parameter file."));
}
prm.leave_subsection();
}
Expand Down
6 changes: 3 additions & 3 deletions source/simulator/parameters.cc
Expand Up @@ -1032,10 +1032,10 @@ namespace aspect
nullspace_removal = NullspaceRemoval::none;
std::vector<std::string> nullspace_names =
Utilities::split_string_list(prm.get("Remove nullspace"));
AssertThrow(Utilities::list_is_unique(nullspace_names),
AssertThrow(Utilities::has_unique_entries(nullspace_names),
ExcMessage("The list of strings for the parameter "
"'Model settings/Remove nullspace' is not unique. "
"Please check your parameter file."));
"'Model settings/Remove nullspace' contains entries more than once. "
"This is not allowed. Please check your parameter file."));

for (unsigned int i=0; i<nullspace_names.size(); ++i)
{
Expand Down
6 changes: 3 additions & 3 deletions source/termination_criteria/interface.cc
Expand Up @@ -227,10 +227,10 @@ namespace aspect
do_checkpoint_on_terminate = prm.get_bool("Checkpoint on termination");

plugin_names = Utilities::split_string_list(prm.get("Termination criteria"));
AssertThrow(Utilities::list_is_unique(plugin_names),
AssertThrow(Utilities::has_unique_entries(plugin_names),
ExcMessage("The list of strings for the parameter "
"'Termination criteria/Termination criteria' is not unique. "
"Please check your parameter file."));
"'Termination criteria/Termination criteria' contains entries more than once. "
"This is not allowed. Please check your parameter file."));

// as described, the end time plugin is always active
if (std::find (plugin_names.begin(), plugin_names.end(), "end time")
Expand Down
6 changes: 3 additions & 3 deletions source/utilities.cc
Expand Up @@ -862,10 +862,10 @@ namespace aspect
}

bool
list_is_unique (const std::vector<std::string> &list_of_strings)
has_unique_entries (const std::vector<std::string> &strings)
{
const std::set<std::string> set_of_strings(list_of_strings.begin(),list_of_strings.end());
return (set_of_strings.size() == list_of_strings.size());
const std::set<std::string> set_of_strings(strings.begin(),strings.end());
return (set_of_strings.size() == strings.size());
}

template <int dim>
Expand Down
2 changes: 1 addition & 1 deletion tests/ellipsoidal_chunk_coordinate_parallel.prm
Expand Up @@ -78,7 +78,7 @@ end

############### Parameters describing what to do with the solution
subsection Postprocess
set List of postprocessors = visualization, velocity statistics, temperature statistics, velocity statistics, basic statistics
set List of postprocessors = visualization, velocity statistics, temperature statistics, basic statistics

subsection Visualization
set List of output variables = density
Expand Down
2 changes: 1 addition & 1 deletion tests/ellipsoidal_chunk_noncoordinate_parallel.prm
Expand Up @@ -80,7 +80,7 @@ end

############### Parameters describing what to do with the solution
subsection Postprocess
set List of postprocessors = visualization, velocity statistics, temperature statistics, velocity statistics, basic statistics
set List of postprocessors = visualization, temperature statistics, velocity statistics, basic statistics

subsection Visualization
set List of output variables = density
Expand Down

0 comments on commit e62a3ae

Please sign in to comment.