本文整理汇总了C++中CGeometry::GetnPointDomain方法的典型用法代码示例。如果您正苦于以下问题:C++ CGeometry::GetnPointDomain方法的具体用法?C++ CGeometry::GetnPointDomain怎么用?C++ CGeometry::GetnPointDomain使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGeometry
的用法示例。
在下文中一共展示了CGeometry::GetnPointDomain方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
case FFD_CONTROL_POINT : surface_mov->SetFFDCPChange(boundary, config, FFDBox[iFFDBox], iFFDBox, iDV, true); break;
case FFD_DIHEDRAL_ANGLE : surface_mov->SetFFDDihedralAngle(boundary, config, FFDBox[iFFDBox], iFFDBox, iDV, true); break;
case FFD_TWIST_ANGLE : surface_mov->SetFFDTwistAngle(boundary, config, FFDBox[iFFDBox], iFFDBox, iDV, true); break;
case FFD_ROTATION : surface_mov->SetFFDRotation(boundary, config, FFDBox[iFFDBox], iFFDBox, iDV, true); break;
case FFD_CAMBER : surface_mov->SetFFDCamber(boundary, config, FFDBox[iFFDBox], iFFDBox, iDV, true); break;
case FFD_THICKNESS : surface_mov->SetFFDThickness(boundary, config, FFDBox[iFFDBox], iFFDBox, iDV, true); break;
case FFD_VOLUME : surface_mov->SetFFDVolume(boundary, config, FFDBox[iFFDBox], iFFDBox, iDV, true); break;
}
/*--- Recompute cartesian coordinates using the new control points position ---*/
surface_mov->SetCartesianCoord(boundary, config, FFDBox[iFFDBox], iFFDBox);
}
}
}
/*--- Continuous adjoint gradient computation ---*/
if (rank == MASTER_NODE)
cout << "Evaluate functional gradient using the continuous adjoint strategy." << endl;
/*--- Load the delta change in the design variable (finite difference step). ---*/
delta_eps = config->GetDV_Value(iDV);
my_Gradient = 0.0; Gradient = 0.0;
/*--- Reset update points ---*/
for (iPoint = 0; iPoint < boundary->GetnPoint(); iPoint++)
UpdatePoint[iPoint] = true;
for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) {
if (config->GetMarker_All_DV(iMarker) == YES) {
for (iVertex = 0; iVertex < boundary->nVertex[iMarker]; iVertex++) {
iPoint = boundary->vertex[iMarker][iVertex]->GetNode();
if ((iPoint < boundary->GetnPointDomain()) && UpdatePoint[iPoint]) {
Normal = boundary->vertex[iMarker][iVertex]->GetNormal();
VarCoord = boundary->vertex[iMarker][iVertex]->GetVarCoord();
Sensitivity = boundary->vertex[iMarker][iVertex]->GetAuxVar();
dS = 0.0;
for (iDim = 0; iDim < boundary->GetnDim(); iDim++) {
dS += Normal[iDim]*Normal[iDim];
deps[iDim] = VarCoord[iDim] / delta_eps;
}
dS = sqrt(dS);
dalpha_deps = 0.0;
for (iDim = 0; iDim < boundary->GetnDim(); iDim++) {
dalpha[iDim] = Normal[iDim] / dS;
dalpha_deps -= dalpha[iDim]*deps[iDim];
}
/*--- Store the geometric sensitivity for this DV (rows) & this node (column) ---*/
if (size == SINGLE_NODE) {
Jacobian_file << ", " << dalpha_deps;
}
my_Gradient += Sensitivity*dalpha_deps;
UpdatePoint[iPoint] = false;
}
}
}
}
#ifndef NO_MPI
MPI::COMM_WORLD.Allreduce(&my_Gradient, &Gradient, 1, MPI::DOUBLE, MPI::SUM);