Skip to content

Commit

Permalink
Merge pull request geodynamics#6108 from gassmoeller/enable_deprecate…
Browse files Browse the repository at this point in the history
…d_checks

Enable deprecation warnings in tester
  • Loading branch information
tjhei authored Oct 25, 2024
2 parents 08d2d0d + e10867b commit 3a91bde
Show file tree
Hide file tree
Showing 13 changed files with 429 additions and 458 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
run: |
mkdir build-no-unity
cd build-no-unity
cmake -D CMAKE_BUILD_TYPE=Debug -D ASPECT_PRECOMPILE_HEADERS=OFF -D ASPECT_UNITY_BUILD=OFF -D CMAKE_CXX_FLAGS='-Werror' ..
cmake -D CMAKE_BUILD_TYPE=Debug -D ASPECT_PRECOMPILE_HEADERS=OFF -D ASPECT_UNITY_BUILD=OFF -D CMAKE_CXX_FLAGS='-Werror' -D ASPECT_ADDITIONAL_CXX_FLAGS='-Wdeprecated-declarations' ..
make -j 4
./aspect --test
Expand Down Expand Up @@ -130,7 +130,7 @@ jobs:
-D CMAKE_BUILD_TYPE=Debug \
-G 'Ninja' \
-D CMAKE_CXX_FLAGS='-Werror' \
-D ASPECT_ADDITIONAL_CXX_FLAGS='-O3' \
-D ASPECT_ADDITIONAL_CXX_FLAGS='-O3 -Wdeprecated-declarations' \
-D ASPECT_TEST_GENERATOR='Ninja' \
-D ASPECT_PRECOMPILE_HEADERS=ON \
-D ASPECT_UNITY_BUILD=ON \
Expand Down
10 changes: 4 additions & 6 deletions source/material_model/diffusion_dislocation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -142,15 +142,13 @@ namespace aspect
// Establish that a background field is required here
chemical_field_names.insert(chemical_field_names.begin(),"background");

Utilities::MapParsing::Options options(chemical_field_names, "Densities");
Utilities::MapParsing::Options options(chemical_field_names, "");
options.list_of_allowed_keys = compositional_field_names;

densities = Utilities::MapParsing::parse_map_to_double_array (prm.get("Densities"),
options);
options.property_name = "Densities";
densities = Utilities::MapParsing::parse_map_to_double_array (prm.get(options.property_name), options);

options.property_name = "Thermal expansivities";
thermal_expansivities = Utilities::MapParsing::parse_map_to_double_array (prm.get("Thermal expansivities"),
options);
thermal_expansivities = Utilities::MapParsing::parse_map_to_double_array (prm.get(options.property_name), options);

