ASPECT
thermodynamic_table_lookup.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2011 - 2022 by the authors of the ASPECT code.
3 
4  This file is part of ASPECT.
5 
6  ASPECT is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2, or (at your option)
9  any later version.
10 
11  ASPECT is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with ASPECT; see the file LICENSE. If not see
18  <http://www.gnu.org/licenses/>.
19 */
20 
21 #ifndef _aspect_material_model_equation_of_state_thermodynamic_table_lookup_h
22 #define _aspect_material_model_equation_of_state_thermodynamic_table_lookup_h
23 
27 
28 
29 namespace aspect
30 {
31  namespace MaterialModel
32  {
33  namespace EquationOfState
34  {
35  using namespace dealii;
36 
42  template <int dim>
44  {
45  public:
50  void
51  initialize ();
52 
56  virtual unsigned int number_of_lookups() const;
57 
66  bool is_compressible () const;
67 
73  void
74  evaluate(const MaterialModel::MaterialModelInputs<dim> &in,
75  std::vector<MaterialModel::EquationOfStateOutputs<dim>> &eos_outputs) const;
76 
80  void
81  fill_additional_outputs(const MaterialModel::MaterialModelInputs<dim> &in,
82  const std::vector<std::vector<double>> &volume_fractions,
84 
88  static
89  void
90  declare_parameters (ParameterHandler &prm);
91 
95  void
96  parse_parameters (ParameterHandler &prm);
97 
98  void
99  create_additional_named_outputs (MaterialModel::MaterialModelOutputs<dim> &out) const;
100 
102  get_material_lookup (unsigned int lookup_index) const;
103 
104 
105  private:
106  unsigned int n_material_lookups;
109 
113  std::string data_directory;
114  std::vector<std::string> material_file_names;
115  std::vector<std::string> derivatives_file_names;
116 
122 
127  enum formats
128  {
130  hefesto
131  } material_file_format;
132 
137  std::vector<std::unique_ptr<MaterialModel::MaterialUtilities::Lookup::MaterialLookup>> material_lookup;
138 
142  std::vector<std::string> unique_phase_names;
143 
150  std::vector<std::vector<unsigned int>> unique_phase_indices;
151 
158  std::vector<std::string> list_of_dominant_phases;
159 
174  std::vector<std::vector<unsigned int>> global_index_of_lookup_phase;
175 
181  void evaluate_thermal_enthalpy_derivatives(const MaterialModel::MaterialModelInputs<dim> &in,
182  std::vector<MaterialModel::EquationOfStateOutputs<dim>> &eos_outputs) const;
183 
195  std::array<std::pair<double, unsigned int>,2>
196  enthalpy_derivatives (const typename Interface<dim>::MaterialModelInputs &in) const;
197 
198  void fill_seismic_velocities (const MaterialModel::MaterialModelInputs<dim> &in,
199  const std::vector<double> &composite_densities,
200  const std::vector<std::vector<double>> &volume_fractions,
201  SeismicAdditionalOutputs<dim> *seismic_out) const;
202 
214  void fill_phase_volume_fractions (const MaterialModel::MaterialModelInputs<dim> &in,
215  const std::vector<std::vector<double>> &volume_fractions,
216  NamedAdditionalMaterialOutputs<dim> *phase_volume_fractions_out) const;
217 
228  void fill_dominant_phases (const MaterialModel::MaterialModelInputs<dim> &in,
229  const std::vector<std::vector<double>> &volume_fractions,
230  PhaseOutputs<dim> &dominant_phases_out) const;
231  };
232  }
233  }
234 }
235 
236 #endif
void declare_parameters(ParameterHandler &prm)
Definition: compat.h:59
std::vector< std::unique_ptr< MaterialModel::MaterialUtilities::Lookup::MaterialLookup > > material_lookup
Definition: compat.h:42