Skip to content

Commit a9e23d2

Browse files
more generality to avoid breaking test in SMApp
1 parent a844ca8 commit a9e23d2

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

applications/StructuralMechanicsApplication/custom_utilities/constitutive_law_utilities.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -391,13 +391,14 @@ void ConstitutiveLawUtilities<TVoigtSize>::CalculateCauchyGreenStrain(
391391

392392
noalias(rStrainVector) = MathUtils<double>::StrainTensorToVector(E_tensor);
393393
} else {
394+
const SizeType space_dimension = rValues.GetElementGeometry().WorkingSpaceDimension();
394395
//1.-Compute total deformation gradient
395396
const ConstitutiveLaw::DeformationGradientMatrixType& F = rValues.GetDeformationGradientF();
396-
KRATOS_DEBUG_ERROR_IF(F.size1()!= Dimension || F.size2() != Dimension)
397-
<< "expected size of F " << Dimension << "x" << Dimension << ", got " << F.size1() << "x" << F.size2() << std::endl;
397+
KRATOS_DEBUG_ERROR_IF(F.size1()!= space_dimension || F.size2() != space_dimension)
398+
<< "expected size of F " << space_dimension << "x" << space_dimension << ", got " << F.size1() << "x" << F.size2() << std::endl;
398399

399400
ConstitutiveLaw::DeformationGradientMatrixType E_tensor = prod(trans(F),F);
400-
for(unsigned int i = 0; i < Dimension; ++i)
401+
for(unsigned int i = 0; i < space_dimension; ++i)
401402
E_tensor(i,i) -= 1.0;
402403
E_tensor *= 0.5;
403404

0 commit comments

Comments
 (0)