// Phenomenological parameters
thermal_diffusivity = prm.get_double("Thermal diffusivity");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,42 +117,29 @@ namespace aspect
void
MulticomponentCompressible<dim>::parse_parameters (ParameterHandler &prm)
{
std::vector<std::string> compositional_field_names = this->introspection().get_composition_names();
// Establish that a background field is required here
const bool has_background_field = true;

// Retrieve the list of composition names
const std::vector<std::string> list_of_composition_names = this->introspection().get_composition_names();
compositional_field_names.insert(compositional_field_names.begin(),"background");
Utilities::MapParsing::Options options(compositional_field_names, "");

// Parse multicomponent properties
reference_temperatures = Utilities::parse_map_to_double_array (prm.get("Reference temperatures"),
list_of_composition_names,
has_background_field,
"Reference temperatures");

reference_densities = Utilities::parse_map_to_double_array (prm.get("Reference densities"),
list_of_composition_names,
has_background_field,
"Reference densities");

reference_isothermal_compressibilities = Utilities::parse_map_to_double_array (prm.get("Reference isothermal compressibilities"),
list_of_composition_names,
has_background_field,
"Reference isothermal compressibilities");

isothermal_bulk_modulus_pressure_derivatives = Utilities::parse_map_to_double_array (prm.get("Isothermal bulk modulus pressure derivatives"),
list_of_composition_names,
has_background_field,
"Isothermal bulk modulus pressure derivatives");

reference_thermal_expansivities = Utilities::parse_map_to_double_array (prm.get("Reference thermal expansivities"),
list_of_composition_names,
has_background_field,
"Reference thermal expansivities");

isochoric_specific_heats = Utilities::parse_map_to_double_array (prm.get("Isochoric specific heats"),
list_of_composition_names,
has_background_field,
"Isochoric specific heats");
options.property_name = "Reference temperatures";
reference_temperatures = Utilities::MapParsing::parse_map_to_double_array (prm.get(options.property_name), options);

options.property_name = "Reference densities";
reference_densities = Utilities::MapParsing::parse_map_to_double_array (prm.get(options.property_name), options);

options.property_name = "Reference isothermal compressibilities";
reference_isothermal_compressibilities = Utilities::MapParsing::parse_map_to_double_array (prm.get(options.property_name), options);

options.property_name = "Isothermal bulk modulus pressure derivatives";
isothermal_bulk_modulus_pressure_derivatives = Utilities::MapParsing::parse_map_to_double_array (prm.get(options.property_name), options);

options.property_name = "Reference thermal expansivities";
reference_thermal_expansivities = Utilities::MapParsing::parse_map_to_double_array (prm.get(options.property_name), options);

options.property_name = "Isochoric specific heats";
isochoric_specific_heats = Utilities::MapParsing::parse_map_to_double_array (prm.get(options.property_name), options);
}
}
}
Expand Down
111 changes: 42 additions & 69 deletions source/material_model/melt_boukare.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1170,75 +1170,48 @@ namespace aspect
AssertThrow (false, ExcNotImplemented());
}

molar_masses = Utilities::parse_map_to_double_array (prm.get("Molar masses"),
endmember_names,
false,
"Molar masses");

number_of_atoms = Utilities::parse_map_to_double_array (prm.get("Number of atoms"),
endmember_names,
false,
"Number of atoms");

reference_volumes = Utilities::parse_map_to_double_array (prm.get("Reference volumes"),
endmember_names,
false,
"Reference volumes");

reference_thermal_expansivities = Utilities::parse_map_to_double_array (prm.get("Reference thermal expansivities"),
endmember_names,
false,
"Reference thermal expansivities");

reference_bulk_moduli = Utilities::parse_map_to_double_array (prm.get("Reference bulk moduli"),
endmember_names,
false,
"Reference bulk moduli");

bulk_modulus_pressure_derivatives = Utilities::parse_map_to_double_array (prm.get("First derivatives of the bulk modulus"),
endmember_names,
false,
"First derivatives of the bulk modulus");

bulk_modulus_second_pressure_derivatives = Utilities::parse_map_to_double_array (prm.get("Second derivatives of the bulk modulus"),
endmember_names,
false,
"Second derivatives of the bulk modulus");

Einstein_temperatures = Utilities::parse_map_to_double_array (prm.get("Einstein temperatures"),
endmember_names,
false,
"Einstein temperatures");

reference_enthalpies = Utilities::parse_map_to_double_array (prm.get("Reference enthalpies"),
endmember_names,
false,
"Reference enthalpies");

reference_entropies = Utilities::parse_map_to_double_array (prm.get("Reference entropies"),
endmember_names,
false,
"Reference entropies");

reference_specific_heats = Utilities::parse_map_to_double_array (prm.get("Reference specific heat capacities"),
endmember_names,
false,
"Reference specific heat capacities");

specific_heat_linear_coefficients = Utilities::parse_map_to_double_array (prm.get("Linear coefficients for specific heat polynomial"),
endmember_names,
false,
"Linear coefficients for specific heat polynomial");

specific_heat_second_coefficients = Utilities::parse_map_to_double_array (prm.get("Second coefficients for specific heat polynomial"),
endmember_names,
false,
"Second coefficients for specific heat polynomial");

