21 #ifndef _aspect_particle_property_cpo_h 22 #define _aspect_particle_property_cpo_h 28 DEAL_II_DISABLE_EXTRA_DIAGNOSTICS
29 #include <boost/random.hpp> 30 DEAL_II_ENABLE_EXTRA_DIAGNOSTICS
157 initialize_one_particle_property (
const Point<dim> &position,
158 std::vector<double> &particle_properties)
const override;
165 typename ParticleHandler<dim>::particle_iterator_range &particles)
const override;
172 need_update ()
const override;
178 late_initialization_mode ()
const override;
184 get_update_flags (
const unsigned int component)
const override;
193 std::vector<std::pair<std::string, unsigned int>>
194 get_property_information()
const override;
213 std::pair<std::vector<double>, std::vector<Tensor<2,3>>>
214 compute_derivatives(
const unsigned int cpo_index,
215 const ArrayView<double> &data,
216 const unsigned int mineral_i,
217 const SymmetricTensor<2,3> &strain_rate_3d,
218 const Tensor<2,3> &velocity_gradient_tensor,
219 const Point<dim> &position,
222 const Tensor<1,dim> &velocity,
223 const std::vector<double> &compositions,
225 const SymmetricTensor<2,dim> &deviatoric_strain_rate,
226 const double water_content)
const;
243 std::pair<std::vector<double>, std::vector<Tensor<2,3>>>
244 compute_derivatives_drex_2004(
const unsigned int cpo_index,
245 const ArrayView<double> &data,
246 const unsigned int mineral_i,
247 const SymmetricTensor<2,3> &strain_rate_3d,
248 const Tensor<2,3> &velocity_gradient_tensor,
249 const std::array<double,4> ref_resolved_shear_stress,
250 const bool prevent_nondimensionalization =
false)
const;
264 parse_parameters (ParameterHandler &prm)
override;
270 get_number_of_grains()
const;
276 get_number_of_minerals()
const;
289 const Point<dim> &position,
290 const double temperature,
291 const double pressure,
292 const Tensor<1,dim> &velocity,
293 const std::vector<double> &compositions,
294 const SymmetricTensor<2,dim> &strain_rate,
295 const SymmetricTensor<2,dim> &deviatoric_strain_rate,
296 const double water_content)
const;
303 determine_deformation_type_karato_2008(
const double stress,
304 const double water_content)
const;
316 reference_resolved_shear_stress_from_deformation_type(
DeformationType deformation_type,
317 double max_value = 1e60)
const;
328 const ArrayView<double> &data,
329 const unsigned int mineral_i)
const 331 return static_cast<DeformationType>(data[cpo_data_position + 0 + mineral_i * (n_grains * 10 + 2)]);
344 const ArrayView<double> &data,
345 const unsigned int mineral_i,
348 data[cpo_data_position + 0 + mineral_i * (n_grains * 10 + 2)] = static_cast<double>(deformation_type);
360 const ArrayView<double> &data,
361 const unsigned int mineral_i)
const 363 return data[cpo_data_position + 1 + mineral_i *(n_grains * 10 + 2)];
376 const ArrayView<double> &data,
377 const unsigned int mineral_i,
378 const double volume_fraction_mineral)
const 380 data[cpo_data_position + 1 + mineral_i *(n_grains * 10 + 2)] = volume_fraction_mineral;
393 const ArrayView<const double> &data,
394 const unsigned int mineral_i,
395 const unsigned int grain_i)
const 397 return data[cpo_data_position + 2 + grain_i * 10 + mineral_i * (n_grains * 10 + 2)];
411 const ArrayView<double> &data,
412 const unsigned int mineral_i,
413 const unsigned int grain_i,
414 const double volume_fractions_grains)
const 416 data[cpo_data_position + 2 + grain_i * 10 + mineral_i * (n_grains * 10 + 2)] = volume_fractions_grains;
430 const ArrayView<const double> &data,
431 const unsigned int mineral_i,
432 const unsigned int grain_i)
const 434 Tensor<2,3> rotation_matrix;
435 for (
unsigned int i = 0; i < Tensor<2,3>::n_independent_components ; ++i)
437 const ::TableIndices<2> index = Tensor<2,3>::unrolled_to_component_indices(i);
438 rotation_matrix[index] = data[cpo_data_position + 3 + grain_i * 10 + mineral_i * (n_grains * 10 + 2) + i];
440 return rotation_matrix;
454 const ArrayView<double> &data,
455 const unsigned int mineral_i,
456 const unsigned int grain_i,
457 const Tensor<2,3> &rotation_matrix)
const 459 for (
unsigned int i = 0; i < Tensor<2,3>::n_independent_components ; ++i)
461 const ::TableIndices<2> index = Tensor<2,3>::unrolled_to_component_indices(i);
462 data[cpo_data_position + 3 + grain_i * 10 + mineral_i * (n_grains * 10 + 2) + i] = rotation_matrix[index];
472 compute_random_rotation_matrix(Tensor<2,3> &rotation_matrix)
const;
490 advect_forward_euler(
const unsigned int cpo_data_position,
491 const ArrayView<double> &data,
492 const unsigned int mineral_i,
494 const std::pair<std::vector<double>, std::vector<Tensor<2,3>>> &derivatives)
const;
512 advect_backward_euler(
const unsigned int cpo_data_position,
513 const ArrayView<double> &data,
514 const unsigned int mineral_i,
516 const std::pair<std::vector<double>, std::vector<Tensor<2,3>>> &derivatives)
const;
525 std::pair<std::vector<double>, std::vector<Tensor<2,3>>>
526 compute_derivatives_spin_tensor(
const Tensor<2,3> &velocity_gradient_tensor)
const;
void set_volume_fraction_mineral(const unsigned int cpo_data_position, const ArrayView< double > &data, const unsigned int mineral_i, const double volume_fraction_mineral) const
Sets the value in the data array representing the volume fraction of a mineral.
DeformationTypeSelector
The type of deformation selector used by the CPO code.
double nucleation_efficiency
CPODerivativeAlgorithm
The algorithm used to compute the derivatives of the grain size and rotation matrix used in the advec...
DeformationType
The type of deformation used by the CPO code.
InitializationModeForLateParticles
double get_volume_fraction_mineral(const unsigned int cpo_data_position, const ArrayView< double > &data, const unsigned int mineral_i) const
Returns the value in the data array representing the volume fraction of a mineral.
unsigned int property_advection_max_iterations
void declare_parameters(ParameterHandler &prm)
AdvectionMethod
The type of Advection method used to advect the CPO properties.
CPOInitialGrainsModel
An enum used to determine how the initial grain sizes and orientations are set for all particles...
AdvectionMethod advection_method
Tensor< 2, 3 > get_rotation_matrix_grains(const unsigned int cpo_data_position, const ArrayView< const double > &data, const unsigned int mineral_i, const unsigned int grain_i) const
Gets the rotation matrix for a grain in a mineral.
CPODerivativeAlgorithm cpo_derivative_algorithm
void set_deformation_type(const unsigned int cpo_data_position, const ArrayView< double > &data, const unsigned int mineral_i, const DeformationType deformation_type) const
Sets the value in the data array representing the deformation type.
DeformationType get_deformation_type(const unsigned int cpo_data_position, const ArrayView< double > &data, const unsigned int mineral_i) const
Returns the value in the data array representing the deformation type.
std::vector< double > volume_fractions_minerals
std::vector< DeformationTypeSelector > deformation_type_selector
void set_rotation_matrix_grains(const unsigned int cpo_data_position, const ArrayView< double > &data, const unsigned int mineral_i, const unsigned int grain_i, const Tensor< 2, 3 > &rotation_matrix) const
Sets the rotation matrix for a grain in a mineral.
double get_volume_fractions_grains(const unsigned int cpo_data_position, const ArrayView< const double > &data, const unsigned int mineral_i, const unsigned int grain_i) const
Returns the value in the data array representing the volume fraction of a grain.
void set_volume_fractions_grains(const unsigned int cpo_data_position, const ArrayView< double > &data, const unsigned int mineral_i, const unsigned int grain_i, const double volume_fractions_grains) const
Sets the value in the data array representing the volume fraction of a grain.
boost::mt19937 random_number_generator
double property_advection_tolerance
unsigned int random_number_seed
CPOInitialGrainsModel initial_grains_model