本文整理汇总了C++中CConfig::GetMesh_Scale_Change方法的典型用法代码示例。如果您正苦于以下问题:C++ CConfig::GetMesh_Scale_Change方法的具体用法?C++ CConfig::GetMesh_Scale_Change怎么用?C++ CConfig::GetMesh_Scale_Change使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CConfig
的用法示例。
在下文中一共展示了CConfig::GetMesh_Scale_Change方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
cout << endl << "Design variable number "<< iDV <<"." << endl;
cout << "Perform 3D deformation of the surface." << endl;
}
surface_mov->SetSpherical(boundary, config, iDV, true);
}
/*--- Design variable not implement ---*/
else { cout << "Design Variable not implement yet" << endl; }
/*--- 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();
MeshScale = config->GetMesh_Scale_Change();
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 += MeshScale*Sensitivity*dalpha_deps;
UpdatePoint[iPoint] = false;
}
}
}
}
#ifndef NO_MPI
#ifdef WINDOWS
MPI_Allreduce(&my_Gradient, &Gradient, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD);
#else
MPI::COMM_WORLD.Allreduce(&my_Gradient, &Gradient, 1, MPI::DOUBLE, MPI::SUM);
#endif