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 #include <array>
28 
29 namespace aspect
30 {
31  namespace Particle
32  {
33  namespace Property
34  {
35 
47  template <int dim>
48  class CpoElasticTensor : public Interface<dim>, public ::aspect::SimulatorAccess<dim>
49  {
50  public:
55 
60  void
61  initialize () override;
62 
72  SymmetricTensor<2,6>
74  const unsigned int cpo_data_position,
75  const ArrayView<double> &data) const;
76 
88  void
89  initialize_one_particle_property (const Point<dim> &position,
90  std::vector<double> &particle_properties) const override;
91 
95  void
97  typename ParticleHandler<dim>::particle_iterator_range &particles) const override;
98 
104  need_update () const override;
105 
109  UpdateFlags
110  get_update_flags (const unsigned int component) const override;
111 
119  std::vector<std::pair<std::string, unsigned int>>
120  get_property_information() const override;
121 
125  static
126  SymmetricTensor<2,6>
127  get_elastic_tensor(unsigned int cpo_index,
128  const ArrayView<double> &data);
129 
133  static
134  void
135  set_elastic_tensor(unsigned int cpo_data_position,
136  const ArrayView<double> &data,
137  const SymmetricTensor<2,6> &elastic_tensor);
138 
142  static
143  void
144  declare_parameters (ParameterHandler &prm);
145 
149  void
150  parse_parameters (ParameterHandler &prm) override;
151 
152  private:
156  unsigned int cpo_data_position;
157 
162  SymmetricTensor<2,6> stiffness_matrix_olivine;
163  SymmetricTensor<2,6> stiffness_matrix_enstatite;
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
Definition: compat.h:59
static void set_elastic_tensor(unsigned int cpo_data_position, const ArrayView< double > &data, const SymmetricTensor< 2, 6 > &elastic_tensor)