@@ -68,7 +68,7 @@ namespace aspect
6868 else
6969 {
7070 EquationOfStateOutputs<dim> eos_outputs_all_phases (n_phases);
71- equation_of_state .evaluate (in, 0 , eos_outputs_all_phases);
71+ equation_of_state_incompressible .evaluate (in, 0 , eos_outputs_all_phases);
7272 reference_density = eos_outputs_all_phases.densities [0 ];
7373 }
7474
@@ -121,7 +121,7 @@ namespace aspect
121121 for (unsigned int i=0 ; i < in.n_evaluation_points (); ++i)
122122 {
123123 // First compute the equation of state variables and thermodynamic properties
124- equation_of_state .evaluate (in, i, eos_outputs_all_phases);
124+ equation_of_state_incompressible .evaluate (in, i, eos_outputs_all_phases);
125125
126126 const double gravity_norm = this ->get_gravity_model ().gravity_vector (in.position [i]).norm ();
127127 const double reference_density = (this ->get_adiabatic_conditions ().is_initialized ())
@@ -308,7 +308,7 @@ namespace aspect
308308 ViscoPlastic<dim>::
309309 is_compressible () const
310310 {
311- return equation_of_state .is_compressible ();
311+ return equation_of_state_incompressible .is_compressible ();
312312 }
313313
314314
@@ -342,6 +342,15 @@ namespace aspect
342342
343343 EquationOfState::MulticomponentIncompressible<dim>::declare_parameters (prm);
344344
345+ EquationOfState::MulticomponentCompressible<dim>::declare_parameters (prm);
346+
347+ prm.declare_entry (" Use compressible equation of state" ," false" ,
348+ Patterns::Bool (),
349+ " Whether to use an incompressible or compressible equation of state. "
350+ " If set to true, the material model will switch from using the "
351+ " multicomponent incompressible multicomponent compressible equation "
352+ " of state model. " );
353+
345354 Rheology::ViscoPlastic<dim>::declare_parameters (prm);
346355
347356 // Equation of state parameters
@@ -389,9 +398,26 @@ namespace aspect
389398 n_phases = phase_function.n_phases_over_all_chemical_compositions ();
390399
391400 // Equation of state parameters
392- equation_of_state.initialize_simulator (this ->get_simulator ());
393- equation_of_state.parse_parameters (prm,
394- std::make_unique<std::vector<unsigned int >>(n_phases_for_each_chemical_composition));
401+ use_compressible_equation_of_state = prm.get_bool (" Use compressible equation of state" );
402+ if (use_compressible_equation_of_state == false )
403+ {
404+ equation_of_state_incompressible.initialize_simulator (this ->get_simulator ());
405+ equation_of_state_incompressible.parse_parameters (prm,
406+ std::make_unique<std::vector<unsigned int >>(n_phases_for_each_chemical_composition));
407+ }
408+ else
409+ {
410+ prm.enter_subsection (" Equation of State" );
411+ {
412+ prm.enter_subsection (" Multicomponent Compressible" );
413+ {
414+ equation_of_state_compressible.initialize_simulator (this ->get_simulator ());
415+ equation_of_state_compressible.parse_parameters (prm);
416+ }
417+ prm.leave_subsection ();
418+ }
419+ prm.leave_subsection ();
420+ }
395421
396422 // Make options file for parsing maps to double arrays
397423 std::vector<std::string> chemical_field_names = this ->introspection ().chemical_composition_field_names ();
0 commit comments