Skip to content

Commit 5669a7a

Browse files
committed
Further adressing Timo's comments.
1 parent 29e4516 commit 5669a7a

10 files changed

+25
-33
lines changed

include/aspect/mesh_refinement/isosurfaces.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ namespace aspect
4545
public:
4646
/**
4747
* Constructor. Converts a property name into a structure containing a property type
48-
* and index. If the property contains multiple items (e.g. the property compositional field has a
49-
* field index) they are stored in the index.
48+
* and an index. If the property contains multiple items (e.g. the property compositional field has a
49+
* field index) the index refering to the particluar item of that proparty is stored in the variable index.
5050
* @param property_name The name of a property, which can be Temperature for the temperature field or
5151
* the name of a compositional field listed in the parameter available_compositions.
5252
* @param available_compositions A list of names of the available compositional fields.
@@ -137,7 +137,7 @@ namespace aspect
137137
/**
138138
* A vector of the isosurfaces used by this class.
139139
*/
140-
std::vector<Internal::Isosurface> isosurfaces;
140+
std::vector<internal::Isosurface> isosurfaces;
141141

142142
};
143143
}

source/mesh_refinement/isosurfaces.cc

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ namespace aspect
3232
{
3333
namespace MeshRefinement
3434
{
35-
namespace Internal
35+
namespace internal
3636
{
3737
bool
3838
Isosurface::are_all_values_in_range(const std::vector<double> &values) const
3939
{
4040
// This assumes that all the vectors in isosurfaces already have the
4141
// same length.
4242
Assert(values.size() == min_values.size(),
43-
ExcMessage("Internal error: Vector of values passed to the isosurface class "
43+
ExcMessage("internal error: Vector of values passed to the isosurface class "
4444
"function are_all_values_in_range, does not have the the correct size."));
4545
for (unsigned int index = 0; index < values.size(); ++index)
4646
{
@@ -90,7 +90,7 @@ namespace aspect
9090
/**
9191
* Convert a string describing the refinement level which potentially contains a min
9292
* or max statement included in them to an integer. The format is "min", "max", "min+X", "max-X", or "X", where X is a positive integer.
93-
93+
9494
For example if minimum_refinement_level
9595
* is 1, and the string is 'min+1', it will return 2. The returned value will be capped
9696
* by the provided @p minimum_refinement_level and @p maximum_refinement_level.
@@ -117,7 +117,7 @@ namespace aspect
117117
}
118118
else
119119
{
120-
AssertThrow(string == "min"),
120+
AssertThrow(string == "min",
121121
ExcMessage("A value of " + string_value + " was provided, but you can't provide a smaller value than the minimum."));
122122
return minimum_refinement_level;
123123
}
@@ -188,11 +188,11 @@ namespace aspect
188188
std::vector<double> values(isosurface.min_values.size());
189189
for (unsigned int index = 0; index < isosurface.properties.size(); ++index)
190190
{
191-
if (isosurface.properties[index].type == Internal::PropertyType::Temperature)
191+
if (isosurface.properties[index].type == internal::PropertyType::Temperature)
192192
{
193193
values[index] = in.temperature[i_quad];
194194
}
195-
else if (isosurface.properties[index].type == Internal::PropertyType::Composition)
195+
else if (isosurface.properties[index].type == internal::PropertyType::Composition)
196196
{
197197
values[index] = in.composition[i_quad][isosurface.properties[index].index];
198198
}
@@ -237,22 +237,22 @@ namespace aspect
237237
coarsen = false;
238238
if (refine == true)
239239
clear_refine = false;
240-
if (coarsen == true)
241-
clear_coarsen = false;
240+
if (clear_coarsen == true)
241+
coarsen = false;
242242

243243
// Perform the actual placement of the coarsening and refinement flags.
244244
if (clear_coarsen == true)
245245
{
246246
cell->clear_coarsen_flag ();
247247
}
248-
if (coarsen == true)
249-
{
250-
cell->set_coarsen_flag ();
251-
}
252248
if (clear_refine == true)
253249
{
254250
cell->clear_refine_flag ();
255251
}
252+
if (coarsen == true)
253+
{
254+
cell->set_coarsen_flag ();
255+
}
256256
if (refine == true)
257257
{
258258
cell->set_refine_flag ();
@@ -317,8 +317,8 @@ namespace aspect
317317
for (auto &isosurface_entry : isosurface_entries)
318318
{
319319
++isosurface_entry_number;
320-
aspect::MeshRefinement::Internal::Isosurface isosurface;
321-
std::vector<aspect::MeshRefinement::Internal::Property> properties;
320+
aspect::MeshRefinement::internal::Isosurface isosurface;
321+
std::vector<aspect::MeshRefinement::internal::Property> properties;
322322
std::vector<double> min_value_inputs;
323323
std::vector<double> max_value_inputs;
324324
const std::vector<std::string> field_entries = dealii::Utilities::split_string_list(isosurface_entry, ',');
@@ -328,8 +328,8 @@ namespace aspect
328328
+ " contains only " + std::to_string(field_entries.size()) + " entries: " + isosurface_entry + "."));
329329

330330
// convert a potential min, min+1, min + 1, min+10, max, max-1, etc. to actual integers.
331-
isosurface.min_refinement = Internal::min_max_string_to_int(field_entries[0], minimum_refinement_level, maximum_refinement_level);
332-
isosurface.max_refinement = Internal::min_max_string_to_int(field_entries[1], minimum_refinement_level, maximum_refinement_level);
331+
isosurface.min_refinement = internal::min_max_string_to_int(field_entries[0], minimum_refinement_level, maximum_refinement_level);
332+
isosurface.max_refinement = internal::min_max_string_to_int(field_entries[1], minimum_refinement_level, maximum_refinement_level);
333333
AssertThrow(isosurface.min_refinement <= isosurface.max_refinement,
334334
ExcMessage("The provided maximum refinement level has to be larger than the minimum refinement level."));
335335
for (auto field_entry = field_entries.begin()+2; field_entry != field_entries.end(); ++field_entry)
@@ -341,7 +341,7 @@ namespace aspect
341341
std::vector<std::string> key_and_value = Utilities::split_string_list (*field_entry, ':');
342342
AssertThrow(key_and_value.size() == 2,
343343
ExcMessage("The isosurface property must have a key (e.g. Temperature) and two values separated by a | (e.g. (300 | 600)."));
344-
properties.push_back(Internal::Property(key_and_value[0], compositions)); // convert key to property name
344+
properties.push_back(internal::Property(key_and_value[0], compositions)); // convert key to property name
345345
const std::vector<std::string> values = dealii::Utilities::split_string_list(key_and_value[1], '|');
346346
AssertThrow(values.size() == 2,
347347
ExcMessage("Both a maximum and a minimum values are required for each isosurface."));

tests/isosurfaces_simple_box_2D.prm

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ set Start time = 0
77
set Adiabatic surface temperature = 1613.0
88
set Surface pressure = 0
99
set Use years in output instead of seconds = true
10-
set Nonlinear solver scheme = no Advection, no Stokes
10+
set Nonlinear solver scheme = no Advection, no Stokes
1111

1212

1313

@@ -54,7 +54,7 @@ end
5454

5555

5656
subsection Boundary temperature model
57-
set List of model names = function
57+
set List of model names = function
5858
subsection Function
5959
set Function expression = 1613.0
6060
end
@@ -103,4 +103,3 @@ subsection Postprocess
103103
set Output format = gnuplot
104104
end
105105
end
106-

tests/isosurfaces_simple_box_2D_custom_fieldnames_fail.prm

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,3 @@ subsection Mesh refinement
1717
0, 0, Temperature: 1600 | 3000, C_2 : 0.0 | 0.5
1818
end
1919
end
20-

tests/isosurfaces_simple_box_2D_min_max_1.prm

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,3 @@ subsection Mesh refinement
1010
min, min, Temperature: 1600 | 3000, C_2 : 0.0 | 0.5
1111
end
1212
end
13-

tests/isosurfaces_simple_box_2D_min_max_2.prm

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,3 @@ subsection Mesh refinement
1010
min + 1,min+2, Temperature: 1600 | 3000, C_2 : 0.0 | 0.5
1111
end
1212
end
13-

tests/isosurfaces_simple_box_3D.prm

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,5 +60,3 @@ end
6060
subsection Boundary velocity model
6161
set Zero velocity boundary indicators = 0,1,2,3,4,5
6262
end
63-
64-

tests/isosurfaces_slab_2D.prm

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ set Start time = 0
88
set Adiabatic surface temperature = 1673.0
99
set Surface pressure = 0
1010
set Use years in output instead of seconds = true
11-
set Nonlinear solver scheme = no Advection, no Stokes
11+
set Nonlinear solver scheme = no Advection, no Stokes
1212

1313
# We take a box geometry and increase the repetitions
1414
# of the coarse mesh
@@ -93,4 +93,3 @@ subsection Postprocess
9393
set Output format = gnuplot
9494
end
9595
end
96-

tests/isosurfaces_slab_3D.prm

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,3 @@ subsection Initial composition model
6060
(((z > x + Xmax - Xtr - Dsl) && (z < x + Xmax - Xtr))? 1.0 : 0.0)
6161
end
6262
end
63-

unit_tests/mesh_refinment.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ namespace aspect
2525
{
2626
namespace MeshRefinement
2727
{
28-
namespace Internal
28+
namespace internal
2929
{
3030
// Forward declaration
3131
unsigned int min_max_string_to_int(const std::string &string_value, const unsigned int minimum_refinement_level, const unsigned int maximum_refinement_level);
@@ -36,7 +36,7 @@ namespace aspect
3636
TEST_CASE("Isosurfaces min_max_string_to_int function")
3737
{
3838

39-
using namespace aspect::MeshRefinement::Internal;
39+
using namespace aspect::MeshRefinement::internal;
4040
CHECK(min_max_string_to_int("min",1,5) == 1);
4141
CHECK(min_max_string_to_int("min+1",1,5) == 2);
4242
CHECK(min_max_string_to_int("min+2",1,5) == 3);

0 commit comments

Comments
 (0)