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;
187 update_particle_property (
const unsigned int data_position,
188 const Vector<double> &solution,
189 const std::vector<Tensor<1,dim>> &gradients,
190 typename ParticleHandler<dim>::particle_iterator &particle)
const override;
197 need_update ()
const override;
203 late_initialization_mode ()
const override;
210 get_needed_update_flags ()
const override;
219 std::vector<std::pair<std::string, unsigned int>>
220 get_property_information()
const override;
239 std::pair<std::vector<double>, std::vector<Tensor<2,3>>>
240 compute_derivatives(
const unsigned int cpo_index,
241 const ArrayView<double> &data,
242 const unsigned int mineral_i,
243 const SymmetricTensor<2,3> &strain_rate_3d,
244 const Tensor<2,3> &velocity_gradient_tensor,
245 const Point<dim> &position,
248 const Tensor<1,dim> &velocity,
249 const std::vector<double> &compositions,
251 const SymmetricTensor<2,dim> &deviatoric_strain_rate,
252 const double water_content)
const;
269 std::pair<std::vector<double>, std::vector<Tensor<2,3>>>
270 compute_derivatives_drex_2004(
const unsigned int cpo_index,
271 const ArrayView<double> &data,
272 const unsigned int mineral_i,
273 const SymmetricTensor<2,3> &strain_rate_3d,
274 const Tensor<2,3> &velocity_gradient_tensor,
275 const std::array<double,4> ref_resolved_shear_stress,
276 const bool prevent_nondimensionalization =
false)
const;
290 parse_parameters (ParameterHandler &prm)
override;
296 get_number_of_grains()
const;
302 get_number_of_minerals()
const;
315 const Point<dim> &position,
316 const double temperature,
317 const double pressure,
318 const Tensor<1,dim> &velocity,
319 const std::vector<double> &compositions,
320 const SymmetricTensor<2,dim> &strain_rate,
321 const SymmetricTensor<2,dim> &deviatoric_strain_rate,
322 const double water_content)
const;
329 determine_deformation_type_karato_2008(
const double stress,
330 const double water_content)
const;
342 reference_resolved_shear_stress_from_deformation_type(
DeformationType deformation_type,
343 double max_value = 1e60)
const;
354 const ArrayView<double> &data,
355 const unsigned int mineral_i)
const 357 return static_cast<DeformationType>(data[cpo_data_position + 0 + mineral_i * (n_grains * 10 + 2)]);
370 const ArrayView<double> &data,
371 const unsigned int mineral_i,
374 data[cpo_data_position + 0 + mineral_i * (n_grains * 10 + 2)] = static_cast<double>(deformation_type);
386 const ArrayView<double> &data,
387 const unsigned int mineral_i)
const 389 return data[cpo_data_position + 1 + mineral_i *(n_grains * 10 + 2)];
402 const ArrayView<double> &data,
403 const unsigned int mineral_i,
404 const double volume_fraction_mineral)
const 406 data[cpo_data_position + 1 + mineral_i *(n_grains * 10 + 2)] = volume_fraction_mineral;
419 const ArrayView<const double> &data,
420 const unsigned int mineral_i,
421 const unsigned int grain_i)
const 423 return data[cpo_data_position + 2 + grain_i * 10 + mineral_i * (n_grains * 10 + 2)];
437 const ArrayView<double> &data,
438 const unsigned int mineral_i,
439 const unsigned int grain_i,
440 const double volume_fractions_grains)
const 442 data[cpo_data_position + 2 + grain_i * 10 + mineral_i * (n_grains * 10 + 2)] = volume_fractions_grains;
456 const ArrayView<const double> &data,
457 const unsigned int mineral_i,
458 const unsigned int grain_i)
const 460 Tensor<2,3> rotation_matrix;
461 for (
unsigned int i = 0; i < Tensor<2,3>::n_independent_components ; ++i)
463 const ::TableIndices<2> index = Tensor<2,3>::unrolled_to_component_indices(i);
464 rotation_matrix[index] = data[cpo_data_position + 3 + grain_i * 10 + mineral_i * (n_grains * 10 + 2) + i];
466 return rotation_matrix;
480 const ArrayView<double> &data,
481 const unsigned int mineral_i,
482 const unsigned int grain_i,
483 const Tensor<2,3> &rotation_matrix)
const 485 for (
unsigned int i = 0; i < Tensor<2,3>::n_independent_components ; ++i)
487 const ::TableIndices<2> index = Tensor<2,3>::unrolled_to_component_indices(i);
488 data[cpo_data_position + 3 + grain_i * 10 + mineral_i * (n_grains * 10 + 2) + i] = rotation_matrix[index];
498 compute_random_rotation_matrix(Tensor<2,3> &rotation_matrix)
const;
516 advect_forward_euler(
const unsigned int cpo_data_position,
517 const ArrayView<double> &data,
518 const unsigned int mineral_i,
520 const std::pair<std::vector<double>, std::vector<Tensor<2,3>>> &derivatives)
const;
538 advect_backward_euler(
const unsigned int cpo_data_position,
539 const ArrayView<double> &data,
540 const unsigned int mineral_i,
542 const std::pair<std::vector<double>, std::vector<Tensor<2,3>>> &derivatives)
const;
551 std::pair<std::vector<double>, std::vector<Tensor<2,3>>>
552 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