aspect icon indicating copy to clipboard operation
aspect copied to clipboard

Add Assert for stress type fields without elasticity enabled

Open anne-glerum opened this issue 11 months ago • 2 comments

Compositional field types do not have to be specified; if they are not specified, they get the type 'unspecified' and ASPECT tries to deduce their type from their name. A field called ve_stress_xx, for example, will get the type 'stress'. If elasticity is disabled, there is at the moment no special function for fields of the type stress, which would imply this field is actually meant as a chemical composition. However, it now has the type 'stress' and is therefore not taken into account when computing material properties in the viscoelastic and viscoplastic material models.

This PR throws if

  1. Elasticity is disabled, and
  2. A field of type 'unspecified' has 'stress' in its name. It tells the user to explicitly specify the field types in the input file.

Several tests will fail, as they already have fields with stress names without using elasticity, e.g. viscous_top_beam. I'll add the field types of those tests to their input files once the tester is done.

For all pull requests:

  • [x] I have followed the instructions for indenting my code.

For new features/models or changes of existing features:

  • [x] I have tested my new feature locally to ensure it is correct.
  • [ ] I have created a testcase for the new feature/benchmark in the tests/ directory.
  • [ ] I have added a changelog entry in the doc/modules/changes directory that will inform other users of my change.

anne-glerum avatar Feb 27 '24 13:02 anne-glerum

I agree that this is an unfortunate situation, but can you explain a bit more why it is a problem? You say the stress fields are then excluded from the material properties computation, but isnt that exactly what one would want? Is there a case where you want the stress field to participate in that computation?

gassmoeller avatar Feb 28 '24 16:02 gassmoeller

Hi @gassmoeller, I see two reasons for asking the user to set the field type specifically:

  1. When elasticity is disabled, fields of type stress are at the moment not used anywhere, so the user might assume that the a field with the name stress is seen as a chemical composition.
  2. Users might actually want to name a chemical composition field something with 'stress' in it. (The name can be whatever, as long it contains 'stress' it will be marked as stress field type.) The PR avoids such unexpected behaviour.

anne-glerum avatar Mar 11 '24 13:03 anne-glerum