本文整理汇总了C++中CConfig::GetGeometryMode方法的典型用法代码示例。如果您正苦于以下问题:C++ CConfig::GetGeometryMode方法的具体用法?C++ CConfig::GetGeometryMode怎么用?C++ CConfig::GetGeometryMode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CConfig
的用法示例。
在下文中一共展示了CConfig::GetGeometryMode方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
/*--- Write the objective function in a external file ---*/
cstr = new char [config->GetObjFunc_Value_FileName().size()+1];
strcpy (cstr, config->GetObjFunc_Value_FileName().c_str());
ObjFunc_file.open(cstr, ios::out);
ObjFunc_file << "TITLE = \"SU2_GEO Simulation\"" << endl;
if (boundary->GetnDim() == 2) {
ObjFunc_file << "VARIABLES = \"MAX_THICKNESS\",\"1/4_THICKNESS\",\"1/3_THICKNESS\",\"1/2_THICKNESS\",\"2/3_THICKNESS\",\"3/4_THICKNESS\",\"AREA\",\"AOA\",\"CHORD\",\"VOLUME\"" << endl;
}
else if (boundary->GetnDim() == 3) {
ObjFunc_file << "VARIABLES = ";
for (iPlane = 0; iPlane < nPlane; iPlane++) ObjFunc_file << "\"MAX_THICKNESS_SEC"<< (iPlane+1) << "\", ";
for (iPlane = 0; iPlane < nPlane; iPlane++) ObjFunc_file << "\"1/4_THICKNESS_SEC"<< (iPlane+1) << "\", ";
for (iPlane = 0; iPlane < nPlane; iPlane++) ObjFunc_file << "\"1/3_THICKNESS_SEC"<< (iPlane+1) << "\", ";
for (iPlane = 0; iPlane < nPlane; iPlane++) ObjFunc_file << "\"1/2_THICKNESS_SEC"<< (iPlane+1) << "\", ";
for (iPlane = 0; iPlane < nPlane; iPlane++) ObjFunc_file << "\"2/3_THICKNESS_SEC"<< (iPlane+1) << "\", ";
for (iPlane = 0; iPlane < nPlane; iPlane++) ObjFunc_file << "\"3/4_THICKNESS_SEC"<< (iPlane+1) << "\", ";
for (iPlane = 0; iPlane < nPlane; iPlane++) ObjFunc_file << "\"AREA_SEC"<< (iPlane+1) << "\", ";
for (iPlane = 0; iPlane < nPlane; iPlane++) ObjFunc_file << "\"AOA_SEC"<< (iPlane+1) << "\", ";
for (iPlane = 0; iPlane < nPlane; iPlane++) ObjFunc_file << "\"CHORD_SEC"<< (iPlane+1) << "\", ";
ObjFunc_file << "\"VOLUME\"" << endl;
}
ObjFunc_file << "ZONE T= \"Geometrical variables (value)\"" << endl;
for (iPlane = 0; iPlane < nPlane*9; iPlane++)
ObjFunc_file << ObjectiveFunc[iPlane] <<", ";
ObjFunc_file << Volume << endl;
ObjFunc_file.close();
}
if (config->GetGeometryMode() == GRADIENT) {
/*--- Definition of the Class for surface deformation ---*/
surface_mov = new CSurfaceMovement();
/*--- Definition of the FFD deformation class ---*/
FFDBox = new CFreeFormDefBox*[MAX_NUMBER_FFD];
if (rank == MASTER_NODE)
cout << endl <<"------------- Gradient evaluation using finite differences --------------" << endl;
/*--- Write the gradient in a external file ---*/
if (rank == MASTER_NODE) {
cstr = new char [config->GetObjFunc_Grad_FileName().size()+1];
strcpy (cstr, config->GetObjFunc_Grad_FileName().c_str());
Gradient_file.open(cstr, ios::out);
}
for (iDV = 0; iDV < config->GetnDV(); iDV++) {
/*--- Free Form deformation based ---*/
if ((config->GetDesign_Variable(iDV) == FFD_CONTROL_POINT_2D) ||
(config->GetDesign_Variable(iDV) == FFD_CAMBER_2D) ||
(config->GetDesign_Variable(iDV) == FFD_THICKNESS_2D) ||
(config->GetDesign_Variable(iDV) == FFD_CONTROL_POINT) ||
(config->GetDesign_Variable(iDV) == FFD_DIHEDRAL_ANGLE) ||
(config->GetDesign_Variable(iDV) == FFD_TWIST_ANGLE) ||
(config->GetDesign_Variable(iDV) == FFD_ROTATION) ||
(config->GetDesign_Variable(iDV) == FFD_CAMBER) ||
(config->GetDesign_Variable(iDV) == FFD_THICKNESS) ) {
/*--- Read the FFD information in the first iteration ---*/
示例2: main
//.........这里部分代码省略.........
/*--- Write the objective function in a external file ---*/
cstr = new char [config->GetObjFunc_Value_FileName().size()+1];
strcpy (cstr, config->GetObjFunc_Value_FileName().c_str());
ObjFunc_file.open(cstr, ios::out);
ObjFunc_file << "TITLE = \"SU2_GDC Simulation\"" << endl;
if (boundary->GetnDim() == 2) {
ObjFunc_file << "VARIABLES = \"MAX_THICKNESS\",\"1/4_THICKNESS\",\"1/3_THICKNESS\",\"1/2_THICKNESS\",\"2/3_THICKNESS\",\"3/4_THICKNESS\",\"AREA\",\"AOA\",\"CHORD\"" << endl;
}
else if (boundary->GetnDim() == 3) {
ObjFunc_file << "VARIABLES = ";
for (iPlane = 0; iPlane < nPlane; iPlane++) ObjFunc_file << "\"MAX_THICKNESS_SEC"<< (iPlane+1) << "\", ";
for (iPlane = 0; iPlane < nPlane; iPlane++) ObjFunc_file << "\"1/4_THICKNESS_SEC"<< (iPlane+1) << "\", ";
for (iPlane = 0; iPlane < nPlane; iPlane++) ObjFunc_file << "\"1/3_THICKNESS_SEC"<< (iPlane+1) << "\", ";
for (iPlane = 0; iPlane < nPlane; iPlane++) ObjFunc_file << "\"1/2_THICKNESS_SEC"<< (iPlane+1) << "\", ";
for (iPlane = 0; iPlane < nPlane; iPlane++) ObjFunc_file << "\"2/3_THICKNESS_SEC"<< (iPlane+1) << "\", ";
for (iPlane = 0; iPlane < nPlane; iPlane++) ObjFunc_file << "\"3/4_THICKNESS_SEC"<< (iPlane+1) << "\", ";
for (iPlane = 0; iPlane < nPlane; iPlane++) ObjFunc_file << "\"AREA_SEC"<< (iPlane+1) << "\", ";
for (iPlane = 0; iPlane < nPlane; iPlane++) ObjFunc_file << "\"AOA_SEC"<< (iPlane+1) << "\", ";
for (iPlane = 0; iPlane < nPlane-1; iPlane++) ObjFunc_file << "\"CHORD_SEC"<< (iPlane+1) << "\", ";
ObjFunc_file << "\"CHORD_SEC"<< (nPlane) << "\"" << endl;
}
ObjFunc_file << "ZONE T= \"Geometrical variables (value)\"" << endl;
for (iPlane = 0; iPlane < nPlane*9-1; iPlane++)
ObjFunc_file << ObjectiveFunc[iPlane] <<", ";
ObjFunc_file << ObjectiveFunc[nPlane*9-1] << endl;
ObjFunc_file.close();
}
if (config->GetGeometryMode() == GRADIENT) {
/*--- Definition of the Class for surface deformation ---*/
surface_mov = new CSurfaceMovement();
/*--- Definition of the FFD deformation class ---*/
FFDBox = new CFreeFormDefBox*[MAX_NUMBER_FFD];
if (rank == MASTER_NODE)
cout << endl <<"------------- Gradient evaluation using finite differences --------------" << endl;
/*--- Write the gradient in a external file ---*/
if (rank == MASTER_NODE) {
cstr = new char [config->GetObjFunc_Grad_FileName().size()+1];
strcpy (cstr, config->GetObjFunc_Grad_FileName().c_str());
Gradient_file.open(cstr, ios::out);
}
for (iDV = 0; iDV < config->GetnDV(); iDV++) {
/*--- Bump deformation for 2D problems ---*/
if (boundary->GetnDim() == 2) {
if (rank == MASTER_NODE)
cout << "Perform 2D deformation of the surface." << endl;
switch ( config->GetDesign_Variable(iDV) ) {
case HICKS_HENNE : surface_mov->SetHicksHenne(boundary, config, iDV, true); break;
case DISPLACEMENT : surface_mov->SetDisplacement(boundary, config, iDV, true); break;
case ROTATION : surface_mov->SetRotation(boundary, config, iDV, true); break;
case NACA_4DIGITS : surface_mov->SetNACA_4Digits(boundary, config); break;
case PARABOLIC : surface_mov->SetParabolic(boundary, config); break;
}