21 #ifndef _aspect_material_model_utilities_h 22 #define _aspect_material_model_utilities_h 25 #include <deal.II/base/point.h> 26 #include <deal.II/base/symmetric_tensor.h> 27 #include <deal.II/fe/component_mask.h> 28 #include <deal.II/base/signaling_nan.h> 29 #include <deal.II/base/parameter_handler.h> 33 template <
int dim>
class SimulatorAccess;
37 using namespace ::Utilities;
40 class StructuredDataLookup;
42 namespace MaterialModel
46 template <
int dim>
class MaterialModelOutputs;
54 namespace MaterialUtilities
73 density(
const double temperature,
74 const double pressure)
const;
77 thermal_expansivity(
const double temperature,
78 const double pressure)
const;
81 seismic_Vp(
const double temperature,
82 const double pressure)
const;
85 seismic_Vs(
const double temperature,
86 const double pressure)
const;
89 enthalpy(
const double temperature,
90 const double pressure)
const;
98 dHdT (
const double temperature,
99 const double pressure)
const;
107 dHdp (
const double temperature,
108 const double pressure)
const;
122 std::array<std::pair<double, unsigned int>,2>
123 enthalpy_derivatives(
const std::vector<double> &temperatures,
124 const std::vector<double> &pressures,
125 const unsigned int n_substeps = 1)
const;
128 dRhodp (
const double temperature,
129 const double pressure)
const;
136 dominant_phase (
const double temperature,
137 const double pressure)
const;
144 has_dominant_phase()
const;
150 std::vector<std::string>
151 phase_volume_column_names()
const;
158 phase_volume_fraction(
const int phase_id,
159 const double temperature,
160 const double pressure)
const;
167 get_pT_steps()
const;
176 const std::vector<std::string> &
177 get_dominant_phase_names()
const;
188 value (
const double temperature,
189 const double pressure,
190 const Table<2, double> &values,
191 const bool interpol)
const;
199 value (
const double temperature,
200 const double pressure,
201 const Table<2, unsigned int> &values)
const;
206 double get_nT(
const double temperature)
const;
211 double get_np(
const double pressure)
const;
253 const std::string &derivatives_filename,
255 const MPI_Comm comm);
267 const MPI_Comm comm);
283 const std::string &data_directory,
284 const std::string &material_file_name);
298 const double pressure)
const;
304 thermal_expansivity(
const double entropy,
305 const double pressure)
const;
312 const double pressure)
const;
318 seismic_vp(
const double entropy,
319 const double pressure)
const;
325 seismic_vs(
const double entropy,
326 const double pressure)
const;
332 density_gradient(
const double entropy,
333 const double pressure)
const;
360 const std::vector<unsigned int> &indices_to_use);
382 const ComponentMask &field_mask = ComponentMask());
393 const std::vector<double> &densities,
394 const bool return_as_fraction);
421 const ParameterHandler &prm);
444 double average_value (
const std::vector<double> &volume_fractions,
445 const std::vector<double> ¶meter_values,
467 const std::vector<double> &mass_fractions,
468 const std::vector<double> &volume_fractions,
469 const unsigned int i,
477 namespace PhaseUtilities
508 const std::vector<unsigned int> &n_phase_transitions_per_composition,
509 const std::vector<double> ¶meter_values,
510 const unsigned int composition_index,
530 const double pressure_depth_derivative,
531 const unsigned int phase_transition_index);
584 double compute_derivative ()
const;
589 unsigned int n_phase_transitions ()
const;
594 unsigned int n_phases ()
const;
599 unsigned int n_phases_over_all_chemical_compositions ()
const;
604 const std::vector<unsigned int> &
605 n_phase_transitions_for_each_chemical_composition ()
const;
610 const std::vector<unsigned int> &
611 n_phases_for_each_chemical_composition ()
const;
619 const std::vector<unsigned int> &
620 n_phase_transitions_for_each_composition ()
const;
628 const std::vector<unsigned int> &
629 n_phases_for_each_composition ()
const;
648 parse_parameters (ParameterHandler &prm);
764 unsigned int n_phase_transitions ()
const;
769 unsigned int n_phases ()
const;
774 unsigned int n_phases_over_all_chemical_compositions ()
const;
780 double get_transition_slope (
const unsigned int phase_transition_index)
const;
785 double get_transition_depth (
const unsigned int phase_transition_index)
const;
790 const std::vector<unsigned int> &
791 n_phase_transitions_for_each_chemical_composition ()
const;
796 const std::vector<unsigned int> &
797 n_phases_for_each_chemical_composition ()
const;
805 const std::vector<unsigned int> &
806 n_phase_transitions_for_each_composition ()
const;
814 const std::vector<unsigned int> &
815 n_phases_for_each_composition ()
const;
834 parse_parameters (ParameterHandler &prm);
unsigned int n_phases_total
void fill_averaged_equation_of_state_outputs(const EquationOfStateOutputs< dim > &eos_outputs, const std::vector< double > &mass_fractions, const std::vector< double > &volume_fractions, const unsigned int i, MaterialModelOutputs< dim > &out)
std::vector< double > transition_depths
std::string data_directory
std::vector< unsigned int > n_phases_per_composition
::Table< 2, double > vp_values
std::vector< std::string > dominant_phase_names
std::vector< double > transition_slopes
CompositionalAveragingOperation
unsigned int n_phases_total_chemical_compositions
unsigned int n_phases_total_chemical_compositions
std::unique_ptr< Utilities::StructuredDataLookup< 2 > > material_lookup
std::vector< std::string > material_file_names
::Table< 2, double > density_values
std::vector< double > transition_pressure_widths
std::vector<::Table< 2, double > > phase_volume_fractions
std::vector< unsigned int > n_phases_per_composition
std::vector< double > maximum_temperature
std::vector< std::string > phase_column_names
void declare_parameters(ParameterHandler &prm)
std::unique_ptr< std::vector< unsigned int > > n_phase_transitions_per_composition
bool use_depth_instead_of_pressure
::Table< 2, double > enthalpy_values
bool has_dominant_phase_column
std::unique_ptr< std::vector< unsigned int > > n_phase_transitions_per_composition
std::vector< unsigned int > n_phase_transitions_per_chemical_composition
double average_value(const std::vector< double > &volume_fractions, const std::vector< double > ¶meter_values, const CompositionalAveragingOperation &average_type)
::Table< 2, double > specific_heat_values
std::vector< std::unique_ptr< Utilities::StructuredDataLookup< 2 > > > material_lookup
double phase_average_value(const std::vector< double > &phase_function_values, const std::vector< unsigned int > &n_phase_transitions_per_composition, const std::vector< double > ¶meter_values, const unsigned int composition_index, const PhaseUtilities::PhaseAveragingOperation operation=PhaseUtilities::arithmetic)
::Table< 2, unsigned int > dominant_phase_indices
std::vector< double > minimum_temperature
std::vector< unsigned int > n_phase_transitions_per_chemical_composition
std::vector< double > maximum_pressure
::Table< 2, double > vs_values
CompositionalAveragingOperation parse_compositional_averaging_operation(const std::string ¶meter_name, const ParameterHandler &prm)
std::vector< unsigned int > n_phases_per_chemical_composition
std::vector< double > minimum_pressure
std::vector< double > transition_temperature_upper_limits
unsigned int n_temperature
std::vector< double > compute_volumes_from_masses(const std::vector< double > &masses, const std::vector< double > &densities, const bool return_as_fraction)
unsigned int n_phases_total
std::vector< unsigned int > n_phases_per_chemical_composition
std::vector< double > transition_widths
std::vector< double > compute_only_composition_fractions(const std::vector< double > &compositional_fields, const std::vector< unsigned int > &indices_to_use)
std::vector< unsigned int > transition_indicators
::Table< 2, double > thermal_expansivity_values
std::vector< double > transition_pressures
std::vector< double > transition_temperatures
std::vector< double > interval_temperature
std::vector< double > transition_temperature_lower_limits
std::vector< double > compute_composition_fractions(const std::vector< double > &compositional_fields, const ComponentMask &field_mask=ComponentMask())
std::vector< double > interval_pressure