ASPECT
cpo_elastic_tensor.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2023 - 2024 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_particle_property_cpo_elastic_tensor_h
22 #define _aspect_particle_property_cpo_elastic_tensor_h
23 
27 
28 namespace aspect
29 {
30  namespace Particle
31  {
32  namespace Property
33  {
34 
46  template <int dim>
47  class CpoElasticTensor : public Interface<dim>, public ::aspect::SimulatorAccess<dim>
48  {
49  public:
54 
59  void
60  initialize () override;
61 
71  SymmetricTensor<2,6>
73  const unsigned int cpo_data_position,
74  const ArrayView<double> &data) const;
75 
87  void
88  initialize_one_particle_property (const Point<dim> &position,
89  std::vector<double> &particle_properties) const override;
90 
94  void
96  typename ParticleHandler<dim>::particle_iterator_range &particles) const override;
97 
103  need_update () const override;
104 
108  UpdateFlags
109  get_update_flags (const unsigned int component) const override;
110 
118  std::vector<std::pair<std::string, unsigned int>>
119  get_property_information() const override;
120 
124  static
125  SymmetricTensor<2,6>
126  get_elastic_tensor(unsigned int cpo_index,
127  const ArrayView<double> &data);
128 
132  static
133  void
134  set_elastic_tensor(unsigned int cpo_data_position,
135  const ArrayView<double> &data,
136  const SymmetricTensor<2,6> &elastic_tensor);
137 
141  static
142  void
143  declare_parameters (ParameterHandler &prm);
144 
148  void
149  parse_parameters (ParameterHandler &prm) override;
150 
151  private:
155  unsigned int cpo_data_position;
156 
161  SymmetricTensor<2,6> stiffness_matrix_olivine;
162  SymmetricTensor<2,6> stiffness_matrix_enstatite;
163  SymmetricTensor<2,6> stiffness_matrix_clinopyroxene;
164 
168  unsigned int n_grains;
169 
173  unsigned int n_minerals;
174 
175  };
176  }
177  }
178 }
179 
180 #endif
static SymmetricTensor< 2, 6 > get_elastic_tensor(unsigned int cpo_index, const ArrayView< double > &data)
SymmetricTensor< 2, 6 > voigt_average_elastic_tensor(const Particle::Property::CrystalPreferredOrientation< dim > &cpo_particle_property, const unsigned int cpo_data_position, const ArrayView< double > &data) const
void parse_parameters(ParameterHandler &prm) override
void initialize_one_particle_property(const Point< dim > &position, std::vector< double > &particle_properties) const override
std::vector< std::pair< std::string, unsigned int > > get_property_information() const override
UpdateTimeFlags need_update() const override
void update_particle_properties(const ParticleUpdateInputs< dim > &inputs, typename ParticleHandler< dim >::particle_iterator_range &particles) const override
static void declare_parameters(ParameterHandler &prm)
UpdateFlags get_update_flags(const unsigned int component) const override
static void set_elastic_tensor(unsigned int cpo_data_position, const ArrayView< double > &data, const SymmetricTensor< 2, 6 > &elastic_tensor)