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 
113  void
114  update_one_particle_property (const unsigned int data_position,
115  const Point<dim> &position,
116  const Vector<double> &solution,
117  const std::vector<Tensor<1,dim>> &gradients,
118  const ArrayView<double> &particle_properties) const override;
119 
125  need_update () const override;
126 
131  UpdateFlags
132  get_needed_update_flags () const override;
133 
141  std::vector<std::pair<std::string, unsigned int>>
142  get_property_information() const override;
143 
147  static
148  SymmetricTensor<2,6>
149  get_elastic_tensor(unsigned int cpo_index,
150  const ArrayView<double> &data);
151 
155  static
156  void
157  set_elastic_tensor(unsigned int cpo_data_position,
158  const ArrayView<double> &data,
159  const SymmetricTensor<2,6> &elastic_tensor);
160 
164  static
165  void
166  declare_parameters (ParameterHandler &prm);
167 
171  void
172  parse_parameters (ParameterHandler &prm) override;
173 
174  private:
178  unsigned int cpo_data_position;
179 
184  SymmetricTensor<2,6> stiffness_matrix_olivine;
185  SymmetricTensor<2,6> stiffness_matrix_enstatite;
186 
190  unsigned int n_grains;
191 
195  unsigned int n_minerals;
196 
197  };
198  }
199  }
200 }
201 
202 #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)
static void set_elastic_tensor(unsigned int cpo_data_position, const ArrayView< double > &data, const SymmetricTensor< 2, 6 > &elastic_tensor)
void update_one_particle_property(const unsigned int data_position, const Point< dim > &position, const Vector< double > &solution, const std::vector< Tensor< 1, dim >> &gradients, const ArrayView< double > &particle_properties) const override