From b1b0c8c93c0ed4755b61c8c294793701e76494ed Mon Sep 17 00:00:00 2001 From: Wenqing Wang Date: Wed, 4 May 2016 11:26:16 +0200 Subject: [PATCH] Fixed a bug for the extrapolation in line, quad or hex element --- FEM/fem_ele.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/FEM/fem_ele.cpp b/FEM/fem_ele.cpp index e8f771fbc..d9b6d6b35 100644 --- a/FEM/fem_ele.cpp +++ b/FEM/fem_ele.cpp @@ -1396,17 +1396,19 @@ void CElement::SetExtropoGaussPoints(const int i) double CElement::CalcXi_p() { MshElemType::type ElementType = MeshElement->GetElementType(); - if (ElementType == MshElemType::LINE || ElementType == MshElemType::QUAD || ElementType == MshElemType::HEXAHEDRON) + Xi_p = 0.0; + if ( ElementType == MshElemType::LINE + || ElementType == MshElemType::QUAD + || ElementType == MshElemType::QUAD8 + || ElementType == MshElemType::HEXAHEDRON) { - double r = .0; for (gp = 0; gp < nGauss; gp++) { - r = MXPGaussPkt(nGauss, gp); - if (fabs(r) > Xi_p) - Xi_p = fabs(r); + const double r = fabs(MXPGaussPkt(nGauss, gp)); + if (r > Xi_p) + Xi_p = r; } - r = 1.0 / Xi_p; - Xi_p = r; + Xi_p = 1.0 / Xi_p; return Xi_p; } else