Skip to content

Commit

Permalink
Check that for each stress field DG is used now that it can be specif…
Browse files Browse the repository at this point in the history
…ied for each field individually
  • Loading branch information
anne-glerum committed Jun 17, 2024
1 parent b497196 commit ced787e
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions source/material_model/rheology/elasticity.cc
Original file line number Diff line number Diff line change
Expand Up @@ -191,21 +191,25 @@ namespace aspect
AssertThrow(!this->get_parameters().use_operator_splitting,
ExcMessage("If stresses are tracked on particles, the stress update is applied by the particle property 'elastic stress' "
"and operator splitting should not be turned on. "));
// The discontinuous element is required to accommodate discontinuous
// strain rates that feed into the stored stresses.
AssertThrow(this->get_parameters().use_discontinuous_composition_discretization,
ExcMessage("The viscoelastic material model and the visco-plastic material model with elasticity enabled require "
"the use of discontinuous elements for composition."));

// Check that 3+3 in 2D or 6+6 in 3D stress fields exist.
AssertThrow((this->introspection().get_number_of_fields_of_type(CompositionalFieldDescription::stress) == 2*SymmetricTensor<2,dim>::n_independent_components),
ExcMessage("Rheology model Elasticity requires 3+3 in 2D or 6+6 in 3D fields of type stress."));

// Check that the compositional fields representing the viscoelastic
// stress tensor components are both named correctly and listed in the right order.
// stress tensor components are both named correctly and listed in the right order
// as well as use a discontinuous discretization.
std::vector<std::string> stress_field_names = this->introspection().get_names_for_fields_of_type(CompositionalFieldDescription::stress);
std::vector<unsigned int> stress_field_indices = this->introspection().get_indices_for_fields_of_type(CompositionalFieldDescription::stress);

// The discontinuous element is required to accommodate discontinuous
// strain rates that feed into the stored stresses.
const std::vector<bool> use_discontinuous_composition_discretization = this->get_parameters().use_discontinuous_composition_discretization;
for (auto stress_field : stress_field_indices)
AssertThrow(use_discontinuous_composition_discretization[stress_field],
ExcMessage("The viscoelastic material model and the visco-plastic material model with elasticity enabled require "
"the use of discontinuous elements for compositions that represent stress tensor components."));

// We require a consecutive range of indices (for example for FEPointEvaluation)
// to extract the fields representing the viscoelastic stress tensor components,
// so check that they are listed without interruption by other fields.
Expand Down

0 comments on commit ced787e

Please sign in to comment.