Skip to content

Commit a343c6d

Browse files
committed
fixing more logic
1 parent 58eaee1 commit a343c6d

2 files changed

Lines changed: 9 additions & 14 deletions

File tree

Common/include/grid_movement/CRadialBasisFunctionInterpolation.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,7 @@ class CRadialBasisFunctionInterpolation : public CVolumetricMovement {
8989
/*!
9090
* \brief Assigning the control nodes.
9191
* \param[in] config -Definition of the particular problem.
92-
* */
93-
92+
*/
9493
void SetCtrlNodes(CConfig* config);
9594

9695
/*!

Common/src/grid_movement/CRadialBasisFunctionInterpolation.cpp

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -423,11 +423,10 @@ void CRadialBasisFunctionInterpolation::UpdateGridCoord(CGeometry* geometry, CCo
423423
void CRadialBasisFunctionInterpolation::UpdateInternalCoords(CGeometry* geometry, const RADIAL_BASIS& type,
424424
const su2double radius,
425425
const vector<unsigned long>& internalNodes) {
426-
/*--- Vector for storing the coordinate variation ---*/
427-
su2double var_coord[3] = {0.0};
428-
429426
/*--- Loop over the internal nodes ---*/
430427
for (auto iNode = 0ul; iNode < internalNodes.size(); iNode++) {
428+
su2double var_coord[3] = {0.0};
429+
431430
/*--- Loop for contribution of each control node ---*/
432431
for (auto jNode = 0ul; jNode < nCtrlNodesGlobal; jNode++) {
433432
/*--- Determine distance between considered internal and control node ---*/
@@ -445,20 +444,18 @@ void CRadialBasisFunctionInterpolation::UpdateInternalCoords(CGeometry* geometry
445444
/*--- Apply the coordinate variation and resetting the var_coord vector to zero ---*/
446445
for (auto iDim = 0u; iDim < nDim; iDim++) {
447446
geometry->nodes->AddCoord(internalNodes[iNode], iDim, var_coord[iDim]);
448-
var_coord[iDim] = 0;
449447
}
450448
}
451449
}
452450

453451
void CRadialBasisFunctionInterpolation::UpdateBoundCoords(CGeometry* geometry, CConfig* config,
454452
const RADIAL_BASIS& type, const su2double radius) {
455-
/*--- Vector for storing the coordinate variation ---*/
456-
su2double var_coord[3] = {0.0};
457-
458453
/*--- In case of data reduction, the non-control boundary nodes are treated as if they where internal nodes ---*/
459454
if (config->GetRBFParam().DataReduction) {
460455
/*--- Looping over the non selected boundary nodes ---*/
461456
for (auto iNode = 0ul; iNode < BoundNodes.size(); iNode++) {
457+
su2double var_coord[3] = {0.0};
458+
462459
/*--- Finding contribution of each control node ---*/
463460
for (auto jNode = 0ul; jNode < nCtrlNodesGlobal; jNode++) {
464461
/*--- Distance of non-selected boundary node to control node ---*/
@@ -474,17 +471,16 @@ void CRadialBasisFunctionInterpolation::UpdateBoundCoords(CGeometry* geometry, C
474471
}
475472
}
476473

477-
/*--- Applying the coordinate variation and resetting the var_coord vector*/
474+
/*--- Applying the coordinate variation and resetting the var_coord vector ---*/
478475
for (auto iDim = 0u; iDim < nDim; iDim++) {
479476
geometry->nodes->AddCoord(BoundNodes[iNode]->GetIndex(), iDim, var_coord[iDim]);
480-
var_coord[iDim] = 0;
481477
}
482478
}
483479
}
484480

485481
/*--- Applying the surface deformation, which are stored in the deformation vector ---*/
486482
for (auto jNode = 0ul; jNode < ControlNodes->size(); jNode++) {
487-
if (config->GetMarker_All_Moving((*ControlNodes)[jNode]->GetMarker())) {
483+
if (IsDeformationMarker(config, (*ControlNodes)[jNode]->GetMarker())) {
488484
for (auto iDim = 0u; iDim < nDim; iDim++) {
489485
geometry->nodes->AddCoord((*ControlNodes)[jNode]->GetIndex(), iDim, CtrlNodeDeformation(jNode, iDim));
490486
}
@@ -579,12 +575,12 @@ void CRadialBasisFunctionInterpolation::GetNodalError(CGeometry* geometry, CConf
579575
const su2double radius, unsigned long iNode,
580576
su2double* localError) {
581577
/*--- If requested (no by default) impose the surface deflections in increments ---*/
582-
const su2double VarIncrement = 1.0 / ((su2double)config->GetGridDef_Nonlinear_Iter());
578+
const su2double VarIncrement = 1.0 / config->GetGridDef_Nonlinear_Iter();
583579

584580
/*--- If node is part of a moving boundary then the error is defined as the difference
585581
between the found and prescribed displacements. Thus, here the displacement is substracted from the error
586582
---*/
587-
if (config->GetMarker_All_Moving(BoundNodes[iNode]->GetMarker())) {
583+
if (IsDeformationMarker(config, BoundNodes[iNode]->GetMarker())) {
588584
auto displacement = geometry->vertex[BoundNodes[iNode]->GetMarker()][BoundNodes[iNode]->GetVertex()]->GetVarCoord();
589585

590586
for (auto iDim = 0u; iDim < nDim; iDim++) {

0 commit comments

Comments
 (0)