Skip to content

Commit 4203364

Browse files
committed
Adding KRATOS_ERROR when detJ .lt. zero in structural_meshmoving_element
1 parent ebd5e53 commit 4203364

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

applications/MeshMovingApplication/custom_elements/structural_meshmoving_element.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,11 @@ StructuralMeshMovingElement::SetAndModifyConstitutiveLaw(
104104

105105
MoveMeshUtilities::CheckJacobianDimension(invJ0, detJ0, rgeom);
106106

107+
if (detJ0[PointNumber] < 0.0) {
108+
KRATOS_ERROR << "Invalid negative Jacobian determinant detected!, Element ID: " << this->Id()
109+
<< "\n Element is inverted. Check mesh quality, node ordering, or surface normals." << std::endl;
110+
}
111+
107112
J0 = GetGeometry().Jacobian(J0, this_integration_method);
108113

109114
MathUtils<double>::InvertMatrix(J0[PointNumber], invJ0[PointNumber],

0 commit comments

Comments
 (0)