From 95fa71ad403e85961c4438155b89e2533d98c855 Mon Sep 17 00:00:00 2001 From: Rene Gassmoeller Date: Wed, 29 Jan 2025 15:57:49 +0100 Subject: [PATCH 1/3] Move namespace into global headers --- include/aspect/global.h | 6 ++++++ source/postprocess/particle_count_statistics.cc | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/include/aspect/global.h b/include/aspect/global.h index 5ba074c3d4f..c7a573d36bd 100644 --- a/include/aspect/global.h +++ b/include/aspect/global.h @@ -42,6 +42,12 @@ DEAL_II_ENABLE_EXTRA_DIAGNOSTICS namespace aspect { + /** + * Make sure that we can use the deal.II classes and utilities + * without prefixing them with "dealii::". + */ + using namespace dealii; + /** * The following are a set of global constants which may be used by ASPECT: * (for sources of data and values used by ASPECT, see source/global.cc) diff --git a/source/postprocess/particle_count_statistics.cc b/source/postprocess/particle_count_statistics.cc index 0db6be47d58..ab0d0d96313 100644 --- a/source/postprocess/particle_count_statistics.cc +++ b/source/postprocess/particle_count_statistics.cc @@ -37,7 +37,7 @@ namespace aspect unsigned int local_min_particles = std::numeric_limits::max(); unsigned int local_max_particles = 0; - Particle::types::particle_index global_particles = 0; + types::particle_index global_particles = 0; for (unsigned int particle_manager_index = 0; particle_manager_index < this->n_particle_managers(); ++particle_manager_index) global_particles += this->get_particle_manager(particle_manager_index).n_global_particles(); From dafd5a90d60ffa51ac3e2a7131ca0fc195e9ebaa Mon Sep 17 00:00:00 2001 From: Rene Gassmoeller Date: Wed, 29 Jan 2025 15:58:02 +0100 Subject: [PATCH 2/3] Remove namespace everywhere else --- benchmarks/advection_in_annulus/advection_in_annulus.cc | 4 ---- benchmarks/annulus/plugin/annulus.cc | 1 - benchmarks/burstedde/burstedde.cc | 2 -- benchmarks/davies_et_al/case-2.3-plugin/VoT.cc | 3 --- benchmarks/doneahuerta/doneahuerta.cc | 2 -- benchmarks/hollow_sphere/hollow_sphere.cc | 2 -- .../inclusion_compositional_fields.h | 2 -- benchmarks/inclusion/inclusion.h | 2 -- benchmarks/infill_density/infill_ascii_data.cc | 2 -- benchmarks/king2dcompressible/plugin/code.cc | 2 -- benchmarks/layeredflow/layeredflow.cc | 2 -- .../nonlinear_channel_flow/simple_nonlinear.cc | 4 ---- .../spiegelman_et_al_2016/drucker_prager_compositions.cc | 4 ---- benchmarks/nsinker/nsinker.cc | 2 -- benchmarks/nsinker_spherical_shell/nsinker.cc | 2 -- .../advection_reaction/advection_reaction.cc | 4 ---- .../exponential_decay/exponential_decay.cc | 4 ---- .../rayleigh_taylor_instability.cc | 2 -- benchmarks/rigid_shear/plugin/rigid_shear.cc | 2 -- benchmarks/shear_bands/shear_bands.cc | 3 --- benchmarks/sinking_block/sinking_block.cc | 2 -- .../compositional_fields/solcx_compositional_fields.h | 2 -- benchmarks/solcx/solcx.h | 2 -- benchmarks/solitary_wave/solitary_wave.cc | 2 -- .../compositional_fields/solkz_compositional_fields.h | 2 -- benchmarks/solkz/solkz.h | 2 -- benchmarks/solubility/plugin/solubility.cc | 2 -- benchmarks/tangurnis/code/tangurnis.cc | 4 ---- .../plugin/time_dependent_annulus.h | 2 -- benchmarks/tosi_et_al_2015_gcubed/tosi.cc | 3 --- benchmarks/viscosity_grooves/viscosity_grooves.cc | 2 -- .../anelasticity_temperature.h | 2 -- cookbooks/anisotropic_viscosity/av_material.cc | 2 -- cookbooks/finite_strain/finite_strain.cc | 2 -- .../free_surface_with_crust/plugin/simpler_with_crust.cc | 2 -- cookbooks/inner_core_convection/inner_core_convection.cc | 4 ---- .../subduction_plate_cooling.h | 2 -- cookbooks/magnetic_stripes/magnetic_stripes.cc | 2 -- cookbooks/morency_doin_2004/morency_doin.h | 2 -- cookbooks/prescribed_velocity/prescribed_velocity.cc | 2 -- .../prescribed_velocity_ascii_data.cc | 2 -- .../plugins/reference_profile.h | 2 -- .../plugins/tomography_based_plate_motions.cc | 2 -- .../plugins/tomography_based_plate_motions.h | 3 --- cookbooks/vankeken_subduction/plugin/van_Keken_mesh.cc | 2 -- include/aspect/adiabatic_conditions/ascii_data.h | 2 -- .../adiabatic_conditions/compute_entropy_profile.h | 2 -- include/aspect/adiabatic_conditions/compute_profile.h | 2 -- include/aspect/adiabatic_conditions/function.h | 2 -- include/aspect/adiabatic_conditions/interface.h | 2 -- include/aspect/boundary_composition/ascii_data.h | 2 -- include/aspect/boundary_composition/function.h | 2 -- include/aspect/boundary_composition/interface.h | 2 -- include/aspect/boundary_fluid_pressure/interface.h | 2 -- include/aspect/boundary_heat_flux/function.h | 2 -- include/aspect/boundary_heat_flux/interface.h | 2 -- include/aspect/boundary_temperature/ascii_data.h | 2 -- include/aspect/boundary_temperature/function.h | 2 -- include/aspect/boundary_temperature/interface.h | 2 -- include/aspect/boundary_traction/ascii_data.h | 2 -- include/aspect/boundary_traction/function.h | 2 -- .../boundary_traction/initial_lithostatic_pressure.h | 2 -- include/aspect/boundary_traction/interface.h | 2 -- include/aspect/boundary_traction/zero_traction.h | 2 -- include/aspect/boundary_velocity/ascii_data.h | 2 -- include/aspect/boundary_velocity/function.h | 2 -- include/aspect/boundary_velocity/gplates.h | 2 -- include/aspect/boundary_velocity/interface.h | 2 -- include/aspect/boundary_velocity/zero_velocity.h | 2 -- include/aspect/fe_variable_collection.h | 2 -- include/aspect/geometry_model/box.h | 2 -- include/aspect/geometry_model/chunk.h | 2 -- include/aspect/geometry_model/ellipsoidal_chunk.h | 2 -- .../geometry_model/initial_topography_model/ascii_data.h | 2 -- .../geometry_model/initial_topography_model/function.h | 2 -- .../geometry_model/initial_topography_model/interface.h | 2 -- .../initial_topography_model/prm_polygon.h | 2 -- .../initial_topography_model/zero_topography.h | 2 -- include/aspect/geometry_model/interface.h | 2 -- include/aspect/geometry_model/sphere.h | 2 -- include/aspect/geometry_model/spherical_shell.h | 2 -- include/aspect/geometry_model/two_merged_boxes.h | 2 -- include/aspect/geometry_model/two_merged_chunks.h | 3 --- include/aspect/gravity_model/ascii_data.h | 2 -- include/aspect/gravity_model/function.h | 2 -- include/aspect/gravity_model/interface.h | 2 -- include/aspect/gravity_model/radial.h | 2 -- include/aspect/gravity_model/vertical.h | 2 -- include/aspect/heating_model/adiabatic_heating.h | 2 -- include/aspect/heating_model/adiabatic_heating_of_melt.h | 2 -- include/aspect/heating_model/compositional_heating.h | 2 -- include/aspect/heating_model/constant_heating.h | 2 -- include/aspect/heating_model/function.h | 2 -- include/aspect/heating_model/interface.h | 2 -- include/aspect/heating_model/latent_heat.h | 2 -- include/aspect/heating_model/latent_heat_melt.h | 2 -- include/aspect/heating_model/radioactive_decay.h | 2 -- include/aspect/heating_model/shear_heating.h | 2 -- include/aspect/heating_model/shear_heating_with_melt.h | 2 -- include/aspect/initial_composition/adiabatic_density.h | 2 -- include/aspect/initial_composition/ascii_data.h | 2 -- include/aspect/initial_composition/ascii_data_layered.h | 2 -- .../aspect/initial_composition/entropy_table_lookup.h | 2 -- include/aspect/initial_composition/function.h | 2 -- include/aspect/initial_composition/interface.h | 2 -- include/aspect/initial_composition/porosity.h | 2 -- include/aspect/initial_composition/slab_model.h | 2 -- include/aspect/initial_composition/world_builder.h | 2 -- include/aspect/initial_temperature/S40RTS_perturbation.h | 2 -- include/aspect/initial_temperature/SAVANI_perturbation.h | 2 -- include/aspect/initial_temperature/adiabatic.h | 2 -- include/aspect/initial_temperature/adiabatic_boundary.h | 2 -- include/aspect/initial_temperature/ascii_data.h | 2 -- include/aspect/initial_temperature/ascii_data_layered.h | 2 -- include/aspect/initial_temperature/ascii_profile.h | 2 -- include/aspect/initial_temperature/box.h | 2 -- include/aspect/initial_temperature/function.h | 2 -- .../aspect/initial_temperature/harmonic_perturbation.h | 2 -- include/aspect/initial_temperature/interface.h | 2 -- include/aspect/initial_temperature/lithosphere_mask.h | 2 -- include/aspect/initial_temperature/patch_on_S40RTS.h | 2 -- .../aspect/initial_temperature/prescribed_temperature.h | 2 -- .../initial_temperature/random_gaussian_perturbation.h | 2 -- include/aspect/initial_temperature/spherical_shell.h | 2 -- include/aspect/initial_temperature/world_builder.h | 2 -- include/aspect/introspection.h | 2 -- include/aspect/lateral_averaging.h | 2 -- include/aspect/material_model/ascii_reference_profile.h | 2 -- include/aspect/material_model/averaging.h | 2 -- include/aspect/material_model/composition_reaction.h | 2 -- include/aspect/material_model/depth_dependent.h | 2 -- include/aspect/material_model/diffusion_dislocation.h | 2 -- include/aspect/material_model/drucker_prager.h | 2 -- include/aspect/material_model/entropy_model.h | 1 - .../aspect/material_model/equation_of_state/interface.h | 2 -- .../equation_of_state/linearized_incompressible.h | 2 -- .../equation_of_state/multicomponent_compressible.h | 2 -- .../equation_of_state/multicomponent_incompressible.h | 2 -- .../equation_of_state/thermodynamic_table_lookup.h | 2 -- include/aspect/material_model/grain_size.h | 2 -- include/aspect/material_model/interface.h | 2 -- include/aspect/material_model/latent_heat.h | 2 -- include/aspect/material_model/latent_heat_melt.h | 2 -- include/aspect/material_model/melt_boukare.h | 2 -- include/aspect/material_model/melt_global.h | 2 -- include/aspect/material_model/melt_simple.h | 2 -- include/aspect/material_model/modified_tait.h | 2 -- include/aspect/material_model/multicomponent.h | 2 -- .../aspect/material_model/multicomponent_compressible.h | 2 -- include/aspect/material_model/nondimensional.h | 2 -- include/aspect/material_model/perplex_lookup.h | 2 -- include/aspect/material_model/prescribed_viscosity.h | 2 -- .../material_model/reaction_model/grain_size_evolution.h | 2 -- .../reaction_model/katz2003_mantle_melting.h | 2 -- include/aspect/material_model/reactive_fluid_transport.h | 1 - .../material_model/replace_lithosphere_viscosity.h | 2 -- .../aspect/material_model/rheology/ascii_depth_profile.h | 2 -- .../material_model/rheology/composite_visco_plastic.h | 2 -- .../rheology/compositional_viscosity_prefactors.h | 2 -- .../aspect/material_model/rheology/constant_viscosity.h | 2 -- .../rheology/constant_viscosity_prefactors.h | 2 -- include/aspect/material_model/rheology/diffusion_creep.h | 2 -- .../material_model/rheology/diffusion_dislocation.h | 2 -- .../aspect/material_model/rheology/dislocation_creep.h | 2 -- include/aspect/material_model/rheology/drucker_prager.h | 2 -- .../material_model/rheology/drucker_prager_power.h | 2 -- include/aspect/material_model/rheology/elasticity.h | 2 -- .../aspect/material_model/rheology/frank_kamenetskii.h | 2 -- include/aspect/material_model/rheology/friction_models.h | 1 - include/aspect/material_model/rheology/peierls_creep.h | 2 -- .../aspect/material_model/rheology/strain_dependent.h | 2 -- include/aspect/material_model/rheology/visco_plastic.h | 2 -- include/aspect/material_model/simple.h | 2 -- include/aspect/material_model/simple_compressible.h | 2 -- include/aspect/material_model/simpler.h | 2 -- include/aspect/material_model/steinberger.h | 2 -- .../material_model/thermal_conductivity/constant.h | 2 -- .../material_model/thermal_conductivity/interface.h | 2 -- include/aspect/material_model/utilities.h | 3 --- include/aspect/material_model/visco_plastic.h | 2 -- include/aspect/material_model/viscoelastic.h | 2 -- include/aspect/melt.h | 2 -- include/aspect/mesh_deformation/ascii_data.h | 2 -- include/aspect/mesh_deformation/diffusion.h | 3 --- include/aspect/mesh_deformation/fastscape.h | 2 -- include/aspect/mesh_deformation/free_surface.h | 2 -- include/aspect/mesh_deformation/function.h | 2 -- include/aspect/mesh_deformation/interface.h | 2 -- include/aspect/mesh_refinement/interface.h | 2 -- include/aspect/newton.h | 2 -- include/aspect/parameters.h | 2 -- include/aspect/particle/generator/uniform_radial.h | 2 -- include/aspect/particle/integrator/interface.h | 1 - include/aspect/particle/interpolator/interface.h | 1 - include/aspect/particle/manager.h | 1 - include/aspect/plugins.h | 9 --------- include/aspect/postprocess/interface.h | 2 -- .../visualization/boundary_strain_rate_residual.h | 1 - .../visualization/boundary_velocity_residual.h | 1 - include/aspect/prescribed_stokes_solution/ascii_data.h | 2 -- include/aspect/prescribed_stokes_solution/circle.h | 2 -- include/aspect/prescribed_stokes_solution/function.h | 2 -- include/aspect/prescribed_stokes_solution/interface.h | 2 -- include/aspect/simulator.h | 2 -- include/aspect/simulator/assemblers/interface.h | 2 -- include/aspect/simulator_access.h | 2 -- include/aspect/solution_evaluator.h | 2 -- include/aspect/stokes_matrix_free.h | 2 -- include/aspect/structured_data.h | 2 -- include/aspect/termination_criteria/interface.h | 2 -- include/aspect/time_stepping/conduction_time_step.h | 2 -- include/aspect/time_stepping/convection_time_step.h | 2 -- include/aspect/time_stepping/function.h | 2 -- include/aspect/time_stepping/interface.h | 2 -- include/aspect/time_stepping/repeat_on_cutback.h | 2 -- include/aspect/time_stepping/repeat_on_nonlinear_fail.h | 2 -- include/aspect/utilities.h | 1 - include/aspect/volume_of_fluid/assembly.h | 2 -- include/aspect/volume_of_fluid/field.h | 2 -- include/aspect/volume_of_fluid/handler.h | 2 -- include/aspect/volume_of_fluid/utilities.h | 2 -- source/material_model/grain_size.cc | 2 -- source/volume_of_fluid/handler.cc | 2 -- source/volume_of_fluid/reconstruct.cc | 2 -- source/volume_of_fluid/setup_initial_conditions.cc | 2 -- source/volume_of_fluid/utilities.cc | 3 --- tests/additional_outputs_02.cc | 1 - tests/additional_outputs_03.cc | 1 - tests/anisotropic_viscosity.cc | 2 -- tests/artificial_postprocess.cc | 2 -- tests/ascii_boundary_member.cc | 1 - tests/boundary_heatflux_update.cc | 2 -- tests/box_initial_mesh_deformation.cc | 2 -- tests/burstedde_stokes_rhs.cc | 2 -- tests/cell_reference.cc | 2 -- tests/check_compositional_field_functions.cc | 1 - tests/check_compositional_field_names.cc | 1 - tests/composite_viscous_outputs.cc | 1 - tests/composite_viscous_outputs_isostress.cc | 1 - tests/composite_viscous_outputs_limited.cc | 1 - tests/composite_viscous_outputs_no_peierls.cc | 1 - tests/composite_viscous_outputs_phases.cc | 1 - tests/composition_active_with_melt.cc | 2 -- tests/composition_reaction_iterated_IMPES.cc | 2 -- tests/compressibility.cc | 2 -- tests/compressibility_iterated_stokes.cc | 2 -- tests/compression_heating.cc | 2 -- tests/cookbook_simpler_with_crust.cc | 2 -- tests/coordinate_transformation.cc | 1 - tests/drucker_prager_derivatives_2d.cc | 1 - tests/drucker_prager_derivatives_3d.cc | 1 - tests/edit_parameters.cc | 2 -- tests/ellipsoidal_chunk_geometry.cc | 2 -- tests/free_surface_blob_melt.cc | 2 -- tests/global_refine_amr.cc | 3 --- tests/grain_size_latent_heat.cc | 2 -- tests/heat_advection_by_melt.cc | 2 -- tests/latent_heat_enthalpy.cc | 2 -- tests/melt_introspection.cc | 2 -- tests/melt_material_4.cc | 3 --- tests/melt_visco_plastic.cc | 4 ---- tests/melting_rate.cc | 3 --- tests/multiple_named_additional_outputs.cc | 2 -- tests/no_adiabatic_heating.cc | 2 -- tests/no_adiabatic_heating_02.cc | 2 -- tests/no_adiabatic_heating_03.cc | 2 -- tests/own_gravity.cc | 3 --- tests/prescribed_dilation.cc | 2 -- tests/prescribed_field.cc | 2 -- tests/prescribed_field_temperature.cc | 2 -- tests/prescribed_field_with_diffusion.cc | 2 -- tests/prescribed_temperature.cc | 2 -- tests/prescribed_temperature_in_field.cc | 2 -- tests/prescribed_temperature_with_diffusion.cc | 2 -- tests/prescribed_velocity_boundary.cc | 2 -- tests/prescribed_velocity_dgp.cc | 2 -- tests/pressure_constraint.cc | 2 -- tests/q1_q1.cc | 2 -- tests/rheology_scaled_profile.cc | 2 -- tests/rising_melt_blob.cc | 3 --- tests/shear_thinning.cc | 2 -- tests/signal_fem.cc | 2 -- tests/simple_shear.cc | 2 -- tests/simple_shear_output_the_mobility.cc | 2 -- tests/spiegelman_fail_test.cc | 2 -- tests/visco_plastic_derivatives_2d.cc | 1 - tests/visco_plastic_derivatives_3d.cc | 1 - tests/vof_err_calc.h | 2 -- 288 files changed, 587 deletions(-) diff --git a/benchmarks/advection_in_annulus/advection_in_annulus.cc b/benchmarks/advection_in_annulus/advection_in_annulus.cc index b983adcfa21..dacec37d529 100644 --- a/benchmarks/advection_in_annulus/advection_in_annulus.cc +++ b/benchmarks/advection_in_annulus/advection_in_annulus.cc @@ -45,8 +45,6 @@ namespace aspect */ namespace AdvectionInAnnulus { - using namespace dealii; - namespace AnalyticSolutions { const double A=2.0, B=-3.0/std::log(2.0), C=-1; @@ -109,8 +107,6 @@ namespace aspect { namespace PrescribedStokesSolution { - using namespace dealii; - /** * A class that implements the flow field of the annulus benchmark. * diff --git a/benchmarks/annulus/plugin/annulus.cc b/benchmarks/annulus/plugin/annulus.cc index 41217cbb5db..61ce9353aaa 100644 --- a/benchmarks/annulus/plugin/annulus.cc +++ b/benchmarks/annulus/plugin/annulus.cc @@ -53,7 +53,6 @@ namespace aspect */ namespace AnnulusBenchmark { - using namespace dealii; using namespace aspect::Utilities::Coordinates; /** diff --git a/benchmarks/burstedde/burstedde.cc b/benchmarks/burstedde/burstedde.cc index 92ee66d1267..abe27dc6185 100644 --- a/benchmarks/burstedde/burstedde.cc +++ b/benchmarks/burstedde/burstedde.cc @@ -51,8 +51,6 @@ namespace aspect */ namespace BursteddeBenchmark { - using namespace dealii; - namespace AnalyticSolutions { Tensor<1,3> diff --git a/benchmarks/davies_et_al/case-2.3-plugin/VoT.cc b/benchmarks/davies_et_al/case-2.3-plugin/VoT.cc index e3f82ec394e..624439e96ed 100644 --- a/benchmarks/davies_et_al/case-2.3-plugin/VoT.cc +++ b/benchmarks/davies_et_al/case-2.3-plugin/VoT.cc @@ -27,9 +27,6 @@ #include -using namespace dealii; - - namespace aspect { namespace MaterialModel diff --git a/benchmarks/doneahuerta/doneahuerta.cc b/benchmarks/doneahuerta/doneahuerta.cc index 156c8926bac..630e5b5241a 100644 --- a/benchmarks/doneahuerta/doneahuerta.cc +++ b/benchmarks/doneahuerta/doneahuerta.cc @@ -36,8 +36,6 @@ namespace aspect { namespace DoneaHuertaBenchmark { - using namespace dealii; - namespace AnalyticSolutions { diff --git a/benchmarks/hollow_sphere/hollow_sphere.cc b/benchmarks/hollow_sphere/hollow_sphere.cc index 1aca2e0483b..b87df5c9fc7 100644 --- a/benchmarks/hollow_sphere/hollow_sphere.cc +++ b/benchmarks/hollow_sphere/hollow_sphere.cc @@ -43,8 +43,6 @@ namespace aspect */ namespace HollowSphereBenchmark { - using namespace dealii; - namespace AnalyticSolutions { const double gammma = 1.0; diff --git a/benchmarks/inclusion/compositional_fields/inclusion_compositional_fields.h b/benchmarks/inclusion/compositional_fields/inclusion_compositional_fields.h index b8d29972826..5418a6ac51f 100644 --- a/benchmarks/inclusion/compositional_fields/inclusion_compositional_fields.h +++ b/benchmarks/inclusion/compositional_fields/inclusion_compositional_fields.h @@ -9,8 +9,6 @@ namespace aspect { namespace InclusionBenchmark { - using namespace dealii; - template class InclusionCompositionalMaterial : public InclusionMaterial { diff --git a/benchmarks/inclusion/inclusion.h b/benchmarks/inclusion/inclusion.h index 9c9a0bb8ed9..ef4d1b756c9 100644 --- a/benchmarks/inclusion/inclusion.h +++ b/benchmarks/inclusion/inclusion.h @@ -36,8 +36,6 @@ namespace aspect */ namespace InclusionBenchmark { - using namespace dealii; - namespace AnalyticSolutions { // based on http://geodynamics.org/hg/cs/AMR/Discontinuous_Stokes with permission diff --git a/benchmarks/infill_density/infill_ascii_data.cc b/benchmarks/infill_density/infill_ascii_data.cc index 92c66e10a1d..f83f83f4577 100644 --- a/benchmarks/infill_density/infill_ascii_data.cc +++ b/benchmarks/infill_density/infill_ascii_data.cc @@ -29,8 +29,6 @@ namespace aspect { namespace BoundaryTraction { - using namespace dealii; - /** * A class that implements prescribed traction boundary conditions determined * from pressures given in an AsciiData input file. diff --git a/benchmarks/king2dcompressible/plugin/code.cc b/benchmarks/king2dcompressible/plugin/code.cc index 8260510f75e..35de854c1c1 100644 --- a/benchmarks/king2dcompressible/plugin/code.cc +++ b/benchmarks/king2dcompressible/plugin/code.cc @@ -27,8 +27,6 @@ namespace aspect { - using namespace dealii; - /** * This benchmark is from the article * @code diff --git a/benchmarks/layeredflow/layeredflow.cc b/benchmarks/layeredflow/layeredflow.cc index 135972f1d08..48f4a369aed 100644 --- a/benchmarks/layeredflow/layeredflow.cc +++ b/benchmarks/layeredflow/layeredflow.cc @@ -36,8 +36,6 @@ namespace aspect { namespace LayeredFlowBenchmark { - using namespace dealii; - namespace AnalyticSolutions { diff --git a/benchmarks/newton_solver_benchmark_set/nonlinear_channel_flow/simple_nonlinear.cc b/benchmarks/newton_solver_benchmark_set/nonlinear_channel_flow/simple_nonlinear.cc index 31289fc68ce..35621a6bee0 100644 --- a/benchmarks/newton_solver_benchmark_set/nonlinear_channel_flow/simple_nonlinear.cc +++ b/benchmarks/newton_solver_benchmark_set/nonlinear_channel_flow/simple_nonlinear.cc @@ -31,8 +31,6 @@ namespace aspect { namespace MaterialModel { - using namespace dealii; - /** * A material model based on a simple power law rheology and * implementing the derivatives needed for the Newton method. @@ -110,8 +108,6 @@ namespace aspect -using namespace dealii; - namespace aspect { diff --git a/benchmarks/newton_solver_benchmark_set/spiegelman_et_al_2016/drucker_prager_compositions.cc b/benchmarks/newton_solver_benchmark_set/spiegelman_et_al_2016/drucker_prager_compositions.cc index 81643fc59d4..ef9a0fb22a5 100644 --- a/benchmarks/newton_solver_benchmark_set/spiegelman_et_al_2016/drucker_prager_compositions.cc +++ b/benchmarks/newton_solver_benchmark_set/spiegelman_et_al_2016/drucker_prager_compositions.cc @@ -37,8 +37,6 @@ namespace aspect { namespace MaterialModel { - using namespace dealii; - /** * The same material model as Drucker Prager, but this one supports multiple * compositions. Designed to run the Spiegelman et al. 2016 benchmark. @@ -171,8 +169,6 @@ namespace aspect #include #include -using namespace dealii; - namespace aspect { namespace diff --git a/benchmarks/nsinker/nsinker.cc b/benchmarks/nsinker/nsinker.cc index e99a20166fc..d7c2a36d0fa 100644 --- a/benchmarks/nsinker/nsinker.cc +++ b/benchmarks/nsinker/nsinker.cc @@ -39,8 +39,6 @@ namespace aspect */ namespace NSinkerBenchmark { - using namespace dealii; - /** * @note This benchmark only talks about the flow field, not about a * temperature field. All quantities related to the temperature are diff --git a/benchmarks/nsinker_spherical_shell/nsinker.cc b/benchmarks/nsinker_spherical_shell/nsinker.cc index 18bd9ba9006..4811fe5d828 100644 --- a/benchmarks/nsinker_spherical_shell/nsinker.cc +++ b/benchmarks/nsinker_spherical_shell/nsinker.cc @@ -32,8 +32,6 @@ namespace aspect */ namespace NSinkerBenchmark { - using namespace dealii; - /** * @note This benchmark only talks about the flow field, not about a * temperature field. All quantities related to the temperature are diff --git a/benchmarks/operator_splitting/advection_reaction/advection_reaction.cc b/benchmarks/operator_splitting/advection_reaction/advection_reaction.cc index fc449c08c1b..575bdcd3976 100644 --- a/benchmarks/operator_splitting/advection_reaction/advection_reaction.cc +++ b/benchmarks/operator_splitting/advection_reaction/advection_reaction.cc @@ -33,8 +33,6 @@ namespace aspect { namespace MaterialModel { - using namespace dealii; - template class ExponentialDecay : public MaterialModel::Interface, public ::aspect::SimulatorAccess { @@ -64,8 +62,6 @@ namespace aspect namespace HeatingModel { - using namespace dealii; - template class ExponentialDecayHeating : public HeatingModel::Interface, public ::aspect::SimulatorAccess { diff --git a/benchmarks/operator_splitting/exponential_decay/exponential_decay.cc b/benchmarks/operator_splitting/exponential_decay/exponential_decay.cc index 1516b8619d9..21b52d8ab39 100644 --- a/benchmarks/operator_splitting/exponential_decay/exponential_decay.cc +++ b/benchmarks/operator_splitting/exponential_decay/exponential_decay.cc @@ -31,8 +31,6 @@ namespace aspect { namespace MaterialModel { - using namespace dealii; - template class ExponentialDecay : public MaterialModel::Interface, public ::aspect::SimulatorAccess { @@ -64,8 +62,6 @@ namespace aspect namespace HeatingModel { - using namespace dealii; - template class ExponentialDecayHeating : public HeatingModel::Interface, public ::aspect::SimulatorAccess { diff --git a/benchmarks/rayleigh_taylor_instability/rayleigh_taylor_instability.cc b/benchmarks/rayleigh_taylor_instability/rayleigh_taylor_instability.cc index 879c094ac89..d6b7ab5f1d4 100644 --- a/benchmarks/rayleigh_taylor_instability/rayleigh_taylor_instability.cc +++ b/benchmarks/rayleigh_taylor_instability/rayleigh_taylor_instability.cc @@ -36,8 +36,6 @@ namespace aspect { namespace RTinstabilityBenchmark { - using namespace dealii; - /** * @note This benchmark only talks about the flow field, not about a * temperature field. All quantities related to the temperature are diff --git a/benchmarks/rigid_shear/plugin/rigid_shear.cc b/benchmarks/rigid_shear/plugin/rigid_shear.cc index 5d1dc871ac2..00865fd9ad7 100644 --- a/benchmarks/rigid_shear/plugin/rigid_shear.cc +++ b/benchmarks/rigid_shear/plugin/rigid_shear.cc @@ -39,8 +39,6 @@ namespace aspect { - using namespace dealii; - namespace RigidShearBenchmark { /** diff --git a/benchmarks/shear_bands/shear_bands.cc b/benchmarks/shear_bands/shear_bands.cc index 5f5dee5e493..7f57f110be4 100644 --- a/benchmarks/shear_bands/shear_bands.cc +++ b/benchmarks/shear_bands/shear_bands.cc @@ -59,9 +59,6 @@ namespace aspect */ namespace ShearBands { - using namespace dealii; - - /** * @note This benchmark only talks about the flow field, not about a * temperature field. All quantities related to the temperature are diff --git a/benchmarks/sinking_block/sinking_block.cc b/benchmarks/sinking_block/sinking_block.cc index 16d038841ee..f559f8701c6 100644 --- a/benchmarks/sinking_block/sinking_block.cc +++ b/benchmarks/sinking_block/sinking_block.cc @@ -35,8 +35,6 @@ namespace aspect { namespace SinkingBlockBenchmark { - using namespace dealii; - /** * @note This benchmark only talks about the flow field, not about a * temperature field. All quantities related to the temperature are diff --git a/benchmarks/solcx/compositional_fields/solcx_compositional_fields.h b/benchmarks/solcx/compositional_fields/solcx_compositional_fields.h index 40eafb19602..f5ecea7e865 100644 --- a/benchmarks/solcx/compositional_fields/solcx_compositional_fields.h +++ b/benchmarks/solcx/compositional_fields/solcx_compositional_fields.h @@ -9,8 +9,6 @@ namespace aspect { namespace InclusionBenchmark { - using namespace dealii; - template class SolCxCompositionalMaterial : public SolCxMaterial { diff --git a/benchmarks/solcx/solcx.h b/benchmarks/solcx/solcx.h index 0e7c8100a48..f6314129edd 100644 --- a/benchmarks/solcx/solcx.h +++ b/benchmarks/solcx/solcx.h @@ -36,8 +36,6 @@ namespace aspect */ namespace InclusionBenchmark { - using namespace dealii; - namespace AnalyticSolutions { // based on http://geodynamics.org/hg/cs/AMR/Discontinuous_Stokes with permission diff --git a/benchmarks/solitary_wave/solitary_wave.cc b/benchmarks/solitary_wave/solitary_wave.cc index 2c83583f071..202d96804ae 100644 --- a/benchmarks/solitary_wave/solitary_wave.cc +++ b/benchmarks/solitary_wave/solitary_wave.cc @@ -117,8 +117,6 @@ namespace aspect */ namespace SolitaryWaveBenchmark { - using namespace dealii; - namespace AnalyticSolutions { // vectors to store the porosity field and the corresponding coordinate in diff --git a/benchmarks/solkz/compositional_fields/solkz_compositional_fields.h b/benchmarks/solkz/compositional_fields/solkz_compositional_fields.h index 8e2e4e7232e..6be9ef49e47 100644 --- a/benchmarks/solkz/compositional_fields/solkz_compositional_fields.h +++ b/benchmarks/solkz/compositional_fields/solkz_compositional_fields.h @@ -10,8 +10,6 @@ namespace aspect { namespace InclusionBenchmark { - using namespace dealii; - template class SolKzCompositionalMaterial : public SolKzMaterial { diff --git a/benchmarks/solkz/solkz.h b/benchmarks/solkz/solkz.h index 50d8e0765e2..d7eb3801f3b 100644 --- a/benchmarks/solkz/solkz.h +++ b/benchmarks/solkz/solkz.h @@ -36,8 +36,6 @@ namespace aspect */ namespace InclusionBenchmark { - using namespace dealii; - namespace AnalyticSolutions { // based on http://geodynamics.org/hg/cs/AMR/Discontinuous_Stokes with permission diff --git a/benchmarks/solubility/plugin/solubility.cc b/benchmarks/solubility/plugin/solubility.cc index 0ed15d3b778..40056cac721 100644 --- a/benchmarks/solubility/plugin/solubility.cc +++ b/benchmarks/solubility/plugin/solubility.cc @@ -32,8 +32,6 @@ namespace aspect { namespace MaterialModel { - using namespace dealii; - /** * Volatiles material model. * @ingroup MaterialModels diff --git a/benchmarks/tangurnis/code/tangurnis.cc b/benchmarks/tangurnis/code/tangurnis.cc index cb3e576a236..9d104adeb10 100644 --- a/benchmarks/tangurnis/code/tangurnis.cc +++ b/benchmarks/tangurnis/code/tangurnis.cc @@ -39,10 +39,6 @@ namespace aspect { - using namespace dealii; - - - /** * This benchmark is from the article * @code diff --git a/benchmarks/time_dependent_annulus/plugin/time_dependent_annulus.h b/benchmarks/time_dependent_annulus/plugin/time_dependent_annulus.h index 624ad9158bd..7b523311f9b 100644 --- a/benchmarks/time_dependent_annulus/plugin/time_dependent_annulus.h +++ b/benchmarks/time_dependent_annulus/plugin/time_dependent_annulus.h @@ -112,8 +112,6 @@ namespace aspect namespace MaterialModel { - using namespace dealii; - template class TimeDependentAnnulus : public MaterialModel::Interface { diff --git a/benchmarks/tosi_et_al_2015_gcubed/tosi.cc b/benchmarks/tosi_et_al_2015_gcubed/tosi.cc index def6629ea40..a4c9667961d 100644 --- a/benchmarks/tosi_et_al_2015_gcubed/tosi.cc +++ b/benchmarks/tosi_et_al_2015_gcubed/tosi.cc @@ -60,9 +60,6 @@ namespace aspect */ namespace TosiBenchmark { - using namespace dealii; - - /** * @ingroup MaterialModels */ diff --git a/benchmarks/viscosity_grooves/viscosity_grooves.cc b/benchmarks/viscosity_grooves/viscosity_grooves.cc index a6d007740ea..2a6e1851963 100644 --- a/benchmarks/viscosity_grooves/viscosity_grooves.cc +++ b/benchmarks/viscosity_grooves/viscosity_grooves.cc @@ -37,8 +37,6 @@ namespace aspect { namespace ViscosityGroovesBenchmark { - using namespace dealii; - namespace AnalyticSolutions { diff --git a/benchmarks/yamauchi_takei_2016_anelasticity/anelasticity_temperature.h b/benchmarks/yamauchi_takei_2016_anelasticity/anelasticity_temperature.h index b6744f31e42..31f571b5891 100644 --- a/benchmarks/yamauchi_takei_2016_anelasticity/anelasticity_temperature.h +++ b/benchmarks/yamauchi_takei_2016_anelasticity/anelasticity_temperature.h @@ -33,8 +33,6 @@ namespace aspect { namespace InitialTemperature { - using namespace dealii; - /** * A class that describes an initial temperature field for a 2D or 3D shear wave velocity (Vs) model. * Vs values are converted to temperature using the anelasticity parameterization of Yamauchi & Takei (2016). diff --git a/cookbooks/anisotropic_viscosity/av_material.cc b/cookbooks/anisotropic_viscosity/av_material.cc index e475d22e459..024e8ed9858 100644 --- a/cookbooks/anisotropic_viscosity/av_material.cc +++ b/cookbooks/anisotropic_viscosity/av_material.cc @@ -63,8 +63,6 @@ namespace aspect { namespace MaterialModel { - using namespace dealii; - /** * Additional output fields for anisotropic viscosities to be added to * the MaterialModel::MaterialModelOutputs structure and filled in the diff --git a/cookbooks/finite_strain/finite_strain.cc b/cookbooks/finite_strain/finite_strain.cc index ec9a7a809ef..621eefbad42 100644 --- a/cookbooks/finite_strain/finite_strain.cc +++ b/cookbooks/finite_strain/finite_strain.cc @@ -28,8 +28,6 @@ namespace aspect { namespace MaterialModel { - using namespace dealii; - template class FiniteStrain : public MaterialModel::Simple { diff --git a/cookbooks/free_surface_with_crust/plugin/simpler_with_crust.cc b/cookbooks/free_surface_with_crust/plugin/simpler_with_crust.cc index db2922e301d..da1acd9b046 100644 --- a/cookbooks/free_surface_with_crust/plugin/simpler_with_crust.cc +++ b/cookbooks/free_surface_with_crust/plugin/simpler_with_crust.cc @@ -30,8 +30,6 @@ namespace aspect { namespace MaterialModel { - using namespace dealii; - /** * A material model similar to the "simpler" material model, but where the * viscosity has two different values dependent on whether we are above or diff --git a/cookbooks/inner_core_convection/inner_core_convection.cc b/cookbooks/inner_core_convection/inner_core_convection.cc index 0ae03edbcae..94e3ccb7c08 100644 --- a/cookbooks/inner_core_convection/inner_core_convection.cc +++ b/cookbooks/inner_core_convection/inner_core_convection.cc @@ -27,8 +27,6 @@ namespace aspect { namespace MaterialModel { - using namespace dealii; - template class InnerCore : public MaterialModel::Simple { @@ -357,8 +355,6 @@ namespace aspect { namespace HeatingModel { - using namespace dealii; - /** * A class that implements a constant radiogenic heating rate. * diff --git a/cookbooks/kinematically_driven_subduction_2d/subduction_plate_cooling.h b/cookbooks/kinematically_driven_subduction_2d/subduction_plate_cooling.h index 511abb2eb57..34772ae58d5 100644 --- a/cookbooks/kinematically_driven_subduction_2d/subduction_plate_cooling.h +++ b/cookbooks/kinematically_driven_subduction_2d/subduction_plate_cooling.h @@ -29,8 +29,6 @@ namespace aspect { namespace InitialTemperature { - using namespace dealii; - /** * A class that prescribes the initial temperature field according to the plate cooling model * and plate geometries implemented in Quinquis (2014). diff --git a/cookbooks/magnetic_stripes/magnetic_stripes.cc b/cookbooks/magnetic_stripes/magnetic_stripes.cc index bb15ec5963a..8f5411307fe 100644 --- a/cookbooks/magnetic_stripes/magnetic_stripes.cc +++ b/cookbooks/magnetic_stripes/magnetic_stripes.cc @@ -27,8 +27,6 @@ namespace aspect { namespace MaterialModel { - using namespace dealii; - template class MagneticStripes : public MaterialModel::CompositionReaction { diff --git a/cookbooks/morency_doin_2004/morency_doin.h b/cookbooks/morency_doin_2004/morency_doin.h index 11c0b6cd534..cf9740f6662 100644 --- a/cookbooks/morency_doin_2004/morency_doin.h +++ b/cookbooks/morency_doin_2004/morency_doin.h @@ -29,8 +29,6 @@ namespace aspect { namespace MaterialModel { - using namespace dealii; - /** * A material model based on the rheology described in (Morency and Doin, * 2004): Brittle-ductile rheology with a viscosity strongly depending on diff --git a/cookbooks/prescribed_velocity/prescribed_velocity.cc b/cookbooks/prescribed_velocity/prescribed_velocity.cc index a5ac8859218..45f06055922 100644 --- a/cookbooks/prescribed_velocity/prescribed_velocity.cc +++ b/cookbooks/prescribed_velocity/prescribed_velocity.cc @@ -28,8 +28,6 @@ namespace aspect { - using namespace dealii; - // Global variables (to be set by parameters) bool prescribe_internal_velocities; diff --git a/cookbooks/prescribed_velocity_ascii_data/prescribed_velocity_ascii_data.cc b/cookbooks/prescribed_velocity_ascii_data/prescribed_velocity_ascii_data.cc index 41436b6bfdf..46805c32253 100644 --- a/cookbooks/prescribed_velocity_ascii_data/prescribed_velocity_ascii_data.cc +++ b/cookbooks/prescribed_velocity_ascii_data/prescribed_velocity_ascii_data.cc @@ -29,8 +29,6 @@ namespace aspect { - using namespace dealii; - // Global variables (to be set by parameters) bool prescribe_internal_velocities; bool prescribed_velocity_ascii_file_loaded; diff --git a/cookbooks/tomography_based_plate_motions/plugins/reference_profile.h b/cookbooks/tomography_based_plate_motions/plugins/reference_profile.h index 9208fe70c82..08f27b2bec8 100644 --- a/cookbooks/tomography_based_plate_motions/plugins/reference_profile.h +++ b/cookbooks/tomography_based_plate_motions/plugins/reference_profile.h @@ -31,8 +31,6 @@ namespace aspect { namespace AdiabaticConditions { - using namespace dealii; - /** * A model similar to the compute profile model * in which the adiabatic profile is diff --git a/cookbooks/tomography_based_plate_motions/plugins/tomography_based_plate_motions.cc b/cookbooks/tomography_based_plate_motions/plugins/tomography_based_plate_motions.cc index 5839f15e7da..2ebbfb18dbe 100644 --- a/cookbooks/tomography_based_plate_motions/plugins/tomography_based_plate_motions.cc +++ b/cookbooks/tomography_based_plate_motions/plugins/tomography_based_plate_motions.cc @@ -33,8 +33,6 @@ #include -using namespace dealii; - namespace aspect { namespace MaterialModel diff --git a/cookbooks/tomography_based_plate_motions/plugins/tomography_based_plate_motions.h b/cookbooks/tomography_based_plate_motions/plugins/tomography_based_plate_motions.h index f422ea0aa51..e49e313cfc9 100644 --- a/cookbooks/tomography_based_plate_motions/plugins/tomography_based_plate_motions.h +++ b/cookbooks/tomography_based_plate_motions/plugins/tomography_based_plate_motions.h @@ -33,9 +33,6 @@ namespace aspect { namespace MaterialModel { - using namespace dealii; - - /** * A material model to set up mantle flow models based on * an input tomography model and a temperature model. diff --git a/cookbooks/vankeken_subduction/plugin/van_Keken_mesh.cc b/cookbooks/vankeken_subduction/plugin/van_Keken_mesh.cc index 14bdcc983f3..5296163b772 100644 --- a/cookbooks/vankeken_subduction/plugin/van_Keken_mesh.cc +++ b/cookbooks/vankeken_subduction/plugin/van_Keken_mesh.cc @@ -33,8 +33,6 @@ namespace aspect { namespace GeometryModel { - using namespace dealii; - /** * A geometry model based on the 2D Cartesian van Keken 2008 subduction * benchmark. A custom mesh that is better suited to deal with diff --git a/include/aspect/adiabatic_conditions/ascii_data.h b/include/aspect/adiabatic_conditions/ascii_data.h index fc9ca54d8e2..60c79a11cfd 100644 --- a/include/aspect/adiabatic_conditions/ascii_data.h +++ b/include/aspect/adiabatic_conditions/ascii_data.h @@ -33,8 +33,6 @@ namespace aspect { namespace AdiabaticConditions { - using namespace dealii; - /** * A simple class that reads adiabatic conditions from a file. */ diff --git a/include/aspect/adiabatic_conditions/compute_entropy_profile.h b/include/aspect/adiabatic_conditions/compute_entropy_profile.h index 77d6d7a4dc5..afc32337a78 100644 --- a/include/aspect/adiabatic_conditions/compute_entropy_profile.h +++ b/include/aspect/adiabatic_conditions/compute_entropy_profile.h @@ -29,8 +29,6 @@ namespace aspect { namespace AdiabaticConditions { - using namespace dealii; - /** * A model in which the adiabatic profile is * calculated by solving the hydrostatic equations for diff --git a/include/aspect/adiabatic_conditions/compute_profile.h b/include/aspect/adiabatic_conditions/compute_profile.h index d0d2f01e76b..bf7d88c530b 100644 --- a/include/aspect/adiabatic_conditions/compute_profile.h +++ b/include/aspect/adiabatic_conditions/compute_profile.h @@ -31,8 +31,6 @@ namespace aspect { namespace AdiabaticConditions { - using namespace dealii; - /** * A model in which the adiabatic profile is calculated by solving the * hydrostatic equations for pressure and temperature in depth. The diff --git a/include/aspect/adiabatic_conditions/function.h b/include/aspect/adiabatic_conditions/function.h index e124766473d..e709ba7185f 100644 --- a/include/aspect/adiabatic_conditions/function.h +++ b/include/aspect/adiabatic_conditions/function.h @@ -32,8 +32,6 @@ namespace aspect { namespace AdiabaticConditions { - using namespace dealii; - /** * A simple class that sets the adiabatic conditions based on given * a given function with three components: temperature, pressure, density. diff --git a/include/aspect/adiabatic_conditions/interface.h b/include/aspect/adiabatic_conditions/interface.h index 24400e2487a..3d494864bbe 100644 --- a/include/aspect/adiabatic_conditions/interface.h +++ b/include/aspect/adiabatic_conditions/interface.h @@ -39,8 +39,6 @@ namespace aspect */ namespace AdiabaticConditions { - using namespace dealii; - /** * Base class for classes that describe adiabatic conditions, * i.e. that starts at the top of the domain and integrate diff --git a/include/aspect/boundary_composition/ascii_data.h b/include/aspect/boundary_composition/ascii_data.h index cfa883422fe..feb1d2d377d 100644 --- a/include/aspect/boundary_composition/ascii_data.h +++ b/include/aspect/boundary_composition/ascii_data.h @@ -32,8 +32,6 @@ namespace aspect { namespace BoundaryComposition { - using namespace dealii; - /** * A class that implements prescribed boundary conditions determined from * a AsciiData input file. diff --git a/include/aspect/boundary_composition/function.h b/include/aspect/boundary_composition/function.h index 89040ac4563..b43fab48ecf 100644 --- a/include/aspect/boundary_composition/function.h +++ b/include/aspect/boundary_composition/function.h @@ -32,8 +32,6 @@ namespace aspect { namespace BoundaryComposition { - using namespace dealii; - /** * A class that implements boundary composition based on a functional * description provided in the input file. diff --git a/include/aspect/boundary_composition/interface.h b/include/aspect/boundary_composition/interface.h index 529c7757465..a0a9996dea2 100644 --- a/include/aspect/boundary_composition/interface.h +++ b/include/aspect/boundary_composition/interface.h @@ -44,8 +44,6 @@ namespace aspect */ namespace BoundaryComposition { - using namespace dealii; - /** * Base class for classes that describe composition boundary values. * diff --git a/include/aspect/boundary_fluid_pressure/interface.h b/include/aspect/boundary_fluid_pressure/interface.h index f3739a75e7f..c5e4b0a98ff 100644 --- a/include/aspect/boundary_fluid_pressure/interface.h +++ b/include/aspect/boundary_fluid_pressure/interface.h @@ -36,8 +36,6 @@ namespace aspect */ namespace BoundaryFluidPressure { - using namespace dealii; - /** * Base class * diff --git a/include/aspect/boundary_heat_flux/function.h b/include/aspect/boundary_heat_flux/function.h index ee10be8d535..8b54043b9bd 100644 --- a/include/aspect/boundary_heat_flux/function.h +++ b/include/aspect/boundary_heat_flux/function.h @@ -32,8 +32,6 @@ namespace aspect { namespace BoundaryHeatFlux { - using namespace dealii; - /** * A class that implements heat flux boundary conditions based on a * functional description provided in the input file. diff --git a/include/aspect/boundary_heat_flux/interface.h b/include/aspect/boundary_heat_flux/interface.h index ff85148d22b..49fbe82a5e5 100644 --- a/include/aspect/boundary_heat_flux/interface.h +++ b/include/aspect/boundary_heat_flux/interface.h @@ -35,8 +35,6 @@ namespace aspect */ namespace BoundaryHeatFlux { - using namespace dealii; - /** * Base class * diff --git a/include/aspect/boundary_temperature/ascii_data.h b/include/aspect/boundary_temperature/ascii_data.h index a71860d79b3..95e06f8261f 100644 --- a/include/aspect/boundary_temperature/ascii_data.h +++ b/include/aspect/boundary_temperature/ascii_data.h @@ -31,8 +31,6 @@ namespace aspect { namespace BoundaryTemperature { - using namespace dealii; - /** * A class that implements prescribed data boundary conditions determined * from a AsciiData input file. diff --git a/include/aspect/boundary_temperature/function.h b/include/aspect/boundary_temperature/function.h index d5bc2e49f84..3580add7d76 100644 --- a/include/aspect/boundary_temperature/function.h +++ b/include/aspect/boundary_temperature/function.h @@ -32,8 +32,6 @@ namespace aspect { namespace BoundaryTemperature { - using namespace dealii; - /** * A class that implements boundary temperature based on a functional * description provided in the input file. diff --git a/include/aspect/boundary_temperature/interface.h b/include/aspect/boundary_temperature/interface.h index 9959773dc97..ede5563f6e7 100644 --- a/include/aspect/boundary_temperature/interface.h +++ b/include/aspect/boundary_temperature/interface.h @@ -46,8 +46,6 @@ namespace aspect */ namespace BoundaryTemperature { - using namespace dealii; - /** * Base class for classes that describe temperature boundary values. * diff --git a/include/aspect/boundary_traction/ascii_data.h b/include/aspect/boundary_traction/ascii_data.h index f6a3b095bd3..0b912597b1b 100644 --- a/include/aspect/boundary_traction/ascii_data.h +++ b/include/aspect/boundary_traction/ascii_data.h @@ -30,8 +30,6 @@ namespace aspect { namespace BoundaryTraction { - using namespace dealii; - /** * A class that implements prescribed traction boundary conditions determined * from pressures given in an AsciiData input file. diff --git a/include/aspect/boundary_traction/function.h b/include/aspect/boundary_traction/function.h index bcb2648bd54..bf070ee8d15 100644 --- a/include/aspect/boundary_traction/function.h +++ b/include/aspect/boundary_traction/function.h @@ -32,8 +32,6 @@ namespace aspect { namespace BoundaryTraction { - using namespace dealii; - /** * A class that implements traction boundary conditions based on a * functional description provided in the input file. diff --git a/include/aspect/boundary_traction/initial_lithostatic_pressure.h b/include/aspect/boundary_traction/initial_lithostatic_pressure.h index e68df505956..a6bb0c7a90e 100644 --- a/include/aspect/boundary_traction/initial_lithostatic_pressure.h +++ b/include/aspect/boundary_traction/initial_lithostatic_pressure.h @@ -30,8 +30,6 @@ namespace aspect { namespace BoundaryTraction { - using namespace dealii; - /** * A class that implements traction boundary conditions by prescribing * the lithostatic pressure as the normal traction component. diff --git a/include/aspect/boundary_traction/interface.h b/include/aspect/boundary_traction/interface.h index 68bff12a0be..9006d3b7ebe 100644 --- a/include/aspect/boundary_traction/interface.h +++ b/include/aspect/boundary_traction/interface.h @@ -38,8 +38,6 @@ namespace aspect */ namespace BoundaryTraction { - using namespace dealii; - /** * A base class for parameterizations of traction boundary conditions. * diff --git a/include/aspect/boundary_traction/zero_traction.h b/include/aspect/boundary_traction/zero_traction.h index d3aba4229d1..84c52d7bb95 100644 --- a/include/aspect/boundary_traction/zero_traction.h +++ b/include/aspect/boundary_traction/zero_traction.h @@ -28,8 +28,6 @@ namespace aspect { namespace BoundaryTraction { - using namespace dealii; - /** * A class that implements zero traction boundary conditions. This * is equivalent to an open boundary condition in domains where diff --git a/include/aspect/boundary_velocity/ascii_data.h b/include/aspect/boundary_velocity/ascii_data.h index 36e451b8dd8..145a97a81b2 100644 --- a/include/aspect/boundary_velocity/ascii_data.h +++ b/include/aspect/boundary_velocity/ascii_data.h @@ -32,8 +32,6 @@ namespace aspect { namespace BoundaryVelocity { - using namespace dealii; - /** * A class that implements prescribed velocity boundary conditions * determined from a AsciiData input file. diff --git a/include/aspect/boundary_velocity/function.h b/include/aspect/boundary_velocity/function.h index f20aa037837..ee67bc75987 100644 --- a/include/aspect/boundary_velocity/function.h +++ b/include/aspect/boundary_velocity/function.h @@ -32,8 +32,6 @@ namespace aspect { namespace BoundaryVelocity { - using namespace dealii; - /** * A class that implements velocity boundary conditions based on a * functional description provided in the input file. diff --git a/include/aspect/boundary_velocity/gplates.h b/include/aspect/boundary_velocity/gplates.h index 10cb0ee05d5..125db62fb3d 100644 --- a/include/aspect/boundary_velocity/gplates.h +++ b/include/aspect/boundary_velocity/gplates.h @@ -33,8 +33,6 @@ namespace aspect { namespace BoundaryVelocity { - using namespace dealii; - namespace internal { /** diff --git a/include/aspect/boundary_velocity/interface.h b/include/aspect/boundary_velocity/interface.h index 9527c9bf453..2fc6714cbab 100644 --- a/include/aspect/boundary_velocity/interface.h +++ b/include/aspect/boundary_velocity/interface.h @@ -44,8 +44,6 @@ namespace aspect */ namespace BoundaryVelocity { - using namespace dealii; - /** * A base class for parameterizations of velocity boundary conditions. * diff --git a/include/aspect/boundary_velocity/zero_velocity.h b/include/aspect/boundary_velocity/zero_velocity.h index d0fc076ce9a..1fd04ba3494 100644 --- a/include/aspect/boundary_velocity/zero_velocity.h +++ b/include/aspect/boundary_velocity/zero_velocity.h @@ -28,8 +28,6 @@ namespace aspect { namespace BoundaryVelocity { - using namespace dealii; - /** * A class that implements zero velocity (stick) boundary conditions. * diff --git a/include/aspect/fe_variable_collection.h b/include/aspect/fe_variable_collection.h index 382af747ea2..4e6dbdd9dc1 100644 --- a/include/aspect/fe_variable_collection.h +++ b/include/aspect/fe_variable_collection.h @@ -28,8 +28,6 @@ namespace aspect { - using namespace dealii; - /** * A structure to describe everything necessary to define a single variable * of the finite element system in isolation. It groups the FiniteElement with other diff --git a/include/aspect/geometry_model/box.h b/include/aspect/geometry_model/box.h index ace5d61b2a9..0f31379e603 100644 --- a/include/aspect/geometry_model/box.h +++ b/include/aspect/geometry_model/box.h @@ -30,8 +30,6 @@ namespace aspect { namespace GeometryModel { - using namespace dealii; - /** * A class that describes a box geometry of certain width, height, and * depth (in 3d), and, possibly, topography. diff --git a/include/aspect/geometry_model/chunk.h b/include/aspect/geometry_model/chunk.h index 4bca95050c0..30b938354ed 100644 --- a/include/aspect/geometry_model/chunk.h +++ b/include/aspect/geometry_model/chunk.h @@ -34,8 +34,6 @@ namespace aspect { namespace GeometryModel { - using namespace dealii; - namespace internal { /** diff --git a/include/aspect/geometry_model/ellipsoidal_chunk.h b/include/aspect/geometry_model/ellipsoidal_chunk.h index 70b1ece4987..19f2ce10ca7 100644 --- a/include/aspect/geometry_model/ellipsoidal_chunk.h +++ b/include/aspect/geometry_model/ellipsoidal_chunk.h @@ -32,8 +32,6 @@ namespace aspect { namespace GeometryModel { - using namespace dealii; - namespace internal { /** diff --git a/include/aspect/geometry_model/initial_topography_model/ascii_data.h b/include/aspect/geometry_model/initial_topography_model/ascii_data.h index 8481e1c29e7..4ad8a1b2703 100644 --- a/include/aspect/geometry_model/initial_topography_model/ascii_data.h +++ b/include/aspect/geometry_model/initial_topography_model/ascii_data.h @@ -31,8 +31,6 @@ namespace aspect { namespace InitialTopographyModel { - using namespace dealii; - /** * A class that implements topography determined * from an AsciiData input file. diff --git a/include/aspect/geometry_model/initial_topography_model/function.h b/include/aspect/geometry_model/initial_topography_model/function.h index 7b7421e0e00..6e806ef13c6 100644 --- a/include/aspect/geometry_model/initial_topography_model/function.h +++ b/include/aspect/geometry_model/initial_topography_model/function.h @@ -32,8 +32,6 @@ namespace aspect { namespace InitialTopographyModel { - using namespace dealii; - /** * A class that implements initial topography based * on a user-defined function.. diff --git a/include/aspect/geometry_model/initial_topography_model/interface.h b/include/aspect/geometry_model/initial_topography_model/interface.h index 6a1f852b65d..4a8a7de0ea2 100644 --- a/include/aspect/geometry_model/initial_topography_model/interface.h +++ b/include/aspect/geometry_model/initial_topography_model/interface.h @@ -41,8 +41,6 @@ namespace aspect */ namespace InitialTopographyModel { - using namespace dealii; - /** * Base class for classes that describe particular initial topographies * for the domain. diff --git a/include/aspect/geometry_model/initial_topography_model/prm_polygon.h b/include/aspect/geometry_model/initial_topography_model/prm_polygon.h index 51364d75e96..c81c53d37bc 100644 --- a/include/aspect/geometry_model/initial_topography_model/prm_polygon.h +++ b/include/aspect/geometry_model/initial_topography_model/prm_polygon.h @@ -29,8 +29,6 @@ namespace aspect { namespace InitialTopographyModel { - using namespace dealii; - /** * A class that describes an initial topography for the geometry model, * by defining a set of polygons on the surface from the prm file. It diff --git a/include/aspect/geometry_model/initial_topography_model/zero_topography.h b/include/aspect/geometry_model/initial_topography_model/zero_topography.h index ce4fad60819..eb867802bf5 100644 --- a/include/aspect/geometry_model/initial_topography_model/zero_topography.h +++ b/include/aspect/geometry_model/initial_topography_model/zero_topography.h @@ -28,8 +28,6 @@ namespace aspect { namespace InitialTopographyModel { - using namespace dealii; - /** * A class that implements zero initial topography. * diff --git a/include/aspect/geometry_model/interface.h b/include/aspect/geometry_model/interface.h index 43076f1c60a..e8e12d92f55 100644 --- a/include/aspect/geometry_model/interface.h +++ b/include/aspect/geometry_model/interface.h @@ -46,8 +46,6 @@ namespace aspect */ namespace GeometryModel { - using namespace dealii; - /** * Base class for classes that describe particular geometries for the * domain. These classes must also be able to create coarse meshes and diff --git a/include/aspect/geometry_model/sphere.h b/include/aspect/geometry_model/sphere.h index 44c0d223a8e..541c63f856b 100644 --- a/include/aspect/geometry_model/sphere.h +++ b/include/aspect/geometry_model/sphere.h @@ -27,8 +27,6 @@ namespace aspect { namespace GeometryModel { - using namespace dealii; - template class Sphere : public Interface, public SimulatorAccess { diff --git a/include/aspect/geometry_model/spherical_shell.h b/include/aspect/geometry_model/spherical_shell.h index efd0b986978..7edf1cfdc42 100644 --- a/include/aspect/geometry_model/spherical_shell.h +++ b/include/aspect/geometry_model/spherical_shell.h @@ -29,8 +29,6 @@ namespace aspect { namespace GeometryModel { - using namespace dealii; - namespace internal { /** diff --git a/include/aspect/geometry_model/two_merged_boxes.h b/include/aspect/geometry_model/two_merged_boxes.h index bfcc53789fd..201c81eb8c9 100644 --- a/include/aspect/geometry_model/two_merged_boxes.h +++ b/include/aspect/geometry_model/two_merged_boxes.h @@ -29,8 +29,6 @@ namespace aspect { namespace GeometryModel { - using namespace dealii; - /** * A class that describes a box geometry of certain width, height, and * depth (in 3d) and adds two (four in 3D) additional boundary indicators diff --git a/include/aspect/geometry_model/two_merged_chunks.h b/include/aspect/geometry_model/two_merged_chunks.h index 3d4008155a2..37868b3712a 100644 --- a/include/aspect/geometry_model/two_merged_chunks.h +++ b/include/aspect/geometry_model/two_merged_chunks.h @@ -34,9 +34,6 @@ namespace aspect { namespace GeometryModel { - using namespace dealii; - - /** * A geometry model class that describes a chunk of a spherical shell, * but with two boundary indicators per side boundary. This allows diff --git a/include/aspect/gravity_model/ascii_data.h b/include/aspect/gravity_model/ascii_data.h index 1c1d407bd6a..032162102f5 100644 --- a/include/aspect/gravity_model/ascii_data.h +++ b/include/aspect/gravity_model/ascii_data.h @@ -30,8 +30,6 @@ namespace aspect { namespace GravityModel { - using namespace dealii; - /** * A class that implements a gravity description based on * an AsciiData input file. diff --git a/include/aspect/gravity_model/function.h b/include/aspect/gravity_model/function.h index 32d5e09e75f..805bc8fed82 100644 --- a/include/aspect/gravity_model/function.h +++ b/include/aspect/gravity_model/function.h @@ -32,8 +32,6 @@ namespace aspect { namespace GravityModel { - using namespace dealii; - /** * A class that implements gravity based on a functional description * provided in the input file. diff --git a/include/aspect/gravity_model/interface.h b/include/aspect/gravity_model/interface.h index e9de18d06f8..9bfac65f34c 100644 --- a/include/aspect/gravity_model/interface.h +++ b/include/aspect/gravity_model/interface.h @@ -36,8 +36,6 @@ namespace aspect */ namespace GravityModel { - using namespace dealii; - /** * A base class for parameterizations of gravity models. * diff --git a/include/aspect/gravity_model/radial.h b/include/aspect/gravity_model/radial.h index df05abe5ce9..07059b5ecbc 100644 --- a/include/aspect/gravity_model/radial.h +++ b/include/aspect/gravity_model/radial.h @@ -29,8 +29,6 @@ namespace aspect { namespace GravityModel { - using namespace dealii; - /** * A class that describes gravity as a radial vector of constant * magnitude. The magnitude's value is read from the input file. diff --git a/include/aspect/gravity_model/vertical.h b/include/aspect/gravity_model/vertical.h index 95d834ad3be..166766c2c15 100644 --- a/include/aspect/gravity_model/vertical.h +++ b/include/aspect/gravity_model/vertical.h @@ -29,8 +29,6 @@ namespace aspect { namespace GravityModel { - using namespace dealii; - /** * A class that describes gravity as a vector of constant magnitude * pointing vertically down. diff --git a/include/aspect/heating_model/adiabatic_heating.h b/include/aspect/heating_model/adiabatic_heating.h index bd8588b3a49..54737f0437c 100644 --- a/include/aspect/heating_model/adiabatic_heating.h +++ b/include/aspect/heating_model/adiabatic_heating.h @@ -29,8 +29,6 @@ namespace aspect { namespace HeatingModel { - using namespace dealii; - /** * A class that implements a standard adiabatic heating rate. * diff --git a/include/aspect/heating_model/adiabatic_heating_of_melt.h b/include/aspect/heating_model/adiabatic_heating_of_melt.h index d992018020e..ce2a5fee47d 100644 --- a/include/aspect/heating_model/adiabatic_heating_of_melt.h +++ b/include/aspect/heating_model/adiabatic_heating_of_melt.h @@ -29,8 +29,6 @@ namespace aspect { namespace HeatingModel { - using namespace dealii; - /** * A class that implements a standard adiabatic heating rate * for partially molten material. diff --git a/include/aspect/heating_model/compositional_heating.h b/include/aspect/heating_model/compositional_heating.h index 5d1a8c6dde1..29c17d64533 100644 --- a/include/aspect/heating_model/compositional_heating.h +++ b/include/aspect/heating_model/compositional_heating.h @@ -30,8 +30,6 @@ namespace aspect { namespace HeatingModel { - using namespace dealii; - /** * A class that implements a heating model where each compositional field * is assigned a user-defined internal heating value. diff --git a/include/aspect/heating_model/constant_heating.h b/include/aspect/heating_model/constant_heating.h index 8eaa75402be..5f4a46cf9d9 100644 --- a/include/aspect/heating_model/constant_heating.h +++ b/include/aspect/heating_model/constant_heating.h @@ -28,8 +28,6 @@ namespace aspect { namespace HeatingModel { - using namespace dealii; - /** * A class that implements a constant radiogenic heating rate. * diff --git a/include/aspect/heating_model/function.h b/include/aspect/heating_model/function.h index bf7b6df4253..af2a98766cf 100644 --- a/include/aspect/heating_model/function.h +++ b/include/aspect/heating_model/function.h @@ -31,8 +31,6 @@ namespace aspect { namespace HeatingModel { - using namespace dealii; - /** * A class that implements a heating model based on a functional * description provided in the input file. diff --git a/include/aspect/heating_model/interface.h b/include/aspect/heating_model/interface.h index 40a76245363..441a2e8b8f7 100644 --- a/include/aspect/heating_model/interface.h +++ b/include/aspect/heating_model/interface.h @@ -45,8 +45,6 @@ namespace aspect */ namespace HeatingModel { - using namespace dealii; - /** * A data structure with the output field of the * HeatingModel::Interface::evaluate() function. The vectors are the diff --git a/include/aspect/heating_model/latent_heat.h b/include/aspect/heating_model/latent_heat.h index 2761cccfae6..0c6bdadcb42 100644 --- a/include/aspect/heating_model/latent_heat.h +++ b/include/aspect/heating_model/latent_heat.h @@ -28,8 +28,6 @@ namespace aspect { namespace HeatingModel { - using namespace dealii; - /** * A class that implements a standard formulation of latent heat. * This includes a left hand side and a right hand side term: diff --git a/include/aspect/heating_model/latent_heat_melt.h b/include/aspect/heating_model/latent_heat_melt.h index 272771e2b82..6f84776ea52 100644 --- a/include/aspect/heating_model/latent_heat_melt.h +++ b/include/aspect/heating_model/latent_heat_melt.h @@ -29,8 +29,6 @@ namespace aspect { namespace HeatingModel { - using namespace dealii; - /** * A class that implements a standard formulation of latent heat * of melting. This assumes that there is a compositional field diff --git a/include/aspect/heating_model/radioactive_decay.h b/include/aspect/heating_model/radioactive_decay.h index d4bf222225a..631b5131174 100644 --- a/include/aspect/heating_model/radioactive_decay.h +++ b/include/aspect/heating_model/radioactive_decay.h @@ -32,8 +32,6 @@ namespace aspect { namespace HeatingModel { - using namespace dealii; - /** * A class that implements a heating model based on radioactive decay. * diff --git a/include/aspect/heating_model/shear_heating.h b/include/aspect/heating_model/shear_heating.h index ee9cd7bf53c..71a6b1c6dd3 100644 --- a/include/aspect/heating_model/shear_heating.h +++ b/include/aspect/heating_model/shear_heating.h @@ -30,8 +30,6 @@ namespace aspect { namespace HeatingModel { - using namespace dealii; - /** * A class that implements a standard shear heating rate. * diff --git a/include/aspect/heating_model/shear_heating_with_melt.h b/include/aspect/heating_model/shear_heating_with_melt.h index 01e1847ae56..b4b09a6e464 100644 --- a/include/aspect/heating_model/shear_heating_with_melt.h +++ b/include/aspect/heating_model/shear_heating_with_melt.h @@ -29,8 +29,6 @@ namespace aspect { namespace HeatingModel { - using namespace dealii; - /** * A class that implements a standard shear heating rate for dissipation * heating of partially molten material. diff --git a/include/aspect/initial_composition/adiabatic_density.h b/include/aspect/initial_composition/adiabatic_density.h index 9229a7c753c..41e5d21e8aa 100644 --- a/include/aspect/initial_composition/adiabatic_density.h +++ b/include/aspect/initial_composition/adiabatic_density.h @@ -30,8 +30,6 @@ namespace aspect { namespace InitialComposition { - using namespace dealii; - /** * A class that implements initial conditions for the compositional fields * based on the adiabatic density profile. Note that only the field diff --git a/include/aspect/initial_composition/ascii_data.h b/include/aspect/initial_composition/ascii_data.h index 0a75b0af38d..4a8bec061f9 100644 --- a/include/aspect/initial_composition/ascii_data.h +++ b/include/aspect/initial_composition/ascii_data.h @@ -32,8 +32,6 @@ namespace aspect { namespace InitialComposition { - using namespace dealii; - /** * A class that implements the prescribed compositional fields determined * from a AsciiData input file. diff --git a/include/aspect/initial_composition/ascii_data_layered.h b/include/aspect/initial_composition/ascii_data_layered.h index 064e3cda15a..fa9da8d3a51 100644 --- a/include/aspect/initial_composition/ascii_data_layered.h +++ b/include/aspect/initial_composition/ascii_data_layered.h @@ -32,8 +32,6 @@ namespace aspect { namespace InitialComposition { - using namespace dealii; - /** * A class that implements prescribed compositional fields determined from * AsciiData input files. Each file defines a layer boundary as a grid of points. diff --git a/include/aspect/initial_composition/entropy_table_lookup.h b/include/aspect/initial_composition/entropy_table_lookup.h index fed4a58a985..9ef69212ef5 100644 --- a/include/aspect/initial_composition/entropy_table_lookup.h +++ b/include/aspect/initial_composition/entropy_table_lookup.h @@ -31,8 +31,6 @@ namespace aspect { namespace InitialComposition { - using namespace dealii; - /** * A class that implements initial conditions for the entropy field * Note that this plugin only diff --git a/include/aspect/initial_composition/function.h b/include/aspect/initial_composition/function.h index 15d0ffc7170..77a72c91e69 100644 --- a/include/aspect/initial_composition/function.h +++ b/include/aspect/initial_composition/function.h @@ -32,8 +32,6 @@ namespace aspect { namespace InitialComposition { - using namespace dealii; - /** * A class that implements initial conditions for the compositional fields * based on a functional description provided in the input file. diff --git a/include/aspect/initial_composition/interface.h b/include/aspect/initial_composition/interface.h index 79d3c7e253f..2933c09cd96 100644 --- a/include/aspect/initial_composition/interface.h +++ b/include/aspect/initial_composition/interface.h @@ -45,8 +45,6 @@ namespace aspect */ namespace InitialComposition { - using namespace dealii; - /** * A base class for parameterizations of initial conditions. * diff --git a/include/aspect/initial_composition/porosity.h b/include/aspect/initial_composition/porosity.h index ea9b6709951..01fc2290e7f 100644 --- a/include/aspect/initial_composition/porosity.h +++ b/include/aspect/initial_composition/porosity.h @@ -31,8 +31,6 @@ namespace aspect { namespace InitialComposition { - using namespace dealii; - /** * A class that implements initial conditions for the porosity field * by computing the equilibrium melt fraction for the given initial diff --git a/include/aspect/initial_composition/slab_model.h b/include/aspect/initial_composition/slab_model.h index 1816743dc76..6168bc6fdf1 100644 --- a/include/aspect/initial_composition/slab_model.h +++ b/include/aspect/initial_composition/slab_model.h @@ -32,8 +32,6 @@ namespace aspect { namespace InitialComposition { - using namespace dealii; - /** * A class that implements subducted slab geometries as a compositional * field determined from an input file. The file defines the depth to diff --git a/include/aspect/initial_composition/world_builder.h b/include/aspect/initial_composition/world_builder.h index 7cfcb104e1b..ab54e4bdae1 100644 --- a/include/aspect/initial_composition/world_builder.h +++ b/include/aspect/initial_composition/world_builder.h @@ -38,8 +38,6 @@ namespace aspect { namespace InitialComposition { - using namespace dealii; - /** * A class that implements initial conditions for the compositional fields * based on a functional description provided in the input file through the diff --git a/include/aspect/initial_temperature/S40RTS_perturbation.h b/include/aspect/initial_temperature/S40RTS_perturbation.h index aa6bda433ce..f65bb4d5c9d 100644 --- a/include/aspect/initial_temperature/S40RTS_perturbation.h +++ b/include/aspect/initial_temperature/S40RTS_perturbation.h @@ -29,8 +29,6 @@ namespace aspect { namespace InitialTemperature { - using namespace dealii; - namespace internal { namespace S40RTS diff --git a/include/aspect/initial_temperature/SAVANI_perturbation.h b/include/aspect/initial_temperature/SAVANI_perturbation.h index 718a7916fc1..34efdb942f5 100644 --- a/include/aspect/initial_temperature/SAVANI_perturbation.h +++ b/include/aspect/initial_temperature/SAVANI_perturbation.h @@ -29,8 +29,6 @@ namespace aspect { namespace InitialTemperature { - using namespace dealii; - namespace internal { namespace SAVANI diff --git a/include/aspect/initial_temperature/adiabatic.h b/include/aspect/initial_temperature/adiabatic.h index 8165488d917..e56bbb98e99 100644 --- a/include/aspect/initial_temperature/adiabatic.h +++ b/include/aspect/initial_temperature/adiabatic.h @@ -32,8 +32,6 @@ namespace aspect { namespace InitialTemperature { - using namespace dealii; - /** * A namespace for selecting how to determine the age of a * boundary layer. Current options are: diff --git a/include/aspect/initial_temperature/adiabatic_boundary.h b/include/aspect/initial_temperature/adiabatic_boundary.h index 02c6b0c5669..2ef5b1418b2 100644 --- a/include/aspect/initial_temperature/adiabatic_boundary.h +++ b/include/aspect/initial_temperature/adiabatic_boundary.h @@ -30,8 +30,6 @@ namespace aspect { namespace InitialTemperature { - using namespace dealii; - /** * A class that computes an initial temperature field based * on a user-defined adiabatic boundary. It discretizes the model domain into diff --git a/include/aspect/initial_temperature/ascii_data.h b/include/aspect/initial_temperature/ascii_data.h index e568cfe53ed..892059ae64e 100644 --- a/include/aspect/initial_temperature/ascii_data.h +++ b/include/aspect/initial_temperature/ascii_data.h @@ -31,8 +31,6 @@ namespace aspect { namespace InitialTemperature { - using namespace dealii; - /** * A class that implements a prescribed temperature field determined from * a AsciiData input file. diff --git a/include/aspect/initial_temperature/ascii_data_layered.h b/include/aspect/initial_temperature/ascii_data_layered.h index ccb5157ab13..610a3500b87 100644 --- a/include/aspect/initial_temperature/ascii_data_layered.h +++ b/include/aspect/initial_temperature/ascii_data_layered.h @@ -31,8 +31,6 @@ namespace aspect { namespace InitialTemperature { - using namespace dealii; - /** * A class that implements an initial temperature field determined from * AsciiData input files. Each file defines an isotherm as a grid of points. diff --git a/include/aspect/initial_temperature/ascii_profile.h b/include/aspect/initial_temperature/ascii_profile.h index 337605de662..4afe034e333 100644 --- a/include/aspect/initial_temperature/ascii_profile.h +++ b/include/aspect/initial_temperature/ascii_profile.h @@ -33,8 +33,6 @@ namespace aspect { namespace InitialTemperature { - using namespace dealii; - /** * A class that implements a prescribed temperature field determined from * a AsciiDataProfile input file. diff --git a/include/aspect/initial_temperature/box.h b/include/aspect/initial_temperature/box.h index 7f9462e17d6..93ca0406cc2 100644 --- a/include/aspect/initial_temperature/box.h +++ b/include/aspect/initial_temperature/box.h @@ -29,8 +29,6 @@ namespace aspect { namespace InitialTemperature { - using namespace dealii; - /** * A class that describes a perturbed initial temperature field for a box * geometry. diff --git a/include/aspect/initial_temperature/function.h b/include/aspect/initial_temperature/function.h index 65f9891f69b..d8ae108d9e3 100644 --- a/include/aspect/initial_temperature/function.h +++ b/include/aspect/initial_temperature/function.h @@ -32,8 +32,6 @@ namespace aspect { namespace InitialTemperature { - using namespace dealii; - /** * A class that implements temperature initial conditions based on a * functional description provided in the input file. diff --git a/include/aspect/initial_temperature/harmonic_perturbation.h b/include/aspect/initial_temperature/harmonic_perturbation.h index 795b6c9d5c5..4817ea87f47 100644 --- a/include/aspect/initial_temperature/harmonic_perturbation.h +++ b/include/aspect/initial_temperature/harmonic_perturbation.h @@ -30,8 +30,6 @@ namespace aspect { namespace InitialTemperature { - using namespace dealii; - /** * A class that describes a perturbed initially constant temperature field * for any geometry model or dimension in shape of a harmonic function. diff --git a/include/aspect/initial_temperature/interface.h b/include/aspect/initial_temperature/interface.h index 5afa03b4fdd..29b7c419055 100644 --- a/include/aspect/initial_temperature/interface.h +++ b/include/aspect/initial_temperature/interface.h @@ -45,8 +45,6 @@ namespace aspect */ namespace InitialTemperature { - using namespace dealii; - /** * A base class for parameterizations of initial conditions. * diff --git a/include/aspect/initial_temperature/lithosphere_mask.h b/include/aspect/initial_temperature/lithosphere_mask.h index db5442d0efa..4186d0a57ee 100644 --- a/include/aspect/initial_temperature/lithosphere_mask.h +++ b/include/aspect/initial_temperature/lithosphere_mask.h @@ -31,8 +31,6 @@ namespace aspect { namespace InitialTemperature { - using namespace dealii; - namespace LABDepth { template diff --git a/include/aspect/initial_temperature/patch_on_S40RTS.h b/include/aspect/initial_temperature/patch_on_S40RTS.h index 45b26fdf57d..e72173ec67b 100644 --- a/include/aspect/initial_temperature/patch_on_S40RTS.h +++ b/include/aspect/initial_temperature/patch_on_S40RTS.h @@ -32,8 +32,6 @@ namespace aspect { namespace InitialTemperature { - using namespace dealii; - /** * A class that implements a prescribed temperature field determined from * an upper mantle Vs model (input as an ascii file) above a specified depth diff --git a/include/aspect/initial_temperature/prescribed_temperature.h b/include/aspect/initial_temperature/prescribed_temperature.h index c60d138f20b..d556c4568ee 100644 --- a/include/aspect/initial_temperature/prescribed_temperature.h +++ b/include/aspect/initial_temperature/prescribed_temperature.h @@ -29,8 +29,6 @@ namespace aspect { namespace InitialTemperature { - using namespace dealii; - /** * A class sets the initial temperature to the precribed temperature * outputs computed by the material model. diff --git a/include/aspect/initial_temperature/random_gaussian_perturbation.h b/include/aspect/initial_temperature/random_gaussian_perturbation.h index bbc9df3bfa6..0a679175c62 100644 --- a/include/aspect/initial_temperature/random_gaussian_perturbation.h +++ b/include/aspect/initial_temperature/random_gaussian_perturbation.h @@ -29,8 +29,6 @@ namespace aspect { namespace InitialTemperature { - using namespace dealii; - /** * A class that describes a perturbation to a zero temperature field * by placing several Gaussians with a given magnitude and width at diff --git a/include/aspect/initial_temperature/spherical_shell.h b/include/aspect/initial_temperature/spherical_shell.h index 8f620e24532..4d68391c4e6 100644 --- a/include/aspect/initial_temperature/spherical_shell.h +++ b/include/aspect/initial_temperature/spherical_shell.h @@ -30,8 +30,6 @@ namespace aspect { namespace InitialTemperature { - using namespace dealii; - /** * A class that describes a perturbed initial temperature field for the * spherical shell. diff --git a/include/aspect/initial_temperature/world_builder.h b/include/aspect/initial_temperature/world_builder.h index cb657c15f9c..55f8d5d933b 100644 --- a/include/aspect/initial_temperature/world_builder.h +++ b/include/aspect/initial_temperature/world_builder.h @@ -39,8 +39,6 @@ namespace aspect { namespace InitialTemperature { - using namespace dealii; - /** * A class that implements temperature initial conditions based on a * functional description provided in the input file through the diff --git a/include/aspect/introspection.h b/include/aspect/introspection.h index 354c8906adc..216571e4685 100644 --- a/include/aspect/introspection.h +++ b/include/aspect/introspection.h @@ -35,8 +35,6 @@ namespace aspect { - using namespace dealii; - /** * Helper function to construct the default list of variables to use * based on the given set of @p parameters. diff --git a/include/aspect/lateral_averaging.h b/include/aspect/lateral_averaging.h index 6100a0268aa..fbae2bead3b 100644 --- a/include/aspect/lateral_averaging.h +++ b/include/aspect/lateral_averaging.h @@ -28,8 +28,6 @@ namespace aspect { - using namespace dealii; - namespace internal { /** diff --git a/include/aspect/material_model/ascii_reference_profile.h b/include/aspect/material_model/ascii_reference_profile.h index b04a689640c..444881bdbd8 100644 --- a/include/aspect/material_model/ascii_reference_profile.h +++ b/include/aspect/material_model/ascii_reference_profile.h @@ -29,8 +29,6 @@ namespace aspect { namespace MaterialModel { - using namespace dealii; - /** * A material model that reads in a reference profile from an ascii file * and computes properties based on this profile. diff --git a/include/aspect/material_model/averaging.h b/include/aspect/material_model/averaging.h index b20dd11a816..c673fd4181d 100644 --- a/include/aspect/material_model/averaging.h +++ b/include/aspect/material_model/averaging.h @@ -28,8 +28,6 @@ namespace aspect { namespace MaterialModel { - using namespace dealii; - /** * An enum to define what kind of averaging operations are implemented. * These are: diff --git a/include/aspect/material_model/composition_reaction.h b/include/aspect/material_model/composition_reaction.h index 81a83dd7815..dfb1c0316ad 100644 --- a/include/aspect/material_model/composition_reaction.h +++ b/include/aspect/material_model/composition_reaction.h @@ -29,8 +29,6 @@ namespace aspect { namespace MaterialModel { - using namespace dealii; - /** * A material model that consists of globally constant values for all * material parameters except that the density decays linearly with the diff --git a/include/aspect/material_model/depth_dependent.h b/include/aspect/material_model/depth_dependent.h index 32cc5e6b31c..ae17d3ceb91 100644 --- a/include/aspect/material_model/depth_dependent.h +++ b/include/aspect/material_model/depth_dependent.h @@ -32,8 +32,6 @@ namespace aspect { namespace MaterialModel { - using namespace dealii; - /** * A material model that applies a depth-dependent viscosity to a ''base model'' * chosen from any of the other available material models. This depth-dependent diff --git a/include/aspect/material_model/diffusion_dislocation.h b/include/aspect/material_model/diffusion_dislocation.h index 54d1db9977b..db2255bd43d 100644 --- a/include/aspect/material_model/diffusion_dislocation.h +++ b/include/aspect/material_model/diffusion_dislocation.h @@ -29,8 +29,6 @@ namespace aspect { namespace MaterialModel { - using namespace dealii; - /** * A material model based on a viscous rheology including diffusion and * dislocation creep. diff --git a/include/aspect/material_model/drucker_prager.h b/include/aspect/material_model/drucker_prager.h index 8cb0fe5581d..fa6c17cd7fc 100644 --- a/include/aspect/material_model/drucker_prager.h +++ b/include/aspect/material_model/drucker_prager.h @@ -30,8 +30,6 @@ namespace aspect { namespace MaterialModel { - using namespace dealii; - /** * A material model that consists of globally constant values for all * material parameters except density and viscosity. diff --git a/include/aspect/material_model/entropy_model.h b/include/aspect/material_model/entropy_model.h index 0f5e7d52dfe..6f01646ffc1 100644 --- a/include/aspect/material_model/entropy_model.h +++ b/include/aspect/material_model/entropy_model.h @@ -34,7 +34,6 @@ namespace aspect { namespace MaterialModel { - using namespace dealii; /** * A material model that is designed to use pressure and entropy (rather * than pressure and temperature) as independent variables. It will look up diff --git a/include/aspect/material_model/equation_of_state/interface.h b/include/aspect/material_model/equation_of_state/interface.h index eee4c557502..dfb7dd55cf3 100644 --- a/include/aspect/material_model/equation_of_state/interface.h +++ b/include/aspect/material_model/equation_of_state/interface.h @@ -31,8 +31,6 @@ namespace aspect { namespace MaterialModel { - using namespace dealii; - /** * A data structure containing output fields that can be filled by the * evaluate() function of an EquationOfState model. It contains those diff --git a/include/aspect/material_model/equation_of_state/linearized_incompressible.h b/include/aspect/material_model/equation_of_state/linearized_incompressible.h index 5b1a4c0ffa7..efadca21f3a 100644 --- a/include/aspect/material_model/equation_of_state/linearized_incompressible.h +++ b/include/aspect/material_model/equation_of_state/linearized_incompressible.h @@ -32,8 +32,6 @@ namespace aspect { namespace EquationOfState { - using namespace dealii; - /** * A simplified, incompressible equation of state where the density depends linearly * on temperature and composition, using the equation diff --git a/include/aspect/material_model/equation_of_state/multicomponent_compressible.h b/include/aspect/material_model/equation_of_state/multicomponent_compressible.h index 33c54d2ec23..2b33863f108 100644 --- a/include/aspect/material_model/equation_of_state/multicomponent_compressible.h +++ b/include/aspect/material_model/equation_of_state/multicomponent_compressible.h @@ -32,8 +32,6 @@ namespace aspect { namespace EquationOfState { - using namespace dealii; - /** * A compressible equation of state that is intended for use with multiple compositional * fields. For each material property, the user supplies a comma delimited list of diff --git a/include/aspect/material_model/equation_of_state/multicomponent_incompressible.h b/include/aspect/material_model/equation_of_state/multicomponent_incompressible.h index 793c509b218..73f3cc4219f 100644 --- a/include/aspect/material_model/equation_of_state/multicomponent_incompressible.h +++ b/include/aspect/material_model/equation_of_state/multicomponent_incompressible.h @@ -32,8 +32,6 @@ namespace aspect { namespace EquationOfState { - using namespace dealii; - /** * An incompressible equation of state that is intended for use with multiple compositional * fields and potentially phases. For each material property, the user supplies a comma diff --git a/include/aspect/material_model/equation_of_state/thermodynamic_table_lookup.h b/include/aspect/material_model/equation_of_state/thermodynamic_table_lookup.h index 2e798906904..3a45cef1ace 100644 --- a/include/aspect/material_model/equation_of_state/thermodynamic_table_lookup.h +++ b/include/aspect/material_model/equation_of_state/thermodynamic_table_lookup.h @@ -32,8 +32,6 @@ namespace aspect { namespace EquationOfState { - using namespace dealii; - /** * An equation of state class that reads thermodynamic properties * from pressure-temperature tables in input files. These input files diff --git a/include/aspect/material_model/grain_size.h b/include/aspect/material_model/grain_size.h index 347921d970c..f948ab09f3f 100644 --- a/include/aspect/material_model/grain_size.h +++ b/include/aspect/material_model/grain_size.h @@ -37,8 +37,6 @@ namespace aspect { namespace MaterialModel { - using namespace dealii; - /** * Additional output fields for the dislocation viscosity parameters * to be added to the MaterialModel::MaterialModelOutputs structure diff --git a/include/aspect/material_model/interface.h b/include/aspect/material_model/interface.h index 0f66ed8ee09..ed7b4c3b752 100644 --- a/include/aspect/material_model/interface.h +++ b/include/aspect/material_model/interface.h @@ -52,8 +52,6 @@ namespace aspect */ namespace MaterialModel { - using namespace dealii; - /** * A namespace whose enum members are used in querying the nonlinear * dependence of physical parameters on other solution variables. diff --git a/include/aspect/material_model/latent_heat.h b/include/aspect/material_model/latent_heat.h index 2646a5bc2e8..8fca2ac4410 100644 --- a/include/aspect/material_model/latent_heat.h +++ b/include/aspect/material_model/latent_heat.h @@ -28,8 +28,6 @@ namespace aspect { namespace MaterialModel { - using namespace dealii; - /** * A material model that implements a standard approximation of the latent * heat terms following Christensen \& Yuen, 1986. The change of entropy diff --git a/include/aspect/material_model/latent_heat_melt.h b/include/aspect/material_model/latent_heat_melt.h index 49aaf04b8d3..2ba9ee80689 100644 --- a/include/aspect/material_model/latent_heat_melt.h +++ b/include/aspect/material_model/latent_heat_melt.h @@ -29,8 +29,6 @@ namespace aspect { namespace MaterialModel { - using namespace dealii; - /** * A material model that implements latent heat of melting for two * materials: peridotite and pyroxenite. The density and thermal diff --git a/include/aspect/material_model/melt_boukare.h b/include/aspect/material_model/melt_boukare.h index 145fad241fb..b7b8fca2f51 100644 --- a/include/aspect/material_model/melt_boukare.h +++ b/include/aspect/material_model/melt_boukare.h @@ -29,8 +29,6 @@ namespace aspect { namespace MaterialModel { - using namespace dealii; - /** * Additional output fields for the melt boukare material model. */ diff --git a/include/aspect/material_model/melt_global.h b/include/aspect/material_model/melt_global.h index 44924d0a030..9d1f1387ecb 100644 --- a/include/aspect/material_model/melt_global.h +++ b/include/aspect/material_model/melt_global.h @@ -30,8 +30,6 @@ namespace aspect { namespace MaterialModel { - using namespace dealii; - /** * A material model that implements a simple formulation of the * material parameters required for the modeling of melt transport diff --git a/include/aspect/material_model/melt_simple.h b/include/aspect/material_model/melt_simple.h index 0c3a7953206..1c934c39aed 100644 --- a/include/aspect/material_model/melt_simple.h +++ b/include/aspect/material_model/melt_simple.h @@ -31,8 +31,6 @@ namespace aspect { namespace MaterialModel { - using namespace dealii; - /** * A material model that implements a simple formulation of the * material parameters required for the modeling of melt transport, diff --git a/include/aspect/material_model/modified_tait.h b/include/aspect/material_model/modified_tait.h index c889f06370b..5557e8ec5a8 100644 --- a/include/aspect/material_model/modified_tait.h +++ b/include/aspect/material_model/modified_tait.h @@ -30,8 +30,6 @@ namespace aspect { namespace MaterialModel { - using namespace dealii; - /** * A compressible material model that implements the thermal modified Tait * equation of state as written in the paper of Holland and Powell, 2011 diff --git a/include/aspect/material_model/multicomponent.h b/include/aspect/material_model/multicomponent.h index 49524bf31e1..419e2e00e83 100644 --- a/include/aspect/material_model/multicomponent.h +++ b/include/aspect/material_model/multicomponent.h @@ -30,8 +30,6 @@ namespace aspect { namespace MaterialModel { - using namespace dealii; - /** * An incompressible material model which is intended for use with multiple * compositional fields. Each compositional field is meant to be a single diff --git a/include/aspect/material_model/multicomponent_compressible.h b/include/aspect/material_model/multicomponent_compressible.h index 9198a5ea8b4..a8e8878b120 100644 --- a/include/aspect/material_model/multicomponent_compressible.h +++ b/include/aspect/material_model/multicomponent_compressible.h @@ -30,8 +30,6 @@ namespace aspect { namespace MaterialModel { - using namespace dealii; - /** * A material model which is intended for use with multiple compositional * fields. Each compositional field is meant to be a single rock type, diff --git a/include/aspect/material_model/nondimensional.h b/include/aspect/material_model/nondimensional.h index 3dcf1482c19..f5ecde9c85a 100644 --- a/include/aspect/material_model/nondimensional.h +++ b/include/aspect/material_model/nondimensional.h @@ -29,8 +29,6 @@ namespace aspect { namespace MaterialModel { - using namespace dealii; - /** * A material model for incompressible (using the Boussinesq approximation) * and compressible computations (with ALA or TALA) for a nondimensionalized diff --git a/include/aspect/material_model/perplex_lookup.h b/include/aspect/material_model/perplex_lookup.h index 5054a36f822..41f18afe055 100644 --- a/include/aspect/material_model/perplex_lookup.h +++ b/include/aspect/material_model/perplex_lookup.h @@ -27,8 +27,6 @@ namespace aspect { namespace MaterialModel { - using namespace dealii; - /** * A material model that calls the thermodynamic software PerpleX * in order to evaluate material properties at a given point, namely diff --git a/include/aspect/material_model/prescribed_viscosity.h b/include/aspect/material_model/prescribed_viscosity.h index f1f3686cca6..88250155cfe 100644 --- a/include/aspect/material_model/prescribed_viscosity.h +++ b/include/aspect/material_model/prescribed_viscosity.h @@ -30,8 +30,6 @@ namespace aspect { namespace MaterialModel { - using namespace dealii; - /** * A material model that applies a viscosity to a ''base model'' chosen from any of * the other available material models. This prescribed viscosity material model diff --git a/include/aspect/material_model/reaction_model/grain_size_evolution.h b/include/aspect/material_model/reaction_model/grain_size_evolution.h index 3ab45dad3e2..ba3a925eb27 100644 --- a/include/aspect/material_model/reaction_model/grain_size_evolution.h +++ b/include/aspect/material_model/reaction_model/grain_size_evolution.h @@ -28,8 +28,6 @@ namespace aspect { namespace MaterialModel { - using namespace dealii; - namespace ReactionModel { /** diff --git a/include/aspect/material_model/reaction_model/katz2003_mantle_melting.h b/include/aspect/material_model/reaction_model/katz2003_mantle_melting.h index 8c7fa2068b4..3c334713147 100644 --- a/include/aspect/material_model/reaction_model/katz2003_mantle_melting.h +++ b/include/aspect/material_model/reaction_model/katz2003_mantle_melting.h @@ -30,8 +30,6 @@ namespace aspect { namespace MaterialModel { - using namespace dealii; - namespace ReactionModel { diff --git a/include/aspect/material_model/reactive_fluid_transport.h b/include/aspect/material_model/reactive_fluid_transport.h index 34a62af4acb..b90b34aab7d 100644 --- a/include/aspect/material_model/reactive_fluid_transport.h +++ b/include/aspect/material_model/reactive_fluid_transport.h @@ -38,7 +38,6 @@ namespace aspect { namespace MaterialModel { - using namespace dealii; /** * A material model that simulates both fluid-rock interactions * and the advection of fluids. It is designed to be composited with another material diff --git a/include/aspect/material_model/replace_lithosphere_viscosity.h b/include/aspect/material_model/replace_lithosphere_viscosity.h index 02af25b2c83..ae35281edeb 100644 --- a/include/aspect/material_model/replace_lithosphere_viscosity.h +++ b/include/aspect/material_model/replace_lithosphere_viscosity.h @@ -30,8 +30,6 @@ namespace aspect { namespace MaterialModel { - using namespace dealii; - /** * A material model that applies a given constant viscosity in the lithosphere. * Viscosity below this is taken from a ''base model'' chosen from any of the diff --git a/include/aspect/material_model/rheology/ascii_depth_profile.h b/include/aspect/material_model/rheology/ascii_depth_profile.h index 1655724499e..10df9562c89 100644 --- a/include/aspect/material_model/rheology/ascii_depth_profile.h +++ b/include/aspect/material_model/rheology/ascii_depth_profile.h @@ -33,8 +33,6 @@ namespace aspect { namespace MaterialModel { - using namespace dealii; - namespace Rheology { diff --git a/include/aspect/material_model/rheology/composite_visco_plastic.h b/include/aspect/material_model/rheology/composite_visco_plastic.h index 94bc3b59879..775dd00695c 100644 --- a/include/aspect/material_model/rheology/composite_visco_plastic.h +++ b/include/aspect/material_model/rheology/composite_visco_plastic.h @@ -34,8 +34,6 @@ namespace aspect { namespace MaterialModel { - using namespace dealii; - namespace Rheology { /** diff --git a/include/aspect/material_model/rheology/compositional_viscosity_prefactors.h b/include/aspect/material_model/rheology/compositional_viscosity_prefactors.h index 970084c4a2e..7af8672c14a 100644 --- a/include/aspect/material_model/rheology/compositional_viscosity_prefactors.h +++ b/include/aspect/material_model/rheology/compositional_viscosity_prefactors.h @@ -29,8 +29,6 @@ namespace aspect { namespace MaterialModel { - using namespace dealii; - namespace Rheology { /** diff --git a/include/aspect/material_model/rheology/constant_viscosity.h b/include/aspect/material_model/rheology/constant_viscosity.h index 987209b35c1..e15dbd3d3e7 100644 --- a/include/aspect/material_model/rheology/constant_viscosity.h +++ b/include/aspect/material_model/rheology/constant_viscosity.h @@ -27,8 +27,6 @@ namespace aspect { namespace MaterialModel { - using namespace dealii; - namespace Rheology { class ConstantViscosity diff --git a/include/aspect/material_model/rheology/constant_viscosity_prefactors.h b/include/aspect/material_model/rheology/constant_viscosity_prefactors.h index 1ecc37aad36..a81b7490631 100644 --- a/include/aspect/material_model/rheology/constant_viscosity_prefactors.h +++ b/include/aspect/material_model/rheology/constant_viscosity_prefactors.h @@ -29,8 +29,6 @@ namespace aspect { namespace MaterialModel { - using namespace dealii; - namespace Rheology { /** diff --git a/include/aspect/material_model/rheology/diffusion_creep.h b/include/aspect/material_model/rheology/diffusion_creep.h index b5bbe3ddfbb..040094e2f6e 100644 --- a/include/aspect/material_model/rheology/diffusion_creep.h +++ b/include/aspect/material_model/rheology/diffusion_creep.h @@ -30,8 +30,6 @@ namespace aspect { namespace MaterialModel { - using namespace dealii; - namespace Rheology { /** diff --git a/include/aspect/material_model/rheology/diffusion_dislocation.h b/include/aspect/material_model/rheology/diffusion_dislocation.h index 49315dda652..edf12be66c7 100644 --- a/include/aspect/material_model/rheology/diffusion_dislocation.h +++ b/include/aspect/material_model/rheology/diffusion_dislocation.h @@ -32,8 +32,6 @@ namespace aspect { namespace MaterialModel { - using namespace dealii; - namespace Rheology { /** diff --git a/include/aspect/material_model/rheology/dislocation_creep.h b/include/aspect/material_model/rheology/dislocation_creep.h index 416a9ef500d..21dd3289af4 100644 --- a/include/aspect/material_model/rheology/dislocation_creep.h +++ b/include/aspect/material_model/rheology/dislocation_creep.h @@ -28,8 +28,6 @@ namespace aspect { namespace MaterialModel { - using namespace dealii; - namespace Rheology { /** diff --git a/include/aspect/material_model/rheology/drucker_prager.h b/include/aspect/material_model/rheology/drucker_prager.h index c817fa2984a..1621051f0db 100644 --- a/include/aspect/material_model/rheology/drucker_prager.h +++ b/include/aspect/material_model/rheology/drucker_prager.h @@ -30,8 +30,6 @@ namespace aspect { namespace MaterialModel { - using namespace dealii; - namespace Rheology { /** diff --git a/include/aspect/material_model/rheology/drucker_prager_power.h b/include/aspect/material_model/rheology/drucker_prager_power.h index e7e618becfb..6f4fe515d71 100644 --- a/include/aspect/material_model/rheology/drucker_prager_power.h +++ b/include/aspect/material_model/rheology/drucker_prager_power.h @@ -32,8 +32,6 @@ namespace aspect { namespace MaterialModel { - using namespace dealii; - namespace Rheology { diff --git a/include/aspect/material_model/rheology/elasticity.h b/include/aspect/material_model/rheology/elasticity.h index fdb28edb24f..2cb7c88b747 100644 --- a/include/aspect/material_model/rheology/elasticity.h +++ b/include/aspect/material_model/rheology/elasticity.h @@ -31,8 +31,6 @@ namespace aspect { namespace MaterialModel { - using namespace dealii; - /** * Additional output fields for the elastic shear modulus to be added to * the MaterialModel::MaterialModelOutputs structure and filled in the diff --git a/include/aspect/material_model/rheology/frank_kamenetskii.h b/include/aspect/material_model/rheology/frank_kamenetskii.h index e7d2009904f..5f20fd88910 100644 --- a/include/aspect/material_model/rheology/frank_kamenetskii.h +++ b/include/aspect/material_model/rheology/frank_kamenetskii.h @@ -29,8 +29,6 @@ namespace aspect { namespace MaterialModel { - using namespace dealii; - namespace Rheology { /** diff --git a/include/aspect/material_model/rheology/friction_models.h b/include/aspect/material_model/rheology/friction_models.h index fb23ef023a4..4e8c6d88a72 100644 --- a/include/aspect/material_model/rheology/friction_models.h +++ b/include/aspect/material_model/rheology/friction_models.h @@ -34,7 +34,6 @@ namespace aspect { namespace MaterialModel { - using namespace dealii; namespace Rheology { /** diff --git a/include/aspect/material_model/rheology/peierls_creep.h b/include/aspect/material_model/rheology/peierls_creep.h index 76d2390ff27..9c52f7ac838 100644 --- a/include/aspect/material_model/rheology/peierls_creep.h +++ b/include/aspect/material_model/rheology/peierls_creep.h @@ -28,8 +28,6 @@ namespace aspect { namespace MaterialModel { - using namespace dealii; - namespace Rheology { /** diff --git a/include/aspect/material_model/rheology/strain_dependent.h b/include/aspect/material_model/rheology/strain_dependent.h index a9a2ea6a3b1..f90fcd31a3c 100644 --- a/include/aspect/material_model/rheology/strain_dependent.h +++ b/include/aspect/material_model/rheology/strain_dependent.h @@ -32,8 +32,6 @@ namespace aspect { namespace MaterialModel { - using namespace dealii; - namespace Rheology { /** diff --git a/include/aspect/material_model/rheology/visco_plastic.h b/include/aspect/material_model/rheology/visco_plastic.h index 7b75573ebd2..436c2300b9b 100644 --- a/include/aspect/material_model/rheology/visco_plastic.h +++ b/include/aspect/material_model/rheology/visco_plastic.h @@ -42,8 +42,6 @@ namespace aspect { namespace MaterialModel { - using namespace dealii; - /** * Additional output fields for the plastic parameters weakened (or hardened) * by strain to be added to the MaterialModel::MaterialModelOutputs structure diff --git a/include/aspect/material_model/simple.h b/include/aspect/material_model/simple.h index e266b0d0302..1616143eeb7 100644 --- a/include/aspect/material_model/simple.h +++ b/include/aspect/material_model/simple.h @@ -29,8 +29,6 @@ namespace aspect { namespace MaterialModel { - using namespace dealii; - /** * A material model that consists of globally constant values for all * material parameters except density and viscosity. diff --git a/include/aspect/material_model/simple_compressible.h b/include/aspect/material_model/simple_compressible.h index 1658b3b147c..fcfd2e457b4 100644 --- a/include/aspect/material_model/simple_compressible.h +++ b/include/aspect/material_model/simple_compressible.h @@ -29,8 +29,6 @@ namespace aspect { namespace MaterialModel { - using namespace dealii; - /** * A material model that consists of globally constant values for the * viscosity, thermal conductivity, thermal expansivity diff --git a/include/aspect/material_model/simpler.h b/include/aspect/material_model/simpler.h index cf4ff1a2487..35eeece6d27 100644 --- a/include/aspect/material_model/simpler.h +++ b/include/aspect/material_model/simpler.h @@ -30,8 +30,6 @@ namespace aspect { namespace MaterialModel { - using namespace dealii; - /** * A material model that consists of globally constant values for all * material parameters except the density, which depends linearly on the diff --git a/include/aspect/material_model/steinberger.h b/include/aspect/material_model/steinberger.h index 8ffd2ce9e31..8b3f1b99ff9 100644 --- a/include/aspect/material_model/steinberger.h +++ b/include/aspect/material_model/steinberger.h @@ -31,8 +31,6 @@ namespace aspect { namespace MaterialModel { - using namespace dealii; - namespace internal { /** diff --git a/include/aspect/material_model/thermal_conductivity/constant.h b/include/aspect/material_model/thermal_conductivity/constant.h index 566e3d2f89c..49ddcf62879 100644 --- a/include/aspect/material_model/thermal_conductivity/constant.h +++ b/include/aspect/material_model/thermal_conductivity/constant.h @@ -30,8 +30,6 @@ namespace aspect { namespace ThermalConductivity { - using namespace dealii; - /** * A class that implements a constant thermal conductivity. * diff --git a/include/aspect/material_model/thermal_conductivity/interface.h b/include/aspect/material_model/thermal_conductivity/interface.h index 19d8db1f901..c662b7496bf 100644 --- a/include/aspect/material_model/thermal_conductivity/interface.h +++ b/include/aspect/material_model/thermal_conductivity/interface.h @@ -32,8 +32,6 @@ namespace aspect { namespace ThermalConductivity { - using namespace dealii; - /** * A base class for parametrizations of the thermal conductivity. Classes derived * from this class will need to implement a function that computes the thermal diff --git a/include/aspect/material_model/utilities.h b/include/aspect/material_model/utilities.h index e1b4c821cae..bf877a0acfe 100644 --- a/include/aspect/material_model/utilities.h +++ b/include/aspect/material_model/utilities.h @@ -33,7 +33,6 @@ namespace aspect template class SimulatorAccess; namespace Utilities { - using namespace dealii; using namespace dealii::Utilities; template @@ -41,8 +40,6 @@ namespace aspect } namespace MaterialModel { - using namespace dealii; - template class MaterialModelOutputs; template struct EquationOfStateOutputs; diff --git a/include/aspect/material_model/visco_plastic.h b/include/aspect/material_model/visco_plastic.h index 446ce21f57b..c07b32303e8 100644 --- a/include/aspect/material_model/visco_plastic.h +++ b/include/aspect/material_model/visco_plastic.h @@ -32,8 +32,6 @@ namespace aspect { namespace MaterialModel { - using namespace dealii; - /** * A material model combining viscous and plastic deformation, with * the option to also include viscoelastic deformation. diff --git a/include/aspect/material_model/viscoelastic.h b/include/aspect/material_model/viscoelastic.h index 7003201e0e7..cd697aca1cc 100644 --- a/include/aspect/material_model/viscoelastic.h +++ b/include/aspect/material_model/viscoelastic.h @@ -30,8 +30,6 @@ namespace aspect { namespace MaterialModel { - using namespace dealii; - /** * An implementation of a simple linear viscoelastic rheology that only * includes the deviatoric components of elasticity. Specifically, the diff --git a/include/aspect/melt.h b/include/aspect/melt.h index 3510372816f..9e31865b582 100644 --- a/include/aspect/melt.h +++ b/include/aspect/melt.h @@ -30,8 +30,6 @@ namespace aspect { - using namespace dealii; - namespace MaterialModel { /** diff --git a/include/aspect/mesh_deformation/ascii_data.h b/include/aspect/mesh_deformation/ascii_data.h index 2211a96e2bb..0b2c84ca71b 100644 --- a/include/aspect/mesh_deformation/ascii_data.h +++ b/include/aspect/mesh_deformation/ascii_data.h @@ -31,8 +31,6 @@ namespace aspect { namespace MeshDeformation { - using namespace dealii; - /** * A class that implements initial topography determined * from an AsciiData input file. diff --git a/include/aspect/mesh_deformation/diffusion.h b/include/aspect/mesh_deformation/diffusion.h index 79bcc677cc6..fb83a347f0e 100644 --- a/include/aspect/mesh_deformation/diffusion.h +++ b/include/aspect/mesh_deformation/diffusion.h @@ -29,9 +29,6 @@ namespace aspect { - using namespace dealii; - - namespace MeshDeformation { /** diff --git a/include/aspect/mesh_deformation/fastscape.h b/include/aspect/mesh_deformation/fastscape.h index 1b189c22028..7eb51756ee9 100644 --- a/include/aspect/mesh_deformation/fastscape.h +++ b/include/aspect/mesh_deformation/fastscape.h @@ -29,8 +29,6 @@ namespace aspect { - using namespace dealii; - namespace MeshDeformation { /** diff --git a/include/aspect/mesh_deformation/free_surface.h b/include/aspect/mesh_deformation/free_surface.h index c1dd4747cc5..2c40608a01f 100644 --- a/include/aspect/mesh_deformation/free_surface.h +++ b/include/aspect/mesh_deformation/free_surface.h @@ -30,8 +30,6 @@ namespace aspect { - using namespace dealii; - namespace MeshDeformation { /** diff --git a/include/aspect/mesh_deformation/function.h b/include/aspect/mesh_deformation/function.h index cdd835cd30d..f324bacf5fe 100644 --- a/include/aspect/mesh_deformation/function.h +++ b/include/aspect/mesh_deformation/function.h @@ -29,8 +29,6 @@ namespace aspect { - using namespace dealii; - namespace MeshDeformation { /** diff --git a/include/aspect/mesh_deformation/interface.h b/include/aspect/mesh_deformation/interface.h index 9cd4e7892ca..c821a9f436e 100644 --- a/include/aspect/mesh_deformation/interface.h +++ b/include/aspect/mesh_deformation/interface.h @@ -40,8 +40,6 @@ namespace aspect { - using namespace dealii; - namespace Assemblers { /** diff --git a/include/aspect/mesh_refinement/interface.h b/include/aspect/mesh_refinement/interface.h index dd7a582cd80..a97abe0515a 100644 --- a/include/aspect/mesh_refinement/interface.h +++ b/include/aspect/mesh_refinement/interface.h @@ -34,8 +34,6 @@ namespace aspect { - using namespace dealii; - template class Simulator; template class SimulatorAccess; diff --git a/include/aspect/newton.h b/include/aspect/newton.h index 3aeeb96a5fd..e7e66be396a 100644 --- a/include/aspect/newton.h +++ b/include/aspect/newton.h @@ -31,8 +31,6 @@ namespace aspect { - using namespace dealii; - namespace MaterialModel { /** diff --git a/include/aspect/parameters.h b/include/aspect/parameters.h index 7fdfb7aa265..ed3f699c6fd 100644 --- a/include/aspect/parameters.h +++ b/include/aspect/parameters.h @@ -30,8 +30,6 @@ namespace aspect { - using namespace dealii; - struct CompositionalFieldDescription; // forward declaration: diff --git a/include/aspect/particle/generator/uniform_radial.h b/include/aspect/particle/generator/uniform_radial.h index 453735b6fb2..00ca12f57a0 100644 --- a/include/aspect/particle/generator/uniform_radial.h +++ b/include/aspect/particle/generator/uniform_radial.h @@ -31,8 +31,6 @@ namespace aspect { namespace Generator { - using namespace dealii; - /** * Generate a uniform radial distribution of particles over the entire * simulation domain. Uniform here means diff --git a/include/aspect/particle/integrator/interface.h b/include/aspect/particle/integrator/interface.h index 0ea4e436a84..8bc61255faa 100644 --- a/include/aspect/particle/integrator/interface.h +++ b/include/aspect/particle/integrator/interface.h @@ -34,7 +34,6 @@ namespace aspect { namespace Integrator { - using namespace dealii; using namespace dealii::Particles; /** diff --git a/include/aspect/particle/interpolator/interface.h b/include/aspect/particle/interpolator/interface.h index f3297fe9514..97fc2198418 100644 --- a/include/aspect/particle/interpolator/interface.h +++ b/include/aspect/particle/interpolator/interface.h @@ -37,7 +37,6 @@ namespace aspect { namespace Interpolator { - using namespace dealii; using namespace dealii::Particles; /** diff --git a/include/aspect/particle/manager.h b/include/aspect/particle/manager.h index f2cee0745bf..09bb3190602 100644 --- a/include/aspect/particle/manager.h +++ b/include/aspect/particle/manager.h @@ -52,7 +52,6 @@ namespace aspect namespace Particle { - using namespace dealii; using namespace dealii::Particles; namespace Generator diff --git a/include/aspect/plugins.h b/include/aspect/plugins.h index ec851b4b52f..4189a3df2d2 100644 --- a/include/aspect/plugins.h +++ b/include/aspect/plugins.h @@ -46,8 +46,6 @@ namespace aspect namespace Plugins { - using namespace dealii; - /** * This function returns if a given plugin (e.g. a material model returned * from SimulatorAccess::get_material_model() ) matches a certain plugin @@ -114,9 +112,6 @@ namespace aspect namespace Plugins { - using namespace dealii; - - /** * A base class for all plugin systems. The class ensures that a * common set of functions is declared as `virtual` (namely, the @@ -426,10 +421,6 @@ namespace aspect */ namespace Plugins { - using namespace dealii; - - - /** * An internal class that is used in the definition of the * ASPECT_REGISTER_* macros. Given a registration function, a classname, diff --git a/include/aspect/postprocess/interface.h b/include/aspect/postprocess/interface.h index d1f28d3da95..5b2384851ed 100644 --- a/include/aspect/postprocess/interface.h +++ b/include/aspect/postprocess/interface.h @@ -38,8 +38,6 @@ namespace aspect { - using namespace dealii; - template class Simulator; template class SimulatorAccess; diff --git a/include/aspect/postprocess/visualization/boundary_strain_rate_residual.h b/include/aspect/postprocess/visualization/boundary_strain_rate_residual.h index a76d0e3d9fc..f1ccba08281 100644 --- a/include/aspect/postprocess/visualization/boundary_strain_rate_residual.h +++ b/include/aspect/postprocess/visualization/boundary_strain_rate_residual.h @@ -35,7 +35,6 @@ namespace aspect { namespace VisualizationPostprocessors { - using namespace dealii; /** * A class derived from DataPostprocessor that takes an output vector * and computes a variable that represents the residual between diff --git a/include/aspect/postprocess/visualization/boundary_velocity_residual.h b/include/aspect/postprocess/visualization/boundary_velocity_residual.h index 4ce232eacc0..2c2ca3e6946 100644 --- a/include/aspect/postprocess/visualization/boundary_velocity_residual.h +++ b/include/aspect/postprocess/visualization/boundary_velocity_residual.h @@ -35,7 +35,6 @@ namespace aspect { namespace VisualizationPostprocessors { - using namespace dealii; /** * A class derived from DataPostprocessor that takes an output vector * and computes a variable that represents the velocity residual between diff --git a/include/aspect/prescribed_stokes_solution/ascii_data.h b/include/aspect/prescribed_stokes_solution/ascii_data.h index c8311aa71be..b0cd7427672 100644 --- a/include/aspect/prescribed_stokes_solution/ascii_data.h +++ b/include/aspect/prescribed_stokes_solution/ascii_data.h @@ -31,8 +31,6 @@ namespace aspect { namespace PrescribedStokesSolution { - using namespace dealii; - /** * A class that implements a prescribed velocity field determined from * a AsciiData input file. diff --git a/include/aspect/prescribed_stokes_solution/circle.h b/include/aspect/prescribed_stokes_solution/circle.h index 5e350d14d6c..fd8199cc3d5 100644 --- a/include/aspect/prescribed_stokes_solution/circle.h +++ b/include/aspect/prescribed_stokes_solution/circle.h @@ -30,8 +30,6 @@ namespace aspect { namespace PrescribedStokesSolution { - using namespace dealii; - /** * A class that implements a circular, divergence-free flow field * around the origin of the coordinate system. diff --git a/include/aspect/prescribed_stokes_solution/function.h b/include/aspect/prescribed_stokes_solution/function.h index 355a6eb6eea..6656f238ed1 100644 --- a/include/aspect/prescribed_stokes_solution/function.h +++ b/include/aspect/prescribed_stokes_solution/function.h @@ -31,8 +31,6 @@ namespace aspect { namespace PrescribedStokesSolution { - using namespace dealii; - /** * A class that implements velocity and pressure solutions based on a * functional description provided in the input file. diff --git a/include/aspect/prescribed_stokes_solution/interface.h b/include/aspect/prescribed_stokes_solution/interface.h index b2a37a8b00a..79b56687b39 100644 --- a/include/aspect/prescribed_stokes_solution/interface.h +++ b/include/aspect/prescribed_stokes_solution/interface.h @@ -40,8 +40,6 @@ namespace aspect */ namespace PrescribedStokesSolution { - using namespace dealii; - /** * This plugin allows the user to prescribe a Stokes solution and can be * thought of as velocity and pressure's equivalent of the initial diff --git a/include/aspect/simulator.h b/include/aspect/simulator.h index 7345e29efdc..eb654c6aee6 100644 --- a/include/aspect/simulator.h +++ b/include/aspect/simulator.h @@ -75,8 +75,6 @@ DEAL_II_ENABLE_EXTRA_DIAGNOSTICS namespace aspect { - using namespace dealii; - template class MeltHandler; diff --git a/include/aspect/simulator/assemblers/interface.h b/include/aspect/simulator/assemblers/interface.h index 4d827c3c85d..0c8a59dce51 100644 --- a/include/aspect/simulator/assemblers/interface.h +++ b/include/aspect/simulator/assemblers/interface.h @@ -29,8 +29,6 @@ namespace aspect { - using namespace dealii; - template class Simulator; diff --git a/include/aspect/simulator_access.h b/include/aspect/simulator_access.h index 556b46fd47d..8f4a74ba4e2 100644 --- a/include/aspect/simulator_access.h +++ b/include/aspect/simulator_access.h @@ -42,8 +42,6 @@ namespace WorldBuilder namespace aspect { - using namespace dealii; - // forward declarations: template class Simulator; template struct SimulatorSignals; diff --git a/include/aspect/solution_evaluator.h b/include/aspect/solution_evaluator.h index 79ab7e14c4f..e1ed4f513a5 100644 --- a/include/aspect/solution_evaluator.h +++ b/include/aspect/solution_evaluator.h @@ -33,8 +33,6 @@ namespace aspect { - using namespace dealii; - namespace internal { /** diff --git a/include/aspect/stokes_matrix_free.h b/include/aspect/stokes_matrix_free.h index 5721636ce0d..cd3376f4ec6 100644 --- a/include/aspect/stokes_matrix_free.h +++ b/include/aspect/stokes_matrix_free.h @@ -51,8 +51,6 @@ using GMGNumberType = double; namespace aspect { - using namespace dealii; - namespace internal { /** diff --git a/include/aspect/structured_data.h b/include/aspect/structured_data.h index 341a871187a..c4c820a430b 100644 --- a/include/aspect/structured_data.h +++ b/include/aspect/structured_data.h @@ -31,8 +31,6 @@ namespace aspect { namespace Utilities { - using namespace dealii; - /** * StructuredDataLookup (formerly AsciiDataLookup) represents structured * data that can be read from files including in ascii format. diff --git a/include/aspect/termination_criteria/interface.h b/include/aspect/termination_criteria/interface.h index f6089e774da..1d974d8a0a9 100644 --- a/include/aspect/termination_criteria/interface.h +++ b/include/aspect/termination_criteria/interface.h @@ -32,8 +32,6 @@ namespace aspect { - using namespace dealii; - template class Simulator; diff --git a/include/aspect/time_stepping/conduction_time_step.h b/include/aspect/time_stepping/conduction_time_step.h index f79c11bfc6d..6dd4f7c9be1 100644 --- a/include/aspect/time_stepping/conduction_time_step.h +++ b/include/aspect/time_stepping/conduction_time_step.h @@ -29,8 +29,6 @@ namespace aspect { namespace TimeStepping { - using namespace dealii; - /** * Compute the conduction time step based on the current solution and * return this as the time step. diff --git a/include/aspect/time_stepping/convection_time_step.h b/include/aspect/time_stepping/convection_time_step.h index 3dd2d56ee47..def4be140f1 100644 --- a/include/aspect/time_stepping/convection_time_step.h +++ b/include/aspect/time_stepping/convection_time_step.h @@ -29,8 +29,6 @@ namespace aspect { namespace TimeStepping { - using namespace dealii; - /** * Compute the convection time step based on the current solution and * return it. diff --git a/include/aspect/time_stepping/function.h b/include/aspect/time_stepping/function.h index 0a1608f0674..3ea6aa6a999 100644 --- a/include/aspect/time_stepping/function.h +++ b/include/aspect/time_stepping/function.h @@ -29,8 +29,6 @@ namespace aspect { namespace TimeStepping { - using namespace dealii; - /** * A class that implements a time stepping plugin on a function * description provided in the input file. diff --git a/include/aspect/time_stepping/interface.h b/include/aspect/time_stepping/interface.h index 9bd89fd3b81..699c63b1deb 100644 --- a/include/aspect/time_stepping/interface.h +++ b/include/aspect/time_stepping/interface.h @@ -28,8 +28,6 @@ namespace aspect { - using namespace dealii; - /** * A namespace containing all class related to the time stepping plugin system. */ diff --git a/include/aspect/time_stepping/repeat_on_cutback.h b/include/aspect/time_stepping/repeat_on_cutback.h index 624e2b90cea..823d9dbce2f 100644 --- a/include/aspect/time_stepping/repeat_on_cutback.h +++ b/include/aspect/time_stepping/repeat_on_cutback.h @@ -28,8 +28,6 @@ namespace aspect { namespace TimeStepping { - using namespace dealii; - /** * A class that implements a time stepping plugin to repeat a time step if the * next time step is significantly smaller than the last step. diff --git a/include/aspect/time_stepping/repeat_on_nonlinear_fail.h b/include/aspect/time_stepping/repeat_on_nonlinear_fail.h index 9ec548838c0..1edfbc5273d 100644 --- a/include/aspect/time_stepping/repeat_on_nonlinear_fail.h +++ b/include/aspect/time_stepping/repeat_on_nonlinear_fail.h @@ -28,8 +28,6 @@ namespace aspect { namespace TimeStepping { - using namespace dealii; - /** * A class that implements a time stepping plugin to repeat a time step if the * nonlinear solver failed to converge in the specified number of iterations. diff --git a/include/aspect/utilities.h b/include/aspect/utilities.h index 43e78a6b8b2..bb25f3865c5 100644 --- a/include/aspect/utilities.h +++ b/include/aspect/utilities.h @@ -53,7 +53,6 @@ namespace aspect */ namespace Utilities { - using namespace dealii; using namespace dealii::Utilities; diff --git a/include/aspect/volume_of_fluid/assembly.h b/include/aspect/volume_of_fluid/assembly.h index dce18ac55ca..55d96a51c0e 100644 --- a/include/aspect/volume_of_fluid/assembly.h +++ b/include/aspect/volume_of_fluid/assembly.h @@ -28,8 +28,6 @@ namespace aspect { - using namespace dealii; - template class Simulator; diff --git a/include/aspect/volume_of_fluid/field.h b/include/aspect/volume_of_fluid/field.h index 2e203d7c797..217a2938e92 100644 --- a/include/aspect/volume_of_fluid/field.h +++ b/include/aspect/volume_of_fluid/field.h @@ -23,8 +23,6 @@ #include -using namespace dealii; - namespace aspect { namespace VolumeOfFluid diff --git a/include/aspect/volume_of_fluid/handler.h b/include/aspect/volume_of_fluid/handler.h index 56be01c21f6..6bf8e1e323f 100644 --- a/include/aspect/volume_of_fluid/handler.h +++ b/include/aspect/volume_of_fluid/handler.h @@ -28,8 +28,6 @@ #include -using namespace dealii; - namespace aspect { /** diff --git a/include/aspect/volume_of_fluid/utilities.h b/include/aspect/volume_of_fluid/utilities.h index 2f24459144b..fe9c6c504f7 100644 --- a/include/aspect/volume_of_fluid/utilities.h +++ b/include/aspect/volume_of_fluid/utilities.h @@ -31,8 +31,6 @@ namespace aspect { namespace Utilities { - using namespace dealii; - /** * Function to calculate volume fraction contained by indicator function * H(d-normal*(x'-x_{cen}')) on the [0, 1]^dim unit cell where x_{cen} is diff --git a/source/material_model/grain_size.cc b/source/material_model/grain_size.cc index b13cf450e01..31d74d38ae6 100644 --- a/source/material_model/grain_size.cc +++ b/source/material_model/grain_size.cc @@ -28,8 +28,6 @@ #include #include -using namespace dealii; - namespace aspect { namespace MaterialModel diff --git a/source/volume_of_fluid/handler.cc b/source/volume_of_fluid/handler.cc index 74dc2d21e0d..87ef38c5bb7 100644 --- a/source/volume_of_fluid/handler.cc +++ b/source/volume_of_fluid/handler.cc @@ -31,8 +31,6 @@ #include #include -using namespace dealii; - namespace aspect { namespace internal diff --git a/source/volume_of_fluid/reconstruct.cc b/source/volume_of_fluid/reconstruct.cc index bae4c639a57..6ed4f4a8a4f 100644 --- a/source/volume_of_fluid/reconstruct.cc +++ b/source/volume_of_fluid/reconstruct.cc @@ -25,8 +25,6 @@ namespace aspect { - using namespace dealii; - template <> void VolumeOfFluidHandler<2>::update_volume_of_fluid_normals (const VolumeOfFluidField<2> &field, LinearAlgebra::BlockVector &solution) diff --git a/source/volume_of_fluid/setup_initial_conditions.cc b/source/volume_of_fluid/setup_initial_conditions.cc index 96a2371a119..ebfdf123acb 100644 --- a/source/volume_of_fluid/setup_initial_conditions.cc +++ b/source/volume_of_fluid/setup_initial_conditions.cc @@ -28,8 +28,6 @@ namespace aspect { - using namespace dealii; - template void VolumeOfFluidHandler::set_initial_volume_fractions () { diff --git a/source/volume_of_fluid/utilities.cc b/source/volume_of_fluid/utilities.cc index 05630f02a2e..f24839d516c 100644 --- a/source/volume_of_fluid/utilities.cc +++ b/source/volume_of_fluid/utilities.cc @@ -26,9 +26,6 @@ namespace aspect { namespace Utilities { - using namespace dealii; - - double compute_fluid_fraction (const Tensor<1, 2> normal, const double d) { diff --git a/tests/additional_outputs_02.cc b/tests/additional_outputs_02.cc index 8323fb2e583..2672d126ffe 100644 --- a/tests/additional_outputs_02.cc +++ b/tests/additional_outputs_02.cc @@ -34,7 +34,6 @@ namespace aspect { namespace MaterialModel { - using namespace dealii; template class AdditionalOutputs1 : public AdditionalMaterialOutputs { diff --git a/tests/additional_outputs_03.cc b/tests/additional_outputs_03.cc index 871eaa60c29..4ed5e9b0eba 100644 --- a/tests/additional_outputs_03.cc +++ b/tests/additional_outputs_03.cc @@ -34,7 +34,6 @@ namespace aspect { namespace MaterialModel { - using namespace dealii; template class AdditionalOutputs1 : public AdditionalMaterialOutputs { diff --git a/tests/anisotropic_viscosity.cc b/tests/anisotropic_viscosity.cc index b41d1e35892..bbc62e3dc1f 100644 --- a/tests/anisotropic_viscosity.cc +++ b/tests/anisotropic_viscosity.cc @@ -604,8 +604,6 @@ namespace aspect namespace MaterialModel { - using namespace dealii; - template class Anisotropic : public MaterialModel::Simple { diff --git a/tests/artificial_postprocess.cc b/tests/artificial_postprocess.cc index 39c36b68121..859d0b24910 100644 --- a/tests/artificial_postprocess.cc +++ b/tests/artificial_postprocess.cc @@ -34,8 +34,6 @@ namespace aspect { - using namespace dealii; - template class EVPostprocessor : public Postprocess::Interface, public ::aspect::SimulatorAccess { diff --git a/tests/ascii_boundary_member.cc b/tests/ascii_boundary_member.cc index 16b580f44c3..657339469db 100644 --- a/tests/ascii_boundary_member.cc +++ b/tests/ascii_boundary_member.cc @@ -34,7 +34,6 @@ namespace aspect { - using namespace dealii; /** * A boundary velocity plugin that uses an AsciiDataBoundary object as member */ diff --git a/tests/boundary_heatflux_update.cc b/tests/boundary_heatflux_update.cc index 662e4cbcc07..dc95172ff24 100644 --- a/tests/boundary_heatflux_update.cc +++ b/tests/boundary_heatflux_update.cc @@ -30,8 +30,6 @@ namespace aspect { namespace BoundaryHeatFlux { - using namespace dealii; - /** * A class that implements heat flux boundary conditions based on a * functional description provided in the input file. diff --git a/tests/box_initial_mesh_deformation.cc b/tests/box_initial_mesh_deformation.cc index 85258cc24b0..82c6eb0abf2 100644 --- a/tests/box_initial_mesh_deformation.cc +++ b/tests/box_initial_mesh_deformation.cc @@ -25,8 +25,6 @@ namespace aspect { - using namespace dealii; - namespace MeshDeformation { template diff --git a/tests/burstedde_stokes_rhs.cc b/tests/burstedde_stokes_rhs.cc index 829ef70d862..708cd53b595 100644 --- a/tests/burstedde_stokes_rhs.cc +++ b/tests/burstedde_stokes_rhs.cc @@ -49,8 +49,6 @@ namespace aspect */ namespace BursteddeBenchmark { - using namespace dealii; - namespace AnalyticSolutions { Tensor<1,3> diff --git a/tests/cell_reference.cc b/tests/cell_reference.cc index cafb6a6f936..82363497e41 100644 --- a/tests/cell_reference.cc +++ b/tests/cell_reference.cc @@ -22,8 +22,6 @@ #include #include -using namespace dealii; - namespace aspect { namespace MaterialModel diff --git a/tests/check_compositional_field_functions.cc b/tests/check_compositional_field_functions.cc index 1f66d188d94..a0f227996cd 100644 --- a/tests/check_compositional_field_functions.cc +++ b/tests/check_compositional_field_functions.cc @@ -60,7 +60,6 @@ void f(const aspect::SimulatorAccess<2> &, template void signal_connector (aspect::SimulatorSignals &signals) { - using namespace dealii; std::cout << "* Connecting signals" << std::endl; signals.set_assemblers.connect (std::bind(&f, std::placeholders::_1, diff --git a/tests/check_compositional_field_names.cc b/tests/check_compositional_field_names.cc index 4b126e9d0d9..73ce915ee4b 100644 --- a/tests/check_compositional_field_names.cc +++ b/tests/check_compositional_field_names.cc @@ -65,7 +65,6 @@ void f(const aspect::SimulatorAccess<2> &, template void signal_connector (aspect::SimulatorSignals &signals) { - using namespace dealii; std::cout << "* Connecting signals" << std::endl; signals.set_assemblers.connect (std::bind(&f, std::placeholders::_1, diff --git a/tests/composite_viscous_outputs.cc b/tests/composite_viscous_outputs.cc index 994c5c899a3..542d2f29519 100644 --- a/tests/composite_viscous_outputs.cc +++ b/tests/composite_viscous_outputs.cc @@ -200,7 +200,6 @@ void f(const aspect::SimulatorAccess<2> &, template void signal_connector (aspect::SimulatorSignals &signals) { - using namespace dealii; std::cout << "* Connecting signals" << std::endl; signals.set_assemblers.connect (std::bind(&f, std::placeholders::_1, diff --git a/tests/composite_viscous_outputs_isostress.cc b/tests/composite_viscous_outputs_isostress.cc index 43bd2c423e6..110e3e861d9 100644 --- a/tests/composite_viscous_outputs_isostress.cc +++ b/tests/composite_viscous_outputs_isostress.cc @@ -202,7 +202,6 @@ void f(const aspect::SimulatorAccess<2> &, template void signal_connector (aspect::SimulatorSignals &signals) { - using namespace dealii; std::cout << "* Connecting signals" << std::endl; signals.set_assemblers.connect (std::bind(&f, std::placeholders::_1, diff --git a/tests/composite_viscous_outputs_limited.cc b/tests/composite_viscous_outputs_limited.cc index a60cacb8d4e..08bbf4b895d 100644 --- a/tests/composite_viscous_outputs_limited.cc +++ b/tests/composite_viscous_outputs_limited.cc @@ -211,7 +211,6 @@ void f(const aspect::SimulatorAccess<2> &, template void signal_connector (aspect::SimulatorSignals &signals) { - using namespace dealii; std::cout << "* Connecting signals" << std::endl; signals.set_assemblers.connect (std::bind(&f, std::placeholders::_1, diff --git a/tests/composite_viscous_outputs_no_peierls.cc b/tests/composite_viscous_outputs_no_peierls.cc index 302a2fbbba6..ef6ef4c702b 100644 --- a/tests/composite_viscous_outputs_no_peierls.cc +++ b/tests/composite_viscous_outputs_no_peierls.cc @@ -190,7 +190,6 @@ void f(const aspect::SimulatorAccess<2> &, template void signal_connector (aspect::SimulatorSignals &signals) { - using namespace dealii; std::cout << "* Connecting signals" << std::endl; signals.set_assemblers.connect (std::bind(&f, std::placeholders::_1, diff --git a/tests/composite_viscous_outputs_phases.cc b/tests/composite_viscous_outputs_phases.cc index 7415ac90e27..c4fc9e024c9 100644 --- a/tests/composite_viscous_outputs_phases.cc +++ b/tests/composite_viscous_outputs_phases.cc @@ -250,7 +250,6 @@ void f(const aspect::SimulatorAccess<2> &, template void signal_connector (aspect::SimulatorSignals &signals) { - using namespace dealii; std::cout << "* Connecting signals" << std::endl; signals.set_assemblers.connect (std::bind(&f, std::placeholders::_1, diff --git a/tests/composition_active_with_melt.cc b/tests/composition_active_with_melt.cc index 9e99dfd3ab8..5362a0fc61e 100644 --- a/tests/composition_active_with_melt.cc +++ b/tests/composition_active_with_melt.cc @@ -29,8 +29,6 @@ namespace aspect { - using namespace dealii; - template class SimpleWithMelt: public MaterialModel::MeltInterface diff --git a/tests/composition_reaction_iterated_IMPES.cc b/tests/composition_reaction_iterated_IMPES.cc index 7e3f2f9d32e..210fa16cd0d 100644 --- a/tests/composition_reaction_iterated_IMPES.cc +++ b/tests/composition_reaction_iterated_IMPES.cc @@ -32,8 +32,6 @@ namespace aspect { namespace MaterialModel { - using namespace dealii; - template class IteratedReaction : public MaterialModel::CompositionReaction { diff --git a/tests/compressibility.cc b/tests/compressibility.cc index 084cef70d48..1206c6675cf 100644 --- a/tests/compressibility.cc +++ b/tests/compressibility.cc @@ -25,8 +25,6 @@ namespace aspect { namespace MaterialModel { - using namespace dealii; - template class Compressibility : public MaterialModel::Simple { diff --git a/tests/compressibility_iterated_stokes.cc b/tests/compressibility_iterated_stokes.cc index f9e548c05fb..e8c8f4ab62b 100644 --- a/tests/compressibility_iterated_stokes.cc +++ b/tests/compressibility_iterated_stokes.cc @@ -26,8 +26,6 @@ namespace aspect { namespace MaterialModel { - using namespace dealii; - template class CompressibilityIteratedStokes : public MaterialModel::Simple { diff --git a/tests/compression_heating.cc b/tests/compression_heating.cc index 4eb0171708b..88b52f19b28 100644 --- a/tests/compression_heating.cc +++ b/tests/compression_heating.cc @@ -27,8 +27,6 @@ namespace aspect { namespace MaterialModel { - using namespace dealii; - template class Compression : public MaterialModel::MeltGlobal { diff --git a/tests/cookbook_simpler_with_crust.cc b/tests/cookbook_simpler_with_crust.cc index da3179eff95..1d7f903fc7d 100644 --- a/tests/cookbook_simpler_with_crust.cc +++ b/tests/cookbook_simpler_with_crust.cc @@ -31,8 +31,6 @@ namespace aspect { namespace MaterialModel { - using namespace dealii; - /** * A material model similar to the "simpler" material model, but where the * viscosity has two different values dependent on whether we are above or diff --git a/tests/coordinate_transformation.cc b/tests/coordinate_transformation.cc index fe8e3491891..8a5e117df98 100644 --- a/tests/coordinate_transformation.cc +++ b/tests/coordinate_transformation.cc @@ -23,7 +23,6 @@ #include -using namespace dealii; using namespace aspect::Utilities; // Check various conversions between cartesian and spherical coordinates diff --git a/tests/drucker_prager_derivatives_2d.cc b/tests/drucker_prager_derivatives_2d.cc index c87f38afb30..61404f38416 100644 --- a/tests/drucker_prager_derivatives_2d.cc +++ b/tests/drucker_prager_derivatives_2d.cc @@ -236,7 +236,6 @@ void f(const aspect::SimulatorAccess<3> &, template void signal_connector (aspect::SimulatorSignals &signals) { - using namespace dealii; std::cout << "* Connecting signals" << std::endl; signals.set_assemblers.connect (std::bind(&f, std::placeholders::_1, diff --git a/tests/drucker_prager_derivatives_3d.cc b/tests/drucker_prager_derivatives_3d.cc index 65b317b63a8..2e8c3281178 100644 --- a/tests/drucker_prager_derivatives_3d.cc +++ b/tests/drucker_prager_derivatives_3d.cc @@ -251,7 +251,6 @@ void f(const aspect::SimulatorAccess<2> &, template void signal_connector (aspect::SimulatorSignals &signals) { - using namespace dealii; std::cout << "* Connecting signals" << std::endl; signals.set_assemblers.connect (std::bind(&f, std::placeholders::_1, diff --git a/tests/edit_parameters.cc b/tests/edit_parameters.cc index 695cb1501ab..66ff54fba49 100644 --- a/tests/edit_parameters.cc +++ b/tests/edit_parameters.cc @@ -25,8 +25,6 @@ namespace aspect { - using namespace dealii; - // Global variables (to be set by parameters) unsigned int switch_step; bool switched; diff --git a/tests/ellipsoidal_chunk_geometry.cc b/tests/ellipsoidal_chunk_geometry.cc index 2e44fe3d28b..0b6baa1d2cf 100644 --- a/tests/ellipsoidal_chunk_geometry.cc +++ b/tests/ellipsoidal_chunk_geometry.cc @@ -26,8 +26,6 @@ #include using namespace aspect; -using namespace dealii; - bool test_point(const GeometryModel::internal::EllipsoidalChunkGeometry<3> ellipsoidal_manifold, const Point<3> &test_point) { diff --git a/tests/free_surface_blob_melt.cc b/tests/free_surface_blob_melt.cc index 4203dac0e97..c80753e77c6 100644 --- a/tests/free_surface_blob_melt.cc +++ b/tests/free_surface_blob_melt.cc @@ -25,8 +25,6 @@ namespace aspect { namespace MaterialModel { - using namespace dealii; - template class MeltFreeSurface : public MaterialModel::MeltFractionModel, public MaterialModel::MeltInterface, public ::aspect::SimulatorAccess { diff --git a/tests/global_refine_amr.cc b/tests/global_refine_amr.cc index a98892ff04a..f7a94a5e543 100644 --- a/tests/global_refine_amr.cc +++ b/tests/global_refine_amr.cc @@ -25,9 +25,6 @@ #include -using namespace dealii; - - namespace aspect { template diff --git a/tests/grain_size_latent_heat.cc b/tests/grain_size_latent_heat.cc index bf2316e12d1..ad9fb2f9df7 100644 --- a/tests/grain_size_latent_heat.cc +++ b/tests/grain_size_latent_heat.cc @@ -32,8 +32,6 @@ namespace aspect { namespace MaterialModel { - using namespace dealii; - /** * A material model that behaves in the same way as the grain size model, but is modified to * resemble the latent heat benchmark. Due to the nature of the benchmark the model needs to be diff --git a/tests/heat_advection_by_melt.cc b/tests/heat_advection_by_melt.cc index 3e092d644a0..12771ed394e 100644 --- a/tests/heat_advection_by_melt.cc +++ b/tests/heat_advection_by_melt.cc @@ -60,8 +60,6 @@ namespace aspect namespace MaterialModel { - using namespace dealii; - template class Advection : public MaterialModel::MeltGlobal { diff --git a/tests/latent_heat_enthalpy.cc b/tests/latent_heat_enthalpy.cc index fcf5b908d62..63a572d7488 100644 --- a/tests/latent_heat_enthalpy.cc +++ b/tests/latent_heat_enthalpy.cc @@ -33,8 +33,6 @@ namespace aspect { namespace MaterialModel { - using namespace dealii; - template class LatentHeatEnthalpy : public MaterialModel::Interface, public ::aspect::SimulatorAccess { diff --git a/tests/melt_introspection.cc b/tests/melt_introspection.cc index c34f4457c56..bbd2e704bc3 100644 --- a/tests/melt_introspection.cc +++ b/tests/melt_introspection.cc @@ -28,8 +28,6 @@ #include #include -using namespace dealii; - namespace aspect { diff --git a/tests/melt_material_4.cc b/tests/melt_material_4.cc index e7d54378841..41c3c751405 100644 --- a/tests/melt_material_4.cc +++ b/tests/melt_material_4.cc @@ -33,9 +33,6 @@ #include #include -using namespace dealii; - - namespace aspect { template diff --git a/tests/melt_visco_plastic.cc b/tests/melt_visco_plastic.cc index 8eac270c9c2..91699bfbdc6 100644 --- a/tests/melt_visco_plastic.cc +++ b/tests/melt_visco_plastic.cc @@ -37,8 +37,6 @@ namespace aspect { namespace MaterialModel { - using namespace dealii; - /** * Additional output fields for the plastic parameters weakened (or hardened) * by strain to be added to the MaterialModel::MaterialModelOutputs structure @@ -253,8 +251,6 @@ namespace aspect namespace MaterialModel { - using namespace dealii; - namespace { std::vector make_plastic_additional_outputs_names() diff --git a/tests/melting_rate.cc b/tests/melting_rate.cc index a9b5467a616..45fd5842a90 100644 --- a/tests/melting_rate.cc +++ b/tests/melting_rate.cc @@ -32,9 +32,6 @@ #include #include -using namespace dealii; - - namespace aspect { template diff --git a/tests/multiple_named_additional_outputs.cc b/tests/multiple_named_additional_outputs.cc index 9ddb75ca0da..7ac57b2dc1b 100644 --- a/tests/multiple_named_additional_outputs.cc +++ b/tests/multiple_named_additional_outputs.cc @@ -25,8 +25,6 @@ namespace aspect { namespace MaterialModel { - using namespace dealii; - template class PrescribedFieldMaterial : public MaterialModel::Simple { diff --git a/tests/no_adiabatic_heating.cc b/tests/no_adiabatic_heating.cc index 439e10250a9..07173deb697 100644 --- a/tests/no_adiabatic_heating.cc +++ b/tests/no_adiabatic_heating.cc @@ -26,8 +26,6 @@ namespace aspect { namespace MaterialModel { - using namespace dealii; - template class NoAdiabaticHeating : public CompressibilityIteratedStokes { diff --git a/tests/no_adiabatic_heating_02.cc b/tests/no_adiabatic_heating_02.cc index 1b5ed90f274..4d6447b126a 100644 --- a/tests/no_adiabatic_heating_02.cc +++ b/tests/no_adiabatic_heating_02.cc @@ -26,8 +26,6 @@ namespace aspect { namespace MaterialModel { - using namespace dealii; - template class NoAdiabaticHeating : public CompressibilityIteratedStokes { diff --git a/tests/no_adiabatic_heating_03.cc b/tests/no_adiabatic_heating_03.cc index 439e10250a9..07173deb697 100644 --- a/tests/no_adiabatic_heating_03.cc +++ b/tests/no_adiabatic_heating_03.cc @@ -26,8 +26,6 @@ namespace aspect { namespace MaterialModel { - using namespace dealii; - template class NoAdiabaticHeating : public CompressibilityIteratedStokes { diff --git a/tests/own_gravity.cc b/tests/own_gravity.cc index af3950f828b..e4ef8057cb6 100644 --- a/tests/own_gravity.cc +++ b/tests/own_gravity.cc @@ -22,9 +22,6 @@ #include #include -using namespace dealii; - - template class MyGravity : public aspect::GravityModel::Interface diff --git a/tests/prescribed_dilation.cc b/tests/prescribed_dilation.cc index 6873d6a8f36..c0793f9e218 100644 --- a/tests/prescribed_dilation.cc +++ b/tests/prescribed_dilation.cc @@ -34,8 +34,6 @@ namespace aspect { namespace Benchmark { - using namespace dealii; - /** * u = cos(y), sin(x)+xy * p = 2/3 eta x diff --git a/tests/prescribed_field.cc b/tests/prescribed_field.cc index c4c3a040ad8..85e6ea59c25 100644 --- a/tests/prescribed_field.cc +++ b/tests/prescribed_field.cc @@ -25,8 +25,6 @@ namespace aspect { namespace MaterialModel { - using namespace dealii; - template class PrescribedFieldMaterial : public MaterialModel::Simple { diff --git a/tests/prescribed_field_temperature.cc b/tests/prescribed_field_temperature.cc index 17b6d5a7076..bd161fb74a5 100644 --- a/tests/prescribed_field_temperature.cc +++ b/tests/prescribed_field_temperature.cc @@ -25,8 +25,6 @@ namespace aspect { namespace MaterialModel { - using namespace dealii; - template class PrescribedFieldMaterial : public MaterialModel::Simple { diff --git a/tests/prescribed_field_with_diffusion.cc b/tests/prescribed_field_with_diffusion.cc index a1aa6fc4415..803f9dc3cc3 100644 --- a/tests/prescribed_field_with_diffusion.cc +++ b/tests/prescribed_field_with_diffusion.cc @@ -25,8 +25,6 @@ namespace aspect { namespace MaterialModel { - using namespace dealii; - template class PrescribedFieldMaterial : public MaterialModel::Simple { diff --git a/tests/prescribed_temperature.cc b/tests/prescribed_temperature.cc index 62687b0c5fd..1821fa43649 100644 --- a/tests/prescribed_temperature.cc +++ b/tests/prescribed_temperature.cc @@ -25,8 +25,6 @@ namespace aspect { namespace MaterialModel { - using namespace dealii; - template class PrescribedTemperatureMaterial : public MaterialModel::Simple { diff --git a/tests/prescribed_temperature_in_field.cc b/tests/prescribed_temperature_in_field.cc index f9409c5632a..45da1519dd3 100644 --- a/tests/prescribed_temperature_in_field.cc +++ b/tests/prescribed_temperature_in_field.cc @@ -28,8 +28,6 @@ namespace aspect { - using namespace dealii; - // Declare and parse additional parameters bool prescribe_internal_temperature; std::vector fixed_compositional_fields; diff --git a/tests/prescribed_temperature_with_diffusion.cc b/tests/prescribed_temperature_with_diffusion.cc index 1c59b9f4eb0..2cae1d5659f 100644 --- a/tests/prescribed_temperature_with_diffusion.cc +++ b/tests/prescribed_temperature_with_diffusion.cc @@ -25,8 +25,6 @@ namespace aspect { namespace MaterialModel { - using namespace dealii; - template class PrescribedTemperatureMaterial : public MaterialModel::Simple { diff --git a/tests/prescribed_velocity_boundary.cc b/tests/prescribed_velocity_boundary.cc index f8e9d98ec96..35c3669d3e0 100644 --- a/tests/prescribed_velocity_boundary.cc +++ b/tests/prescribed_velocity_boundary.cc @@ -36,8 +36,6 @@ namespace aspect { namespace InclusionBenchmark { - using namespace dealii; - namespace AnalyticSolutions { // based on http://geodynamics.org/hg/cs/AMR/Discontinuous_Stokes with permission diff --git a/tests/prescribed_velocity_dgp.cc b/tests/prescribed_velocity_dgp.cc index 30afa2c63f3..55ff39fefce 100644 --- a/tests/prescribed_velocity_dgp.cc +++ b/tests/prescribed_velocity_dgp.cc @@ -27,8 +27,6 @@ namespace aspect { - using namespace dealii; - // Global variables (to be set by parameters) bool prescribe_internal_velocities; diff --git a/tests/pressure_constraint.cc b/tests/pressure_constraint.cc index 2b1f1a84868..0372893d1a3 100644 --- a/tests/pressure_constraint.cc +++ b/tests/pressure_constraint.cc @@ -26,8 +26,6 @@ namespace aspect { - using namespace dealii; - template void modify_constraints (const SimulatorAccess &simulator_access, AffineConstraints ¤t_constraints) diff --git a/tests/q1_q1.cc b/tests/q1_q1.cc index 7a614ac255c..0ed03bd338c 100644 --- a/tests/q1_q1.cc +++ b/tests/q1_q1.cc @@ -39,8 +39,6 @@ namespace aspect { namespace DoneaHuertaBenchmark { - using namespace dealii; - namespace AnalyticSolutions { diff --git a/tests/rheology_scaled_profile.cc b/tests/rheology_scaled_profile.cc index 295c94d8296..2705752ba49 100644 --- a/tests/rheology_scaled_profile.cc +++ b/tests/rheology_scaled_profile.cc @@ -28,8 +28,6 @@ namespace aspect { - using namespace dealii; - namespace MaterialModel { /** diff --git a/tests/rising_melt_blob.cc b/tests/rising_melt_blob.cc index 7a6e3de58e5..5f6fd34485c 100644 --- a/tests/rising_melt_blob.cc +++ b/tests/rising_melt_blob.cc @@ -32,9 +32,6 @@ #include #include -using namespace dealii; - - namespace aspect { template diff --git a/tests/shear_thinning.cc b/tests/shear_thinning.cc index 47997051b48..026a4edb897 100644 --- a/tests/shear_thinning.cc +++ b/tests/shear_thinning.cc @@ -25,8 +25,6 @@ namespace aspect { namespace MaterialModel { - using namespace dealii; - template class ShearThinning : public MaterialModel::Simple { diff --git a/tests/signal_fem.cc b/tests/signal_fem.cc index 43a2872fb9e..edd1ddaeda8 100644 --- a/tests/signal_fem.cc +++ b/tests/signal_fem.cc @@ -27,8 +27,6 @@ #include #include -using namespace dealii; - namespace aspect { diff --git a/tests/simple_shear.cc b/tests/simple_shear.cc index f8688bbe875..6c0d28d068f 100644 --- a/tests/simple_shear.cc +++ b/tests/simple_shear.cc @@ -28,8 +28,6 @@ namespace aspect { namespace MaterialModel { - using namespace dealii; - template class FiniteStrain : public MaterialModel::Simple { diff --git a/tests/simple_shear_output_the_mobility.cc b/tests/simple_shear_output_the_mobility.cc index f8688bbe875..6c0d28d068f 100644 --- a/tests/simple_shear_output_the_mobility.cc +++ b/tests/simple_shear_output_the_mobility.cc @@ -28,8 +28,6 @@ namespace aspect { namespace MaterialModel { - using namespace dealii; - template class FiniteStrain : public MaterialModel::Simple { diff --git a/tests/spiegelman_fail_test.cc b/tests/spiegelman_fail_test.cc index 60ed8005162..706d1013da0 100644 --- a/tests/spiegelman_fail_test.cc +++ b/tests/spiegelman_fail_test.cc @@ -34,8 +34,6 @@ namespace aspect { namespace MaterialModel { - using namespace dealii; - /** * The same material model as Drucker Prager, but this one supports multiple * compositions in a way to reproduce the Spiegelman 2016 paper. diff --git a/tests/visco_plastic_derivatives_2d.cc b/tests/visco_plastic_derivatives_2d.cc index 7fca67dd7ab..1468d4563ff 100644 --- a/tests/visco_plastic_derivatives_2d.cc +++ b/tests/visco_plastic_derivatives_2d.cc @@ -247,7 +247,6 @@ void f(const aspect::SimulatorAccess<3> &, template void signal_connector (aspect::SimulatorSignals &signals) { - using namespace dealii; std::cout << "* Connecting signals" << std::endl; signals.set_assemblers.connect (std::bind(&f, std::placeholders::_1, diff --git a/tests/visco_plastic_derivatives_3d.cc b/tests/visco_plastic_derivatives_3d.cc index e1f213361c7..dcf32291bcd 100644 --- a/tests/visco_plastic_derivatives_3d.cc +++ b/tests/visco_plastic_derivatives_3d.cc @@ -262,7 +262,6 @@ void f(const aspect::SimulatorAccess<2> &, template void signal_connector (aspect::SimulatorSignals &signals) { - using namespace dealii; std::cout << "* Connecting signals" << std::endl; signals.set_assemblers.connect (std::bind(&f, std::placeholders::_1, diff --git a/tests/vof_err_calc.h b/tests/vof_err_calc.h index d51500e7d95..8b7d81bef88 100644 --- a/tests/vof_err_calc.h +++ b/tests/vof_err_calc.h @@ -35,8 +35,6 @@ namespace aspect { namespace Postprocess { - using namespace dealii; - template class VolumeOfFluidSpecifiedSolutionDiff : public Interface, public ::aspect::SimulatorAccess { From 30f7ad2c1ff8eb61361819ec4698bfb5af663cb2 Mon Sep 17 00:00:00 2001 From: Rene Gassmoeller Date: Wed, 29 Jan 2025 16:25:08 +0100 Subject: [PATCH 3/3] Fix tests --- tests/composite_viscous_outputs.cc | 370 ++++++------ tests/composite_viscous_outputs_isostress.cc | 396 ++++++------- tests/composite_viscous_outputs_limited.cc | 392 ++++++------- tests/composite_viscous_outputs_no_peierls.cc | 353 ++++++------ tests/composite_viscous_outputs_phases.cc | 469 +++++++-------- tests/coordinate_transformation.cc | 101 ++-- tests/drucker_prager_derivatives_2d.cc | 375 ++++++------ tests/drucker_prager_derivatives_3d.cc | 405 ++++++------- tests/own_gravity.cc | 29 +- tests/prm_distance_polygon.cc | 101 ++-- tests/simple_nonlinear.cc | 418 +++++++------- tests/spiegelman_material.cc | 544 +++++++++--------- tests/visco_plastic_derivatives_2d.cc | 455 +++++++-------- tests/visco_plastic_derivatives_3d.cc | 485 ++++++++-------- 14 files changed, 2470 insertions(+), 2423 deletions(-) diff --git a/tests/composite_viscous_outputs.cc b/tests/composite_viscous_outputs.cc index 542d2f29519..70a2f7c0c11 100644 --- a/tests/composite_viscous_outputs.cc +++ b/tests/composite_viscous_outputs.cc @@ -22,189 +22,193 @@ #include #include -template -void f(const aspect::SimulatorAccess &simulator_access, - aspect::Assemblers::Manager &) +namespace aspect { - // This function tests whether the composite creep rheology is producing - // the correct composite viscosity and partial strain rates corresponding to - // the different creep mechanisms incorporated into the rheology. - // It is assumed that each individual creep mechanism has already been tested. - - using namespace aspect::MaterialModel; - - // First, we set up a few objects which are used by the rheology model. - aspect::ParameterHandler prm; - const std::vector list_of_composition_names = simulator_access.introspection().get_composition_names(); - auto n_phases = std::make_unique>(1); // 1 phase per composition - const unsigned int composition = 0; - const std::vector volume_fractions = {1.}; - const std::vector phase_function_values = std::vector(); - const std::vector n_phase_transitions_per_composition = std::vector(1); - - // Next, we initialise instances of the composite rheology and - // individual creep mechanisms. - std::unique_ptr> composite_creep; - composite_creep = std::make_unique>(); - composite_creep->initialize_simulator (simulator_access.get_simulator()); - composite_creep->declare_parameters(prm); - prm.set("Viscosity averaging scheme", "isostrain"); - prm.set("Include diffusion creep in composite rheology", "true"); - prm.set("Include dislocation creep in composite rheology", "true"); - prm.set("Include Peierls creep in composite rheology", "true"); - prm.set("Include Drucker Prager plasticity in composite rheology", "true"); - prm.set("Peierls creep flow law", "viscosity approximation"); - prm.set("Maximum yield stress", "5e8"); - composite_creep->parse_parameters(prm); - - std::unique_ptr> diffusion_creep; - diffusion_creep = std::make_unique>(); - diffusion_creep->initialize_simulator (simulator_access.get_simulator()); - diffusion_creep->declare_parameters(prm); - diffusion_creep->parse_parameters(prm); - - std::unique_ptr> dislocation_creep; - dislocation_creep = std::make_unique>(); - dislocation_creep->initialize_simulator (simulator_access.get_simulator()); - dislocation_creep->declare_parameters(prm); - dislocation_creep->parse_parameters(prm); - - std::unique_ptr> peierls_creep; - peierls_creep = std::make_unique>(); - peierls_creep->initialize_simulator (simulator_access.get_simulator()); - peierls_creep->declare_parameters(prm); - peierls_creep->parse_parameters(prm); - - std::unique_ptr> drucker_prager_power; - drucker_prager_power = std::make_unique>(); - drucker_prager_power->initialize_simulator (simulator_access.get_simulator()); - drucker_prager_power->declare_parameters(prm); - prm.set("Maximum yield stress", "5e8"); - drucker_prager_power->parse_parameters(prm); - Rheology::DruckerPragerParameters p = drucker_prager_power->compute_drucker_prager_parameters(composition, phase_function_values, n_phase_transitions_per_composition); - - // The creep components are arranged in series with each other. - // This package of components is then arranged in parallel with - // a strain rate limiter with a constant viscosity lim_visc. - // The whole system is then arranged in series with a viscosity limiter with - // viscosity max_visc. - // lim_visc is equal to (min_visc*max_visc)/(max_visc - min_visc) - double min_visc = prm.get_double("Minimum viscosity"); - double max_visc = prm.get_double("Maximum viscosity"); - double lim_visc = (min_visc*max_visc)/(max_visc - min_visc); - - // Assign values to the variables which will be passed to compute_viscosity - // The test involves pure shear calculations at 1 GPa and variable temperature - double temperature; - const double pressure = 1.e9; - const double grain_size = 1.e-3; - SymmetricTensor<2,dim> strain_rate; - strain_rate[0][0] = -1e-11; - strain_rate[0][1] = 0.; - strain_rate[1][1] = 1e-11; - strain_rate[2][0] = 0.; - strain_rate[2][1] = 0.; - strain_rate[2][2] = 0.; - - std::cout << "temperature (K) eta (Pas) creep stress (Pa) edot_ii (/s) edot_ii fractions (diff, disl, prls, drpr, max)" << std::endl; - - // Loop through strain rates, tracking whether there is a discrepancy in - // the decomposed strain rates. - bool error = false; - double viscosity; - double total_strain_rate; - double creep_strain_rate; - double creep_stress; - double diff_stress; - double disl_stress; - double prls_stress; - double drpr_stress; - std::vector partial_strain_rates(5, 0.); - - for (unsigned int i=0; i <= 10; i++) - { - temperature = 1000. + i*100.; - - // Compute the viscosity - viscosity = composite_creep->compute_viscosity(pressure, temperature, grain_size, volume_fractions, strain_rate, partial_strain_rates); - total_strain_rate = std::accumulate(partial_strain_rates.begin(), partial_strain_rates.end(), 0.); - - // The creep strain rate is calculated by subtracting the strain rate - // of the max viscosity dashpot from the total strain rate - // The creep stress is then calculated by subtracting the stress running - // through the strain rate limiter from the total stress - creep_strain_rate = total_strain_rate - partial_strain_rates[4]; - creep_stress = 2.*(viscosity*total_strain_rate - lim_visc*creep_strain_rate); - - // Print the output - std::cout << temperature << ' ' << viscosity << ' ' << creep_stress << ' ' << total_strain_rate; - for (unsigned int i=0; i < partial_strain_rates.size(); ++i) - { - std::cout << ' ' << partial_strain_rates[i]/total_strain_rate; - } - std::cout << std::endl; - - // The following lines test that each individual creep mechanism - // experiences the same creep stress - - // Each creep mechanism should experience the same stress - diff_stress = 2.*partial_strain_rates[0]*diffusion_creep->compute_viscosity(pressure, temperature, grain_size, composition); - disl_stress = 2.*partial_strain_rates[1]*dislocation_creep->compute_viscosity(partial_strain_rates[1], pressure, temperature, composition); - prls_stress = 2.*partial_strain_rates[2]*peierls_creep->compute_viscosity(partial_strain_rates[2], pressure, temperature, composition); - if (partial_strain_rates[3] > 0.) - { - drpr_stress = 2.*partial_strain_rates[3]*drucker_prager_power->compute_viscosity(p.cohesion, - p.angle_internal_friction, - pressure, - partial_strain_rates[3], - p.max_yield_stress); - } - else - { - drpr_stress = creep_stress; - } - - if ((std::fabs((diff_stress - creep_stress)/creep_stress) > 1e-6) - || (std::fabs((disl_stress - creep_stress)/creep_stress) > 1e-6) - || (std::fabs((prls_stress - creep_stress)/creep_stress) > 1e-6) - || (std::fabs((drpr_stress - creep_stress)/creep_stress) > 1e-6)) - { - error = true; - std::cout << " creep stress: " << creep_stress; - std::cout << " diffusion stress: " << diff_stress; - std::cout << " dislocation stress: " << disl_stress; - std::cout << " peierls stress: " << prls_stress; - std::cout << " drucker prager stress: " << drpr_stress << std::endl; - } - } - - if (error) - { - std::cout << " Error: The individual creep stresses differ by more than the required tolerance." << std::endl; - std::cout << "Some parts of the test were not successful." << std::endl; - } - else - { - std::cout << "OK" << std::endl; - } + template + void f(const aspect::SimulatorAccess &simulator_access, + aspect::Assemblers::Manager &) + { + // This function tests whether the composite creep rheology is producing + // the correct composite viscosity and partial strain rates corresponding to + // the different creep mechanisms incorporated into the rheology. + // It is assumed that each individual creep mechanism has already been tested. + + using namespace aspect::MaterialModel; + + // First, we set up a few objects which are used by the rheology model. + aspect::ParameterHandler prm; + const std::vector list_of_composition_names = simulator_access.introspection().get_composition_names(); + auto n_phases = std::make_unique>(1); // 1 phase per composition + const unsigned int composition = 0; + const std::vector volume_fractions = {1.}; + const std::vector phase_function_values = std::vector(); + const std::vector n_phase_transitions_per_composition = std::vector(1); + + // Next, we initialise instances of the composite rheology and + // individual creep mechanisms. + std::unique_ptr> composite_creep; + composite_creep = std::make_unique>(); + composite_creep->initialize_simulator (simulator_access.get_simulator()); + composite_creep->declare_parameters(prm); + prm.set("Viscosity averaging scheme", "isostrain"); + prm.set("Include diffusion creep in composite rheology", "true"); + prm.set("Include dislocation creep in composite rheology", "true"); + prm.set("Include Peierls creep in composite rheology", "true"); + prm.set("Include Drucker Prager plasticity in composite rheology", "true"); + prm.set("Peierls creep flow law", "viscosity approximation"); + prm.set("Maximum yield stress", "5e8"); + composite_creep->parse_parameters(prm); + + std::unique_ptr> diffusion_creep; + diffusion_creep = std::make_unique>(); + diffusion_creep->initialize_simulator (simulator_access.get_simulator()); + diffusion_creep->declare_parameters(prm); + diffusion_creep->parse_parameters(prm); + + std::unique_ptr> dislocation_creep; + dislocation_creep = std::make_unique>(); + dislocation_creep->initialize_simulator (simulator_access.get_simulator()); + dislocation_creep->declare_parameters(prm); + dislocation_creep->parse_parameters(prm); + + std::unique_ptr> peierls_creep; + peierls_creep = std::make_unique>(); + peierls_creep->initialize_simulator (simulator_access.get_simulator()); + peierls_creep->declare_parameters(prm); + peierls_creep->parse_parameters(prm); + + std::unique_ptr> drucker_prager_power; + drucker_prager_power = std::make_unique>(); + drucker_prager_power->initialize_simulator (simulator_access.get_simulator()); + drucker_prager_power->declare_parameters(prm); + prm.set("Maximum yield stress", "5e8"); + drucker_prager_power->parse_parameters(prm); + Rheology::DruckerPragerParameters p = drucker_prager_power->compute_drucker_prager_parameters(composition, phase_function_values, n_phase_transitions_per_composition); + + // The creep components are arranged in series with each other. + // This package of components is then arranged in parallel with + // a strain rate limiter with a constant viscosity lim_visc. + // The whole system is then arranged in series with a viscosity limiter with + // viscosity max_visc. + // lim_visc is equal to (min_visc*max_visc)/(max_visc - min_visc) + double min_visc = prm.get_double("Minimum viscosity"); + double max_visc = prm.get_double("Maximum viscosity"); + double lim_visc = (min_visc*max_visc)/(max_visc - min_visc); + + // Assign values to the variables which will be passed to compute_viscosity + // The test involves pure shear calculations at 1 GPa and variable temperature + double temperature; + const double pressure = 1.e9; + const double grain_size = 1.e-3; + SymmetricTensor<2,dim> strain_rate; + strain_rate[0][0] = -1e-11; + strain_rate[0][1] = 0.; + strain_rate[1][1] = 1e-11; + strain_rate[2][0] = 0.; + strain_rate[2][1] = 0.; + strain_rate[2][2] = 0.; + + std::cout << "temperature (K) eta (Pas) creep stress (Pa) edot_ii (/s) edot_ii fractions (diff, disl, prls, drpr, max)" << std::endl; + + // Loop through strain rates, tracking whether there is a discrepancy in + // the decomposed strain rates. + bool error = false; + double viscosity; + double total_strain_rate; + double creep_strain_rate; + double creep_stress; + double diff_stress; + double disl_stress; + double prls_stress; + double drpr_stress; + std::vector partial_strain_rates(5, 0.); + + for (unsigned int i=0; i <= 10; i++) + { + temperature = 1000. + i*100.; + + // Compute the viscosity + viscosity = composite_creep->compute_viscosity(pressure, temperature, grain_size, volume_fractions, strain_rate, partial_strain_rates); + total_strain_rate = std::accumulate(partial_strain_rates.begin(), partial_strain_rates.end(), 0.); + + // The creep strain rate is calculated by subtracting the strain rate + // of the max viscosity dashpot from the total strain rate + // The creep stress is then calculated by subtracting the stress running + // through the strain rate limiter from the total stress + creep_strain_rate = total_strain_rate - partial_strain_rates[4]; + creep_stress = 2.*(viscosity*total_strain_rate - lim_visc*creep_strain_rate); + + // Print the output + std::cout << temperature << ' ' << viscosity << ' ' << creep_stress << ' ' << total_strain_rate; + for (unsigned int i=0; i < partial_strain_rates.size(); ++i) + { + std::cout << ' ' << partial_strain_rates[i]/total_strain_rate; + } + std::cout << std::endl; + + // The following lines test that each individual creep mechanism + // experiences the same creep stress + + // Each creep mechanism should experience the same stress + diff_stress = 2.*partial_strain_rates[0]*diffusion_creep->compute_viscosity(pressure, temperature, grain_size, composition); + disl_stress = 2.*partial_strain_rates[1]*dislocation_creep->compute_viscosity(partial_strain_rates[1], pressure, temperature, composition); + prls_stress = 2.*partial_strain_rates[2]*peierls_creep->compute_viscosity(partial_strain_rates[2], pressure, temperature, composition); + if (partial_strain_rates[3] > 0.) + { + drpr_stress = 2.*partial_strain_rates[3]*drucker_prager_power->compute_viscosity(p.cohesion, + p.angle_internal_friction, + pressure, + partial_strain_rates[3], + p.max_yield_stress); + } + else + { + drpr_stress = creep_stress; + } + + if ((std::fabs((diff_stress - creep_stress)/creep_stress) > 1e-6) + || (std::fabs((disl_stress - creep_stress)/creep_stress) > 1e-6) + || (std::fabs((prls_stress - creep_stress)/creep_stress) > 1e-6) + || (std::fabs((drpr_stress - creep_stress)/creep_stress) > 1e-6)) + { + error = true; + std::cout << " creep stress: " << creep_stress; + std::cout << " diffusion stress: " << diff_stress; + std::cout << " dislocation stress: " << disl_stress; + std::cout << " peierls stress: " << prls_stress; + std::cout << " drucker prager stress: " << drpr_stress << std::endl; + } + } + + if (error) + { + std::cout << " Error: The individual creep stresses differ by more than the required tolerance." << std::endl; + std::cout << "Some parts of the test were not successful." << std::endl; + } + else + { + std::cout << "OK" << std::endl; + } + + } + + template <> + void f(const aspect::SimulatorAccess<2> &, + aspect::Assemblers::Manager<2> &) + { + AssertThrow(false,dealii::ExcInternalError()); + } + + template + void signal_connector (aspect::SimulatorSignals &signals) + { + std::cout << "* Connecting signals" << std::endl; + signals.set_assemblers.connect (std::bind(&f, + std::placeholders::_1, + std::placeholders::_2)); + } + + ASPECT_REGISTER_SIGNALS_CONNECTOR(signal_connector<2>, + signal_connector<3>) } - -template <> -void f(const aspect::SimulatorAccess<2> &, - aspect::Assemblers::Manager<2> &) -{ - AssertThrow(false,dealii::ExcInternalError()); -} - -template -void signal_connector (aspect::SimulatorSignals &signals) -{ - std::cout << "* Connecting signals" << std::endl; - signals.set_assemblers.connect (std::bind(&f, - std::placeholders::_1, - std::placeholders::_2)); -} - -ASPECT_REGISTER_SIGNALS_CONNECTOR(signal_connector<2>, - signal_connector<3>) diff --git a/tests/composite_viscous_outputs_isostress.cc b/tests/composite_viscous_outputs_isostress.cc index 110e3e861d9..dd6e30b0481 100644 --- a/tests/composite_viscous_outputs_isostress.cc +++ b/tests/composite_viscous_outputs_isostress.cc @@ -23,215 +23,219 @@ #include #include -template -void f(const aspect::SimulatorAccess &simulator_access, - aspect::Assemblers::Manager &) +namespace aspect { - // This function tests whether the composite creep rheology is producing - // the correct composite viscosity and partial strain rates corresponding to - // the different creep mechanisms incorporated into the rheology. - // It is assumed that each individual creep mechanism has already been tested. - - using namespace aspect::MaterialModel; - - // First, we set up a few objects which are used by the rheology model. - aspect::ParameterHandler prm; - - const std::vector list_of_composition_names = simulator_access.introspection().get_composition_names(); - auto n_phases = std::make_unique>(1); // 1 phase per composition - const unsigned int composition = 0; - const std::vector volume_fractions = {0.6, 0.4}; - const std::vector phase_function_values = std::vector(); - const std::vector n_phase_transitions_per_composition = std::vector(1); - - // Next, we initialise instances of the composite rheology and - // individual creep mechanisms. - std::unique_ptr> composite_creep; - composite_creep = std::make_unique>(); - composite_creep->initialize_simulator (simulator_access.get_simulator()); - composite_creep->declare_parameters(prm); - prm.set("Viscosity averaging scheme", "isostress"); - prm.set("Include diffusion creep in composite rheology", "true"); - prm.set("Include dislocation creep in composite rheology", "true"); - prm.set("Include Peierls creep in composite rheology", "true"); - prm.set("Include Drucker Prager plasticity in composite rheology", "true"); - prm.set("Peierls creep flow law", "viscosity approximation"); - prm.set("Maximum yield stress", "5e8"); - composite_creep->parse_parameters(prm); - - std::unique_ptr> diffusion_creep; - diffusion_creep = std::make_unique>(); - diffusion_creep->initialize_simulator (simulator_access.get_simulator()); - diffusion_creep->declare_parameters(prm); - diffusion_creep->parse_parameters(prm); - - std::unique_ptr> dislocation_creep; - dislocation_creep = std::make_unique>(); - dislocation_creep->initialize_simulator (simulator_access.get_simulator()); - dislocation_creep->declare_parameters(prm); - dislocation_creep->parse_parameters(prm); - - std::unique_ptr> peierls_creep; - peierls_creep = std::make_unique>(); - peierls_creep->initialize_simulator (simulator_access.get_simulator()); - peierls_creep->declare_parameters(prm); - peierls_creep->parse_parameters(prm); - - std::unique_ptr> drucker_prager_power; - drucker_prager_power = std::make_unique>(); - drucker_prager_power->initialize_simulator (simulator_access.get_simulator()); - drucker_prager_power->declare_parameters(prm); - prm.set("Maximum yield stress", "5e8"); - drucker_prager_power->parse_parameters(prm); - Rheology::DruckerPragerParameters p = drucker_prager_power->compute_drucker_prager_parameters(composition, phase_function_values, n_phase_transitions_per_composition); - - // The creep components are arranged in series with each other. - // This package of components is then arranged in parallel with - // a strain rate limiter with a constant viscosity lim_visc. - // The whole system is then arranged in series with a viscosity limiter with - // viscosity max_visc. - // lim_visc is equal to (min_visc*max_visc)/(max_visc - min_visc) - double min_visc = prm.get_double("Minimum viscosity"); - double max_visc = prm.get_double("Maximum viscosity"); - double lim_visc = (min_visc*max_visc)/(max_visc - min_visc); - - // Assign values to the variables which will be passed to compute_viscosity - // The test involves pure shear calculations at 1 GPa and variable temperature - double temperature; - const double pressure = 1.e9; - const double grain_size = 1.e-3; - SymmetricTensor<2,dim> strain_rate; - strain_rate[0][0] = -1e-11; - strain_rate[0][1] = 0.; - strain_rate[1][1] = 1e-11; - strain_rate[2][0] = 0.; - strain_rate[2][1] = 0.; - strain_rate[2][2] = 0.; - - std::cout << "temperature (K) eta (Pas) creep stress (Pa) edot_ii (/s) edot_ii fractions (diff, disl, prls, drpr, max)" << std::endl; - - // Loop through strain rates, tracking whether there is a discrepancy in - // the decomposed strain rates. - bool error = false; - double viscosity; - double total_strain_rate; - double creep_strain_rate; - double creep_stress; - double diff_stress; - double disl_stress; - double prls_stress; - double drpr_stress; - std::vector partial_strain_rates(5, 0.); - - for (unsigned int i=0; i <= 10; i++) - { - temperature = 1000. + i*100.; - - // Compute the viscosity - viscosity = composite_creep->compute_viscosity(pressure, temperature, grain_size, volume_fractions, strain_rate, partial_strain_rates); - total_strain_rate = std::accumulate(partial_strain_rates.begin(), partial_strain_rates.end(), 0.); - - // The creep strain rate is calculated by subtracting the strain rate - // of the max viscosity dashpot from the total strain rate - // The creep stress is then calculated by subtracting the stress running - // through the strain rate limiter from the total stress - creep_strain_rate = total_strain_rate - partial_strain_rates[4]; - creep_stress = 2.*(viscosity*total_strain_rate - lim_visc*creep_strain_rate); - - // Print the output - std::cout << temperature << ' ' << viscosity << ' ' << creep_stress << ' ' << total_strain_rate; - for (unsigned int i=0; i < partial_strain_rates.size(); ++i) - { - std::cout << ' ' << partial_strain_rates[i]/total_strain_rate; - } - std::cout << std::endl; - - // The following lines test that each individual creep mechanism - // experiences the same creep stress - - // Each creep mechanism should experience the same stress - diff_stress = 2.*partial_strain_rates[0]*diffusion_creep->compute_viscosity(pressure, temperature, grain_size, composition); - disl_stress = 2.*partial_strain_rates[1]*dislocation_creep->compute_viscosity(partial_strain_rates[1], pressure, temperature, composition); - prls_stress = 2.*partial_strain_rates[2]*peierls_creep->compute_viscosity(partial_strain_rates[2], pressure, temperature, composition); - if (partial_strain_rates[3] > 0.) - { - drpr_stress = 2.*partial_strain_rates[3]*drucker_prager_power->compute_viscosity(p.cohesion, - p.angle_internal_friction, - pressure, - partial_strain_rates[3], - p.max_yield_stress); - } - else - { - drpr_stress = creep_stress; - } - - if ((std::fabs((diff_stress - creep_stress)/creep_stress) > 1e-6) - || (std::fabs((disl_stress - creep_stress)/creep_stress) > 1e-6) - || (std::fabs((prls_stress - creep_stress)/creep_stress) > 1e-6) - || (std::fabs((drpr_stress - creep_stress)/creep_stress) > 1e-6)) - { - error = true; - std::cout << " creep stress: " << creep_stress; - std::cout << " diffusion stress: " << diff_stress; - std::cout << " dislocation stress: " << disl_stress; - std::cout << " peierls stress: " << prls_stress; - std::cout << " drucker prager stress: " << drpr_stress << std::endl; - } - } - - if (error) - { - std::cout << " Error: The individual creep stresses differ by more than the required tolerance." << std::endl; - std::cout << "Some parts of the test were not successful." << std::endl; - } - else - { - std::cout << "OK" << std::endl; - } + template + void f(const aspect::SimulatorAccess &simulator_access, + aspect::Assemblers::Manager &) + { + // This function tests whether the composite creep rheology is producing + // the correct composite viscosity and partial strain rates corresponding to + // the different creep mechanisms incorporated into the rheology. + // It is assumed that each individual creep mechanism has already been tested. + + using namespace aspect::MaterialModel; + + // First, we set up a few objects which are used by the rheology model. + aspect::ParameterHandler prm; + + const std::vector list_of_composition_names = simulator_access.introspection().get_composition_names(); + auto n_phases = std::make_unique>(1); // 1 phase per composition + const unsigned int composition = 0; + const std::vector volume_fractions = {0.6, 0.4}; + const std::vector phase_function_values = std::vector(); + const std::vector n_phase_transitions_per_composition = std::vector(1); + + // Next, we initialise instances of the composite rheology and + // individual creep mechanisms. + std::unique_ptr> composite_creep; + composite_creep = std::make_unique>(); + composite_creep->initialize_simulator (simulator_access.get_simulator()); + composite_creep->declare_parameters(prm); + prm.set("Viscosity averaging scheme", "isostress"); + prm.set("Include diffusion creep in composite rheology", "true"); + prm.set("Include dislocation creep in composite rheology", "true"); + prm.set("Include Peierls creep in composite rheology", "true"); + prm.set("Include Drucker Prager plasticity in composite rheology", "true"); + prm.set("Peierls creep flow law", "viscosity approximation"); + prm.set("Maximum yield stress", "5e8"); + composite_creep->parse_parameters(prm); + + std::unique_ptr> diffusion_creep; + diffusion_creep = std::make_unique>(); + diffusion_creep->initialize_simulator (simulator_access.get_simulator()); + diffusion_creep->declare_parameters(prm); + diffusion_creep->parse_parameters(prm); + + std::unique_ptr> dislocation_creep; + dislocation_creep = std::make_unique>(); + dislocation_creep->initialize_simulator (simulator_access.get_simulator()); + dislocation_creep->declare_parameters(prm); + dislocation_creep->parse_parameters(prm); + + std::unique_ptr> peierls_creep; + peierls_creep = std::make_unique>(); + peierls_creep->initialize_simulator (simulator_access.get_simulator()); + peierls_creep->declare_parameters(prm); + peierls_creep->parse_parameters(prm); + + std::unique_ptr> drucker_prager_power; + drucker_prager_power = std::make_unique>(); + drucker_prager_power->initialize_simulator (simulator_access.get_simulator()); + drucker_prager_power->declare_parameters(prm); + prm.set("Maximum yield stress", "5e8"); + drucker_prager_power->parse_parameters(prm); + Rheology::DruckerPragerParameters p = drucker_prager_power->compute_drucker_prager_parameters(composition, phase_function_values, n_phase_transitions_per_composition); + + // The creep components are arranged in series with each other. + // This package of components is then arranged in parallel with + // a strain rate limiter with a constant viscosity lim_visc. + // The whole system is then arranged in series with a viscosity limiter with + // viscosity max_visc. + // lim_visc is equal to (min_visc*max_visc)/(max_visc - min_visc) + double min_visc = prm.get_double("Minimum viscosity"); + double max_visc = prm.get_double("Maximum viscosity"); + double lim_visc = (min_visc*max_visc)/(max_visc - min_visc); + + // Assign values to the variables which will be passed to compute_viscosity + // The test involves pure shear calculations at 1 GPa and variable temperature + double temperature; + const double pressure = 1.e9; + const double grain_size = 1.e-3; + SymmetricTensor<2,dim> strain_rate; + strain_rate[0][0] = -1e-11; + strain_rate[0][1] = 0.; + strain_rate[1][1] = 1e-11; + strain_rate[2][0] = 0.; + strain_rate[2][1] = 0.; + strain_rate[2][2] = 0.; + + std::cout << "temperature (K) eta (Pas) creep stress (Pa) edot_ii (/s) edot_ii fractions (diff, disl, prls, drpr, max)" << std::endl; + + // Loop through strain rates, tracking whether there is a discrepancy in + // the decomposed strain rates. + bool error = false; + double viscosity; + double total_strain_rate; + double creep_strain_rate; + double creep_stress; + double diff_stress; + double disl_stress; + double prls_stress; + double drpr_stress; + std::vector partial_strain_rates(5, 0.); + + for (unsigned int i=0; i <= 10; i++) + { + temperature = 1000. + i*100.; + + // Compute the viscosity + viscosity = composite_creep->compute_viscosity(pressure, temperature, grain_size, volume_fractions, strain_rate, partial_strain_rates); + total_strain_rate = std::accumulate(partial_strain_rates.begin(), partial_strain_rates.end(), 0.); + + // The creep strain rate is calculated by subtracting the strain rate + // of the max viscosity dashpot from the total strain rate + // The creep stress is then calculated by subtracting the stress running + // through the strain rate limiter from the total stress + creep_strain_rate = total_strain_rate - partial_strain_rates[4]; + creep_stress = 2.*(viscosity*total_strain_rate - lim_visc*creep_strain_rate); + + // Print the output + std::cout << temperature << ' ' << viscosity << ' ' << creep_stress << ' ' << total_strain_rate; + for (unsigned int i=0; i < partial_strain_rates.size(); ++i) + { + std::cout << ' ' << partial_strain_rates[i]/total_strain_rate; + } + std::cout << std::endl; + + // The following lines test that each individual creep mechanism + // experiences the same creep stress + + // Each creep mechanism should experience the same stress + diff_stress = 2.*partial_strain_rates[0]*diffusion_creep->compute_viscosity(pressure, temperature, grain_size, composition); + disl_stress = 2.*partial_strain_rates[1]*dislocation_creep->compute_viscosity(partial_strain_rates[1], pressure, temperature, composition); + prls_stress = 2.*partial_strain_rates[2]*peierls_creep->compute_viscosity(partial_strain_rates[2], pressure, temperature, composition); + if (partial_strain_rates[3] > 0.) + { + drpr_stress = 2.*partial_strain_rates[3]*drucker_prager_power->compute_viscosity(p.cohesion, + p.angle_internal_friction, + pressure, + partial_strain_rates[3], + p.max_yield_stress); + } + else + { + drpr_stress = creep_stress; + } + + if ((std::fabs((diff_stress - creep_stress)/creep_stress) > 1e-6) + || (std::fabs((disl_stress - creep_stress)/creep_stress) > 1e-6) + || (std::fabs((prls_stress - creep_stress)/creep_stress) > 1e-6) + || (std::fabs((drpr_stress - creep_stress)/creep_stress) > 1e-6)) + { + error = true; + std::cout << " creep stress: " << creep_stress; + std::cout << " diffusion stress: " << diff_stress; + std::cout << " dislocation stress: " << disl_stress; + std::cout << " peierls stress: " << prls_stress; + std::cout << " drucker prager stress: " << drpr_stress << std::endl; + } + } + + if (error) + { + std::cout << " Error: The individual creep stresses differ by more than the required tolerance." << std::endl; + std::cout << "Some parts of the test were not successful." << std::endl; + } + else + { + std::cout << "OK" << std::endl; + } -} + } -template <> -void f(const aspect::SimulatorAccess<2> &, - aspect::Assemblers::Manager<2> &) -{ - AssertThrow(false,dealii::ExcInternalError()); -} + template <> + void f(const aspect::SimulatorAccess<2> &, + aspect::Assemblers::Manager<2> &) + { + AssertThrow(false,dealii::ExcInternalError()); + } -template -void signal_connector (aspect::SimulatorSignals &signals) -{ - std::cout << "* Connecting signals" << std::endl; - signals.set_assemblers.connect (std::bind(&f, - std::placeholders::_1, - std::placeholders::_2)); -} + template + void signal_connector (aspect::SimulatorSignals &signals) + { + std::cout << "* Connecting signals" << std::endl; + signals.set_assemblers.connect (std::bind(&f, + std::placeholders::_1, + std::placeholders::_2)); + } -using namespace aspect; + using namespace aspect; -void declare_parameters(const unsigned int dim, - ParameterHandler &prm) -{ - prm.enter_subsection("Compositional fields"); + void declare_parameters(const unsigned int dim, + ParameterHandler &prm) { - prm.declare_entry("Number of fields","1", Patterns::Integer()); + prm.enter_subsection("Compositional fields"); + { + prm.declare_entry("Number of fields","1", Patterns::Integer()); + } + prm.leave_subsection(); } - prm.leave_subsection(); -} -void parameter_connector () -{ - SimulatorSignals<2>::declare_additional_parameters.connect (&declare_parameters); - SimulatorSignals<3>::declare_additional_parameters.connect (&declare_parameters); -} + void parameter_connector () + { + SimulatorSignals<2>::declare_additional_parameters.connect (&declare_parameters); + SimulatorSignals<3>::declare_additional_parameters.connect (&declare_parameters); + } + + ASPECT_REGISTER_SIGNALS_CONNECTOR(signal_connector<2>, + signal_connector<3>) + ASPECT_REGISTER_SIGNALS_PARAMETER_CONNECTOR(parameter_connector) -ASPECT_REGISTER_SIGNALS_CONNECTOR(signal_connector<2>, - signal_connector<3>) -ASPECT_REGISTER_SIGNALS_PARAMETER_CONNECTOR(parameter_connector) +} diff --git a/tests/composite_viscous_outputs_limited.cc b/tests/composite_viscous_outputs_limited.cc index 08bbf4b895d..fdcbf3f551d 100644 --- a/tests/composite_viscous_outputs_limited.cc +++ b/tests/composite_viscous_outputs_limited.cc @@ -22,200 +22,204 @@ #include #include -template -void f(const aspect::SimulatorAccess &simulator_access, - aspect::Assemblers::Manager &) +namespace aspect { - // This function tests whether the composite creep rheology is producing - // the correct composite viscosity and partial strain rates corresponding to - // the different creep mechanisms incorporated into the rheology. - // It is assumed that each individual creep mechanism has already been tested. - - using namespace aspect::MaterialModel; - - // First, we set up a few objects which are used by the rheology model. - aspect::ParameterHandler prm; - const std::vector list_of_composition_names = simulator_access.introspection().get_composition_names(); - auto n_phases = std::make_unique>(1); // 1 phase per composition - const unsigned int composition = 0; - const std::vector volume_fractions = {1.}; - const std::vector phase_function_values = std::vector(); - const std::vector n_phase_transitions_per_composition = std::vector(1); - - // Next, we initialise instances of the composite rheology and - // individual creep mechanisms. - std::unique_ptr> composite_creep; - composite_creep = std::make_unique>(); - composite_creep->initialize_simulator (simulator_access.get_simulator()); - composite_creep->declare_parameters(prm); - prm.set("Viscosity averaging scheme", "isostrain"); - prm.set("Include diffusion creep in composite rheology", "true"); - prm.set("Include dislocation creep in composite rheology", "true"); - prm.set("Include Peierls creep in composite rheology", "true"); - prm.set("Include Drucker Prager plasticity in composite rheology", "true"); - prm.set("Peierls creep flow law", "viscosity approximation"); - prm.set("Maximum yield stress", "5e8"); - prm.set("Minimum viscosity", "1e18"); - prm.set("Maximum viscosity", "4e18"); - composite_creep->parse_parameters(prm); - - std::unique_ptr> diffusion_creep; - diffusion_creep = std::make_unique>(); - diffusion_creep->initialize_simulator (simulator_access.get_simulator()); - diffusion_creep->declare_parameters(prm); - diffusion_creep->parse_parameters(prm); - - std::unique_ptr> dislocation_creep; - dislocation_creep = std::make_unique>(); - dislocation_creep->initialize_simulator (simulator_access.get_simulator()); - dislocation_creep->declare_parameters(prm); - dislocation_creep->parse_parameters(prm); - - std::unique_ptr> peierls_creep; - peierls_creep = std::make_unique>(); - peierls_creep->initialize_simulator (simulator_access.get_simulator()); - peierls_creep->declare_parameters(prm); - peierls_creep->parse_parameters(prm); - - std::unique_ptr> drucker_prager_power; - drucker_prager_power = std::make_unique>(); - drucker_prager_power->initialize_simulator (simulator_access.get_simulator()); - drucker_prager_power->declare_parameters(prm); - prm.set("Maximum yield stress", "5e8"); - drucker_prager_power->parse_parameters(prm); - Rheology::DruckerPragerParameters p = drucker_prager_power->compute_drucker_prager_parameters(composition, phase_function_values, n_phase_transitions_per_composition); - - // The creep components are arranged in series with each other. - // This package of components is then arranged in parallel with - // a strain rate limiter with a constant viscosity lim_visc. - // The whole system is then arranged in series with a viscosity limiter with - // viscosity maximum_viscosity. - // lim_visc is equal to (minimum_viscosity*maximum_viscosity)/(maximum_viscosity - minimum_viscosity) - double minimum_viscosity = prm.get_double("Minimum viscosity"); - double maximum_viscosity = prm.get_double("Maximum viscosity"); - - AssertThrow(minimum_viscosity > 0, - ExcMessage("Minimum viscosity needs to be larger than zero.")); - - AssertThrow(maximum_viscosity > 1.1 * minimum_viscosity, - ExcMessage("The maximum viscosity needs to be at least ten percent larger than the minimum viscosity. " - "If you require an isoviscous model consider a different rheology, or set the " - "parameters of the active flow laws to be independent of temperature, pressure, grain size, and stress.")); - - double lim_visc = (minimum_viscosity*maximum_viscosity)/(maximum_viscosity - minimum_viscosity); - - // Assign values to the variables which will be passed to compute_viscosity - // The test involves pure shear calculations at 1 GPa and variable temperature - double temperature; - const double pressure = 1.e9; - const double grain_size = 1.e-3; - SymmetricTensor<2,dim> strain_rate; - strain_rate[0][0] = -1e-11; - strain_rate[0][1] = 0.; - strain_rate[1][1] = 1e-11; - strain_rate[2][0] = 0.; - strain_rate[2][1] = 0.; - strain_rate[2][2] = 0.; - - std::cout << "temperature (K) eta (Pas) creep stress (Pa) edot_ii (/s) edot_ii fractions (diff, disl, prls, drpr, max)" << std::endl; - - // Loop through strain rates, tracking whether there is a discrepancy in - // the decomposed strain rates. - bool error = false; - double viscosity; - double total_strain_rate; - double creep_strain_rate; - double creep_stress; - double diff_stress; - double disl_stress; - double prls_stress; - double drpr_stress; - std::vector partial_strain_rates(5, 0.); - - for (unsigned int i=0; i <= 10; i++) - { - temperature = 1000. + i*100.; - - // Compute the viscosity - viscosity = composite_creep->compute_viscosity(pressure, temperature, grain_size, volume_fractions, strain_rate, partial_strain_rates); - total_strain_rate = std::accumulate(partial_strain_rates.begin(), partial_strain_rates.end(), 0.); - - // The creep strain rate is calculated by subtracting the strain rate - // of the max viscosity dashpot from the total strain rate - // The creep stress is then calculated by subtracting the stress running - // through the strain rate limiter from the total stress - creep_strain_rate = total_strain_rate - partial_strain_rates[4]; - creep_stress = 2.*(viscosity*total_strain_rate - lim_visc*creep_strain_rate); - - // Print the output - std::cout << temperature << ' ' << viscosity << ' ' << creep_stress << ' ' << total_strain_rate; - for (unsigned int i=0; i < partial_strain_rates.size(); ++i) - { - std::cout << ' ' << partial_strain_rates[i]/total_strain_rate; - } - std::cout << std::endl; - - // The following lines test that each individual creep mechanism - // experiences the same creep stress - - // Each creep mechanism should experience the same stress - diff_stress = 2.*partial_strain_rates[0]*diffusion_creep->compute_viscosity(pressure, temperature, grain_size, composition); - disl_stress = 2.*partial_strain_rates[1]*dislocation_creep->compute_viscosity(partial_strain_rates[1], pressure, temperature, composition); - prls_stress = 2.*partial_strain_rates[2]*peierls_creep->compute_viscosity(partial_strain_rates[2], pressure, temperature, composition); - if (partial_strain_rates[3] > 0.) - { - drpr_stress = 2.*partial_strain_rates[3]*drucker_prager_power->compute_viscosity(p.cohesion, - p.angle_internal_friction, - pressure, - partial_strain_rates[3], - p.max_yield_stress); - } - else - { - drpr_stress = creep_stress; - } - - if ((std::fabs((diff_stress - creep_stress)/creep_stress) > 1e-6) - || (std::fabs((disl_stress - creep_stress)/creep_stress) > 1e-6) - || (std::fabs((prls_stress - creep_stress)/creep_stress) > 1e-6) - || (std::fabs((drpr_stress - creep_stress)/creep_stress) > 1e-6)) - { - error = true; - std::cout << " creep stress: " << creep_stress; - std::cout << " diffusion stress: " << diff_stress; - std::cout << " dislocation stress: " << disl_stress; - std::cout << " peierls stress: " << prls_stress; - std::cout << " drucker prager stress: " << drpr_stress << std::endl; - } - } - - if (error) - { - std::cout << " Error: The individual creep stresses differ by more than the required tolerance." << std::endl; - std::cout << "Some parts of the test were not successful." << std::endl; - } - else - { - std::cout << "OK" << std::endl; - } + template + void f(const aspect::SimulatorAccess &simulator_access, + aspect::Assemblers::Manager &) + { + // This function tests whether the composite creep rheology is producing + // the correct composite viscosity and partial strain rates corresponding to + // the different creep mechanisms incorporated into the rheology. + // It is assumed that each individual creep mechanism has already been tested. + + using namespace aspect::MaterialModel; + + // First, we set up a few objects which are used by the rheology model. + aspect::ParameterHandler prm; + const std::vector list_of_composition_names = simulator_access.introspection().get_composition_names(); + auto n_phases = std::make_unique>(1); // 1 phase per composition + const unsigned int composition = 0; + const std::vector volume_fractions = {1.}; + const std::vector phase_function_values = std::vector(); + const std::vector n_phase_transitions_per_composition = std::vector(1); + + // Next, we initialise instances of the composite rheology and + // individual creep mechanisms. + std::unique_ptr> composite_creep; + composite_creep = std::make_unique>(); + composite_creep->initialize_simulator (simulator_access.get_simulator()); + composite_creep->declare_parameters(prm); + prm.set("Viscosity averaging scheme", "isostrain"); + prm.set("Include diffusion creep in composite rheology", "true"); + prm.set("Include dislocation creep in composite rheology", "true"); + prm.set("Include Peierls creep in composite rheology", "true"); + prm.set("Include Drucker Prager plasticity in composite rheology", "true"); + prm.set("Peierls creep flow law", "viscosity approximation"); + prm.set("Maximum yield stress", "5e8"); + prm.set("Minimum viscosity", "1e18"); + prm.set("Maximum viscosity", "4e18"); + composite_creep->parse_parameters(prm); + + std::unique_ptr> diffusion_creep; + diffusion_creep = std::make_unique>(); + diffusion_creep->initialize_simulator (simulator_access.get_simulator()); + diffusion_creep->declare_parameters(prm); + diffusion_creep->parse_parameters(prm); + + std::unique_ptr> dislocation_creep; + dislocation_creep = std::make_unique>(); + dislocation_creep->initialize_simulator (simulator_access.get_simulator()); + dislocation_creep->declare_parameters(prm); + dislocation_creep->parse_parameters(prm); + + std::unique_ptr> peierls_creep; + peierls_creep = std::make_unique>(); + peierls_creep->initialize_simulator (simulator_access.get_simulator()); + peierls_creep->declare_parameters(prm); + peierls_creep->parse_parameters(prm); + + std::unique_ptr> drucker_prager_power; + drucker_prager_power = std::make_unique>(); + drucker_prager_power->initialize_simulator (simulator_access.get_simulator()); + drucker_prager_power->declare_parameters(prm); + prm.set("Maximum yield stress", "5e8"); + drucker_prager_power->parse_parameters(prm); + Rheology::DruckerPragerParameters p = drucker_prager_power->compute_drucker_prager_parameters(composition, phase_function_values, n_phase_transitions_per_composition); + + // The creep components are arranged in series with each other. + // This package of components is then arranged in parallel with + // a strain rate limiter with a constant viscosity lim_visc. + // The whole system is then arranged in series with a viscosity limiter with + // viscosity maximum_viscosity. + // lim_visc is equal to (minimum_viscosity*maximum_viscosity)/(maximum_viscosity - minimum_viscosity) + double minimum_viscosity = prm.get_double("Minimum viscosity"); + double maximum_viscosity = prm.get_double("Maximum viscosity"); + + AssertThrow(minimum_viscosity > 0, + ExcMessage("Minimum viscosity needs to be larger than zero.")); + + AssertThrow(maximum_viscosity > 1.1 * minimum_viscosity, + ExcMessage("The maximum viscosity needs to be at least ten percent larger than the minimum viscosity. " + "If you require an isoviscous model consider a different rheology, or set the " + "parameters of the active flow laws to be independent of temperature, pressure, grain size, and stress.")); + + double lim_visc = (minimum_viscosity*maximum_viscosity)/(maximum_viscosity - minimum_viscosity); + + // Assign values to the variables which will be passed to compute_viscosity + // The test involves pure shear calculations at 1 GPa and variable temperature + double temperature; + const double pressure = 1.e9; + const double grain_size = 1.e-3; + SymmetricTensor<2,dim> strain_rate; + strain_rate[0][0] = -1e-11; + strain_rate[0][1] = 0.; + strain_rate[1][1] = 1e-11; + strain_rate[2][0] = 0.; + strain_rate[2][1] = 0.; + strain_rate[2][2] = 0.; + + std::cout << "temperature (K) eta (Pas) creep stress (Pa) edot_ii (/s) edot_ii fractions (diff, disl, prls, drpr, max)" << std::endl; + + // Loop through strain rates, tracking whether there is a discrepancy in + // the decomposed strain rates. + bool error = false; + double viscosity; + double total_strain_rate; + double creep_strain_rate; + double creep_stress; + double diff_stress; + double disl_stress; + double prls_stress; + double drpr_stress; + std::vector partial_strain_rates(5, 0.); + + for (unsigned int i=0; i <= 10; i++) + { + temperature = 1000. + i*100.; + + // Compute the viscosity + viscosity = composite_creep->compute_viscosity(pressure, temperature, grain_size, volume_fractions, strain_rate, partial_strain_rates); + total_strain_rate = std::accumulate(partial_strain_rates.begin(), partial_strain_rates.end(), 0.); + + // The creep strain rate is calculated by subtracting the strain rate + // of the max viscosity dashpot from the total strain rate + // The creep stress is then calculated by subtracting the stress running + // through the strain rate limiter from the total stress + creep_strain_rate = total_strain_rate - partial_strain_rates[4]; + creep_stress = 2.*(viscosity*total_strain_rate - lim_visc*creep_strain_rate); + + // Print the output + std::cout << temperature << ' ' << viscosity << ' ' << creep_stress << ' ' << total_strain_rate; + for (unsigned int i=0; i < partial_strain_rates.size(); ++i) + { + std::cout << ' ' << partial_strain_rates[i]/total_strain_rate; + } + std::cout << std::endl; + + // The following lines test that each individual creep mechanism + // experiences the same creep stress + + // Each creep mechanism should experience the same stress + diff_stress = 2.*partial_strain_rates[0]*diffusion_creep->compute_viscosity(pressure, temperature, grain_size, composition); + disl_stress = 2.*partial_strain_rates[1]*dislocation_creep->compute_viscosity(partial_strain_rates[1], pressure, temperature, composition); + prls_stress = 2.*partial_strain_rates[2]*peierls_creep->compute_viscosity(partial_strain_rates[2], pressure, temperature, composition); + if (partial_strain_rates[3] > 0.) + { + drpr_stress = 2.*partial_strain_rates[3]*drucker_prager_power->compute_viscosity(p.cohesion, + p.angle_internal_friction, + pressure, + partial_strain_rates[3], + p.max_yield_stress); + } + else + { + drpr_stress = creep_stress; + } + + if ((std::fabs((diff_stress - creep_stress)/creep_stress) > 1e-6) + || (std::fabs((disl_stress - creep_stress)/creep_stress) > 1e-6) + || (std::fabs((prls_stress - creep_stress)/creep_stress) > 1e-6) + || (std::fabs((drpr_stress - creep_stress)/creep_stress) > 1e-6)) + { + error = true; + std::cout << " creep stress: " << creep_stress; + std::cout << " diffusion stress: " << diff_stress; + std::cout << " dislocation stress: " << disl_stress; + std::cout << " peierls stress: " << prls_stress; + std::cout << " drucker prager stress: " << drpr_stress << std::endl; + } + } + + if (error) + { + std::cout << " Error: The individual creep stresses differ by more than the required tolerance." << std::endl; + std::cout << "Some parts of the test were not successful." << std::endl; + } + else + { + std::cout << "OK" << std::endl; + } + + } + + template <> + void f(const aspect::SimulatorAccess<2> &, + aspect::Assemblers::Manager<2> &) + { + AssertThrow(false,dealii::ExcInternalError()); + } + + template + void signal_connector (aspect::SimulatorSignals &signals) + { + std::cout << "* Connecting signals" << std::endl; + signals.set_assemblers.connect (std::bind(&f, + std::placeholders::_1, + std::placeholders::_2)); + } + + ASPECT_REGISTER_SIGNALS_CONNECTOR(signal_connector<2>, + signal_connector<3>) } - -template <> -void f(const aspect::SimulatorAccess<2> &, - aspect::Assemblers::Manager<2> &) -{ - AssertThrow(false,dealii::ExcInternalError()); -} - -template -void signal_connector (aspect::SimulatorSignals &signals) -{ - std::cout << "* Connecting signals" << std::endl; - signals.set_assemblers.connect (std::bind(&f, - std::placeholders::_1, - std::placeholders::_2)); -} - -ASPECT_REGISTER_SIGNALS_CONNECTOR(signal_connector<2>, - signal_connector<3>) diff --git a/tests/composite_viscous_outputs_no_peierls.cc b/tests/composite_viscous_outputs_no_peierls.cc index ef6ef4c702b..c7826412354 100644 --- a/tests/composite_viscous_outputs_no_peierls.cc +++ b/tests/composite_viscous_outputs_no_peierls.cc @@ -21,180 +21,183 @@ #include #include -template -void f(const aspect::SimulatorAccess &simulator_access, - aspect::Assemblers::Manager &) +namespace aspect { - // This function tests whether the composite creep rheology is producing - // the correct composite viscosity and partial strain rates corresponding to - // the different creep mechanisms incorporated into the rheology. - // It is assumed that each individual creep mechanism has already been tested. - - using namespace aspect::MaterialModel; - - // First, we set up a few objects which are used by the rheology model. - aspect::ParameterHandler prm; - - const std::vector list_of_composition_names = simulator_access.introspection().get_composition_names(); - auto n_phases = std::make_unique>(1); // 1 phase per composition - const unsigned int composition = 0; - const std::vector volume_fractions = {1.}; - const std::vector phase_function_values = std::vector(); - const std::vector n_phase_transitions_per_composition = std::vector(1); - - // Next, we initialise instances of the composite rheology and - // individual creep mechanisms. - std::unique_ptr> composite_creep; - composite_creep = std::make_unique>(); - composite_creep->initialize_simulator (simulator_access.get_simulator()); - composite_creep->declare_parameters(prm); - prm.set("Viscosity averaging scheme", "isostrain"); - prm.set("Include diffusion creep in composite rheology", "true"); - prm.set("Include dislocation creep in composite rheology", "true"); - prm.set("Include Peierls creep in composite rheology", "false"); - prm.set("Include Drucker Prager plasticity in composite rheology", "true"); - prm.set("Peierls creep flow law", "viscosity approximation"); - prm.set("Maximum yield stress", "5e8"); - composite_creep->parse_parameters(prm); - - std::unique_ptr> diffusion_creep; - diffusion_creep = std::make_unique>(); - diffusion_creep->initialize_simulator (simulator_access.get_simulator()); - diffusion_creep->declare_parameters(prm); - diffusion_creep->parse_parameters(prm); - - std::unique_ptr> dislocation_creep; - dislocation_creep = std::make_unique>(); - dislocation_creep->initialize_simulator (simulator_access.get_simulator()); - dislocation_creep->declare_parameters(prm); - dislocation_creep->parse_parameters(prm); - - std::unique_ptr> drucker_prager_power; - drucker_prager_power = std::make_unique>(); - drucker_prager_power->initialize_simulator (simulator_access.get_simulator()); - drucker_prager_power->declare_parameters(prm); - prm.set("Maximum yield stress", "5e8"); - drucker_prager_power->parse_parameters(prm); - Rheology::DruckerPragerParameters p = drucker_prager_power->compute_drucker_prager_parameters(composition, phase_function_values, n_phase_transitions_per_composition); - - // The creep components are arranged in series with each other. - // This package of components is then arranged in parallel with - // a strain rate limiter with a constant viscosity lim_visc. - // The whole system is then arranged in series with a viscosity limiter with - // viscosity max_visc. - // lim_visc is equal to (min_visc*max_visc)/(max_visc - min_visc) - double min_visc = prm.get_double("Minimum viscosity"); - double max_visc = prm.get_double("Maximum viscosity"); - double lim_visc = (min_visc*max_visc)/(max_visc - min_visc); - - // Assign values to the variables which will be passed to compute_viscosity - // The test involves pure shear calculations at 1 GPa and variable temperature - double temperature; - const double pressure = 1.e9; - const double grain_size = 1.e-3; - SymmetricTensor<2,dim> strain_rate; - strain_rate[0][0] = -1e-11; - strain_rate[0][1] = 0.; - strain_rate[1][1] = 1e-11; - strain_rate[2][0] = 0.; - strain_rate[2][1] = 0.; - strain_rate[2][2] = 0.; - - std::cout << "temperature (K) eta (Pas) creep stress (Pa) edot_ii (/s) edot_ii fractions (diff, disl, prls, drpr, max)" << std::endl; - - // Loop through strain rates, tracking whether there is a discrepancy in - // the decomposed strain rates. - bool error = false; - double viscosity; - double total_strain_rate; - double creep_strain_rate; - double creep_stress; - double diff_stress; - double disl_stress; - double drpr_stress; - std::vector partial_strain_rates(5, 0.); - - for (unsigned int i=0; i <= 10; i++) - { - temperature = 1000. + i*100.; - - // Compute the viscosity - viscosity = composite_creep->compute_viscosity(pressure, temperature, grain_size, volume_fractions, strain_rate, partial_strain_rates); - total_strain_rate = std::accumulate(partial_strain_rates.begin(), partial_strain_rates.end(), 0.); - - // The creep strain rate is calculated by subtracting the strain rate - // of the max viscosity dashpot from the total strain rate - // The creep stress is then calculated by subtracting the stress running - // through the strain rate limiter from the total stress - creep_strain_rate = total_strain_rate - partial_strain_rates[4]; - creep_stress = 2.*(viscosity*total_strain_rate - lim_visc*creep_strain_rate); - - // Print the output - std::cout << temperature << ' ' << viscosity << ' ' << creep_stress << ' ' << total_strain_rate; - for (unsigned int i=0; i < partial_strain_rates.size(); ++i) - { - std::cout << ' ' << partial_strain_rates[i]/total_strain_rate; - } - std::cout << std::endl; - - // The following lines test that each individual creep mechanism - // experiences the same creep stress - - // Each creep mechanism should experience the same stress - diff_stress = 2.*partial_strain_rates[0]*diffusion_creep->compute_viscosity(pressure, temperature, grain_size, composition); - disl_stress = 2.*partial_strain_rates[1]*dislocation_creep->compute_viscosity(partial_strain_rates[1], pressure, temperature, composition); - if (partial_strain_rates[3] > 0.) - { - drpr_stress = 2.*partial_strain_rates[3]*drucker_prager_power->compute_viscosity(p.cohesion, - p.angle_internal_friction, - pressure, - partial_strain_rates[3], - p.max_yield_stress); - } - else - { - drpr_stress = creep_stress; - } - - if ((std::fabs((diff_stress - creep_stress)/creep_stress) > 1e-6) - || (std::fabs((disl_stress - creep_stress)/creep_stress) > 1e-6) - || (std::fabs((drpr_stress - creep_stress)/creep_stress) > 1e-6)) - { - error = true; - std::cout << " creep stress: " << creep_stress; - std::cout << " diffusion stress: " << diff_stress; - std::cout << " dislocation stress: " << disl_stress; - std::cout << " drucker prager stress: " << drpr_stress << std::endl; - } - } - - if (error) - { - std::cout << " Error: The individual creep stresses differ by more than the required tolerance." << std::endl; - std::cout << "Some parts of the test were not successful." << std::endl; - } - else - { - std::cout << "OK" << std::endl; - } - -} - -template <> -void f(const aspect::SimulatorAccess<2> &, - aspect::Assemblers::Manager<2> &) -{ - AssertThrow(false,dealii::ExcInternalError()); + template + void f(const aspect::SimulatorAccess &simulator_access, + aspect::Assemblers::Manager &) + { + // This function tests whether the composite creep rheology is producing + // the correct composite viscosity and partial strain rates corresponding to + // the different creep mechanisms incorporated into the rheology. + // It is assumed that each individual creep mechanism has already been tested. + + using namespace aspect::MaterialModel; + + // First, we set up a few objects which are used by the rheology model. + aspect::ParameterHandler prm; + + const std::vector list_of_composition_names = simulator_access.introspection().get_composition_names(); + auto n_phases = std::make_unique>(1); // 1 phase per composition + const unsigned int composition = 0; + const std::vector volume_fractions = {1.}; + const std::vector phase_function_values = std::vector(); + const std::vector n_phase_transitions_per_composition = std::vector(1); + + // Next, we initialise instances of the composite rheology and + // individual creep mechanisms. + std::unique_ptr> composite_creep; + composite_creep = std::make_unique>(); + composite_creep->initialize_simulator (simulator_access.get_simulator()); + composite_creep->declare_parameters(prm); + prm.set("Viscosity averaging scheme", "isostrain"); + prm.set("Include diffusion creep in composite rheology", "true"); + prm.set("Include dislocation creep in composite rheology", "true"); + prm.set("Include Peierls creep in composite rheology", "false"); + prm.set("Include Drucker Prager plasticity in composite rheology", "true"); + prm.set("Peierls creep flow law", "viscosity approximation"); + prm.set("Maximum yield stress", "5e8"); + composite_creep->parse_parameters(prm); + + std::unique_ptr> diffusion_creep; + diffusion_creep = std::make_unique>(); + diffusion_creep->initialize_simulator (simulator_access.get_simulator()); + diffusion_creep->declare_parameters(prm); + diffusion_creep->parse_parameters(prm); + + std::unique_ptr> dislocation_creep; + dislocation_creep = std::make_unique>(); + dislocation_creep->initialize_simulator (simulator_access.get_simulator()); + dislocation_creep->declare_parameters(prm); + dislocation_creep->parse_parameters(prm); + + std::unique_ptr> drucker_prager_power; + drucker_prager_power = std::make_unique>(); + drucker_prager_power->initialize_simulator (simulator_access.get_simulator()); + drucker_prager_power->declare_parameters(prm); + prm.set("Maximum yield stress", "5e8"); + drucker_prager_power->parse_parameters(prm); + Rheology::DruckerPragerParameters p = drucker_prager_power->compute_drucker_prager_parameters(composition, phase_function_values, n_phase_transitions_per_composition); + + // The creep components are arranged in series with each other. + // This package of components is then arranged in parallel with + // a strain rate limiter with a constant viscosity lim_visc. + // The whole system is then arranged in series with a viscosity limiter with + // viscosity max_visc. + // lim_visc is equal to (min_visc*max_visc)/(max_visc - min_visc) + double min_visc = prm.get_double("Minimum viscosity"); + double max_visc = prm.get_double("Maximum viscosity"); + double lim_visc = (min_visc*max_visc)/(max_visc - min_visc); + + // Assign values to the variables which will be passed to compute_viscosity + // The test involves pure shear calculations at 1 GPa and variable temperature + double temperature; + const double pressure = 1.e9; + const double grain_size = 1.e-3; + SymmetricTensor<2,dim> strain_rate; + strain_rate[0][0] = -1e-11; + strain_rate[0][1] = 0.; + strain_rate[1][1] = 1e-11; + strain_rate[2][0] = 0.; + strain_rate[2][1] = 0.; + strain_rate[2][2] = 0.; + + std::cout << "temperature (K) eta (Pas) creep stress (Pa) edot_ii (/s) edot_ii fractions (diff, disl, prls, drpr, max)" << std::endl; + + // Loop through strain rates, tracking whether there is a discrepancy in + // the decomposed strain rates. + bool error = false; + double viscosity; + double total_strain_rate; + double creep_strain_rate; + double creep_stress; + double diff_stress; + double disl_stress; + double drpr_stress; + std::vector partial_strain_rates(5, 0.); + + for (unsigned int i=0; i <= 10; i++) + { + temperature = 1000. + i*100.; + + // Compute the viscosity + viscosity = composite_creep->compute_viscosity(pressure, temperature, grain_size, volume_fractions, strain_rate, partial_strain_rates); + total_strain_rate = std::accumulate(partial_strain_rates.begin(), partial_strain_rates.end(), 0.); + + // The creep strain rate is calculated by subtracting the strain rate + // of the max viscosity dashpot from the total strain rate + // The creep stress is then calculated by subtracting the stress running + // through the strain rate limiter from the total stress + creep_strain_rate = total_strain_rate - partial_strain_rates[4]; + creep_stress = 2.*(viscosity*total_strain_rate - lim_visc*creep_strain_rate); + + // Print the output + std::cout << temperature << ' ' << viscosity << ' ' << creep_stress << ' ' << total_strain_rate; + for (unsigned int i=0; i < partial_strain_rates.size(); ++i) + { + std::cout << ' ' << partial_strain_rates[i]/total_strain_rate; + } + std::cout << std::endl; + + // The following lines test that each individual creep mechanism + // experiences the same creep stress + + // Each creep mechanism should experience the same stress + diff_stress = 2.*partial_strain_rates[0]*diffusion_creep->compute_viscosity(pressure, temperature, grain_size, composition); + disl_stress = 2.*partial_strain_rates[1]*dislocation_creep->compute_viscosity(partial_strain_rates[1], pressure, temperature, composition); + if (partial_strain_rates[3] > 0.) + { + drpr_stress = 2.*partial_strain_rates[3]*drucker_prager_power->compute_viscosity(p.cohesion, + p.angle_internal_friction, + pressure, + partial_strain_rates[3], + p.max_yield_stress); + } + else + { + drpr_stress = creep_stress; + } + + if ((std::fabs((diff_stress - creep_stress)/creep_stress) > 1e-6) + || (std::fabs((disl_stress - creep_stress)/creep_stress) > 1e-6) + || (std::fabs((drpr_stress - creep_stress)/creep_stress) > 1e-6)) + { + error = true; + std::cout << " creep stress: " << creep_stress; + std::cout << " diffusion stress: " << diff_stress; + std::cout << " dislocation stress: " << disl_stress; + std::cout << " drucker prager stress: " << drpr_stress << std::endl; + } + } + + if (error) + { + std::cout << " Error: The individual creep stresses differ by more than the required tolerance." << std::endl; + std::cout << "Some parts of the test were not successful." << std::endl; + } + else + { + std::cout << "OK" << std::endl; + } + + } + + template <> + void f(const aspect::SimulatorAccess<2> &, + aspect::Assemblers::Manager<2> &) + { + AssertThrow(false,dealii::ExcInternalError()); + } + + template + void signal_connector (aspect::SimulatorSignals &signals) + { + std::cout << "* Connecting signals" << std::endl; + signals.set_assemblers.connect (std::bind(&f, + std::placeholders::_1, + std::placeholders::_2)); + } + + ASPECT_REGISTER_SIGNALS_CONNECTOR(signal_connector<2>, + signal_connector<3>) } - -template -void signal_connector (aspect::SimulatorSignals &signals) -{ - std::cout << "* Connecting signals" << std::endl; - signals.set_assemblers.connect (std::bind(&f, - std::placeholders::_1, - std::placeholders::_2)); -} - -ASPECT_REGISTER_SIGNALS_CONNECTOR(signal_connector<2>, - signal_connector<3>) diff --git a/tests/composite_viscous_outputs_phases.cc b/tests/composite_viscous_outputs_phases.cc index c4fc9e024c9..932bb762ed7 100644 --- a/tests/composite_viscous_outputs_phases.cc +++ b/tests/composite_viscous_outputs_phases.cc @@ -23,238 +23,241 @@ #include #include -template -void f(const aspect::SimulatorAccess &simulator_access, - aspect::Assemblers::Manager &) +namespace aspect { - // This function tests whether the composite creep rheology is producing - // the correct composite viscosity and partial strain rates corresponding to - // the different creep mechanisms incorporated into the rheology. - // It is assumed that each individual creep mechanism has already been tested. - - using namespace aspect::MaterialModel; - - // First, we set up a few objects which are used by the rheology model. - aspect::ParameterHandler prm; - const std::vector list_of_composition_names = simulator_access.introspection().get_composition_names(); - MaterialUtilities::PhaseFunction phase_function; - phase_function.initialize_simulator (simulator_access.get_simulator()); - phase_function.declare_parameters (prm); - prm.set("Define transition by depth instead of pressure", "false"); - prm.set("Phase transition pressures", "3e9"); - prm.set("Phase transition pressure widths", "1e9"); - prm.set("Phase transition temperatures", "273"); - prm.set("Phase transition Clapeyron slopes", "0"); - phase_function.parse_parameters (prm); - - std::vector n_phases_for_each_composition = phase_function.n_phases_for_each_composition(); - // Currently, phase_function.n_phases_for_each_composition() returns a list of length - // equal to the total number of compositions, whether or not they are chemical compositions. - // The equation_of_state (multicomponent incompressible) requires a list only for - // chemical compositions. - std::vector n_phases_for_each_chemical_composition = {n_phases_for_each_composition[0]}; - std::vector n_phase_transitions_for_each_chemical_composition = {n_phases_for_each_composition[0] - 1}; - unsigned int n_phases = n_phases_for_each_composition[0]; - for (auto i : simulator_access.introspection().chemical_composition_field_indices()) - { - n_phases_for_each_chemical_composition.push_back(n_phases_for_each_composition[i+1]); - n_phase_transitions_for_each_chemical_composition.push_back(n_phases_for_each_composition[i+1] - 1); - n_phases += n_phases_for_each_composition[i+1]; - } - - const unsigned int composition = 0; - const std::vector volume_fractions = {1.}; - std::vector phase_function_values = {0.}; - const std::vector n_phase_transitions_per_composition = n_phase_transitions_for_each_chemical_composition; - - // Next, we initialise instances of the composite rheology and - // individual creep mechanisms. - std::unique_ptr> composite_creep; - composite_creep = std::make_unique>(); - composite_creep->initialize_simulator (simulator_access.get_simulator()); - composite_creep->declare_parameters(prm); - MaterialUtilities::PhaseFunction::declare_parameters(prm); - prm.set("Viscosity averaging scheme", "isostrain"); - prm.set("Include diffusion creep in composite rheology", "true"); - prm.set("Include dislocation creep in composite rheology", "true"); - prm.set("Include Peierls creep in composite rheology", "true"); - prm.set("Include Drucker Prager plasticity in composite rheology", "true"); - prm.set("Peierls creep flow law", "viscosity approximation"); - prm.set("Cohesions", "background:1e9|5e8"); - prm.set("Maximum yield stress", "5e10"); - composite_creep->parse_parameters(prm, std::make_unique>(n_phases_for_each_chemical_composition)); - - std::unique_ptr> diffusion_creep; - diffusion_creep = std::make_unique>(); - diffusion_creep->initialize_simulator (simulator_access.get_simulator()); - diffusion_creep->declare_parameters(prm); - diffusion_creep->parse_parameters(prm, std::make_unique>(n_phases_for_each_chemical_composition)); - - std::unique_ptr> dislocation_creep; - dislocation_creep = std::make_unique>(); - dislocation_creep->initialize_simulator (simulator_access.get_simulator()); - dislocation_creep->declare_parameters(prm); - dislocation_creep->parse_parameters(prm, std::make_unique>(n_phases_for_each_chemical_composition)); - - std::unique_ptr> peierls_creep; - peierls_creep = std::make_unique>(); - peierls_creep->initialize_simulator (simulator_access.get_simulator()); - peierls_creep->declare_parameters(prm); - peierls_creep->parse_parameters(prm, std::make_unique>(n_phases_for_each_chemical_composition)); - - std::unique_ptr> drucker_prager_power; - drucker_prager_power = std::make_unique>(); - drucker_prager_power->initialize_simulator (simulator_access.get_simulator()); - drucker_prager_power->declare_parameters(prm); - prm.set("Cohesions", "background:1e9|5e8"); - prm.set("Maximum yield stress", "5e10"); - drucker_prager_power->parse_parameters(prm, std::make_unique>(n_phases_for_each_chemical_composition)); - - // The creep components are arranged in series with each other. - // This package of components is then arranged in parallel with - // a strain rate limiter with a constant viscosity lim_visc. - // The whole system is then arranged in series with a viscosity limiter with - // viscosity max_visc. - // lim_visc is equal to (min_visc*max_visc)/(max_visc - min_visc) - double min_visc = prm.get_double("Minimum viscosity"); - double max_visc = prm.get_double("Maximum viscosity"); - double lim_visc = (min_visc*max_visc)/(max_visc - min_visc); - - // Assign values to the variables which will be passed to compute_viscosity - // The test involves pure shear calculations at variable pressure and temperature - double temperature; - double pressure; - const double grain_size = 1.e-3; - SymmetricTensor<2,dim> strain_rate; - strain_rate[0][0] = -1e-11; - strain_rate[0][1] = 0.; - strain_rate[1][1] = 1e-11; - strain_rate[2][0] = 0.; - strain_rate[2][1] = 0.; - strain_rate[2][2] = 0.; - - std::cout << "temperature (K) phase transition progress eta (Pas) creep stress (Pa) edot_ii (/s) edot_ii fractions (diff, disl, prls, drpr, max)" << std::endl; - - // Loop through strain rates, tracking whether there is a discrepancy in - // the decomposed strain rates. - bool error = false; - double viscosity; - double total_strain_rate; - double creep_strain_rate; - double creep_stress; - double diff_stress; - double disl_stress; - double prls_stress; - double drpr_stress; - std::vector partial_strain_rates(5, 0.); - - for (unsigned int i=0; i <= 2; i++) - { - pressure = 1.e9 + i*2.e9; - std::cout << "pressure: " << pressure / 1.e9 << " GPa" << std::endl; - for (unsigned int j = 0; j <= 10; j++) - { - temperature = 1000. + j*100.; - - // Compute the phase function values - // The depth and gravity are set to zero because they are unused - // when phase functions are calculated by pressure. - // The phase index is set to invalid_unsigned_int, because it is only used internally - // in phase_average_equation_of_state_outputs to loop over all existing phases - MaterialUtilities::PhaseFunctionInputs phase_inputs(temperature, - pressure, - 0., 0., - numbers::invalid_unsigned_int); - - // Compute value of phase functions - for (unsigned int j=0; j < phase_function.n_phase_transitions(); ++j) - { - phase_inputs.phase_transition_index = j; - phase_function_values[j] = phase_function.compute_value(phase_inputs); - } - - Rheology::DruckerPragerParameters p = drucker_prager_power->compute_drucker_prager_parameters(composition, phase_function_values, n_phase_transitions_per_composition); - - // Compute the viscosity - viscosity = composite_creep->compute_viscosity(pressure, temperature, grain_size, volume_fractions, strain_rate, partial_strain_rates, phase_function_values, n_phase_transitions_per_composition); - total_strain_rate = std::accumulate(partial_strain_rates.begin(), partial_strain_rates.end(), 0.); - - // The creep strain rate is calculated by subtracting the strain rate - // of the max viscosity dashpot from the total strain rate - // The creep stress is then calculated by subtracting the stress running - // through the strain rate limiter from the total stress - creep_strain_rate = total_strain_rate - partial_strain_rates[4]; - creep_stress = 2.*(viscosity*total_strain_rate - lim_visc*creep_strain_rate); - - // Print the output - std::cout << temperature << ' ' << phase_function_values[0] << ' ' << viscosity << ' ' << creep_stress << ' ' << total_strain_rate; - for (unsigned int i=0; i < partial_strain_rates.size(); ++i) - { - std::cout << ' ' << partial_strain_rates[i]/total_strain_rate; - } - std::cout << std::endl; - - // The following lines test that each individual creep mechanism - // experiences the same creep stress - - // Each creep mechanism should experience the same stress - diff_stress = 2.*partial_strain_rates[0]*diffusion_creep->compute_viscosity(pressure, temperature, grain_size, composition); - disl_stress = 2.*partial_strain_rates[1]*dislocation_creep->compute_viscosity(partial_strain_rates[1], pressure, temperature, composition); - prls_stress = 2.*partial_strain_rates[2]*peierls_creep->compute_viscosity(partial_strain_rates[2], pressure, temperature, composition); - if (partial_strain_rates[3] > 0.) - { - drpr_stress = 2.*partial_strain_rates[3]*drucker_prager_power->compute_viscosity(p.cohesion, - p.angle_internal_friction, - pressure, - partial_strain_rates[3], - p.max_yield_stress); - } - else - { - drpr_stress = creep_stress; - } - - if ((std::fabs((diff_stress - creep_stress)/creep_stress) > 1e-6) - || (std::fabs((disl_stress - creep_stress)/creep_stress) > 1e-6) - || (std::fabs((prls_stress - creep_stress)/creep_stress) > 1e-6) - || (std::fabs((drpr_stress - creep_stress)/creep_stress) > 1e-6)) - { - error = true; - std::cout << " creep stress: " << creep_stress; - std::cout << " diffusion stress: " << diff_stress; - std::cout << " dislocation stress: " << disl_stress; - std::cout << " peierls stress: " << prls_stress; - std::cout << " drucker prager stress: " << drpr_stress << std::endl; - } - } - } - - if (error) - { - std::cout << " Error: The individual creep stresses differ by more than the required tolerance." << std::endl; - std::cout << "Some parts of the test were not successful." << std::endl; - } - else - { - std::cout << "OK" << std::endl; - } + template + void f(const aspect::SimulatorAccess &simulator_access, + aspect::Assemblers::Manager &) + { + // This function tests whether the composite creep rheology is producing + // the correct composite viscosity and partial strain rates corresponding to + // the different creep mechanisms incorporated into the rheology. + // It is assumed that each individual creep mechanism has already been tested. + + using namespace aspect::MaterialModel; + + // First, we set up a few objects which are used by the rheology model. + aspect::ParameterHandler prm; + const std::vector list_of_composition_names = simulator_access.introspection().get_composition_names(); + MaterialUtilities::PhaseFunction phase_function; + phase_function.initialize_simulator (simulator_access.get_simulator()); + phase_function.declare_parameters (prm); + prm.set("Define transition by depth instead of pressure", "false"); + prm.set("Phase transition pressures", "3e9"); + prm.set("Phase transition pressure widths", "1e9"); + prm.set("Phase transition temperatures", "273"); + prm.set("Phase transition Clapeyron slopes", "0"); + phase_function.parse_parameters (prm); + + std::vector n_phases_for_each_composition = phase_function.n_phases_for_each_composition(); + // Currently, phase_function.n_phases_for_each_composition() returns a list of length + // equal to the total number of compositions, whether or not they are chemical compositions. + // The equation_of_state (multicomponent incompressible) requires a list only for + // chemical compositions. + std::vector n_phases_for_each_chemical_composition = {n_phases_for_each_composition[0]}; + std::vector n_phase_transitions_for_each_chemical_composition = {n_phases_for_each_composition[0] - 1}; + unsigned int n_phases = n_phases_for_each_composition[0]; + for (auto i : simulator_access.introspection().chemical_composition_field_indices()) + { + n_phases_for_each_chemical_composition.push_back(n_phases_for_each_composition[i+1]); + n_phase_transitions_for_each_chemical_composition.push_back(n_phases_for_each_composition[i+1] - 1); + n_phases += n_phases_for_each_composition[i+1]; + } + + const unsigned int composition = 0; + const std::vector volume_fractions = {1.}; + std::vector phase_function_values = {0.}; + const std::vector n_phase_transitions_per_composition = n_phase_transitions_for_each_chemical_composition; + + // Next, we initialise instances of the composite rheology and + // individual creep mechanisms. + std::unique_ptr> composite_creep; + composite_creep = std::make_unique>(); + composite_creep->initialize_simulator (simulator_access.get_simulator()); + composite_creep->declare_parameters(prm); + MaterialUtilities::PhaseFunction::declare_parameters(prm); + prm.set("Viscosity averaging scheme", "isostrain"); + prm.set("Include diffusion creep in composite rheology", "true"); + prm.set("Include dislocation creep in composite rheology", "true"); + prm.set("Include Peierls creep in composite rheology", "true"); + prm.set("Include Drucker Prager plasticity in composite rheology", "true"); + prm.set("Peierls creep flow law", "viscosity approximation"); + prm.set("Cohesions", "background:1e9|5e8"); + prm.set("Maximum yield stress", "5e10"); + composite_creep->parse_parameters(prm, std::make_unique>(n_phases_for_each_chemical_composition)); + + std::unique_ptr> diffusion_creep; + diffusion_creep = std::make_unique>(); + diffusion_creep->initialize_simulator (simulator_access.get_simulator()); + diffusion_creep->declare_parameters(prm); + diffusion_creep->parse_parameters(prm, std::make_unique>(n_phases_for_each_chemical_composition)); + + std::unique_ptr> dislocation_creep; + dislocation_creep = std::make_unique>(); + dislocation_creep->initialize_simulator (simulator_access.get_simulator()); + dislocation_creep->declare_parameters(prm); + dislocation_creep->parse_parameters(prm, std::make_unique>(n_phases_for_each_chemical_composition)); + + std::unique_ptr> peierls_creep; + peierls_creep = std::make_unique>(); + peierls_creep->initialize_simulator (simulator_access.get_simulator()); + peierls_creep->declare_parameters(prm); + peierls_creep->parse_parameters(prm, std::make_unique>(n_phases_for_each_chemical_composition)); + + std::unique_ptr> drucker_prager_power; + drucker_prager_power = std::make_unique>(); + drucker_prager_power->initialize_simulator (simulator_access.get_simulator()); + drucker_prager_power->declare_parameters(prm); + prm.set("Cohesions", "background:1e9|5e8"); + prm.set("Maximum yield stress", "5e10"); + drucker_prager_power->parse_parameters(prm, std::make_unique>(n_phases_for_each_chemical_composition)); + + // The creep components are arranged in series with each other. + // This package of components is then arranged in parallel with + // a strain rate limiter with a constant viscosity lim_visc. + // The whole system is then arranged in series with a viscosity limiter with + // viscosity max_visc. + // lim_visc is equal to (min_visc*max_visc)/(max_visc - min_visc) + double min_visc = prm.get_double("Minimum viscosity"); + double max_visc = prm.get_double("Maximum viscosity"); + double lim_visc = (min_visc*max_visc)/(max_visc - min_visc); + + // Assign values to the variables which will be passed to compute_viscosity + // The test involves pure shear calculations at variable pressure and temperature + double temperature; + double pressure; + const double grain_size = 1.e-3; + SymmetricTensor<2,dim> strain_rate; + strain_rate[0][0] = -1e-11; + strain_rate[0][1] = 0.; + strain_rate[1][1] = 1e-11; + strain_rate[2][0] = 0.; + strain_rate[2][1] = 0.; + strain_rate[2][2] = 0.; + + std::cout << "temperature (K) phase transition progress eta (Pas) creep stress (Pa) edot_ii (/s) edot_ii fractions (diff, disl, prls, drpr, max)" << std::endl; + + // Loop through strain rates, tracking whether there is a discrepancy in + // the decomposed strain rates. + bool error = false; + double viscosity; + double total_strain_rate; + double creep_strain_rate; + double creep_stress; + double diff_stress; + double disl_stress; + double prls_stress; + double drpr_stress; + std::vector partial_strain_rates(5, 0.); + + for (unsigned int i=0; i <= 2; i++) + { + pressure = 1.e9 + i*2.e9; + std::cout << "pressure: " << pressure / 1.e9 << " GPa" << std::endl; + for (unsigned int j = 0; j <= 10; j++) + { + temperature = 1000. + j*100.; + + // Compute the phase function values + // The depth and gravity are set to zero because they are unused + // when phase functions are calculated by pressure. + // The phase index is set to invalid_unsigned_int, because it is only used internally + // in phase_average_equation_of_state_outputs to loop over all existing phases + MaterialUtilities::PhaseFunctionInputs phase_inputs(temperature, + pressure, + 0., 0., + numbers::invalid_unsigned_int); + + // Compute value of phase functions + for (unsigned int j=0; j < phase_function.n_phase_transitions(); ++j) + { + phase_inputs.phase_transition_index = j; + phase_function_values[j] = phase_function.compute_value(phase_inputs); + } + + Rheology::DruckerPragerParameters p = drucker_prager_power->compute_drucker_prager_parameters(composition, phase_function_values, n_phase_transitions_per_composition); + + // Compute the viscosity + viscosity = composite_creep->compute_viscosity(pressure, temperature, grain_size, volume_fractions, strain_rate, partial_strain_rates, phase_function_values, n_phase_transitions_per_composition); + total_strain_rate = std::accumulate(partial_strain_rates.begin(), partial_strain_rates.end(), 0.); + + // The creep strain rate is calculated by subtracting the strain rate + // of the max viscosity dashpot from the total strain rate + // The creep stress is then calculated by subtracting the stress running + // through the strain rate limiter from the total stress + creep_strain_rate = total_strain_rate - partial_strain_rates[4]; + creep_stress = 2.*(viscosity*total_strain_rate - lim_visc*creep_strain_rate); + + // Print the output + std::cout << temperature << ' ' << phase_function_values[0] << ' ' << viscosity << ' ' << creep_stress << ' ' << total_strain_rate; + for (unsigned int i=0; i < partial_strain_rates.size(); ++i) + { + std::cout << ' ' << partial_strain_rates[i]/total_strain_rate; + } + std::cout << std::endl; + + // The following lines test that each individual creep mechanism + // experiences the same creep stress + + // Each creep mechanism should experience the same stress + diff_stress = 2.*partial_strain_rates[0]*diffusion_creep->compute_viscosity(pressure, temperature, grain_size, composition); + disl_stress = 2.*partial_strain_rates[1]*dislocation_creep->compute_viscosity(partial_strain_rates[1], pressure, temperature, composition); + prls_stress = 2.*partial_strain_rates[2]*peierls_creep->compute_viscosity(partial_strain_rates[2], pressure, temperature, composition); + if (partial_strain_rates[3] > 0.) + { + drpr_stress = 2.*partial_strain_rates[3]*drucker_prager_power->compute_viscosity(p.cohesion, + p.angle_internal_friction, + pressure, + partial_strain_rates[3], + p.max_yield_stress); + } + else + { + drpr_stress = creep_stress; + } + + if ((std::fabs((diff_stress - creep_stress)/creep_stress) > 1e-6) + || (std::fabs((disl_stress - creep_stress)/creep_stress) > 1e-6) + || (std::fabs((prls_stress - creep_stress)/creep_stress) > 1e-6) + || (std::fabs((drpr_stress - creep_stress)/creep_stress) > 1e-6)) + { + error = true; + std::cout << " creep stress: " << creep_stress; + std::cout << " diffusion stress: " << diff_stress; + std::cout << " dislocation stress: " << disl_stress; + std::cout << " peierls stress: " << prls_stress; + std::cout << " drucker prager stress: " << drpr_stress << std::endl; + } + } + } + + if (error) + { + std::cout << " Error: The individual creep stresses differ by more than the required tolerance." << std::endl; + std::cout << "Some parts of the test were not successful." << std::endl; + } + else + { + std::cout << "OK" << std::endl; + } + } + + template <> + void f(const aspect::SimulatorAccess<2> &, + aspect::Assemblers::Manager<2> &) + { + AssertThrow(false,dealii::ExcInternalError()); + } + + template + void signal_connector (aspect::SimulatorSignals &signals) + { + std::cout << "* Connecting signals" << std::endl; + signals.set_assemblers.connect (std::bind(&f, + std::placeholders::_1, + std::placeholders::_2)); + } + + ASPECT_REGISTER_SIGNALS_CONNECTOR(signal_connector<2>, + signal_connector<3>) } - -template <> -void f(const aspect::SimulatorAccess<2> &, - aspect::Assemblers::Manager<2> &) -{ - AssertThrow(false,dealii::ExcInternalError()); -} - -template -void signal_connector (aspect::SimulatorSignals &signals) -{ - std::cout << "* Connecting signals" << std::endl; - signals.set_assemblers.connect (std::bind(&f, - std::placeholders::_1, - std::placeholders::_2)); -} - -ASPECT_REGISTER_SIGNALS_CONNECTOR(signal_connector<2>, - signal_connector<3>) diff --git a/tests/coordinate_transformation.cc b/tests/coordinate_transformation.cc index 8a5e117df98..2bae9995adb 100644 --- a/tests/coordinate_transformation.cc +++ b/tests/coordinate_transformation.cc @@ -23,71 +23,74 @@ #include -using namespace aspect::Utilities; +namespace aspect +{ + using namespace aspect::Utilities; // Check various conversions between cartesian and spherical coordinates -template -void check_point(T point1, T point2) -{ - std::cout << std::endl << "Point 1: "; - for (unsigned int i = 0; i < dim; ++i) - std::cout << point1[i] << ' '; + template + void check_point(T point1, T point2) + { + std::cout << std::endl << "Point 1: "; + for (unsigned int i = 0; i < dim; ++i) + std::cout << point1[i] << ' '; - std::cout << std::endl << "Point 2: "; - for (unsigned int i = 0; i < dim; ++i) - std::cout << point2[i] << ' '; + std::cout << std::endl << "Point 2: "; + for (unsigned int i = 0; i < dim; ++i) + std::cout << point2[i] << ' '; - std::cout << std::endl; -} + std::cout << std::endl; + } -int f() -{ - const dealii::Point<2> origin2(0,0); - const dealii::Point<3> origin3(0,0,0); + int f() + { + const dealii::Point<2> origin2(0,0); + const dealii::Point<3> origin3(0,0,0); - const std::array sorigin2 = {{0,0}}; - const std::array sorigin3 = {{0,0,0}}; + const std::array sorigin2 = {{0,0}}; + const std::array sorigin3 = {{0,0,0}}; - const dealii::Point<2> one2(1,1); - const dealii::Point<3> one3(1,1,1); + const dealii::Point<2> one2(1,1); + const dealii::Point<3> one3(1,1,1); - const std::array sone2 = {{std::sqrt(2),numbers::PI/4}}; - const std::array sone3 = {{std::sqrt(3),numbers::PI/4,std::acos(1/std::sqrt(3))}}; + const std::array sone2 = {{std::sqrt(2),numbers::PI/4}}; + const std::array sone3 = {{std::sqrt(3),numbers::PI/4,std::acos(1/std::sqrt(3))}}; - const dealii::Point<3> x(1,0,0); - const dealii::Point<3> y(0,1,0); - const dealii::Point<3> z(0,0,1); + const dealii::Point<3> x(1,0,0); + const dealii::Point<3> y(0,1,0); + const dealii::Point<3> z(0,0,1); - const std::array sx = {{1,0,numbers::PI/2}}; - const std::array sy = {{1,numbers::PI/2,numbers::PI/2}}; - const std::array sz = {{1,0,0}}; + const std::array sx = {{1,0,numbers::PI/2}}; + const std::array sy = {{1,numbers::PI/2,numbers::PI/2}}; + const std::array sz = {{1,0,0}}; - check_point,2>(Coordinates::cartesian_to_spherical_coordinates(origin2),sorigin2); - check_point,3>(Coordinates::cartesian_to_spherical_coordinates(origin3),sorigin3); - check_point,2>(origin2, Coordinates::spherical_to_cartesian_coordinates<2>(sorigin2)); - check_point,3>(origin3, Coordinates::spherical_to_cartesian_coordinates<3>(sorigin3)); + check_point,2>(Coordinates::cartesian_to_spherical_coordinates(origin2),sorigin2); + check_point,3>(Coordinates::cartesian_to_spherical_coordinates(origin3),sorigin3); + check_point,2>(origin2, Coordinates::spherical_to_cartesian_coordinates<2>(sorigin2)); + check_point,3>(origin3, Coordinates::spherical_to_cartesian_coordinates<3>(sorigin3)); - check_point,2>(Coordinates::cartesian_to_spherical_coordinates(one2),sone2); - check_point,3>(Coordinates::cartesian_to_spherical_coordinates(one3),sone3); - check_point,2>(one2, Coordinates::spherical_to_cartesian_coordinates<2>(sone2)); - check_point,3>(one3, Coordinates::spherical_to_cartesian_coordinates<3>(sone3)); + check_point,2>(Coordinates::cartesian_to_spherical_coordinates(one2),sone2); + check_point,3>(Coordinates::cartesian_to_spherical_coordinates(one3),sone3); + check_point,2>(one2, Coordinates::spherical_to_cartesian_coordinates<2>(sone2)); + check_point,3>(one3, Coordinates::spherical_to_cartesian_coordinates<3>(sone3)); - check_point,3>(x, Coordinates::spherical_to_cartesian_coordinates<3>(sx)); - check_point,3>(y, Coordinates::spherical_to_cartesian_coordinates<3>(sy)); - check_point,3>(z, Coordinates::spherical_to_cartesian_coordinates<3>(sz)); + check_point,3>(x, Coordinates::spherical_to_cartesian_coordinates<3>(sx)); + check_point,3>(y, Coordinates::spherical_to_cartesian_coordinates<3>(sy)); + check_point,3>(z, Coordinates::spherical_to_cartesian_coordinates<3>(sz)); - check_point,3>(Coordinates::cartesian_to_spherical_coordinates(x),sx); - check_point,3>(Coordinates::cartesian_to_spherical_coordinates(y),sy); - check_point,3>(Coordinates::cartesian_to_spherical_coordinates(z),sz); + check_point,3>(Coordinates::cartesian_to_spherical_coordinates(x),sx); + check_point,3>(Coordinates::cartesian_to_spherical_coordinates(y),sy); + check_point,3>(Coordinates::cartesian_to_spherical_coordinates(z),sz); - const dealii::Point<3> dateline(0,-1,0); - const std::array sdateline = {{1,3*numbers::PI/2,numbers::PI/2}}; + const dealii::Point<3> dateline(0,-1,0); + const std::array sdateline = {{1,3*numbers::PI/2,numbers::PI/2}}; - check_point,3>(dateline, Coordinates::spherical_to_cartesian_coordinates<3>(sdateline)); - check_point,3>(Coordinates::cartesian_to_spherical_coordinates(dateline),sdateline); + check_point,3>(dateline, Coordinates::spherical_to_cartesian_coordinates<3>(sdateline)); + check_point,3>(Coordinates::cartesian_to_spherical_coordinates(dateline),sdateline); - return 42; -} + return 42; + } -int i = f(); + int i = f(); +} diff --git a/tests/drucker_prager_derivatives_2d.cc b/tests/drucker_prager_derivatives_2d.cc index 61404f38416..de7647c1a0e 100644 --- a/tests/drucker_prager_derivatives_2d.cc +++ b/tests/drucker_prager_derivatives_2d.cc @@ -33,214 +33,217 @@ #include -template -void f(const aspect::SimulatorAccess &simulator_access, - aspect::Assemblers::Manager &) +namespace aspect { - - std::cout << std::endl << "Testing DruckerPrager derivatives against finite difference derivatives " << std::endl; - - using namespace aspect::MaterialModel; - - // first set all material model values - MaterialModelInputs in_base(5,3); - in_base.composition[0][0] = 0; - in_base.composition[0][1] = 0; - in_base.composition[0][2] = 0; - in_base.composition[1][0] = 0.75; - in_base.composition[1][1] = 0.15; - in_base.composition[1][2] = 0.10; - in_base.composition[2][0] = 0; - in_base.composition[2][1] = 0.2; - in_base.composition[2][2] = 0.4; - in_base.composition[3][0] = 0; - in_base.composition[3][1] = 0.2; - in_base.composition[3][2] = 0.4; - in_base.composition[4][0] = 1; - in_base.composition[4][1] = 0; - in_base.composition[4][2] = 0; - - in_base.temperature[0] = 293; - in_base.temperature[1] = 1600; - in_base.temperature[2] = 2000; - in_base.temperature[3] = 2100; - in_base.temperature[4] = 2200; - - in_base.pressure[0] = 1e9; - in_base.pressure[1] = 5e9; - in_base.pressure[2] = 2e10; - in_base.pressure[3] = 2e11; - in_base.pressure[4] = 2e12; - - /** - * We can't take to small strain-rates, because then the difference in the - * visocisty will be too small for the double accuracy which stores - * the visocity solutions and the finite difference solution. - */ - in_base.strain_rate[0] = SymmetricTensor<2,dim>(); - in_base.strain_rate[0][0][0] = 1e-12; - in_base.strain_rate[0][0][1] = 1e-12; - in_base.strain_rate[0][1][1] = 1e-11; - - in_base.strain_rate[1] = SymmetricTensor<2,dim>(in_base.strain_rate[0]); - in_base.strain_rate[1][0][0] = -1.71266e-13; - in_base.strain_rate[1][0][1] = -5.82647e-12; - in_base.strain_rate[1][1][1] = 4.21668e-14; - - in_base.strain_rate[2] = SymmetricTensor<2,dim>(in_base.strain_rate[0]); - in_base.strain_rate[2][1][1] = 1e-13; - in_base.strain_rate[2][0][1] = 1e-11; - in_base.strain_rate[2][0][0] = -1e-12; - - in_base.strain_rate[3] = SymmetricTensor<2,dim>(in_base.strain_rate[0]); - in_base.strain_rate[3][1][1] = 4.9e-21; - in_base.strain_rate[3][0][1] = 4.9e-21; - in_base.strain_rate[3][0][0] = 4.9e-21; - - in_base.strain_rate[4] = SymmetricTensor<2,dim>(in_base.strain_rate[0]); - in_base.strain_rate[4][1][1] = 1e-11; - in_base.strain_rate[4][0][1] = 1e-11; - in_base.strain_rate[4][0][0] = 1e-11; - - // initialize some variables we will need later. - const double finite_difference_accuracy = 1e-7; - const double finite_difference_factor = 1+finite_difference_accuracy; - - MaterialModelInputs in_dviscositydstrainrate(in_base); - - MaterialModelOutputs out_base(5,3); - MaterialModelOutputs out_dviscositydpressure(5,3); - MaterialModelOutputs out_dviscositydstrainrate(5,3); - - // initialize the material we want to test. - aspect::ParameterHandler prm; - - const aspect::MaterialModel::DruckerPrager const_material_model = dynamic_cast &>(simulator_access.get_material_model()); - aspect::MaterialModel::DruckerPrager material_model = const_cast &>(const_material_model); - - material_model.declare_parameters(prm); - - prm.enter_subsection("Material model"); + template + void f(const aspect::SimulatorAccess &simulator_access, + aspect::Assemblers::Manager &) { - prm.enter_subsection ("Drucker Prager"); + + std::cout << std::endl << "Testing DruckerPrager derivatives against finite difference derivatives " << std::endl; + + using namespace aspect::MaterialModel; + + // first set all material model values + MaterialModelInputs in_base(5,3); + in_base.composition[0][0] = 0; + in_base.composition[0][1] = 0; + in_base.composition[0][2] = 0; + in_base.composition[1][0] = 0.75; + in_base.composition[1][1] = 0.15; + in_base.composition[1][2] = 0.10; + in_base.composition[2][0] = 0; + in_base.composition[2][1] = 0.2; + in_base.composition[2][2] = 0.4; + in_base.composition[3][0] = 0; + in_base.composition[3][1] = 0.2; + in_base.composition[3][2] = 0.4; + in_base.composition[4][0] = 1; + in_base.composition[4][1] = 0; + in_base.composition[4][2] = 0; + + in_base.temperature[0] = 293; + in_base.temperature[1] = 1600; + in_base.temperature[2] = 2000; + in_base.temperature[3] = 2100; + in_base.temperature[4] = 2200; + + in_base.pressure[0] = 1e9; + in_base.pressure[1] = 5e9; + in_base.pressure[2] = 2e10; + in_base.pressure[3] = 2e11; + in_base.pressure[4] = 2e12; + + /** + * We can't take to small strain-rates, because then the difference in the + * visocisty will be too small for the double accuracy which stores + * the visocity solutions and the finite difference solution. + */ + in_base.strain_rate[0] = SymmetricTensor<2,dim>(); + in_base.strain_rate[0][0][0] = 1e-12; + in_base.strain_rate[0][0][1] = 1e-12; + in_base.strain_rate[0][1][1] = 1e-11; + + in_base.strain_rate[1] = SymmetricTensor<2,dim>(in_base.strain_rate[0]); + in_base.strain_rate[1][0][0] = -1.71266e-13; + in_base.strain_rate[1][0][1] = -5.82647e-12; + in_base.strain_rate[1][1][1] = 4.21668e-14; + + in_base.strain_rate[2] = SymmetricTensor<2,dim>(in_base.strain_rate[0]); + in_base.strain_rate[2][1][1] = 1e-13; + in_base.strain_rate[2][0][1] = 1e-11; + in_base.strain_rate[2][0][0] = -1e-12; + + in_base.strain_rate[3] = SymmetricTensor<2,dim>(in_base.strain_rate[0]); + in_base.strain_rate[3][1][1] = 4.9e-21; + in_base.strain_rate[3][0][1] = 4.9e-21; + in_base.strain_rate[3][0][0] = 4.9e-21; + + in_base.strain_rate[4] = SymmetricTensor<2,dim>(in_base.strain_rate[0]); + in_base.strain_rate[4][1][1] = 1e-11; + in_base.strain_rate[4][0][1] = 1e-11; + in_base.strain_rate[4][0][0] = 1e-11; + + // initialize some variables we will need later. + const double finite_difference_accuracy = 1e-7; + const double finite_difference_factor = 1+finite_difference_accuracy; + + MaterialModelInputs in_dviscositydstrainrate(in_base); + + MaterialModelOutputs out_base(5,3); + MaterialModelOutputs out_dviscositydpressure(5,3); + MaterialModelOutputs out_dviscositydstrainrate(5,3); + + // initialize the material we want to test. + aspect::ParameterHandler prm; + + const aspect::MaterialModel::DruckerPrager const_material_model = dynamic_cast &>(simulator_access.get_material_model()); + aspect::MaterialModel::DruckerPrager material_model = const_cast &>(const_material_model); + + material_model.declare_parameters(prm); + + prm.enter_subsection("Material model"); { - prm.enter_subsection ("Viscosity"); + prm.enter_subsection ("Drucker Prager"); { - prm.set ("Reference strain rate", "1e-20"); - prm.set ("Angle of internal friction", "30"); + prm.enter_subsection ("Viscosity"); + { + prm.set ("Reference strain rate", "1e-20"); + prm.set ("Angle of internal friction", "30"); + } + prm.leave_subsection(); } prm.leave_subsection(); } prm.leave_subsection(); - } - prm.leave_subsection(); - - const_cast &>(simulator_access.get_material_model()).parse_parameters(prm); - out_base.additional_outputs.push_back(std::make_unique> (5)); + const_cast &>(simulator_access.get_material_model()).parse_parameters(prm); - simulator_access.get_material_model().evaluate(in_base, out_base); + out_base.additional_outputs.push_back(std::make_unique> (5)); - // set up additional output for the derivatives - MaterialModelDerivatives *derivatives; - derivatives = out_base.template get_additional_output>(); - double temp; + simulator_access.get_material_model().evaluate(in_base, out_base); - // have a bool so we know whether the test has succeed or not. - bool Error = false; - - // test the pressure derivative. - MaterialModelInputs in_dviscositydpressure(in_base); - in_dviscositydpressure.pressure[0] *= finite_difference_factor; - in_dviscositydpressure.pressure[1] *= finite_difference_factor; - in_dviscositydpressure.pressure[2] *= finite_difference_factor; - in_dviscositydpressure.pressure[3] *= finite_difference_factor; - in_dviscositydpressure.pressure[4] *= finite_difference_factor; - - simulator_access.get_material_model().evaluate(in_dviscositydpressure, out_dviscositydpressure); - - for (unsigned int i = 0; i < 5; i++) - { - // prevent division by zero. If it is zero, the test has passed, because or - // the finite difference and the analytical result match perfectly, or (more - // likely) the material model in independent of this variable. - temp = (out_dviscositydpressure.viscosities[i] - out_base.viscosities[i]); - if (in_base.pressure[i] != 0) - { - temp /= (in_base.pressure[i] * finite_difference_accuracy); - } - std::cout << "pressure: point = " << i << ", Finite difference = " << temp << ", Analytical derivative = " << derivatives->viscosity_derivative_wrt_pressure[i] << std::endl; - if (std::fabs(temp - derivatives->viscosity_derivative_wrt_pressure[i]) > 1e-3 * (std::fabs(temp) + std::fabs(derivatives->viscosity_derivative_wrt_pressure[i]))) - { - std::cout << " Error: The derivative of the viscosity to the pressure is too different from the analytical value." << std::endl; - Error = true; - } + // set up additional output for the derivatives + MaterialModelDerivatives *derivatives; + derivatives = out_base.template get_additional_output>(); + double temp; - } + // have a bool so we know whether the test has succeed or not. + bool Error = false; - // test the strain-rate derivative. - for (unsigned int component = 0; component < SymmetricTensor<2,dim>::n_independent_components; ++component) - { - const TableIndices<2> strain_rate_indices = SymmetricTensor<2,dim>::unrolled_to_component_indices (component); + // test the pressure derivative. + MaterialModelInputs in_dviscositydpressure(in_base); + in_dviscositydpressure.pressure[0] *= finite_difference_factor; + in_dviscositydpressure.pressure[1] *= finite_difference_factor; + in_dviscositydpressure.pressure[2] *= finite_difference_factor; + in_dviscositydpressure.pressure[3] *= finite_difference_factor; + in_dviscositydpressure.pressure[4] *= finite_difference_factor; - for (unsigned int i = 0; i < 5; i++) - { - in_dviscositydstrainrate.strain_rate[i] = in_base.strain_rate[i] - + std::fabs(in_base.strain_rate[i][strain_rate_indices]) - * finite_difference_accuracy - * aspect::Utilities::nth_basis_for_symmetric_tensors(component); - } + simulator_access.get_material_model().evaluate(in_dviscositydpressure, out_dviscositydpressure); + for (unsigned int i = 0; i < 5; i++) + { + // prevent division by zero. If it is zero, the test has passed, because or + // the finite difference and the analytical result match perfectly, or (more + // likely) the material model in independent of this variable. + temp = (out_dviscositydpressure.viscosities[i] - out_base.viscosities[i]); + if (in_base.pressure[i] != 0) + { + temp /= (in_base.pressure[i] * finite_difference_accuracy); + } + std::cout << "pressure: point = " << i << ", Finite difference = " << temp << ", Analytical derivative = " << derivatives->viscosity_derivative_wrt_pressure[i] << std::endl; + if (std::fabs(temp - derivatives->viscosity_derivative_wrt_pressure[i]) > 1e-3 * (std::fabs(temp) + std::fabs(derivatives->viscosity_derivative_wrt_pressure[i]))) + { + std::cout << " Error: The derivative of the viscosity to the pressure is too different from the analytical value." << std::endl; + Error = true; + } - simulator_access.get_material_model().evaluate(in_dviscositydstrainrate, out_dviscositydstrainrate); + } - for (unsigned int i = 0; i < 5; i++) - { - // prevent division by zero. If it is zero, the test has passed, because or - // the finite difference and the analytical result match perfectly, or (more - // likely) the material model in independent of this variable. - temp = out_dviscositydstrainrate.viscosities[i] - out_base.viscosities[i]; - if (temp != 0) - { - temp /= std::fabs(in_dviscositydstrainrate.strain_rate[i][strain_rate_indices]) * finite_difference_accuracy; - } - std::cout << "strain-rate: point = " << i << ", component = " << component << ", Finite difference = " << temp << ", Analytical derivative = " << derivatives->viscosity_derivative_wrt_strain_rate[i][strain_rate_indices] << std::endl; - if (std::fabs(temp - derivatives->viscosity_derivative_wrt_strain_rate[i][strain_rate_indices]) > 1e-3 * (std::fabs(temp) + std::fabs(derivatives->viscosity_derivative_wrt_strain_rate[i][strain_rate_indices]))) - { - std::cout << " Error: The derivative of the viscosity to the strain rate is too different from the analytical value." << std::endl; - Error = true; - } + // test the strain-rate derivative. + for (unsigned int component = 0; component < SymmetricTensor<2,dim>::n_independent_components; ++component) + { + const TableIndices<2> strain_rate_indices = SymmetricTensor<2,dim>::unrolled_to_component_indices (component); + + for (unsigned int i = 0; i < 5; i++) + { + in_dviscositydstrainrate.strain_rate[i] = in_base.strain_rate[i] + + std::fabs(in_base.strain_rate[i][strain_rate_indices]) + * finite_difference_accuracy + * aspect::Utilities::nth_basis_for_symmetric_tensors(component); + } + + + simulator_access.get_material_model().evaluate(in_dviscositydstrainrate, out_dviscositydstrainrate); + + for (unsigned int i = 0; i < 5; i++) + { + // prevent division by zero. If it is zero, the test has passed, because or + // the finite difference and the analytical result match perfectly, or (more + // likely) the material model in independent of this variable. + temp = out_dviscositydstrainrate.viscosities[i] - out_base.viscosities[i]; + if (temp != 0) + { + temp /= std::fabs(in_dviscositydstrainrate.strain_rate[i][strain_rate_indices]) * finite_difference_accuracy; + } + std::cout << "strain-rate: point = " << i << ", component = " << component << ", Finite difference = " << temp << ", Analytical derivative = " << derivatives->viscosity_derivative_wrt_strain_rate[i][strain_rate_indices] << std::endl; + if (std::fabs(temp - derivatives->viscosity_derivative_wrt_strain_rate[i][strain_rate_indices]) > 1e-3 * (std::fabs(temp) + std::fabs(derivatives->viscosity_derivative_wrt_strain_rate[i][strain_rate_indices]))) + { + std::cout << " Error: The derivative of the viscosity to the strain rate is too different from the analytical value." << std::endl; + Error = true; + } + + } - } + } - } + if (Error) + { + std::cout << "Some parts of the test were not successful." << std::endl; + } + else + { + std::cout << "OK" << std::endl; + } - if (Error) - { - std::cout << "Some parts of the test were not successful." << std::endl; - } - else - { - std::cout << "OK" << std::endl; - } + } -} + template <> + void f(const aspect::SimulatorAccess<3> &, + aspect::Assemblers::Manager<3> &) + { + AssertThrow(false,dealii::ExcInternalError()); + } -template <> -void f(const aspect::SimulatorAccess<3> &, - aspect::Assemblers::Manager<3> &) -{ - AssertThrow(false,dealii::ExcInternalError()); -} + template + void signal_connector (aspect::SimulatorSignals &signals) + { + std::cout << "* Connecting signals" << std::endl; + signals.set_assemblers.connect (std::bind(&f, + std::placeholders::_1, + std::placeholders::_2)); + } -template -void signal_connector (aspect::SimulatorSignals &signals) -{ - std::cout << "* Connecting signals" << std::endl; - signals.set_assemblers.connect (std::bind(&f, - std::placeholders::_1, - std::placeholders::_2)); + ASPECT_REGISTER_SIGNALS_CONNECTOR(signal_connector<2>, + signal_connector<3>) } - -ASPECT_REGISTER_SIGNALS_CONNECTOR(signal_connector<2>, - signal_connector<3>) diff --git a/tests/drucker_prager_derivatives_3d.cc b/tests/drucker_prager_derivatives_3d.cc index 2e8c3281178..6ec15235044 100644 --- a/tests/drucker_prager_derivatives_3d.cc +++ b/tests/drucker_prager_derivatives_3d.cc @@ -33,229 +33,232 @@ #include -template -void f(const aspect::SimulatorAccess &simulator_access, - aspect::Assemblers::Manager &) +namespace aspect { - - std::cout << std::endl << "Testing DruckerPrager derivatives against finite difference derivatives " << std::endl; - - using namespace aspect::MaterialModel; - - // first set all material model values - MaterialModelInputs in_base(5,3); - in_base.composition[0][0] = 0; - in_base.composition[0][1] = 0; - in_base.composition[0][2] = 0; - in_base.composition[1][0] = 0.75; - in_base.composition[1][1] = 0.15; - in_base.composition[1][2] = 0.10; - in_base.composition[2][0] = 0; - in_base.composition[2][1] = 0.2; - in_base.composition[2][2] = 0.4; - in_base.composition[3][0] = 0; - in_base.composition[3][1] = 0.2; - in_base.composition[3][2] = 0.4; - in_base.composition[4][0] = 1; - in_base.composition[4][1] = 0; - in_base.composition[4][2] = 0; - - in_base.temperature[0] = 293; - in_base.temperature[1] = 1600; - in_base.temperature[2] = 2000; - in_base.temperature[3] = 2100; - in_base.temperature[4] = 2200; - - in_base.pressure[0] = 1e9; - in_base.pressure[1] = 5e9; - in_base.pressure[2] = 2e10; - in_base.pressure[3] = 2e11; - in_base.pressure[4] = 2e12; - - /** - * We can't take to small strain-rates, because then the difference in the - * visocisty will be too small for the double accuracy which stores - * the visocity solutions and the finite difference solution. - */ - in_base.strain_rate[0] = SymmetricTensor<2,dim>(); - in_base.strain_rate[0][0][0] = 1e-12; - in_base.strain_rate[0][0][1] = 1e-12; - in_base.strain_rate[0][1][1] = 1e-11; - in_base.strain_rate[0][2][0] = 1e-12; - in_base.strain_rate[0][2][1] = 1e-12; - in_base.strain_rate[0][2][2] = 1e-11; - - in_base.strain_rate[1] = SymmetricTensor<2,dim>(in_base.strain_rate[0]); - in_base.strain_rate[1][0][0] = -1.71266e-13; - in_base.strain_rate[1][0][1] = -5.82647e-12; - in_base.strain_rate[1][1][1] = 4.21668e-14; - in_base.strain_rate[1][2][0] = -5.42647e-12; - in_base.strain_rate[1][2][1] = -5.22647e-12; - in_base.strain_rate[1][2][2] = 4.21668e-14; - - in_base.strain_rate[2] = SymmetricTensor<2,dim>(in_base.strain_rate[0]); - in_base.strain_rate[2][1][1] = 1e-13; - in_base.strain_rate[2][0][1] = 1e-11; - in_base.strain_rate[2][0][0] = -1e-12; - in_base.strain_rate[2][2][0] = 1e-11; - in_base.strain_rate[2][2][1] = 1e-11; - in_base.strain_rate[2][2][2] = -1e-12; - - in_base.strain_rate[3] = SymmetricTensor<2,dim>(in_base.strain_rate[0]); - in_base.strain_rate[3][1][1] = 4.9e-21; - in_base.strain_rate[3][0][1] = 4.9e-21; - in_base.strain_rate[3][0][0] = 4.9e-21; - in_base.strain_rate[3][2][0] = 4.9e-21; - in_base.strain_rate[3][2][1] = 4.9e-21; - in_base.strain_rate[3][2][2] = 4.9e-21; - - in_base.strain_rate[4] = SymmetricTensor<2,dim>(in_base.strain_rate[0]); - in_base.strain_rate[4][1][1] = 1e-11; - in_base.strain_rate[4][0][1] = 1e-11; - in_base.strain_rate[4][0][0] = 1e-11; - in_base.strain_rate[4][2][0] = 1e-11; - in_base.strain_rate[4][2][1] = 1e-11; - in_base.strain_rate[4][2][2] = 1e-11; - - // initialize some variables we will need later. - const double finite_difference_accuracy = 1e-7; - const double finite_difference_factor = 1+finite_difference_accuracy; - - MaterialModelInputs in_dviscositydstrainrate(in_base); - - MaterialModelOutputs out_base(5,3); - MaterialModelOutputs out_dviscositydpressure(5,3); - MaterialModelOutputs out_dviscositydstrainrate(5,3); - - // initialize the material we want to test. - aspect::ParameterHandler prm; - - const aspect::MaterialModel::DruckerPrager const_material_model = dynamic_cast &>(simulator_access.get_material_model()); - aspect::MaterialModel::DruckerPrager material_model = const_cast &>(const_material_model); - - material_model.declare_parameters(prm); - - prm.enter_subsection("Material model"); + template + void f(const aspect::SimulatorAccess &simulator_access, + aspect::Assemblers::Manager &) { - prm.enter_subsection ("Drucker Prager"); + + std::cout << std::endl << "Testing DruckerPrager derivatives against finite difference derivatives " << std::endl; + + using namespace aspect::MaterialModel; + + // first set all material model values + MaterialModelInputs in_base(5,3); + in_base.composition[0][0] = 0; + in_base.composition[0][1] = 0; + in_base.composition[0][2] = 0; + in_base.composition[1][0] = 0.75; + in_base.composition[1][1] = 0.15; + in_base.composition[1][2] = 0.10; + in_base.composition[2][0] = 0; + in_base.composition[2][1] = 0.2; + in_base.composition[2][2] = 0.4; + in_base.composition[3][0] = 0; + in_base.composition[3][1] = 0.2; + in_base.composition[3][2] = 0.4; + in_base.composition[4][0] = 1; + in_base.composition[4][1] = 0; + in_base.composition[4][2] = 0; + + in_base.temperature[0] = 293; + in_base.temperature[1] = 1600; + in_base.temperature[2] = 2000; + in_base.temperature[3] = 2100; + in_base.temperature[4] = 2200; + + in_base.pressure[0] = 1e9; + in_base.pressure[1] = 5e9; + in_base.pressure[2] = 2e10; + in_base.pressure[3] = 2e11; + in_base.pressure[4] = 2e12; + + /** + * We can't take to small strain-rates, because then the difference in the + * visocisty will be too small for the double accuracy which stores + * the visocity solutions and the finite difference solution. + */ + in_base.strain_rate[0] = SymmetricTensor<2,dim>(); + in_base.strain_rate[0][0][0] = 1e-12; + in_base.strain_rate[0][0][1] = 1e-12; + in_base.strain_rate[0][1][1] = 1e-11; + in_base.strain_rate[0][2][0] = 1e-12; + in_base.strain_rate[0][2][1] = 1e-12; + in_base.strain_rate[0][2][2] = 1e-11; + + in_base.strain_rate[1] = SymmetricTensor<2,dim>(in_base.strain_rate[0]); + in_base.strain_rate[1][0][0] = -1.71266e-13; + in_base.strain_rate[1][0][1] = -5.82647e-12; + in_base.strain_rate[1][1][1] = 4.21668e-14; + in_base.strain_rate[1][2][0] = -5.42647e-12; + in_base.strain_rate[1][2][1] = -5.22647e-12; + in_base.strain_rate[1][2][2] = 4.21668e-14; + + in_base.strain_rate[2] = SymmetricTensor<2,dim>(in_base.strain_rate[0]); + in_base.strain_rate[2][1][1] = 1e-13; + in_base.strain_rate[2][0][1] = 1e-11; + in_base.strain_rate[2][0][0] = -1e-12; + in_base.strain_rate[2][2][0] = 1e-11; + in_base.strain_rate[2][2][1] = 1e-11; + in_base.strain_rate[2][2][2] = -1e-12; + + in_base.strain_rate[3] = SymmetricTensor<2,dim>(in_base.strain_rate[0]); + in_base.strain_rate[3][1][1] = 4.9e-21; + in_base.strain_rate[3][0][1] = 4.9e-21; + in_base.strain_rate[3][0][0] = 4.9e-21; + in_base.strain_rate[3][2][0] = 4.9e-21; + in_base.strain_rate[3][2][1] = 4.9e-21; + in_base.strain_rate[3][2][2] = 4.9e-21; + + in_base.strain_rate[4] = SymmetricTensor<2,dim>(in_base.strain_rate[0]); + in_base.strain_rate[4][1][1] = 1e-11; + in_base.strain_rate[4][0][1] = 1e-11; + in_base.strain_rate[4][0][0] = 1e-11; + in_base.strain_rate[4][2][0] = 1e-11; + in_base.strain_rate[4][2][1] = 1e-11; + in_base.strain_rate[4][2][2] = 1e-11; + + // initialize some variables we will need later. + const double finite_difference_accuracy = 1e-7; + const double finite_difference_factor = 1+finite_difference_accuracy; + + MaterialModelInputs in_dviscositydstrainrate(in_base); + + MaterialModelOutputs out_base(5,3); + MaterialModelOutputs out_dviscositydpressure(5,3); + MaterialModelOutputs out_dviscositydstrainrate(5,3); + + // initialize the material we want to test. + aspect::ParameterHandler prm; + + const aspect::MaterialModel::DruckerPrager const_material_model = dynamic_cast &>(simulator_access.get_material_model()); + aspect::MaterialModel::DruckerPrager material_model = const_cast &>(const_material_model); + + material_model.declare_parameters(prm); + + prm.enter_subsection("Material model"); { - prm.enter_subsection ("Viscosity"); + prm.enter_subsection ("Drucker Prager"); { - prm.set ("Reference strain rate", "1e-20"); - prm.set ("Angle of internal friction", "30"); + prm.enter_subsection ("Viscosity"); + { + prm.set ("Reference strain rate", "1e-20"); + prm.set ("Angle of internal friction", "30"); + } + prm.leave_subsection(); } prm.leave_subsection(); } prm.leave_subsection(); - } - prm.leave_subsection(); - - const_cast &>(simulator_access.get_material_model()).parse_parameters(prm); - out_base.additional_outputs.push_back(std::make_unique> (5)); + const_cast &>(simulator_access.get_material_model()).parse_parameters(prm); - simulator_access.get_material_model().evaluate(in_base, out_base); + out_base.additional_outputs.push_back(std::make_unique> (5)); - // set up additional output for the derivatives - MaterialModelDerivatives *derivatives; - derivatives = out_base.template get_additional_output>(); - double temp; + simulator_access.get_material_model().evaluate(in_base, out_base); - // have a bool so we know whether the test has succeed or not. - bool Error = false; - - // test the pressure derivative. - MaterialModelInputs in_dviscositydpressure(in_base); - in_dviscositydpressure.pressure[0] *= finite_difference_factor; - in_dviscositydpressure.pressure[1] *= finite_difference_factor; - in_dviscositydpressure.pressure[2] *= finite_difference_factor; - in_dviscositydpressure.pressure[3] *= finite_difference_factor; - in_dviscositydpressure.pressure[4] *= finite_difference_factor; - - simulator_access.get_material_model().evaluate(in_dviscositydpressure, out_dviscositydpressure); - - for (unsigned int i = 0; i < 5; i++) - { - // prevent division by zero. If it is zero, the test has passed, because or - // the finite difference and the analytical result match perfectly, or (more - // likely) the material model in independent of this variable. - temp = (out_dviscositydpressure.viscosities[i] - out_base.viscosities[i]); - if (in_base.pressure[i] != 0) - { - temp /= (in_base.pressure[i] * finite_difference_accuracy); - } - std::cout << "pressure: point = " << i << ", Finite difference = " << temp << ", Analytical derivative = " << derivatives->viscosity_derivative_wrt_pressure[i] << std::endl; - if (std::fabs(temp - derivatives->viscosity_derivative_wrt_pressure[i]) > 1e-3 * (std::fabs(temp) + std::fabs(derivatives->viscosity_derivative_wrt_pressure[i]))) - { - std::cout << " Error: The derivative of the viscosity to the pressure is too different from the analytical value." << std::endl; - Error = true; - } + // set up additional output for the derivatives + MaterialModelDerivatives *derivatives; + derivatives = out_base.template get_additional_output>(); + double temp; - } + // have a bool so we know whether the test has succeed or not. + bool Error = false; - // test the strain-rate derivative. - for (unsigned int component = 0; component < SymmetricTensor<2,dim>::n_independent_components; ++component) - { - const TableIndices<2> strain_rate_indices = SymmetricTensor<2,dim>::unrolled_to_component_indices (component); + // test the pressure derivative. + MaterialModelInputs in_dviscositydpressure(in_base); + in_dviscositydpressure.pressure[0] *= finite_difference_factor; + in_dviscositydpressure.pressure[1] *= finite_difference_factor; + in_dviscositydpressure.pressure[2] *= finite_difference_factor; + in_dviscositydpressure.pressure[3] *= finite_difference_factor; + in_dviscositydpressure.pressure[4] *= finite_difference_factor; - for (unsigned int i = 0; i < 5; i++) - { - in_dviscositydstrainrate.strain_rate[i] = in_base.strain_rate[i] - + std::fabs(in_base.strain_rate[i][strain_rate_indices]) - * finite_difference_accuracy - * aspect::Utilities::nth_basis_for_symmetric_tensors(component); - } + simulator_access.get_material_model().evaluate(in_dviscositydpressure, out_dviscositydpressure); + for (unsigned int i = 0; i < 5; i++) + { + // prevent division by zero. If it is zero, the test has passed, because or + // the finite difference and the analytical result match perfectly, or (more + // likely) the material model in independent of this variable. + temp = (out_dviscositydpressure.viscosities[i] - out_base.viscosities[i]); + if (in_base.pressure[i] != 0) + { + temp /= (in_base.pressure[i] * finite_difference_accuracy); + } + std::cout << "pressure: point = " << i << ", Finite difference = " << temp << ", Analytical derivative = " << derivatives->viscosity_derivative_wrt_pressure[i] << std::endl; + if (std::fabs(temp - derivatives->viscosity_derivative_wrt_pressure[i]) > 1e-3 * (std::fabs(temp) + std::fabs(derivatives->viscosity_derivative_wrt_pressure[i]))) + { + std::cout << " Error: The derivative of the viscosity to the pressure is too different from the analytical value." << std::endl; + Error = true; + } - simulator_access.get_material_model().evaluate(in_dviscositydstrainrate, out_dviscositydstrainrate); + } - for (unsigned int i = 0; i < 5; i++) - { - // prevent division by zero. If it is zero, the test has passed, because or - // the finite difference and the analytical result match perfectly, or (more - // likely) the material model in independent of this variable. - temp = out_dviscositydstrainrate.viscosities[i] - out_base.viscosities[i]; - if (temp != 0) - { - temp /= std::fabs(in_dviscositydstrainrate.strain_rate[i][strain_rate_indices]) * finite_difference_accuracy; - } - std::cout << "strain-rate: point = " << i << ", component = " << component << ", Finite difference = " << temp << ", Analytical derivative = " << derivatives->viscosity_derivative_wrt_strain_rate[i][strain_rate_indices] << std::endl; - if (std::fabs(temp - derivatives->viscosity_derivative_wrt_strain_rate[i][strain_rate_indices]) > 1e-3 * (std::fabs(temp) + std::fabs(derivatives->viscosity_derivative_wrt_strain_rate[i][strain_rate_indices]))) - { - std::cout << " Error: The derivative of the viscosity to the strain rate is too different from the analytical value." << std::endl; - Error = true; - } + // test the strain-rate derivative. + for (unsigned int component = 0; component < SymmetricTensor<2,dim>::n_independent_components; ++component) + { + const TableIndices<2> strain_rate_indices = SymmetricTensor<2,dim>::unrolled_to_component_indices (component); + + for (unsigned int i = 0; i < 5; i++) + { + in_dviscositydstrainrate.strain_rate[i] = in_base.strain_rate[i] + + std::fabs(in_base.strain_rate[i][strain_rate_indices]) + * finite_difference_accuracy + * aspect::Utilities::nth_basis_for_symmetric_tensors(component); + } + + + simulator_access.get_material_model().evaluate(in_dviscositydstrainrate, out_dviscositydstrainrate); + + for (unsigned int i = 0; i < 5; i++) + { + // prevent division by zero. If it is zero, the test has passed, because or + // the finite difference and the analytical result match perfectly, or (more + // likely) the material model in independent of this variable. + temp = out_dviscositydstrainrate.viscosities[i] - out_base.viscosities[i]; + if (temp != 0) + { + temp /= std::fabs(in_dviscositydstrainrate.strain_rate[i][strain_rate_indices]) * finite_difference_accuracy; + } + std::cout << "strain-rate: point = " << i << ", component = " << component << ", Finite difference = " << temp << ", Analytical derivative = " << derivatives->viscosity_derivative_wrt_strain_rate[i][strain_rate_indices] << std::endl; + if (std::fabs(temp - derivatives->viscosity_derivative_wrt_strain_rate[i][strain_rate_indices]) > 1e-3 * (std::fabs(temp) + std::fabs(derivatives->viscosity_derivative_wrt_strain_rate[i][strain_rate_indices]))) + { + std::cout << " Error: The derivative of the viscosity to the strain rate is too different from the analytical value." << std::endl; + Error = true; + } + + } - } + } - } + if (Error) + { + std::cout << "Some parts of the test were not successful." << std::endl; + } + else + { + std::cout << "OK" << std::endl; + } - if (Error) - { - std::cout << "Some parts of the test were not successful." << std::endl; - } - else - { - std::cout << "OK" << std::endl; - } + } -} + template <> + void f(const aspect::SimulatorAccess<2> &, + aspect::Assemblers::Manager<2> &) + { + AssertThrow(false,dealii::ExcInternalError()); + } -template <> -void f(const aspect::SimulatorAccess<2> &, - aspect::Assemblers::Manager<2> &) -{ - AssertThrow(false,dealii::ExcInternalError()); -} + template + void signal_connector (aspect::SimulatorSignals &signals) + { + std::cout << "* Connecting signals" << std::endl; + signals.set_assemblers.connect (std::bind(&f, + std::placeholders::_1, + std::placeholders::_2)); + } -template -void signal_connector (aspect::SimulatorSignals &signals) -{ - std::cout << "* Connecting signals" << std::endl; - signals.set_assemblers.connect (std::bind(&f, - std::placeholders::_1, - std::placeholders::_2)); + ASPECT_REGISTER_SIGNALS_CONNECTOR(signal_connector<2>, + signal_connector<3>) } - -ASPECT_REGISTER_SIGNALS_CONNECTOR(signal_connector<2>, - signal_connector<3>) diff --git a/tests/own_gravity.cc b/tests/own_gravity.cc index e4ef8057cb6..aac5dd918cb 100644 --- a/tests/own_gravity.cc +++ b/tests/own_gravity.cc @@ -22,20 +22,23 @@ #include #include -template -class MyGravity : - public aspect::GravityModel::Interface +namespace aspect { - public: - virtual Tensor<1,dim> gravity_vector (const Point &position) const - { - Tensor<1,dim> ret; - ret[0] = position[1]; - ret[1] = 42.0; - return ret; - } -}; + template + class MyGravity : + public aspect::GravityModel::Interface + { + public: + virtual Tensor<1,dim> gravity_vector (const Point &position) const + { + Tensor<1,dim> ret; + ret[0] = position[1]; + ret[1] = 42.0; + return ret; + } + }; // explicit instantiation -ASPECT_REGISTER_GRAVITY_MODEL(MyGravity, "my gravity", "no description") + ASPECT_REGISTER_GRAVITY_MODEL(MyGravity, "my gravity", "no description") +} diff --git a/tests/prm_distance_polygon.cc b/tests/prm_distance_polygon.cc index 50d48fda0f8..85bcdf1dde5 100644 --- a/tests/prm_distance_polygon.cc +++ b/tests/prm_distance_polygon.cc @@ -24,54 +24,57 @@ #include -int f() +namespace aspect { - using namespace aspect::Utilities; - - const int dim=3; - - // A square polygon - std::vector> polygon(4); - polygon[0] = Point<2>(0.0,0.0); - polygon[1] = Point<2>(1.0,0.0); - polygon[2] = Point<2>(1.0,1.0); - polygon[3] = Point<2>(0.0,1.0); - - // A concave polygon - std::vector> concave_polygon(5); - concave_polygon[0] = Point<2>(0.0,0.0); - concave_polygon[1] = Point<2>(1.0,0.0); - concave_polygon[2] = Point<2>(1.0,1.0); - concave_polygon[3] = Point<2>(0.5,0.5); - concave_polygon[4] = Point<2>(0.0,1.0); - - // A selfcrossing polygon - std::vector> crossing_polygon(4); - crossing_polygon[0] = Point<2>(0.0,0.0); - crossing_polygon[1] = Point<2>(1.0,0.0); - crossing_polygon[2] = Point<2>(1.0,-1.0); - crossing_polygon[3] = Point<2>(0.0,1.0); - - - // Some points inside and outside the polygon - Point<2> points[] = {Point<2>(0.5,-1), Point<2>(0.5,0.5), Point<2>(0.001,0.2), Point<2>(2.0,2.0), Point<2>(0.25,0.70)}; - - std::cout << "Testing distance to polygon function with the following parameters: (polygon 1) " - << polygon[0] << ", " << polygon[1] << ", " << polygon[2] << ", " << polygon[3] << ", " - << "(polygon 2) " << concave_polygon[0] << ", " << concave_polygon[1] << ", " << concave_polygon[2] << ", " << concave_polygon[3] << ", " << concave_polygon[4] << ", " - << "(polygon 3) " << crossing_polygon[0] << ", " << crossing_polygon[1] << ", " << crossing_polygon[2] << ", " << crossing_polygon[3] - << ", (points) " - << points[0] << ", " << points[1] << ", " << points[2] << ", " << points[3] << ", " << points[4] << std::endl; - - for (unsigned int i = 0; i < 5; i++) - { - std::cout << "Minimal distance of point " << points[i] << " to polygon 1 = " << signed_distance_to_polygon(polygon,points[i]) << std::endl; - std::cout << "Minimal distance of point " << points[i] << " to polygon 2 = " << signed_distance_to_polygon(concave_polygon,points[i]) << std::endl; - std::cout << "Minimal distance of point " << points[i] << " to polygon 3 = " << signed_distance_to_polygon(crossing_polygon,points[i]) << std::endl; - } - - exit(0); - return 42; -} + int f() + { + using namespace aspect::Utilities; + + const int dim=3; + + // A square polygon + std::vector> polygon(4); + polygon[0] = Point<2>(0.0,0.0); + polygon[1] = Point<2>(1.0,0.0); + polygon[2] = Point<2>(1.0,1.0); + polygon[3] = Point<2>(0.0,1.0); + + // A concave polygon + std::vector> concave_polygon(5); + concave_polygon[0] = Point<2>(0.0,0.0); + concave_polygon[1] = Point<2>(1.0,0.0); + concave_polygon[2] = Point<2>(1.0,1.0); + concave_polygon[3] = Point<2>(0.5,0.5); + concave_polygon[4] = Point<2>(0.0,1.0); + + // A selfcrossing polygon + std::vector> crossing_polygon(4); + crossing_polygon[0] = Point<2>(0.0,0.0); + crossing_polygon[1] = Point<2>(1.0,0.0); + crossing_polygon[2] = Point<2>(1.0,-1.0); + crossing_polygon[3] = Point<2>(0.0,1.0); + + + // Some points inside and outside the polygon + Point<2> points[] = {Point<2>(0.5,-1), Point<2>(0.5,0.5), Point<2>(0.001,0.2), Point<2>(2.0,2.0), Point<2>(0.25,0.70)}; + + std::cout << "Testing distance to polygon function with the following parameters: (polygon 1) " + << polygon[0] << ", " << polygon[1] << ", " << polygon[2] << ", " << polygon[3] << ", " + << "(polygon 2) " << concave_polygon[0] << ", " << concave_polygon[1] << ", " << concave_polygon[2] << ", " << concave_polygon[3] << ", " << concave_polygon[4] << ", " + << "(polygon 3) " << crossing_polygon[0] << ", " << crossing_polygon[1] << ", " << crossing_polygon[2] << ", " << crossing_polygon[3] + << ", (points) " + << points[0] << ", " << points[1] << ", " << points[2] << ", " << points[3] << ", " << points[4] << std::endl; + + for (unsigned int i = 0; i < 5; i++) + { + std::cout << "Minimal distance of point " << points[i] << " to polygon 1 = " << signed_distance_to_polygon(polygon,points[i]) << std::endl; + std::cout << "Minimal distance of point " << points[i] << " to polygon 2 = " << signed_distance_to_polygon(concave_polygon,points[i]) << std::endl; + std::cout << "Minimal distance of point " << points[i] << " to polygon 3 = " << signed_distance_to_polygon(crossing_polygon,points[i]) << std::endl; + } + + exit(0); + return 42; + } // run this function by initializing a global variable by it -int i = f(); + int i = f(); +} diff --git a/tests/simple_nonlinear.cc b/tests/simple_nonlinear.cc index 023770ed4c5..c16f554b64f 100644 --- a/tests/simple_nonlinear.cc +++ b/tests/simple_nonlinear.cc @@ -30,224 +30,228 @@ #include "../benchmarks/newton_solver_benchmark_set/nonlinear_channel_flow/simple_nonlinear.cc" -template -int f(double parameter) +namespace aspect { + template + int f(double parameter) + { - std::cout << std::endl << "Test for p = " << parameter << " with dimension " << dim << std::endl; - - using namespace aspect::MaterialModel; - - // first set all material model values - MaterialModelInputs in_base(5,3); - in_base.composition[0][0] = 0; - in_base.composition[0][1] = 0; - in_base.composition[0][2] = 0; - in_base.composition[1][0] = 0.75; - in_base.composition[1][1] = 0.15; - in_base.composition[1][2] = 0.10; - in_base.composition[2][0] = 0; - in_base.composition[2][1] = 0.2; - in_base.composition[2][2] = 0.4; - in_base.composition[3][0] = 0; - in_base.composition[3][1] = 0.2; - in_base.composition[3][2] = 0.4; - in_base.composition[4][0] = 1; - in_base.composition[4][1] = 0; - in_base.composition[4][2] = 0; - - in_base.temperature[0] = 293; - in_base.temperature[1] = 1600; - in_base.temperature[2] = 2000; - in_base.temperature[3] = 2100; - in_base.temperature[4] = 2200; - - in_base.pressure[0] = 1e9; - in_base.pressure[1] = 5e9; - in_base.pressure[2] = 2e10; - in_base.pressure[3] = 2e11; - in_base.pressure[4] = 2e12; - - /** - * We can't take to small strain-rates, because then the difference in the - * viscosity will be too small for the double accuracy which stores - * the viscosity solutions and the finite difference solution. - */ - in_base.strain_rate[0] = SymmetricTensor<2,dim>(); - in_base.strain_rate[0][0][0] = 1e-12; - in_base.strain_rate[0][0][1] = 1e-12; - in_base.strain_rate[0][1][1] = 1e-11; - if (dim == 3) - { - in_base.strain_rate[0][2][0] = 1e-12; - in_base.strain_rate[0][2][1] = 1e-12; - in_base.strain_rate[0][2][2] = 1e-11; - } - - in_base.strain_rate[1] = SymmetricTensor<2,dim>(in_base.strain_rate[0]); - in_base.strain_rate[1][0][0] = -1.71266e-13; - in_base.strain_rate[1][0][1] = -5.82647e-12; - in_base.strain_rate[1][1][1] = 4.21668e-14; - if (dim == 3) - { - in_base.strain_rate[1][2][0] = -5.42647e-12; - in_base.strain_rate[1][2][1] = -5.22647e-12; - in_base.strain_rate[1][2][2] = 4.21668e-14; - } - in_base.strain_rate[2] = SymmetricTensor<2,dim>(in_base.strain_rate[0]); - in_base.strain_rate[2][1][1] = 1e-13; - in_base.strain_rate[2][0][1] = 1e-11; - in_base.strain_rate[2][0][0] = -1e-12; - if (dim == 3) + std::cout << std::endl << "Test for p = " << parameter << " with dimension " << dim << std::endl; + + using namespace aspect::MaterialModel; + + // first set all material model values + MaterialModelInputs in_base(5,3); + in_base.composition[0][0] = 0; + in_base.composition[0][1] = 0; + in_base.composition[0][2] = 0; + in_base.composition[1][0] = 0.75; + in_base.composition[1][1] = 0.15; + in_base.composition[1][2] = 0.10; + in_base.composition[2][0] = 0; + in_base.composition[2][1] = 0.2; + in_base.composition[2][2] = 0.4; + in_base.composition[3][0] = 0; + in_base.composition[3][1] = 0.2; + in_base.composition[3][2] = 0.4; + in_base.composition[4][0] = 1; + in_base.composition[4][1] = 0; + in_base.composition[4][2] = 0; + + in_base.temperature[0] = 293; + in_base.temperature[1] = 1600; + in_base.temperature[2] = 2000; + in_base.temperature[3] = 2100; + in_base.temperature[4] = 2200; + + in_base.pressure[0] = 1e9; + in_base.pressure[1] = 5e9; + in_base.pressure[2] = 2e10; + in_base.pressure[3] = 2e11; + in_base.pressure[4] = 2e12; + + /** + * We can't take to small strain-rates, because then the difference in the + * viscosity will be too small for the double accuracy which stores + * the viscosity solutions and the finite difference solution. + */ + in_base.strain_rate[0] = SymmetricTensor<2,dim>(); + in_base.strain_rate[0][0][0] = 1e-12; + in_base.strain_rate[0][0][1] = 1e-12; + in_base.strain_rate[0][1][1] = 1e-11; + if (dim == 3) + { + in_base.strain_rate[0][2][0] = 1e-12; + in_base.strain_rate[0][2][1] = 1e-12; + in_base.strain_rate[0][2][2] = 1e-11; + } + + in_base.strain_rate[1] = SymmetricTensor<2,dim>(in_base.strain_rate[0]); + in_base.strain_rate[1][0][0] = -1.71266e-13; + in_base.strain_rate[1][0][1] = -5.82647e-12; + in_base.strain_rate[1][1][1] = 4.21668e-14; + if (dim == 3) + { + in_base.strain_rate[1][2][0] = -5.42647e-12; + in_base.strain_rate[1][2][1] = -5.22647e-12; + in_base.strain_rate[1][2][2] = 4.21668e-14; + } + in_base.strain_rate[2] = SymmetricTensor<2,dim>(in_base.strain_rate[0]); + in_base.strain_rate[2][1][1] = 1e-13; + in_base.strain_rate[2][0][1] = 1e-11; + in_base.strain_rate[2][0][0] = -1e-12; + if (dim == 3) + { + in_base.strain_rate[2][2][0] = 1e-11; + in_base.strain_rate[2][2][1] = 1e-11; + in_base.strain_rate[2][2][2] = -1e-12; + } + in_base.strain_rate[3] = SymmetricTensor<2,dim>(in_base.strain_rate[0]); + in_base.strain_rate[3][1][1] = 4.9e-21; + in_base.strain_rate[3][0][1] = 4.9e-21; + in_base.strain_rate[3][0][0] = 4.9e-21; + if (dim == 3) + { + in_base.strain_rate[3][2][0] = 4.9e-21; + in_base.strain_rate[3][2][1] = 4.9e-21; + in_base.strain_rate[3][2][2] = 4.9e-21; + } + in_base.strain_rate[4] = SymmetricTensor<2,dim>(in_base.strain_rate[0]); + in_base.strain_rate[4][1][1] = 1e-11; + in_base.strain_rate[4][0][1] = 1e-11; + in_base.strain_rate[4][0][0] = 1e-11; + if (dim == 3) + { + in_base.strain_rate[4][2][0] = 1e-11; + in_base.strain_rate[4][2][1] = 1e-11; + in_base.strain_rate[4][2][2] = 1e-11; + } + + // initialize some variables we will need later. + double finite_difference_accuracy = 1e-7; + double finite_difference_factor = 1+finite_difference_accuracy; + + + MaterialModelInputs in_dviscositydstrainrate(in_base); + + MaterialModelOutputs out_base(5,3); + MaterialModelOutputs out_dviscositydstrainrate(5,3); + + if (out_base.template get_additional_output>() != nullptr) + throw "error"; + + out_base.additional_outputs.push_back(std::make_unique> (5)); + + // initialize the material we want to test. + SimpleNonlinear mat; + ParameterHandler prm; + mat.declare_parameters(prm); + + prm.enter_subsection("Compositional fields"); { - in_base.strain_rate[2][2][0] = 1e-11; - in_base.strain_rate[2][2][1] = 1e-11; - in_base.strain_rate[2][2][2] = -1e-12; + prm.set("Number of fields","3"); } - in_base.strain_rate[3] = SymmetricTensor<2,dim>(in_base.strain_rate[0]); - in_base.strain_rate[3][1][1] = 4.9e-21; - in_base.strain_rate[3][0][1] = 4.9e-21; - in_base.strain_rate[3][0][0] = 4.9e-21; - if (dim == 3) - { - in_base.strain_rate[3][2][0] = 4.9e-21; - in_base.strain_rate[3][2][1] = 4.9e-21; - in_base.strain_rate[3][2][2] = 4.9e-21; - } - in_base.strain_rate[4] = SymmetricTensor<2,dim>(in_base.strain_rate[0]); - in_base.strain_rate[4][1][1] = 1e-11; - in_base.strain_rate[4][0][1] = 1e-11; - in_base.strain_rate[4][0][0] = 1e-11; - if (dim == 3) + prm.leave_subsection(); + prm.enter_subsection("Material model"); { - in_base.strain_rate[4][2][0] = 1e-11; - in_base.strain_rate[4][2][1] = 1e-11; - in_base.strain_rate[4][2][2] = 1e-11; + prm.enter_subsection ("Simple nonlinear"); + { + prm.set ("Viscosity prefactor", "1e-37,1e-36,1e-35,5e-36"); + prm.set ("Viscosity averaging p", std::to_string(parameter)); + prm.set ("Minimum strain rate", 1.4e-20); + } + prm.leave_subsection(); } + prm.leave_subsection(); - // initialize some variables we will need later. - double finite_difference_accuracy = 1e-7; - double finite_difference_factor = 1+finite_difference_accuracy; - - - MaterialModelInputs in_dviscositydstrainrate(in_base); - - MaterialModelOutputs out_base(5,3); - MaterialModelOutputs out_dviscositydstrainrate(5,3); - - if (out_base.template get_additional_output>() != nullptr) - throw "error"; - - out_base.additional_outputs.push_back(std::make_unique> (5)); - - // initialize the material we want to test. - SimpleNonlinear mat; - ParameterHandler prm; - mat.declare_parameters(prm); - - prm.enter_subsection("Compositional fields"); - { - prm.set("Number of fields","3"); + mat.parse_parameters(prm); + + mat.evaluate(in_base, out_base); + + // set up additional output for the derivatives + MaterialModelDerivatives *derivatives; + derivatives = out_base.template get_additional_output>(); + double temp; + + // have a bool so we know whether the test has succeed or not. + bool Error = false; + + // this material is not pressure dependent, so we do not test it. + + // test the strain-rate derivative. + for (unsigned int component = 0; component < SymmetricTensor<2,dim>::n_independent_components; ++component) + { + const TableIndices<2> strain_rate_indices = SymmetricTensor<2,dim>::unrolled_to_component_indices (component); + + for (unsigned int i = 0; i < 5; i++) + { + in_dviscositydstrainrate.strain_rate[i] = in_base.strain_rate[i] + + std::fabs(in_base.strain_rate[i][strain_rate_indices]) + * finite_difference_accuracy + * aspect::Utilities::nth_basis_for_symmetric_tensors(component); + } + + + mat.evaluate(in_dviscositydstrainrate, out_dviscositydstrainrate); + + for (unsigned int i = 0; i < 5; i++) + { + // prevent division by zero. If it is zero, the test has passed, because or + // the finite difference and the analytical result match perfectly, or (more + // likely) the material model in independent of this variable. + temp = out_dviscositydstrainrate.viscosities[i] - out_base.viscosities[i]; + if (temp != 0) + { + temp /= std::fabs(in_dviscositydstrainrate.strain_rate[i][strain_rate_indices]) * finite_difference_accuracy; + } + std::cout << "strain-rate: component = " << component << ", point = " << i << ", Finite difference = " << temp << ", Analytical derivative = " << derivatives->viscosity_derivative_wrt_strain_rate[i][strain_rate_indices] << std::endl; + if (std::fabs(temp - derivatives->viscosity_derivative_wrt_strain_rate[i][strain_rate_indices]) > 1e-3 * (std::fabs(temp) + std::fabs(derivatives->viscosity_derivative_wrt_strain_rate[i][strain_rate_indices]))) + { + std::cout << " Error: The derivative of the viscosity to the strain rate is too different from the analytical value." << std::endl; + Error = true; + } + + } + + } + + if (Error) + { + std::cout << "Some parts of the test were not successful." << std::endl; + } + else + { + std::cout << "OK" << std::endl; + } + + return 42; } - prm.leave_subsection(); - prm.enter_subsection("Material model"); + + int exit_function() { - prm.enter_subsection ("Simple nonlinear"); - { - prm.set ("Viscosity prefactor", "1e-37,1e-36,1e-35,5e-36"); - prm.set ("Viscosity averaging p", std::to_string(parameter)); - prm.set ("Minimum strain rate", 1.4e-20); - } - prm.leave_subsection(); + exit(0); + return 42; } - prm.leave_subsection(); - - mat.parse_parameters(prm); - - mat.evaluate(in_base, out_base); - - // set up additional output for the derivatives - MaterialModelDerivatives *derivatives; - derivatives = out_base.template get_additional_output>(); - double temp; - - // have a bool so we know whether the test has succeed or not. - bool Error = false; - - // this material is not pressure dependent, so we do not test it. - - // test the strain-rate derivative. - for (unsigned int component = 0; component < SymmetricTensor<2,dim>::n_independent_components; ++component) - { - const TableIndices<2> strain_rate_indices = SymmetricTensor<2,dim>::unrolled_to_component_indices (component); - - for (unsigned int i = 0; i < 5; i++) - { - in_dviscositydstrainrate.strain_rate[i] = in_base.strain_rate[i] - + std::fabs(in_base.strain_rate[i][strain_rate_indices]) - * finite_difference_accuracy - * aspect::Utilities::nth_basis_for_symmetric_tensors(component); - } - - - mat.evaluate(in_dviscositydstrainrate, out_dviscositydstrainrate); - - for (unsigned int i = 0; i < 5; i++) - { - // prevent division by zero. If it is zero, the test has passed, because or - // the finite difference and the analytical result match perfectly, or (more - // likely) the material model in independent of this variable. - temp = out_dviscositydstrainrate.viscosities[i] - out_base.viscosities[i]; - if (temp != 0) - { - temp /= std::fabs(in_dviscositydstrainrate.strain_rate[i][strain_rate_indices]) * finite_difference_accuracy; - } - std::cout << "strain-rate: component = " << component << ", point = " << i << ", Finite difference = " << temp << ", Analytical derivative = " << derivatives->viscosity_derivative_wrt_strain_rate[i][strain_rate_indices] << std::endl; - if (std::fabs(temp - derivatives->viscosity_derivative_wrt_strain_rate[i][strain_rate_indices]) > 1e-3 * (std::fabs(temp) + std::fabs(derivatives->viscosity_derivative_wrt_strain_rate[i][strain_rate_indices]))) - { - std::cout << " Error: The derivative of the viscosity to the strain rate is too different from the analytical value." << std::endl; - Error = true; - } - - } - - } - - if (Error) - { - std::cout << "Some parts of the test were not successful." << std::endl; - } - else - { - std::cout << "OK" << std::endl; - } - - return 42; -} - -int exit_function() -{ - exit(0); - return 42; -} // run this function by initializing a global variable by it // test 2D -int ii2 = f<2>(-1000); // Testing min function -int iz2 = f<2>(-2); // Testing generalized p norm mean with negative p -int ij2 = f<2>(-1.5); // Testing generalized p norm mean with negative, non int p -int ik2 = f<2>(-1); // Testing harmonic mean -int ji2 = f<2>(0); // Testing geometric mean -int jj2 = f<2>(1); // Testing arithmetic mean -int jk2 = f<2>(2); // Testing generalized p norm mean with positive p -int kj2 = f<2>(1000); // Testing max function + int ii2 = f<2>(-1000); // Testing min function + int iz2 = f<2>(-2); // Testing generalized p norm mean with negative p + int ij2 = f<2>(-1.5); // Testing generalized p norm mean with negative, non int p + int ik2 = f<2>(-1); // Testing harmonic mean + int ji2 = f<2>(0); // Testing geometric mean + int jj2 = f<2>(1); // Testing arithmetic mean + int jk2 = f<2>(2); // Testing generalized p norm mean with positive p + int kj2 = f<2>(1000); // Testing max function // test 3D -int ii3 = f<3>(-1000); // Testing min function -int iz3 = f<3>(-2); // Testing generalized p norm mean with negative p -int ij3 = f<3>(-1.5); // Testing generalized p norm mean with negative, non int p -int ik3 = f<3>(-1); // Testing harmonic mean -int ji3 = f<3>(0); // Testing geometric mean -int jj3 = f<3>(1); // Testing arithmetic mean -int jk3 = f<3>(2); // Testing generalized p norm mean with positive p -int kj3 = f<3>(1000); // Testing max function + int ii3 = f<3>(-1000); // Testing min function + int iz3 = f<3>(-2); // Testing generalized p norm mean with negative p + int ij3 = f<3>(-1.5); // Testing generalized p norm mean with negative, non int p + int ik3 = f<3>(-1); // Testing harmonic mean + int ji3 = f<3>(0); // Testing geometric mean + int jj3 = f<3>(1); // Testing arithmetic mean + int jk3 = f<3>(2); // Testing generalized p norm mean with positive p + int kj3 = f<3>(1000); // Testing max function // exit -int kl2 = exit_function(); + int kl2 = exit_function(); + +} diff --git a/tests/spiegelman_material.cc b/tests/spiegelman_material.cc index 5650b030bd8..c4ddb9280c6 100644 --- a/tests/spiegelman_material.cc +++ b/tests/spiegelman_material.cc @@ -20,284 +20,288 @@ #include "../tests/spiegelman_fail_test.cc" -int f(double parameter) +namespace aspect { - - std::cout << std::endl << "Test for p = " << parameter << std::endl; - - const int dim=2; - using namespace aspect::MaterialModel; - MaterialModelInputs in_base(5,3); - in_base.composition[0][0] = 0; - in_base.composition[0][1] = 0; - in_base.composition[0][2] = 0; - in_base.composition[1][0] = 0.75; - in_base.composition[1][1] = 0.15; - in_base.composition[1][2] = 0.10; - in_base.composition[2][0] = 0; - in_base.composition[2][1] = 0.2; - in_base.composition[2][2] = 0.4; - in_base.composition[3][0] = 0; - in_base.composition[3][1] = 0.2; - in_base.composition[3][2] = 0.4; - in_base.composition[4][0] = 1; - in_base.composition[4][1] = 0; - in_base.composition[4][2] = 0; - - in_base.pressure[0] = 1e9; - in_base.pressure[1] = 5e9; - in_base.pressure[2] = 2e10; - in_base.pressure[3] = 2e11; - in_base.pressure[4] = 2e12; - - /** - * We can't take to small strain-rates, because then the difference in the - * viscosity will be too small for the double accuracy which stores - * the viscosity solutions and the finite difference solution. - */ - in_base.strain_rate[0] = SymmetricTensor<2,dim>(); - in_base.strain_rate[0][0][0] = 1e-12; - in_base.strain_rate[0][0][1] = 1e-12; - in_base.strain_rate[0][1][1] = 1e-11; - in_base.strain_rate[1] = SymmetricTensor<2,dim>(in_base.strain_rate[0]); - in_base.strain_rate[1][0][0] = -1.71266e-13; - in_base.strain_rate[1][0][1] = -5.82647e-12; - in_base.strain_rate[1][1][1] = 4.21668e-14; - in_base.strain_rate[2] = SymmetricTensor<2,dim>(in_base.strain_rate[0]); - in_base.strain_rate[2][1][1] = 1e-13; - in_base.strain_rate[2][0][1] = 1e-11; - in_base.strain_rate[2][0][0] = -1e-12; - in_base.strain_rate[3] = SymmetricTensor<2,dim>(in_base.strain_rate[0]); - in_base.strain_rate[3][1][1] = 1e-22; - in_base.strain_rate[3][0][1] = 1e-22; - in_base.strain_rate[3][0][0] = -1e-22; - /** - * We can get it working with these values: - * - * in_base.strain_rate[3][1][1] = 9e-16; - * in_base.strain_rate[3][0][1] = 9e-16; - * in_base.strain_rate[3][0][0] = -9e-16; - * - * With very low strain-rates the differences between the finite difference and - * analytical solution grow. We interpent this as that the finite difference - * method we use becomes unaccurate for very low strain-rates. - */ - in_base.strain_rate[4] = SymmetricTensor<2,dim>(in_base.strain_rate[0]); - in_base.strain_rate[4][1][1] = 1e-11; - in_base.strain_rate[4][0][1] = 1e-11; - in_base.strain_rate[4][0][0] = 1e-11; - - in_base.temperature[0] = 293; - in_base.temperature[1] = 1600; - in_base.temperature[2] = 2000; - in_base.temperature[3] = 2100; - in_base.temperature[4] = 2200; - - SymmetricTensor<2,dim> zerozero = SymmetricTensor<2,dim>(); - SymmetricTensor<2,dim> onezero = SymmetricTensor<2,dim>(); - SymmetricTensor<2,dim> oneone = SymmetricTensor<2,dim>(); - - zerozero[0][0] = 1; - onezero[1][0] = 0.5; // because symmetry doubles this entry - oneone[1][1] = 1; - - double finite_difference_accuracy = 1e-7; - double finite_difference_factor = 1+finite_difference_accuracy; - - bool Error = false; - - MaterialModelInputs in_dviscositydpressure(in_base); - in_dviscositydpressure.pressure[0] *= finite_difference_factor; - in_dviscositydpressure.pressure[1] *= finite_difference_factor; - in_dviscositydpressure.pressure[2] *= finite_difference_factor; - in_dviscositydpressure.pressure[3] *= finite_difference_factor; - in_dviscositydpressure.pressure[4] *= finite_difference_factor; - - MaterialModelInputs in_dviscositydstrainrate_zerozero(in_base); - MaterialModelInputs in_dviscositydstrainrate_onezero(in_base); - MaterialModelInputs in_dviscositydstrainrate_oneone(in_base); - - in_dviscositydstrainrate_zerozero.strain_rate[0] += std::fabs(in_dviscositydstrainrate_zerozero.strain_rate[0][0][0]) * finite_difference_accuracy * zerozero; - in_dviscositydstrainrate_zerozero.strain_rate[1] += std::fabs(in_dviscositydstrainrate_zerozero.strain_rate[1][0][0]) * finite_difference_accuracy * zerozero; - in_dviscositydstrainrate_zerozero.strain_rate[2] += std::fabs(in_dviscositydstrainrate_zerozero.strain_rate[2][0][0]) * finite_difference_accuracy * zerozero; - in_dviscositydstrainrate_zerozero.strain_rate[3] += std::fabs(in_dviscositydstrainrate_zerozero.strain_rate[3][0][0]) * finite_difference_accuracy * zerozero; - in_dviscositydstrainrate_zerozero.strain_rate[4] += std::fabs(in_dviscositydstrainrate_zerozero.strain_rate[4][0][0]) * finite_difference_accuracy * zerozero; - in_dviscositydstrainrate_onezero.strain_rate[0] += std::fabs(in_dviscositydstrainrate_onezero.strain_rate[0][1][0]) * finite_difference_accuracy * onezero; - in_dviscositydstrainrate_onezero.strain_rate[1] += std::fabs(in_dviscositydstrainrate_onezero.strain_rate[1][1][0]) * finite_difference_accuracy * onezero; - in_dviscositydstrainrate_onezero.strain_rate[2] += std::fabs(in_dviscositydstrainrate_onezero.strain_rate[2][1][0]) * finite_difference_accuracy * onezero; - in_dviscositydstrainrate_onezero.strain_rate[3] += std::fabs(in_dviscositydstrainrate_onezero.strain_rate[3][1][0]) * finite_difference_accuracy * onezero; - in_dviscositydstrainrate_onezero.strain_rate[4] += std::fabs(in_dviscositydstrainrate_onezero.strain_rate[4][1][0]) * finite_difference_accuracy * onezero; - in_dviscositydstrainrate_oneone.strain_rate[0] += std::fabs(in_dviscositydstrainrate_oneone.strain_rate[0][1][1]) * finite_difference_accuracy * oneone; - in_dviscositydstrainrate_oneone.strain_rate[1] += std::fabs(in_dviscositydstrainrate_oneone.strain_rate[1][1][1]) * finite_difference_accuracy * oneone; - in_dviscositydstrainrate_oneone.strain_rate[2] += std::fabs(in_dviscositydstrainrate_oneone.strain_rate[2][1][1]) * finite_difference_accuracy * oneone; - in_dviscositydstrainrate_oneone.strain_rate[3] += std::fabs(in_dviscositydstrainrate_oneone.strain_rate[3][1][1]) * finite_difference_accuracy * oneone; - in_dviscositydstrainrate_oneone.strain_rate[4] += std::fabs(in_dviscositydstrainrate_oneone.strain_rate[4][1][1]) * finite_difference_accuracy * oneone; - - MaterialModelInputs in_dviscositydtemperature(in_base); - in_dviscositydtemperature.temperature[0] *= 1.0000000001; - in_dviscositydtemperature.temperature[1] *= 1.0000000001; - in_dviscositydtemperature.temperature[2] *= 1.0000000001; - in_dviscositydtemperature.temperature[3] *= 1.0000000001; - in_dviscositydtemperature.temperature[4] *= 1.0000000001; - - - MaterialModelOutputs out_base(5,3); - - MaterialModelOutputs out_dviscositydpressure(5,3); - MaterialModelOutputs out_dviscositydstrainrate_zerozero(5,3); - MaterialModelOutputs out_dviscositydstrainrate_onezero(5,3); - MaterialModelOutputs out_dviscositydstrainrate_oneone(5,3); - MaterialModelOutputs out_dviscositydtemperature(5,3); - - if (out_base.get_additional_output>() != nullptr) - throw "error"; - - out_base.additional_outputs.push_back(std::make_unique> (5)); - - SpiegelmanMaterial mat; - ParameterHandler prm; - mat.declare_parameters(prm); - - prm.enter_subsection("Compositional fields"); - { - prm.set("Number of fields","3"); - prm.set("List of conductivities","2.25"); - prm.set("List of capacities","1250"); - prm.set("List of reference densities","2700.0"); - prm.set("List of cohesions","1e8,0,1e8,1e8"); - prm.set("List of angles of internal friction","30.0"); - prm.set("List of initial viscosities","1e20"); - prm.set("List of constant viscosities","0,1e21,0,0"); - } - prm.leave_subsection(); - prm.enter_subsection("Material model"); + int f(double parameter) { - prm.enter_subsection ("Spiegelman 2016"); - { - prm.set("Use deviator of strain-rate", "false"); - prm.set("Use analytical derivative", "true"); - prm.set ("Viscosity averaging p", std::to_string(parameter)); - } - prm.leave_subsection(); - } - prm.leave_subsection(); - - mat.parse_parameters(prm); - - mat.evaluate(in_base, out_base); - mat.evaluate(in_dviscositydpressure, out_dviscositydpressure); - mat.evaluate(in_dviscositydstrainrate_zerozero, out_dviscositydstrainrate_zerozero); - mat.evaluate(in_dviscositydstrainrate_onezero, out_dviscositydstrainrate_onezero); - mat.evaluate(in_dviscositydstrainrate_oneone, out_dviscositydstrainrate_oneone); - mat.evaluate(in_dviscositydtemperature, out_dviscositydtemperature); - //set up additional output for the derivatives - MaterialModelDerivatives *derivatives; - derivatives = out_base.get_additional_output>(); - - double temp; - for (unsigned int i = 0; i < 5; i++) + std::cout << std::endl << "Test for p = " << parameter << std::endl; + + const int dim=2; + using namespace aspect::MaterialModel; + MaterialModelInputs in_base(5,3); + in_base.composition[0][0] = 0; + in_base.composition[0][1] = 0; + in_base.composition[0][2] = 0; + in_base.composition[1][0] = 0.75; + in_base.composition[1][1] = 0.15; + in_base.composition[1][2] = 0.10; + in_base.composition[2][0] = 0; + in_base.composition[2][1] = 0.2; + in_base.composition[2][2] = 0.4; + in_base.composition[3][0] = 0; + in_base.composition[3][1] = 0.2; + in_base.composition[3][2] = 0.4; + in_base.composition[4][0] = 1; + in_base.composition[4][1] = 0; + in_base.composition[4][2] = 0; + + in_base.pressure[0] = 1e9; + in_base.pressure[1] = 5e9; + in_base.pressure[2] = 2e10; + in_base.pressure[3] = 2e11; + in_base.pressure[4] = 2e12; + + /** + * We can't take to small strain-rates, because then the difference in the + * viscosity will be too small for the double accuracy which stores + * the viscosity solutions and the finite difference solution. + */ + in_base.strain_rate[0] = SymmetricTensor<2,dim>(); + in_base.strain_rate[0][0][0] = 1e-12; + in_base.strain_rate[0][0][1] = 1e-12; + in_base.strain_rate[0][1][1] = 1e-11; + in_base.strain_rate[1] = SymmetricTensor<2,dim>(in_base.strain_rate[0]); + in_base.strain_rate[1][0][0] = -1.71266e-13; + in_base.strain_rate[1][0][1] = -5.82647e-12; + in_base.strain_rate[1][1][1] = 4.21668e-14; + in_base.strain_rate[2] = SymmetricTensor<2,dim>(in_base.strain_rate[0]); + in_base.strain_rate[2][1][1] = 1e-13; + in_base.strain_rate[2][0][1] = 1e-11; + in_base.strain_rate[2][0][0] = -1e-12; + in_base.strain_rate[3] = SymmetricTensor<2,dim>(in_base.strain_rate[0]); + in_base.strain_rate[3][1][1] = 1e-22; + in_base.strain_rate[3][0][1] = 1e-22; + in_base.strain_rate[3][0][0] = -1e-22; + /** + * We can get it working with these values: + * + * in_base.strain_rate[3][1][1] = 9e-16; + * in_base.strain_rate[3][0][1] = 9e-16; + * in_base.strain_rate[3][0][0] = -9e-16; + * + * With very low strain-rates the differences between the finite difference and + * analytical solution grow. We interpent this as that the finite difference + * method we use becomes unaccurate for very low strain-rates. + */ + in_base.strain_rate[4] = SymmetricTensor<2,dim>(in_base.strain_rate[0]); + in_base.strain_rate[4][1][1] = 1e-11; + in_base.strain_rate[4][0][1] = 1e-11; + in_base.strain_rate[4][0][0] = 1e-11; + + in_base.temperature[0] = 293; + in_base.temperature[1] = 1600; + in_base.temperature[2] = 2000; + in_base.temperature[3] = 2100; + in_base.temperature[4] = 2200; + + SymmetricTensor<2,dim> zerozero = SymmetricTensor<2,dim>(); + SymmetricTensor<2,dim> onezero = SymmetricTensor<2,dim>(); + SymmetricTensor<2,dim> oneone = SymmetricTensor<2,dim>(); + + zerozero[0][0] = 1; + onezero[1][0] = 0.5; // because symmetry doubles this entry + oneone[1][1] = 1; + + double finite_difference_accuracy = 1e-7; + double finite_difference_factor = 1+finite_difference_accuracy; + + bool Error = false; + + MaterialModelInputs in_dviscositydpressure(in_base); + in_dviscositydpressure.pressure[0] *= finite_difference_factor; + in_dviscositydpressure.pressure[1] *= finite_difference_factor; + in_dviscositydpressure.pressure[2] *= finite_difference_factor; + in_dviscositydpressure.pressure[3] *= finite_difference_factor; + in_dviscositydpressure.pressure[4] *= finite_difference_factor; + + MaterialModelInputs in_dviscositydstrainrate_zerozero(in_base); + MaterialModelInputs in_dviscositydstrainrate_onezero(in_base); + MaterialModelInputs in_dviscositydstrainrate_oneone(in_base); + + in_dviscositydstrainrate_zerozero.strain_rate[0] += std::fabs(in_dviscositydstrainrate_zerozero.strain_rate[0][0][0]) * finite_difference_accuracy * zerozero; + in_dviscositydstrainrate_zerozero.strain_rate[1] += std::fabs(in_dviscositydstrainrate_zerozero.strain_rate[1][0][0]) * finite_difference_accuracy * zerozero; + in_dviscositydstrainrate_zerozero.strain_rate[2] += std::fabs(in_dviscositydstrainrate_zerozero.strain_rate[2][0][0]) * finite_difference_accuracy * zerozero; + in_dviscositydstrainrate_zerozero.strain_rate[3] += std::fabs(in_dviscositydstrainrate_zerozero.strain_rate[3][0][0]) * finite_difference_accuracy * zerozero; + in_dviscositydstrainrate_zerozero.strain_rate[4] += std::fabs(in_dviscositydstrainrate_zerozero.strain_rate[4][0][0]) * finite_difference_accuracy * zerozero; + in_dviscositydstrainrate_onezero.strain_rate[0] += std::fabs(in_dviscositydstrainrate_onezero.strain_rate[0][1][0]) * finite_difference_accuracy * onezero; + in_dviscositydstrainrate_onezero.strain_rate[1] += std::fabs(in_dviscositydstrainrate_onezero.strain_rate[1][1][0]) * finite_difference_accuracy * onezero; + in_dviscositydstrainrate_onezero.strain_rate[2] += std::fabs(in_dviscositydstrainrate_onezero.strain_rate[2][1][0]) * finite_difference_accuracy * onezero; + in_dviscositydstrainrate_onezero.strain_rate[3] += std::fabs(in_dviscositydstrainrate_onezero.strain_rate[3][1][0]) * finite_difference_accuracy * onezero; + in_dviscositydstrainrate_onezero.strain_rate[4] += std::fabs(in_dviscositydstrainrate_onezero.strain_rate[4][1][0]) * finite_difference_accuracy * onezero; + in_dviscositydstrainrate_oneone.strain_rate[0] += std::fabs(in_dviscositydstrainrate_oneone.strain_rate[0][1][1]) * finite_difference_accuracy * oneone; + in_dviscositydstrainrate_oneone.strain_rate[1] += std::fabs(in_dviscositydstrainrate_oneone.strain_rate[1][1][1]) * finite_difference_accuracy * oneone; + in_dviscositydstrainrate_oneone.strain_rate[2] += std::fabs(in_dviscositydstrainrate_oneone.strain_rate[2][1][1]) * finite_difference_accuracy * oneone; + in_dviscositydstrainrate_oneone.strain_rate[3] += std::fabs(in_dviscositydstrainrate_oneone.strain_rate[3][1][1]) * finite_difference_accuracy * oneone; + in_dviscositydstrainrate_oneone.strain_rate[4] += std::fabs(in_dviscositydstrainrate_oneone.strain_rate[4][1][1]) * finite_difference_accuracy * oneone; + + MaterialModelInputs in_dviscositydtemperature(in_base); + in_dviscositydtemperature.temperature[0] *= 1.0000000001; + in_dviscositydtemperature.temperature[1] *= 1.0000000001; + in_dviscositydtemperature.temperature[2] *= 1.0000000001; + in_dviscositydtemperature.temperature[3] *= 1.0000000001; + in_dviscositydtemperature.temperature[4] *= 1.0000000001; + + + MaterialModelOutputs out_base(5,3); + + MaterialModelOutputs out_dviscositydpressure(5,3); + MaterialModelOutputs out_dviscositydstrainrate_zerozero(5,3); + MaterialModelOutputs out_dviscositydstrainrate_onezero(5,3); + MaterialModelOutputs out_dviscositydstrainrate_oneone(5,3); + MaterialModelOutputs out_dviscositydtemperature(5,3); + + if (out_base.get_additional_output>() != nullptr) + throw "error"; + + out_base.additional_outputs.push_back(std::make_unique> (5)); + + SpiegelmanMaterial mat; + ParameterHandler prm; + mat.declare_parameters(prm); + + prm.enter_subsection("Compositional fields"); { - // prevent division by zero. If it is zero, the test has passed, because or - // the finite difference and the analytical result match perfectly, or (more - // likely) the material model in independent of this variable. - temp = (out_dviscositydpressure.viscosities[i] - out_base.viscosities[i]); - if (in_base.pressure[i] != 0) - { - temp /= (in_base.pressure[i] * finite_difference_accuracy); - } - - std::cout << "pressure on quadrature point " << i << ": Finite difference = " << temp << ". Analytical derivative = " << derivatives->viscosity_derivative_wrt_pressure[i] << std::endl; - if (std::fabs(temp - derivatives->viscosity_derivative_wrt_pressure[i]) > 1e-3 * 0.5 * (std::fabs(temp) + std::fabs(derivatives->viscosity_derivative_wrt_pressure[i]))) - { - std::cout << "Error: The derivative of the viscosity to the pressure is too different from the analytical value." << std::endl; - Error = true; - } - + prm.set("Number of fields","3"); + prm.set("List of conductivities","2.25"); + prm.set("List of capacities","1250"); + prm.set("List of reference densities","2700.0"); + prm.set("List of cohesions","1e8,0,1e8,1e8"); + prm.set("List of angles of internal friction","30.0"); + prm.set("List of initial viscosities","1e20"); + prm.set("List of constant viscosities","0,1e21,0,0"); } - - for (unsigned int i = 0; i < 5; i++) - { - // prevent division by zero. If it is zero, the test has passed, because or - // the finite difference and the analytical result match perfectly, or (more - // likely) the material model in independent of this variable. - temp = out_dviscositydstrainrate_zerozero.viscosities[i] - out_base.viscosities[i]; - if (temp != 0) - { - temp /= std::fabs(in_dviscositydstrainrate_zerozero.strain_rate[i][0][0]) * finite_difference_accuracy; - } - std::cout << "zerozero on quadrature point " << i << ": Finite difference = " << temp << ". Analytical derivative = " << derivatives->viscosity_derivative_wrt_strain_rate[i][0][0] << std::endl; - if (std::fabs(temp - derivatives->viscosity_derivative_wrt_strain_rate[i][0][0]) > 1e-3 * 0.5 * (std::fabs(temp) + std::fabs(derivatives->viscosity_derivative_wrt_strain_rate[i][0][0]))) - { - std::cout << " Error: The derivative of the viscosity to the strain rate is too different from the analytical value." << std::endl; - Error = true; - } - - - - } - - for (unsigned int i = 0; i < 5; i++) - { - // prevent division by zero. If it is zero, the test has passed, because or - // the finite difference and the analytical result match perfectly, or (more - // likely) the material model in independent of this variable. - temp = out_dviscositydstrainrate_onezero.viscosities[i] - out_base.viscosities[i]; - if (temp != 0) - { - temp /= std::fabs(in_dviscositydstrainrate_onezero.strain_rate[i][1][0]) * finite_difference_accuracy; - } - std::cout << "onezero on quadrature point " << i << ": Finite difference = " << temp << ". Analytical derivative = " << derivatives->viscosity_derivative_wrt_strain_rate[i][1][0] << std::endl; - if (std::fabs(temp - derivatives->viscosity_derivative_wrt_strain_rate[i][1][0]) > 1e-3 * 0.5 * (std::fabs(temp) + std::fabs(derivatives->viscosity_derivative_wrt_strain_rate[i][1][0])) ) - { - std::cout << " Error: The derivative of the viscosity to the strain rate is too different from the analytical value." << std::endl; - Error = true; - } - } - - for (unsigned int i = 0; i < 5; i++) + prm.leave_subsection(); + prm.enter_subsection("Material model"); { - // prevent division by zero. If it is zero, the test has passed, because or - // the finite difference and the analytical result match perfectly, or (more - // likely) the material model in independent of this variable. - temp = out_dviscositydstrainrate_oneone.viscosities[i] - out_base.viscosities[i]; - if (temp != 0) - { - temp /= std::fabs(in_dviscositydstrainrate_oneone.strain_rate[i][1][1]) * finite_difference_accuracy; - } - std::cout << "oneone on quadrature point " << i << ": Finite difference = " << temp << ". Analytical derivative = " << derivatives->viscosity_derivative_wrt_strain_rate[i][1][1] << std::endl; - if (std::fabs(temp - derivatives->viscosity_derivative_wrt_strain_rate[i][1][1]) > 1e-3 * 0.5 * (std::fabs(temp) + std::fabs(derivatives->viscosity_derivative_wrt_strain_rate[i][1][1])) ) - { - std::cout << " Error: The derivative of the viscosity to the strain rate is too different from the analytical value." << std::endl; - Error = true; - } - + prm.enter_subsection ("Spiegelman 2016"); + { + prm.set("Use deviator of strain-rate", "false"); + prm.set("Use analytical derivative", "true"); + prm.set ("Viscosity averaging p", std::to_string(parameter)); + } + prm.leave_subsection(); } + prm.leave_subsection(); - if (Error) - { - std::cout << "Some parts of the test were not successful." << std::endl; - } - else - { - std::cout << "OK" << std::endl; - } + mat.parse_parameters(prm); + + mat.evaluate(in_base, out_base); + mat.evaluate(in_dviscositydpressure, out_dviscositydpressure); + mat.evaluate(in_dviscositydstrainrate_zerozero, out_dviscositydstrainrate_zerozero); + mat.evaluate(in_dviscositydstrainrate_onezero, out_dviscositydstrainrate_onezero); + mat.evaluate(in_dviscositydstrainrate_oneone, out_dviscositydstrainrate_oneone); + mat.evaluate(in_dviscositydtemperature, out_dviscositydtemperature); + + //set up additional output for the derivatives + MaterialModelDerivatives *derivatives; + derivatives = out_base.get_additional_output>(); + + double temp; + for (unsigned int i = 0; i < 5; i++) + { + // prevent division by zero. If it is zero, the test has passed, because or + // the finite difference and the analytical result match perfectly, or (more + // likely) the material model in independent of this variable. + temp = (out_dviscositydpressure.viscosities[i] - out_base.viscosities[i]); + if (in_base.pressure[i] != 0) + { + temp /= (in_base.pressure[i] * finite_difference_accuracy); + } + + std::cout << "pressure on quadrature point " << i << ": Finite difference = " << temp << ". Analytical derivative = " << derivatives->viscosity_derivative_wrt_pressure[i] << std::endl; + if (std::fabs(temp - derivatives->viscosity_derivative_wrt_pressure[i]) > 1e-3 * 0.5 * (std::fabs(temp) + std::fabs(derivatives->viscosity_derivative_wrt_pressure[i]))) + { + std::cout << "Error: The derivative of the viscosity to the pressure is too different from the analytical value." << std::endl; + Error = true; + } + + } + + for (unsigned int i = 0; i < 5; i++) + { + // prevent division by zero. If it is zero, the test has passed, because or + // the finite difference and the analytical result match perfectly, or (more + // likely) the material model in independent of this variable. + temp = out_dviscositydstrainrate_zerozero.viscosities[i] - out_base.viscosities[i]; + if (temp != 0) + { + temp /= std::fabs(in_dviscositydstrainrate_zerozero.strain_rate[i][0][0]) * finite_difference_accuracy; + } + std::cout << "zerozero on quadrature point " << i << ": Finite difference = " << temp << ". Analytical derivative = " << derivatives->viscosity_derivative_wrt_strain_rate[i][0][0] << std::endl; + if (std::fabs(temp - derivatives->viscosity_derivative_wrt_strain_rate[i][0][0]) > 1e-3 * 0.5 * (std::fabs(temp) + std::fabs(derivatives->viscosity_derivative_wrt_strain_rate[i][0][0]))) + { + std::cout << " Error: The derivative of the viscosity to the strain rate is too different from the analytical value." << std::endl; + Error = true; + } + + + + } + + for (unsigned int i = 0; i < 5; i++) + { + // prevent division by zero. If it is zero, the test has passed, because or + // the finite difference and the analytical result match perfectly, or (more + // likely) the material model in independent of this variable. + temp = out_dviscositydstrainrate_onezero.viscosities[i] - out_base.viscosities[i]; + if (temp != 0) + { + temp /= std::fabs(in_dviscositydstrainrate_onezero.strain_rate[i][1][0]) * finite_difference_accuracy; + } + std::cout << "onezero on quadrature point " << i << ": Finite difference = " << temp << ". Analytical derivative = " << derivatives->viscosity_derivative_wrt_strain_rate[i][1][0] << std::endl; + if (std::fabs(temp - derivatives->viscosity_derivative_wrt_strain_rate[i][1][0]) > 1e-3 * 0.5 * (std::fabs(temp) + std::fabs(derivatives->viscosity_derivative_wrt_strain_rate[i][1][0])) ) + { + std::cout << " Error: The derivative of the viscosity to the strain rate is too different from the analytical value." << std::endl; + Error = true; + } + } + + for (unsigned int i = 0; i < 5; i++) + { + // prevent division by zero. If it is zero, the test has passed, because or + // the finite difference and the analytical result match perfectly, or (more + // likely) the material model in independent of this variable. + temp = out_dviscositydstrainrate_oneone.viscosities[i] - out_base.viscosities[i]; + if (temp != 0) + { + temp /= std::fabs(in_dviscositydstrainrate_oneone.strain_rate[i][1][1]) * finite_difference_accuracy; + } + std::cout << "oneone on quadrature point " << i << ": Finite difference = " << temp << ". Analytical derivative = " << derivatives->viscosity_derivative_wrt_strain_rate[i][1][1] << std::endl; + if (std::fabs(temp - derivatives->viscosity_derivative_wrt_strain_rate[i][1][1]) > 1e-3 * 0.5 * (std::fabs(temp) + std::fabs(derivatives->viscosity_derivative_wrt_strain_rate[i][1][1])) ) + { + std::cout << " Error: The derivative of the viscosity to the strain rate is too different from the analytical value." << std::endl; + Error = true; + } + + } + + if (Error) + { + std::cout << "Some parts of the test were not successful." << std::endl; + } + else + { + std::cout << "OK" << std::endl; + } + + return 42; + } - return 42; -} + int exit_function() + { + exit(0); + return 42; + } +// run this function by initializing a global variable by it + int ii = f(-1000); // Testing min function + int iz = f(-2); // Testing generalized p norm mean with negative p + int ij = f(-1.5); // Testing generalized p norm mean with negative, non int p + int ik = f(-1); // Testing harmonic mean + int ji = f(0); // Testing geometric mean + int jj = f(1); // Testing arithmetic mean + int jk = f(2); // Testing generalized p norm mean with positive p + int kj = f(1000); // Testing max function + int kl = exit_function(); -int exit_function() -{ - exit(0); - return 42; } -// run this function by initializing a global variable by it -int ii = f(-1000); // Testing min function -int iz = f(-2); // Testing generalized p norm mean with negative p -int ij = f(-1.5); // Testing generalized p norm mean with negative, non int p -int ik = f(-1); // Testing harmonic mean -int ji = f(0); // Testing geometric mean -int jj = f(1); // Testing arithmetic mean -int jk = f(2); // Testing generalized p norm mean with positive p -int kj = f(1000); // Testing max function -int kl = exit_function(); diff --git a/tests/visco_plastic_derivatives_2d.cc b/tests/visco_plastic_derivatives_2d.cc index 1468d4563ff..f97b46d729c 100644 --- a/tests/visco_plastic_derivatives_2d.cc +++ b/tests/visco_plastic_derivatives_2d.cc @@ -34,240 +34,243 @@ #include -template -void f(const aspect::SimulatorAccess &simulator_access, - aspect::Assemblers::Manager &, - std::string averaging_parameter) +namespace aspect { - - std::cout << std::endl << "Testing ViscoPlastic derivatives against analytical derivatives for averaging parameter " << averaging_parameter << std::endl; - - using namespace aspect::MaterialModel; - - // first set all material model values - MaterialModelInputs in_base(5,3); - in_base.composition[0][0] = 0; - in_base.composition[0][1] = 0; - in_base.composition[0][2] = 0; - in_base.composition[1][0] = 0.75; - in_base.composition[1][1] = 0.15; - in_base.composition[1][2] = 0.10; - in_base.composition[2][0] = 0; - in_base.composition[2][1] = 0.2; - in_base.composition[2][2] = 0.4; - in_base.composition[3][0] = 0; - in_base.composition[3][1] = 0.2; - in_base.composition[3][2] = 0.4; - in_base.composition[4][0] = 1; - in_base.composition[4][1] = 0; - in_base.composition[4][2] = 0; - - in_base.temperature[0] = 293; - in_base.temperature[1] = 1600; - in_base.temperature[2] = 2000; - in_base.temperature[3] = 2100; - in_base.temperature[4] = 600; - - in_base.pressure[0] = 1e9; - in_base.pressure[1] = 5e9; - in_base.pressure[2] = 2e10; - in_base.pressure[3] = 2e11; - in_base.pressure[4] = 5e8; - - in_base.position[0] = Point(); - in_base.position[1] = Point(); - in_base.position[2] = Point(); - in_base.position[3] = Point(); - in_base.position[4] = Point(); - - /** - * We can't take too small strain-rates, because then the difference in the - * viscosity will be too small for the double accuracy which stores - * the viscosity solutions and the finite difference solution. - */ - in_base.strain_rate[0] = SymmetricTensor<2,dim>(); - in_base.strain_rate[0][0][0] = 1e-12; - in_base.strain_rate[0][0][1] = 1e-12; - in_base.strain_rate[0][1][1] = 1e-11; - - in_base.strain_rate[1] = SymmetricTensor<2,dim>(in_base.strain_rate[0]); - in_base.strain_rate[1][0][0] = -1.71266e-13; - in_base.strain_rate[1][0][1] = -5.82647e-12; - in_base.strain_rate[1][1][1] = 4.21668e-14; - - in_base.strain_rate[2] = SymmetricTensor<2,dim>(in_base.strain_rate[0]); - in_base.strain_rate[2][1][1] = 1e-13; - in_base.strain_rate[2][0][1] = 1e-11; - in_base.strain_rate[2][0][0] = -1e-12; - - in_base.strain_rate[3] = SymmetricTensor<2,dim>(in_base.strain_rate[0]); - in_base.strain_rate[3][1][1] = 4.9e-21; - in_base.strain_rate[3][0][1] = 4.9e-21; - in_base.strain_rate[3][0][0] = 4.9e-21; - - in_base.strain_rate[4] = SymmetricTensor<2,dim>(in_base.strain_rate[0]); - in_base.strain_rate[4][1][1] = 1e-11; - in_base.strain_rate[4][0][1] = 1e-11; - in_base.strain_rate[4][0][0] = -1e-11; - - - // initialize some variables we will need later. - double finite_difference_accuracy = 1e-7; - double finite_difference_factor = 1+finite_difference_accuracy; - - - MaterialModelInputs in_dviscositydstrainrate(in_base); - - MaterialModelOutputs out_base(5,3); - MaterialModelOutputs out_dviscositydpressure(5,3); - MaterialModelOutputs out_dviscositydstrainrate(5,3); - - // initialize the material we want to test. - aspect::ParameterHandler prm; - - const aspect::MaterialModel::ViscoPlastic &const_material_model = dynamic_cast &>(simulator_access.get_material_model()); - aspect::MaterialModel::ViscoPlastic &material_model = const_cast &>(const_material_model); - - material_model.declare_parameters(prm); - - prm.enter_subsection("Material model"); + template + void f(const aspect::SimulatorAccess &simulator_access, + aspect::Assemblers::Manager &, + std::string averaging_parameter) { - prm.enter_subsection ("Visco Plastic"); - { - prm.set ("Viscosity averaging scheme", averaging_parameter); - prm.set ("Angles of internal friction", "30"); - } - prm.leave_subsection(); - } - prm.leave_subsection(); - - const_cast &>(simulator_access.get_material_model()).parse_parameters(prm); - - out_base.additional_outputs.push_back(std::make_unique> (5)); - - simulator_access.get_material_model().evaluate(in_base, out_base); - // set up additional output for the derivatives - MaterialModelDerivatives *derivatives; - derivatives = out_base.template get_additional_output>(); - double temp; - - // have a bool so we know whether the test has succeed or not. - bool Error = false; - - // test the pressure derivative. - MaterialModelInputs in_dviscositydpressure(in_base); - in_dviscositydpressure.pressure[0] *= finite_difference_factor; - in_dviscositydpressure.pressure[1] *= finite_difference_factor; - in_dviscositydpressure.pressure[2] *= finite_difference_factor; - in_dviscositydpressure.pressure[3] *= finite_difference_factor; - in_dviscositydpressure.pressure[4] *= finite_difference_factor; - - simulator_access.get_material_model().evaluate(in_dviscositydpressure, out_dviscositydpressure); - - for (unsigned int i = 0; i < 5; i++) + std::cout << std::endl << "Testing ViscoPlastic derivatives against analytical derivatives for averaging parameter " << averaging_parameter << std::endl; + + using namespace aspect::MaterialModel; + + // first set all material model values + MaterialModelInputs in_base(5,3); + in_base.composition[0][0] = 0; + in_base.composition[0][1] = 0; + in_base.composition[0][2] = 0; + in_base.composition[1][0] = 0.75; + in_base.composition[1][1] = 0.15; + in_base.composition[1][2] = 0.10; + in_base.composition[2][0] = 0; + in_base.composition[2][1] = 0.2; + in_base.composition[2][2] = 0.4; + in_base.composition[3][0] = 0; + in_base.composition[3][1] = 0.2; + in_base.composition[3][2] = 0.4; + in_base.composition[4][0] = 1; + in_base.composition[4][1] = 0; + in_base.composition[4][2] = 0; + + in_base.temperature[0] = 293; + in_base.temperature[1] = 1600; + in_base.temperature[2] = 2000; + in_base.temperature[3] = 2100; + in_base.temperature[4] = 600; + + in_base.pressure[0] = 1e9; + in_base.pressure[1] = 5e9; + in_base.pressure[2] = 2e10; + in_base.pressure[3] = 2e11; + in_base.pressure[4] = 5e8; + + in_base.position[0] = Point(); + in_base.position[1] = Point(); + in_base.position[2] = Point(); + in_base.position[3] = Point(); + in_base.position[4] = Point(); + + /** + * We can't take too small strain-rates, because then the difference in the + * viscosity will be too small for the double accuracy which stores + * the viscosity solutions and the finite difference solution. + */ + in_base.strain_rate[0] = SymmetricTensor<2,dim>(); + in_base.strain_rate[0][0][0] = 1e-12; + in_base.strain_rate[0][0][1] = 1e-12; + in_base.strain_rate[0][1][1] = 1e-11; + + in_base.strain_rate[1] = SymmetricTensor<2,dim>(in_base.strain_rate[0]); + in_base.strain_rate[1][0][0] = -1.71266e-13; + in_base.strain_rate[1][0][1] = -5.82647e-12; + in_base.strain_rate[1][1][1] = 4.21668e-14; + + in_base.strain_rate[2] = SymmetricTensor<2,dim>(in_base.strain_rate[0]); + in_base.strain_rate[2][1][1] = 1e-13; + in_base.strain_rate[2][0][1] = 1e-11; + in_base.strain_rate[2][0][0] = -1e-12; + + in_base.strain_rate[3] = SymmetricTensor<2,dim>(in_base.strain_rate[0]); + in_base.strain_rate[3][1][1] = 4.9e-21; + in_base.strain_rate[3][0][1] = 4.9e-21; + in_base.strain_rate[3][0][0] = 4.9e-21; + + in_base.strain_rate[4] = SymmetricTensor<2,dim>(in_base.strain_rate[0]); + in_base.strain_rate[4][1][1] = 1e-11; + in_base.strain_rate[4][0][1] = 1e-11; + in_base.strain_rate[4][0][0] = -1e-11; + + + // initialize some variables we will need later. + double finite_difference_accuracy = 1e-7; + double finite_difference_factor = 1+finite_difference_accuracy; + + + MaterialModelInputs in_dviscositydstrainrate(in_base); + + MaterialModelOutputs out_base(5,3); + MaterialModelOutputs out_dviscositydpressure(5,3); + MaterialModelOutputs out_dviscositydstrainrate(5,3); + + // initialize the material we want to test. + aspect::ParameterHandler prm; + + const aspect::MaterialModel::ViscoPlastic &const_material_model = dynamic_cast &>(simulator_access.get_material_model()); + aspect::MaterialModel::ViscoPlastic &material_model = const_cast &>(const_material_model); + + material_model.declare_parameters(prm); + + prm.enter_subsection("Material model"); { - // prevent division by zero. If it is zero, the test has passed, because or - // the finite difference and the analytical result match perfectly, or (more - // likely) the material model in independent of this variable. - temp = (out_dviscositydpressure.viscosities[i] - out_base.viscosities[i]); - if (in_base.pressure[i] != 0) - { - temp /= (in_base.pressure[i] * finite_difference_accuracy); - } - std::cout << "pressure: point = " << i << ", Finite difference = " << temp << ", Analytical derivative = " << derivatives->viscosity_derivative_wrt_pressure[i] << std::endl; - if (std::fabs(temp - derivatives->viscosity_derivative_wrt_pressure[i]) > 1e-3 * (std::fabs(temp) + std::fabs(derivatives->viscosity_derivative_wrt_pressure[i]))) - { - std::cout << " Error: The derivative of the viscosity to the pressure is too different from the analytical value." << std::endl; - Error = true; - } - + prm.enter_subsection ("Visco Plastic"); + { + prm.set ("Viscosity averaging scheme", averaging_parameter); + prm.set ("Angles of internal friction", "30"); + } + prm.leave_subsection(); } + prm.leave_subsection(); - // test the strain-rate derivative. - for (unsigned int component = 0; component < SymmetricTensor<2,dim>::n_independent_components; ++component) - { - const TableIndices<2> strain_rate_indices = SymmetricTensor<2,dim>::unrolled_to_component_indices (component); - - for (unsigned int i = 0; i < 5; i++) - { - // components that are not on the diagonal are multiplied by 0.5, because the symmetric tensor - // is modified by 0.5 in both symmetric directions (xy/yx) simultaneously and we compute the combined - // derivative - in_dviscositydstrainrate.strain_rate[i] = in_base.strain_rate[i] - + std::fabs(in_base.strain_rate[i][strain_rate_indices]) - * (component > dim-1 ? 0.5 : 1 ) - * finite_difference_accuracy - * aspect::Utilities::nth_basis_for_symmetric_tensors(component); - } - - - simulator_access.get_material_model().evaluate(in_dviscositydstrainrate, out_dviscositydstrainrate); - - for (unsigned int i = 0; i < 5; i++) - { - // prevent division by zero. If it is zero, the test has passed, because or - // the finite difference and the analytical result match perfectly, or (more - // likely) the material model in independent of this variable. - temp = out_dviscositydstrainrate.viscosities[i] - out_base.viscosities[i]; - if (temp != 0) - { - temp /= std::fabs(in_dviscositydstrainrate.strain_rate[i][strain_rate_indices]) * finite_difference_accuracy; - } - std::cout << "strain-rate: point = " << i << ", component = " << component << ", Finite difference = " << temp << ", Analytical derivative = " << derivatives->viscosity_derivative_wrt_strain_rate[i][strain_rate_indices] << std::endl; - if (std::fabs(temp - derivatives->viscosity_derivative_wrt_strain_rate[i][strain_rate_indices]) > 1e-3 * (std::fabs(temp) + std::fabs(derivatives->viscosity_derivative_wrt_strain_rate[i][strain_rate_indices]))) - { - std::cout << " Error: The derivative of the viscosity to the strain rate is too different from the analytical value." << std::endl; - Error = true; - } - - } + const_cast &>(simulator_access.get_material_model()).parse_parameters(prm); + + out_base.additional_outputs.push_back(std::make_unique> (5)); + + simulator_access.get_material_model().evaluate(in_base, out_base); + + // set up additional output for the derivatives + MaterialModelDerivatives *derivatives; + derivatives = out_base.template get_additional_output>(); + double temp; + + // have a bool so we know whether the test has succeed or not. + bool Error = false; + + // test the pressure derivative. + MaterialModelInputs in_dviscositydpressure(in_base); + in_dviscositydpressure.pressure[0] *= finite_difference_factor; + in_dviscositydpressure.pressure[1] *= finite_difference_factor; + in_dviscositydpressure.pressure[2] *= finite_difference_factor; + in_dviscositydpressure.pressure[3] *= finite_difference_factor; + in_dviscositydpressure.pressure[4] *= finite_difference_factor; + + simulator_access.get_material_model().evaluate(in_dviscositydpressure, out_dviscositydpressure); + + for (unsigned int i = 0; i < 5; i++) + { + // prevent division by zero. If it is zero, the test has passed, because or + // the finite difference and the analytical result match perfectly, or (more + // likely) the material model in independent of this variable. + temp = (out_dviscositydpressure.viscosities[i] - out_base.viscosities[i]); + if (in_base.pressure[i] != 0) + { + temp /= (in_base.pressure[i] * finite_difference_accuracy); + } + std::cout << "pressure: point = " << i << ", Finite difference = " << temp << ", Analytical derivative = " << derivatives->viscosity_derivative_wrt_pressure[i] << std::endl; + if (std::fabs(temp - derivatives->viscosity_derivative_wrt_pressure[i]) > 1e-3 * (std::fabs(temp) + std::fabs(derivatives->viscosity_derivative_wrt_pressure[i]))) + { + std::cout << " Error: The derivative of the viscosity to the pressure is too different from the analytical value." << std::endl; + Error = true; + } + + } + + // test the strain-rate derivative. + for (unsigned int component = 0; component < SymmetricTensor<2,dim>::n_independent_components; ++component) + { + const TableIndices<2> strain_rate_indices = SymmetricTensor<2,dim>::unrolled_to_component_indices (component); + + for (unsigned int i = 0; i < 5; i++) + { + // components that are not on the diagonal are multiplied by 0.5, because the symmetric tensor + // is modified by 0.5 in both symmetric directions (xy/yx) simultaneously and we compute the combined + // derivative + in_dviscositydstrainrate.strain_rate[i] = in_base.strain_rate[i] + + std::fabs(in_base.strain_rate[i][strain_rate_indices]) + * (component > dim-1 ? 0.5 : 1 ) + * finite_difference_accuracy + * aspect::Utilities::nth_basis_for_symmetric_tensors(component); + } + + + simulator_access.get_material_model().evaluate(in_dviscositydstrainrate, out_dviscositydstrainrate); + + for (unsigned int i = 0; i < 5; i++) + { + // prevent division by zero. If it is zero, the test has passed, because or + // the finite difference and the analytical result match perfectly, or (more + // likely) the material model in independent of this variable. + temp = out_dviscositydstrainrate.viscosities[i] - out_base.viscosities[i]; + if (temp != 0) + { + temp /= std::fabs(in_dviscositydstrainrate.strain_rate[i][strain_rate_indices]) * finite_difference_accuracy; + } + std::cout << "strain-rate: point = " << i << ", component = " << component << ", Finite difference = " << temp << ", Analytical derivative = " << derivatives->viscosity_derivative_wrt_strain_rate[i][strain_rate_indices] << std::endl; + if (std::fabs(temp - derivatives->viscosity_derivative_wrt_strain_rate[i][strain_rate_indices]) > 1e-3 * (std::fabs(temp) + std::fabs(derivatives->viscosity_derivative_wrt_strain_rate[i][strain_rate_indices]))) + { + std::cout << " Error: The derivative of the viscosity to the strain rate is too different from the analytical value." << std::endl; + Error = true; + } + + } + + } + + if (Error) + { + std::cout << "Some parts of the test were not successful." << std::endl; + } + else + { + std::cout << "OK" << std::endl; + } - } - - if (Error) - { - std::cout << "Some parts of the test were not successful." << std::endl; - } - else - { - std::cout << "OK" << std::endl; - } + } -} + template <> + void f(const aspect::SimulatorAccess<3> &, + aspect::Assemblers::Manager<3> &, + std::string ) + { + AssertThrow(false,dealii::ExcInternalError()); + } -template <> -void f(const aspect::SimulatorAccess<3> &, - aspect::Assemblers::Manager<3> &, - std::string ) -{ - AssertThrow(false,dealii::ExcInternalError()); -} + template + void signal_connector (aspect::SimulatorSignals &signals) + { + std::cout << "* Connecting signals" << std::endl; + signals.set_assemblers.connect (std::bind(&f, + std::placeholders::_1, + std::placeholders::_2, + "harmonic")); + + signals.set_assemblers.connect (std::bind(&f, + std::placeholders::_1, + std::placeholders::_2, + "geometric")); + + signals.set_assemblers.connect (std::bind(&f, + std::placeholders::_1, + std::placeholders::_2, + "arithmetic")); + + signals.set_assemblers.connect (std::bind(&f, + std::placeholders::_1, + std::placeholders::_2, + "maximum composition")); + } -template -void signal_connector (aspect::SimulatorSignals &signals) -{ - std::cout << "* Connecting signals" << std::endl; - signals.set_assemblers.connect (std::bind(&f, - std::placeholders::_1, - std::placeholders::_2, - "harmonic")); - - signals.set_assemblers.connect (std::bind(&f, - std::placeholders::_1, - std::placeholders::_2, - "geometric")); - - signals.set_assemblers.connect (std::bind(&f, - std::placeholders::_1, - std::placeholders::_2, - "arithmetic")); - - signals.set_assemblers.connect (std::bind(&f, - std::placeholders::_1, - std::placeholders::_2, - "maximum composition")); + ASPECT_REGISTER_SIGNALS_CONNECTOR(signal_connector<2>, + signal_connector<3>) } - -ASPECT_REGISTER_SIGNALS_CONNECTOR(signal_connector<2>, - signal_connector<3>) diff --git a/tests/visco_plastic_derivatives_3d.cc b/tests/visco_plastic_derivatives_3d.cc index dcf32291bcd..930a6a4ec51 100644 --- a/tests/visco_plastic_derivatives_3d.cc +++ b/tests/visco_plastic_derivatives_3d.cc @@ -34,255 +34,258 @@ #include -template -void f(const aspect::SimulatorAccess &simulator_access, - aspect::Assemblers::Manager &, - std::string averaging_parameter) +namespace aspect { - - std::cout << std::endl << "Testing ViscoPlastic derivatives against analytical derivatives for averaging parameter " << averaging_parameter << std::endl; - - using namespace aspect::MaterialModel; - - // first set all material model values - MaterialModelInputs in_base(5,3); - in_base.composition[0][0] = 0; - in_base.composition[0][1] = 0; - in_base.composition[0][2] = 0; - in_base.composition[1][0] = 0.75; - in_base.composition[1][1] = 0.15; - in_base.composition[1][2] = 0.10; - in_base.composition[2][0] = 0; - in_base.composition[2][1] = 0.2; - in_base.composition[2][2] = 0.4; - in_base.composition[3][0] = 0; - in_base.composition[3][1] = 0.2; - in_base.composition[3][2] = 0.4; - in_base.composition[4][0] = 1; - in_base.composition[4][1] = 0; - in_base.composition[4][2] = 0; - - in_base.temperature[0] = 293; - in_base.temperature[1] = 1600; - in_base.temperature[2] = 2000; - in_base.temperature[3] = 2100; - in_base.temperature[4] = 600; - - in_base.pressure[0] = 1e9; - in_base.pressure[1] = 5e9; - in_base.pressure[2] = 2e10; - in_base.pressure[3] = 2e11; - in_base.pressure[4] = 5e8; - - in_base.position[0] = Point(); - in_base.position[1] = Point(); - in_base.position[2] = Point(); - in_base.position[3] = Point(); - in_base.position[4] = Point(); - - /** - * We can't take too small strain-rates, because then the difference in the - * viscosity will be too small for the double accuracy which stores - * the viscosity solutions and the finite difference solution. - */ - in_base.strain_rate[0] = SymmetricTensor<2,dim>(); - in_base.strain_rate[0][0][0] = 1e-12; - in_base.strain_rate[0][0][1] = 1e-12; - in_base.strain_rate[0][1][1] = 1e-11; - in_base.strain_rate[0][2][0] = 1e-12; - in_base.strain_rate[0][2][1] = 1e-12; - in_base.strain_rate[0][2][2] = 1e-11; - - in_base.strain_rate[1] = SymmetricTensor<2,dim>(in_base.strain_rate[0]); - in_base.strain_rate[1][0][0] = -1.71266e-13; - in_base.strain_rate[1][0][1] = -5.82647e-12; - in_base.strain_rate[1][1][1] = 4.21668e-14; - in_base.strain_rate[1][2][0] = -5.42647e-12; - in_base.strain_rate[1][2][1] = -5.22647e-12; - in_base.strain_rate[1][2][2] = 4.21668e-14; - - in_base.strain_rate[2] = SymmetricTensor<2,dim>(in_base.strain_rate[0]); - in_base.strain_rate[2][1][1] = 1e-13; - in_base.strain_rate[2][0][1] = 1e-11; - in_base.strain_rate[2][0][0] = -1e-12; - in_base.strain_rate[2][2][0] = 1e-11; - in_base.strain_rate[2][2][1] = 1e-11; - in_base.strain_rate[2][2][2] = -1e-12; - - in_base.strain_rate[3] = SymmetricTensor<2,dim>(in_base.strain_rate[0]); - in_base.strain_rate[3][1][1] = 4.9e-21; - in_base.strain_rate[3][0][1] = 4.9e-21; - in_base.strain_rate[3][0][0] = 4.9e-21; - in_base.strain_rate[3][2][0] = 4.9e-21; - in_base.strain_rate[3][2][1] = 4.9e-21; - in_base.strain_rate[3][2][2] = 4.9e-21; - - in_base.strain_rate[4] = SymmetricTensor<2,dim>(in_base.strain_rate[0]); - in_base.strain_rate[4][1][1] = 1e-11; - in_base.strain_rate[4][0][1] = 1e-11; - in_base.strain_rate[4][0][0] = -5e-12; - in_base.strain_rate[4][2][0] = 1e-11; - in_base.strain_rate[4][2][1] = 1e-11; - in_base.strain_rate[4][2][2] = -5e-12; - - - // initialize some variables we will need later. - double finite_difference_accuracy = 1e-7; - double finite_difference_factor = 1+finite_difference_accuracy; - - - MaterialModelInputs in_dviscositydstrainrate(in_base); - - MaterialModelOutputs out_base(5,3); - MaterialModelOutputs out_dviscositydpressure(5,3); - MaterialModelOutputs out_dviscositydstrainrate(5,3); - - // initialize the material we want to test. - aspect::ParameterHandler prm; - - const aspect::MaterialModel::ViscoPlastic &const_material_model = dynamic_cast &>(simulator_access.get_material_model()); - aspect::MaterialModel::ViscoPlastic &material_model = const_cast &>(const_material_model); - - material_model.declare_parameters(prm); - - prm.enter_subsection("Material model"); + template + void f(const aspect::SimulatorAccess &simulator_access, + aspect::Assemblers::Manager &, + std::string averaging_parameter) { - prm.enter_subsection ("Visco Plastic"); - { - prm.set ("Viscosity averaging scheme", averaging_parameter); - prm.set ("Angles of internal friction", "30"); - } - prm.leave_subsection(); - } - prm.leave_subsection(); - - const_cast &>(simulator_access.get_material_model()).parse_parameters(prm); - - out_base.additional_outputs.push_back(std::make_unique> (5)); - - simulator_access.get_material_model().evaluate(in_base, out_base); - // set up additional output for the derivatives - MaterialModelDerivatives *derivatives; - derivatives = out_base.template get_additional_output>(); - double temp; - - // have a bool so we know whether the test has succeed or not. - bool Error = false; - - // test the pressure derivative. - MaterialModelInputs in_dviscositydpressure(in_base); - in_dviscositydpressure.pressure[0] *= finite_difference_factor; - in_dviscositydpressure.pressure[1] *= finite_difference_factor; - in_dviscositydpressure.pressure[2] *= finite_difference_factor; - in_dviscositydpressure.pressure[3] *= finite_difference_factor; - in_dviscositydpressure.pressure[4] *= finite_difference_factor; - - simulator_access.get_material_model().evaluate(in_dviscositydpressure, out_dviscositydpressure); - - for (unsigned int i = 0; i < 5; i++) + std::cout << std::endl << "Testing ViscoPlastic derivatives against analytical derivatives for averaging parameter " << averaging_parameter << std::endl; + + using namespace aspect::MaterialModel; + + // first set all material model values + MaterialModelInputs in_base(5,3); + in_base.composition[0][0] = 0; + in_base.composition[0][1] = 0; + in_base.composition[0][2] = 0; + in_base.composition[1][0] = 0.75; + in_base.composition[1][1] = 0.15; + in_base.composition[1][2] = 0.10; + in_base.composition[2][0] = 0; + in_base.composition[2][1] = 0.2; + in_base.composition[2][2] = 0.4; + in_base.composition[3][0] = 0; + in_base.composition[3][1] = 0.2; + in_base.composition[3][2] = 0.4; + in_base.composition[4][0] = 1; + in_base.composition[4][1] = 0; + in_base.composition[4][2] = 0; + + in_base.temperature[0] = 293; + in_base.temperature[1] = 1600; + in_base.temperature[2] = 2000; + in_base.temperature[3] = 2100; + in_base.temperature[4] = 600; + + in_base.pressure[0] = 1e9; + in_base.pressure[1] = 5e9; + in_base.pressure[2] = 2e10; + in_base.pressure[3] = 2e11; + in_base.pressure[4] = 5e8; + + in_base.position[0] = Point(); + in_base.position[1] = Point(); + in_base.position[2] = Point(); + in_base.position[3] = Point(); + in_base.position[4] = Point(); + + /** + * We can't take too small strain-rates, because then the difference in the + * viscosity will be too small for the double accuracy which stores + * the viscosity solutions and the finite difference solution. + */ + in_base.strain_rate[0] = SymmetricTensor<2,dim>(); + in_base.strain_rate[0][0][0] = 1e-12; + in_base.strain_rate[0][0][1] = 1e-12; + in_base.strain_rate[0][1][1] = 1e-11; + in_base.strain_rate[0][2][0] = 1e-12; + in_base.strain_rate[0][2][1] = 1e-12; + in_base.strain_rate[0][2][2] = 1e-11; + + in_base.strain_rate[1] = SymmetricTensor<2,dim>(in_base.strain_rate[0]); + in_base.strain_rate[1][0][0] = -1.71266e-13; + in_base.strain_rate[1][0][1] = -5.82647e-12; + in_base.strain_rate[1][1][1] = 4.21668e-14; + in_base.strain_rate[1][2][0] = -5.42647e-12; + in_base.strain_rate[1][2][1] = -5.22647e-12; + in_base.strain_rate[1][2][2] = 4.21668e-14; + + in_base.strain_rate[2] = SymmetricTensor<2,dim>(in_base.strain_rate[0]); + in_base.strain_rate[2][1][1] = 1e-13; + in_base.strain_rate[2][0][1] = 1e-11; + in_base.strain_rate[2][0][0] = -1e-12; + in_base.strain_rate[2][2][0] = 1e-11; + in_base.strain_rate[2][2][1] = 1e-11; + in_base.strain_rate[2][2][2] = -1e-12; + + in_base.strain_rate[3] = SymmetricTensor<2,dim>(in_base.strain_rate[0]); + in_base.strain_rate[3][1][1] = 4.9e-21; + in_base.strain_rate[3][0][1] = 4.9e-21; + in_base.strain_rate[3][0][0] = 4.9e-21; + in_base.strain_rate[3][2][0] = 4.9e-21; + in_base.strain_rate[3][2][1] = 4.9e-21; + in_base.strain_rate[3][2][2] = 4.9e-21; + + in_base.strain_rate[4] = SymmetricTensor<2,dim>(in_base.strain_rate[0]); + in_base.strain_rate[4][1][1] = 1e-11; + in_base.strain_rate[4][0][1] = 1e-11; + in_base.strain_rate[4][0][0] = -5e-12; + in_base.strain_rate[4][2][0] = 1e-11; + in_base.strain_rate[4][2][1] = 1e-11; + in_base.strain_rate[4][2][2] = -5e-12; + + + // initialize some variables we will need later. + double finite_difference_accuracy = 1e-7; + double finite_difference_factor = 1+finite_difference_accuracy; + + + MaterialModelInputs in_dviscositydstrainrate(in_base); + + MaterialModelOutputs out_base(5,3); + MaterialModelOutputs out_dviscositydpressure(5,3); + MaterialModelOutputs out_dviscositydstrainrate(5,3); + + // initialize the material we want to test. + aspect::ParameterHandler prm; + + const aspect::MaterialModel::ViscoPlastic &const_material_model = dynamic_cast &>(simulator_access.get_material_model()); + aspect::MaterialModel::ViscoPlastic &material_model = const_cast &>(const_material_model); + + material_model.declare_parameters(prm); + + prm.enter_subsection("Material model"); { - // prevent division by zero. If it is zero, the test has passed, because or - // the finite difference and the analytical result match perfectly, or (more - // likely) the material model in independent of this variable. - temp = (out_dviscositydpressure.viscosities[i] - out_base.viscosities[i]); - if (in_base.pressure[i] != 0) - { - temp /= (in_base.pressure[i] * finite_difference_accuracy); - } - std::cout << "pressure: point = " << i << ", Finite difference = " << temp << ", Analytical derivative = " << derivatives->viscosity_derivative_wrt_pressure[i] << std::endl; - if (std::fabs(temp - derivatives->viscosity_derivative_wrt_pressure[i]) > 1e-3 * (std::fabs(temp) + std::fabs(derivatives->viscosity_derivative_wrt_pressure[i]))) - { - std::cout << " Error: The derivative of the viscosity to the pressure is too different from the analytical value." << std::endl; - Error = true; - } - + prm.enter_subsection ("Visco Plastic"); + { + prm.set ("Viscosity averaging scheme", averaging_parameter); + prm.set ("Angles of internal friction", "30"); + } + prm.leave_subsection(); } + prm.leave_subsection(); - // test the strain-rate derivative. - for (unsigned int component = 0; component < SymmetricTensor<2,dim>::n_independent_components; ++component) - { - const TableIndices<2> strain_rate_indices = SymmetricTensor<2,dim>::unrolled_to_component_indices (component); - - for (unsigned int i = 0; i < 5; i++) - { - // components that are not on the diagonal are multiplied by 0.5, because the symmetric tensor - // is modified by 0.5 in both symmetric directions (xy/yx) simultaneously and we compute the combined - // derivative - in_dviscositydstrainrate.strain_rate[i] = in_base.strain_rate[i] - + std::fabs(in_base.strain_rate[i][strain_rate_indices]) - * (component > dim-1 ? 0.5 : 1 ) - * finite_difference_accuracy - * aspect::Utilities::nth_basis_for_symmetric_tensors(component); - } - - - simulator_access.get_material_model().evaluate(in_dviscositydstrainrate, out_dviscositydstrainrate); - - for (unsigned int i = 0; i < 5; i++) - { - // prevent division by zero. If it is zero, the test has passed, because or - // the finite difference and the analytical result match perfectly, or (more - // likely) the material model in independent of this variable. - temp = out_dviscositydstrainrate.viscosities[i] - out_base.viscosities[i]; - if (temp != 0) - { - temp /= std::fabs(in_dviscositydstrainrate.strain_rate[i][strain_rate_indices]) * finite_difference_accuracy; - } - std::cout << "strain-rate: point = " << i << ", component = " << component << ", Finite difference = " << temp << ", Analytical derivative = " << derivatives->viscosity_derivative_wrt_strain_rate[i][strain_rate_indices] << std::endl; - if (std::fabs(temp - derivatives->viscosity_derivative_wrt_strain_rate[i][strain_rate_indices]) > 1e-3 * (std::fabs(temp) + std::fabs(derivatives->viscosity_derivative_wrt_strain_rate[i][strain_rate_indices]))) - { - std::cout << " Error: The derivative of the viscosity to the strain rate is too different from the analytical value." << std::endl; - Error = true; - } - - } + const_cast &>(simulator_access.get_material_model()).parse_parameters(prm); + + out_base.additional_outputs.push_back(std::make_unique> (5)); + + simulator_access.get_material_model().evaluate(in_base, out_base); + + // set up additional output for the derivatives + MaterialModelDerivatives *derivatives; + derivatives = out_base.template get_additional_output>(); + double temp; + + // have a bool so we know whether the test has succeed or not. + bool Error = false; + + // test the pressure derivative. + MaterialModelInputs in_dviscositydpressure(in_base); + in_dviscositydpressure.pressure[0] *= finite_difference_factor; + in_dviscositydpressure.pressure[1] *= finite_difference_factor; + in_dviscositydpressure.pressure[2] *= finite_difference_factor; + in_dviscositydpressure.pressure[3] *= finite_difference_factor; + in_dviscositydpressure.pressure[4] *= finite_difference_factor; + + simulator_access.get_material_model().evaluate(in_dviscositydpressure, out_dviscositydpressure); + + for (unsigned int i = 0; i < 5; i++) + { + // prevent division by zero. If it is zero, the test has passed, because or + // the finite difference and the analytical result match perfectly, or (more + // likely) the material model in independent of this variable. + temp = (out_dviscositydpressure.viscosities[i] - out_base.viscosities[i]); + if (in_base.pressure[i] != 0) + { + temp /= (in_base.pressure[i] * finite_difference_accuracy); + } + std::cout << "pressure: point = " << i << ", Finite difference = " << temp << ", Analytical derivative = " << derivatives->viscosity_derivative_wrt_pressure[i] << std::endl; + if (std::fabs(temp - derivatives->viscosity_derivative_wrt_pressure[i]) > 1e-3 * (std::fabs(temp) + std::fabs(derivatives->viscosity_derivative_wrt_pressure[i]))) + { + std::cout << " Error: The derivative of the viscosity to the pressure is too different from the analytical value." << std::endl; + Error = true; + } + + } + + // test the strain-rate derivative. + for (unsigned int component = 0; component < SymmetricTensor<2,dim>::n_independent_components; ++component) + { + const TableIndices<2> strain_rate_indices = SymmetricTensor<2,dim>::unrolled_to_component_indices (component); + + for (unsigned int i = 0; i < 5; i++) + { + // components that are not on the diagonal are multiplied by 0.5, because the symmetric tensor + // is modified by 0.5 in both symmetric directions (xy/yx) simultaneously and we compute the combined + // derivative + in_dviscositydstrainrate.strain_rate[i] = in_base.strain_rate[i] + + std::fabs(in_base.strain_rate[i][strain_rate_indices]) + * (component > dim-1 ? 0.5 : 1 ) + * finite_difference_accuracy + * aspect::Utilities::nth_basis_for_symmetric_tensors(component); + } + + + simulator_access.get_material_model().evaluate(in_dviscositydstrainrate, out_dviscositydstrainrate); + + for (unsigned int i = 0; i < 5; i++) + { + // prevent division by zero. If it is zero, the test has passed, because or + // the finite difference and the analytical result match perfectly, or (more + // likely) the material model in independent of this variable. + temp = out_dviscositydstrainrate.viscosities[i] - out_base.viscosities[i]; + if (temp != 0) + { + temp /= std::fabs(in_dviscositydstrainrate.strain_rate[i][strain_rate_indices]) * finite_difference_accuracy; + } + std::cout << "strain-rate: point = " << i << ", component = " << component << ", Finite difference = " << temp << ", Analytical derivative = " << derivatives->viscosity_derivative_wrt_strain_rate[i][strain_rate_indices] << std::endl; + if (std::fabs(temp - derivatives->viscosity_derivative_wrt_strain_rate[i][strain_rate_indices]) > 1e-3 * (std::fabs(temp) + std::fabs(derivatives->viscosity_derivative_wrt_strain_rate[i][strain_rate_indices]))) + { + std::cout << " Error: The derivative of the viscosity to the strain rate is too different from the analytical value." << std::endl; + Error = true; + } + + } + + } + + if (Error) + { + std::cout << "Some parts of the test were not successful." << std::endl; + } + else + { + std::cout << "OK" << std::endl; + } - } - - if (Error) - { - std::cout << "Some parts of the test were not successful." << std::endl; - } - else - { - std::cout << "OK" << std::endl; - } + } -} + template <> + void f(const aspect::SimulatorAccess<2> &, + aspect::Assemblers::Manager<2> &, + std::string ) + { + AssertThrow(false,dealii::ExcInternalError()); + } -template <> -void f(const aspect::SimulatorAccess<2> &, - aspect::Assemblers::Manager<2> &, - std::string ) -{ - AssertThrow(false,dealii::ExcInternalError()); -} + template + void signal_connector (aspect::SimulatorSignals &signals) + { + std::cout << "* Connecting signals" << std::endl; + signals.set_assemblers.connect (std::bind(&f, + std::placeholders::_1, + std::placeholders::_2, + "harmonic")); + + signals.set_assemblers.connect (std::bind(&f, + std::placeholders::_1, + std::placeholders::_2, + "geometric")); + + signals.set_assemblers.connect (std::bind(&f, + std::placeholders::_1, + std::placeholders::_2, + "arithmetic")); + + signals.set_assemblers.connect (std::bind(&f, + std::placeholders::_1, + std::placeholders::_2, + "maximum composition")); + } -template -void signal_connector (aspect::SimulatorSignals &signals) -{ - std::cout << "* Connecting signals" << std::endl; - signals.set_assemblers.connect (std::bind(&f, - std::placeholders::_1, - std::placeholders::_2, - "harmonic")); - - signals.set_assemblers.connect (std::bind(&f, - std::placeholders::_1, - std::placeholders::_2, - "geometric")); - - signals.set_assemblers.connect (std::bind(&f, - std::placeholders::_1, - std::placeholders::_2, - "arithmetic")); - - signals.set_assemblers.connect (std::bind(&f, - std::placeholders::_1, - std::placeholders::_2, - "maximum composition")); + ASPECT_REGISTER_SIGNALS_CONNECTOR(signal_connector<2>, + signal_connector<3>) } - -ASPECT_REGISTER_SIGNALS_CONNECTOR(signal_connector<2>, - signal_connector<3>)