From fd9aafbc899748b38f7e8ec6241dd9a4cf5f0b9c Mon Sep 17 00:00:00 2001 From: Oliver Gloth Date: Tue, 24 Feb 2015 12:22:43 +0100 Subject: [PATCH] move nodes in small steps to limit heights --- src/libengrid/boundarylayeroperation.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/libengrid/boundarylayeroperation.cpp b/src/libengrid/boundarylayeroperation.cpp index f9806180..ea025b66 100644 --- a/src/libengrid/boundarylayeroperation.cpp +++ b/src/libengrid/boundarylayeroperation.cpp @@ -1341,13 +1341,15 @@ void BoundaryLayerOperation::limitHeights(double safety_factor) double beta = m_MaxHeightInGaps/(1.0 - m_MaxHeightInGaps); QVector h_save = m_Height; - for (int pass = 1; pass <= 5; ++pass) { + int max_pass = 5; + for (int pass = 0; pass <= max_pass; ++pass) { - // move nodes for second pass - if (pass > 1) { + // move nodes (small steps per pass) + { + double w = double(pass)/max_pass; for (vtkIdType id_node = 0; id_node < m_Grid->GetNumberOfPoints(); ++id_node) { if (m_BoundaryLayerNode[id_node]) { - vec3_t x = x_old[id_node] + m_Height[id_node]*m_BoundaryLayerVectors[id_node]; + vec3_t x = x_old[id_node] + w*m_Height[id_node]*m_BoundaryLayerVectors[id_node]; m_Grid->GetPoints()->SetPoint(id_node, x.data()); } } -- 2.11.4.GIT