ASPECT
cpo_elastic_tensor.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2023 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 
118  void
119  update_particle_property (const unsigned int data_position,
120  const Vector<double> &solution,
121  const std::vector<Tensor<1,dim>> &gradients,
122  typename ParticleHandler<dim>::particle_iterator &particle) const override;
123 
129  need_update () const override;
130 
135  UpdateFlags
136  get_needed_update_flags () const override;
137 
145  std::vector<std::pair<std::string, unsigned int>>
146  get_property_information() const override;
147 
151  static
152  SymmetricTensor<2,6>
153  get_elastic_tensor(unsigned int cpo_index,
154  const ArrayView<double> &data);
155 
159  static
160  void
161  set_elastic_tensor(unsigned int cpo_data_position,
162  const ArrayView<double> &data,
163  const SymmetricTensor<2,6> &elastic_tensor);
164 
168  static
169  void
170  declare_parameters (ParameterHandler &prm);
171 
175  void
176  parse_parameters (ParameterHandler &prm) override;
177 
178  private:
182  unsigned int cpo_data_position;
183 
188  SymmetricTensor<2,6> stiffness_matrix_olivine;
189  SymmetricTensor<2,6> stiffness_matrix_enstatite;
190 
194  unsigned int n_grains;
195 
199  unsigned int n_minerals;
200 
201  };
202  }
203  }
204 }
205 
206 #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
UpdateFlags get_needed_update_flags() const override
static void declare_parameters(ParameterHandler &prm)
Definition: compat.h:59
void update_particle_property(const unsigned int data_position, const Vector< double > &solution, const std::vector< Tensor< 1, dim >> &gradients, typename ParticleHandler< dim >::particle_iterator &particle) const override
static void set_elastic_tensor(unsigned int cpo_data_position, const ArrayView< double > &data, const SymmetricTensor< 2, 6 > &elastic_tensor)