ASPECT
cpo_elastic_tensor.h
Go to the documentation of this file.
1 // ------------------------------------------------------
2 //
3 // SPDX-License-Identifier: GPL-2.0-or-later
4 //
5 // SPDX-FileCopyrightText: Copyright (C) 2023-2026 by the ASPECT authors.
6 //
7 // This file is part of ASPECT.
8 //
9 // Detailed license information governing the source code and
10 // contributions can be found in the folder LICENSES and in
11 // LICENSE and CONTRIBUTING.md at the top level directory.
12 //
13 // ------------------------------------------------------
14 
15 #ifndef _aspect_particle_property_cpo_elastic_tensor_h
16 #define _aspect_particle_property_cpo_elastic_tensor_h
17 
21 
22 namespace aspect
23 {
24  namespace Particle
25  {
26  namespace Property
27  {
28 
40  template <int dim>
41  class CpoElasticTensor : public Interface<dim>, public ::aspect::SimulatorAccess<dim>
42  {
43  public:
48 
53  void
54  initialize () override;
55 
67  const unsigned int cpo_data_position,
68  const ArrayView<double> &data) const;
69 
81  void
83  std::vector<double> &particle_properties) const override;
84 
88  void
90  typename ParticleHandler<dim>::particle_iterator_range &particles) const override;
91 
97  need_update () const override;
98 
103  get_update_flags (const unsigned int component) const override;
104 
112  std::vector<std::pair<std::string, unsigned int>>
113  get_property_information() const override;
114 
118  static
120  get_elastic_tensor(unsigned int cpo_index,
121  const ArrayView<double> &data);
122 
126  static
127  void
128  set_elastic_tensor(unsigned int cpo_data_position,
129  const ArrayView<double> &data,
130  const SymmetricTensor<2,6> &elastic_tensor);
131 
135  static
136  void
138 
142  void
143  parse_parameters (ParameterHandler &prm) override;
144 
145  private:
149  unsigned int cpo_data_position;
150 
158 
165  unsigned int n_grains;
166 
173  unsigned int n_minerals;
174 
175  };
176  }
177  }
178 }
179 
180 #endif
std::vector< index_type > data
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
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
boost::iterator_range< particle_iterator > particle_iterator_range
static void set_elastic_tensor(unsigned int cpo_data_position, const ArrayView< double > &data, const SymmetricTensor< 2, 6 > &elastic_tensor)