specific_heat_third_coefficients = Utilities::parse_map_to_double_array (prm.get("Third coefficients for specific heat polynomial"),
endmember_names,
false,
"Third coefficients for specific heat polynomial");
Utilities::MapParsing::Options options(endmember_names, "");
options.property_name = "Molar masses";
molar_masses = Utilities::MapParsing::parse_map_to_double_array (prm.get(options.property_name), options);

options.property_name = "Number of atoms";
number_of_atoms = Utilities::MapParsing::parse_map_to_double_array (prm.get(options.property_name), options);

options.property_name = "Reference volumes";
reference_volumes = Utilities::MapParsing::parse_map_to_double_array (prm.get(options.property_name), options);

options.property_name = "Reference thermal expansivities";
reference_thermal_expansivities = Utilities::MapParsing::parse_map_to_double_array (prm.get(options.property_name), options);

options.property_name = "Reference bulk moduli";
reference_bulk_moduli = Utilities::MapParsing::parse_map_to_double_array (prm.get(options.property_name), options);

options.property_name = "First derivatives of the bulk modulus";
bulk_modulus_pressure_derivatives = Utilities::MapParsing::parse_map_to_double_array (prm.get(options.property_name), options);

options.property_name = "Second derivatives of the bulk modulus";
bulk_modulus_second_pressure_derivatives = Utilities::MapParsing::parse_map_to_double_array (prm.get(options.property_name), options);

options.property_name = "Einstein temperatures";
Einstein_temperatures = Utilities::MapParsing::parse_map_to_double_array (prm.get(options.property_name), options);

options.property_name = "Reference enthalpies";
reference_enthalpies = Utilities::MapParsing::parse_map_to_double_array (prm.get(options.property_name), options);

options.property_name = "Reference entropies";
reference_entropies = Utilities::MapParsing::parse_map_to_double_array (prm.get(options.property_name), options);

options.property_name = "Reference specific heat capacities";
reference_specific_heats = Utilities::MapParsing::parse_map_to_double_array (prm.get(options.property_name), options);

options.property_name = "Linear coefficients for specific heat polynomial";
specific_heat_linear_coefficients = Utilities::MapParsing::parse_map_to_double_array (prm.get(options.property_name), options);

options.property_name = "Second coefficients for specific heat polynomial";
specific_heat_second_coefficients = Utilities::MapParsing::parse_map_to_double_array (prm.get(options.property_name), options);

options.property_name = "Third coefficients for specific heat polynomial";
specific_heat_third_coefficients = Utilities::MapParsing::parse_map_to_double_array (prm.get(options.property_name), options);

// Check all lists have the correct length.
AssertThrow(endmember_names.size() == endmember_states.size(),
Expand Down
19 changes: 7 additions & 12 deletions source/material_model/multicomponent_compressible.cc
Original file line number Diff line number Diff line change
Expand Up @@ -126,21 +126,16 @@ namespace aspect
viscosity_averaging = MaterialUtilities::parse_compositional_averaging_operation ("Viscosity averaging scheme",
prm);

std::vector<std::string> compositional_field_names = this->introspection().get_composition_names();
// Establish that a background field is required here
const bool has_background_field = true;
compositional_field_names.insert(compositional_field_names.begin(),"background");
Utilities::MapParsing::Options options(compositional_field_names, "");

// Retrieve the list of composition names
const std::vector<std::string> list_of_composition_names = this->introspection().get_composition_names();
options.property_name = "Viscosities";
viscosities = Utilities::MapParsing::parse_map_to_double_array (prm.get(options.property_name), options);

viscosities = Utilities::parse_map_to_double_array (prm.get("Viscosities"),
list_of_composition_names,
has_background_field,
"Viscosities");

thermal_conductivities = Utilities::parse_map_to_double_array (prm.get("Thermal conductivities"),
list_of_composition_names,
has_background_field,
"Thermal conductivities");
options.property_name = "Thermal conductivities";
thermal_conductivities = Utilities::MapParsing::parse_map_to_double_array (prm.get(options.property_name), options);
}
prm.leave_subsection();
}
Expand Down
Loading

0 comments on commit 3a91bde

Please sign in to comment.