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_index);
579 unsigned int n_phase_transitions ()
const;
584 unsigned int n_phases ()
const;
589 unsigned int n_phases_over_all_chemical_compositions ()
const;
595 double get_transition_slope (
const unsigned int phase_index)
const;
600 double get_transition_depth (
const unsigned int phase_index)
const;
605 const std::vector<unsigned int> &
606 n_phase_transitions_for_each_chemical_composition ()
const;
611 const std::vector<unsigned int> &
612 n_phases_for_each_chemical_composition ()
const;
620 const std::vector<unsigned int> &
621 n_phase_transitions_for_each_composition ()
const;
629 const std::vector<unsigned int> &
630 n_phases_for_each_composition ()
const;
649 parse_parameters (ParameterHandler &prm);
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::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
std::unique_ptr< Utilities::StructuredDataLookup< 2 > > material_lookup
::Table< 2, double > density_values
std::vector< double > transition_pressure_widths
std::vector<::Table< 2, double > > phase_volume_fractions
std::vector< std::string > phase_column_names
void declare_parameters(ParameterHandler &prm)
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
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
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< unsigned int > n_phase_transitions_per_chemical_composition
::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 > 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< double > transition_widths
std::vector< double > compute_only_composition_fractions(const std::vector< double > &compositional_fields, const std::vector< unsigned int > &indices_to_use)
::Table< 2, double > thermal_expansivity_values
std::vector< double > transition_pressures
std::vector< double > transition_temperatures
std::vector< double > transition_temperature_lower_limits
std::vector< double > compute_composition_fractions(const std::vector< double > &compositional_fields, const ComponentMask &field_mask=ComponentMask())