From 0fb8ab12a4bb4cf81d587c51820a4e5fa5ee1d9e Mon Sep 17 00:00:00 2001 From: Alasdair Christison Gray Date: Mon, 8 Jul 2024 14:30:20 -0400 Subject: [PATCH] Fix to prev commit so that failure0 is the aggregated failure value --- .../TACSBladeStiffenedShellConstitutive.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/constitutive/TACSBladeStiffenedShellConstitutive.cpp b/src/constitutive/TACSBladeStiffenedShellConstitutive.cpp index da708af45..7825609e8 100644 --- a/src/constitutive/TACSBladeStiffenedShellConstitutive.cpp +++ b/src/constitutive/TACSBladeStiffenedShellConstitutive.cpp @@ -1228,12 +1228,15 @@ TacsScalar TACSBladeStiffenedShellConstitutive::evalDesignFieldValue( TacsScalar TACSBladeStiffenedShellConstitutive::evalFailureFieldValue( int elemIndex, const double pt[], const TacsScalar X[], const TacsScalar strain[], int failIndex) { - if (failIndex < 0 || failIndex >= this->NUM_FAILURES) { + if (failIndex == 0) { + return this->evalFailure(elemIndex, pt, X, strain); + } else if (failIndex >= 1 && failIndex <= this->NUM_FAILURES) { + TacsScalar fails[this->NUM_FAILURES]; + computeFailureValues(strain, fails); + return fails[failIndex - 1]; + } else { return 0.0; } - TacsScalar fails[this->NUM_FAILURES]; - computeFailureValues(strain, fails); - return fails[failIndex]; } TacsScalar