本文整理汇总了C++中CConfig::GetKind_ObjFunc方法的典型用法代码示例。如果您正苦于以下问题:C++ CConfig::GetKind_ObjFunc方法的具体用法?C++ CConfig::GetKind_ObjFunc怎么用?C++ CConfig::GetKind_ObjFunc使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CConfig
的用法示例。
在下文中一共展示了CConfig::GetKind_ObjFunc方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
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);
#else
Gradient = my_Gradient;
#endif
if (rank == MASTER_NODE) {
switch (config->GetKind_ObjFunc()) {
case LIFT_COEFFICIENT :
if (iDV == 0) Gradient_file << "Lift coeff. grad. using cont. adj." << endl;
cout << "Lift coefficient gradient: "<< Gradient << "." << endl; break;
case DRAG_COEFFICIENT :
if (iDV == 0) Gradient_file << "Drag coeff. grad. using cont. adj." << endl;
cout << "Drag coefficient gradient: "<< Gradient << "." << endl; break;
case SIDEFORCE_COEFFICIENT :
if (iDV == 0) Gradient_file << "Sideforce coeff. grad. using cont. adj." << endl;
cout << "Sideforce coefficient gradient: "<< Gradient << "." << endl; break;
case MOMENT_X_COEFFICIENT :
if (iDV == 0) Gradient_file << "Moment x coeff. grad. using cont. adj." << endl;
cout << "Moment x coefficient gradient: "<< Gradient << "." << endl; break;
case MOMENT_Y_COEFFICIENT :
if (iDV == 0) Gradient_file << "Moment y coeff. grad. using cont. adj." << endl;
cout << "Moment y coefficient gradient: "<< Gradient << "." << endl; break;
case MOMENT_Z_COEFFICIENT :
if (iDV == 0) Gradient_file << "Moment z coeff. grad. using cont. adj." << endl;
cout << "Moment z coefficient gradient: "<< Gradient << "." << endl; break;
case EFFICIENCY :
if (iDV == 0) Gradient_file << "Efficiency coeff. grad. using cont. adj." << endl;
cout << "Efficiency coefficient gradient: "<< Gradient << "." << endl; break;
case EQUIVALENT_AREA :
if (iDV == 0) Gradient_file << "Equivalent area coeff. grad. using cont. adj." << endl;
cout << "Equivalent Area coefficient gradient: "<< Gradient << "." << endl; break;
case NEARFIELD_PRESSURE :
if (iDV == 0) Gradient_file << "Near-field pressure coeff. grad. using cont. adj." << endl;
cout << "Near-field pressure coefficient gradient: "<< Gradient << "." << endl; break;
case FORCE_X_COEFFICIENT :
if (iDV == 0) Gradient_file << "Force x coeff. grad. using cont. adj." << endl;
cout << "Force x coefficient gradient: "<< Gradient << "." << endl; break;
case FORCE_Y_COEFFICIENT :
if (iDV == 0) Gradient_file << "Force y coeff. grad. using cont. adj." << endl;