-
Notifications
You must be signed in to change notification settings - Fork 849
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom objective function (e.g. 'DRAG + LIFT') #1478
Merged
Merged
Changes from 1 commit
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
67296cb
cleanup objective function handling
pcarruscag 9fd4ee0
working primal version
pcarruscag ab5ab6c
some optimization
pcarruscag 7ff9060
multizone implementation
pcarruscag 407423b
Merge remote-tracking branch 'upstream/develop' into custom_objective…
pcarruscag 6df54b6
testcases and a bunch of output fixes
pcarruscag 9f5dff1
missing file
pcarruscag 4d51419
compiler fix
pcarruscag d16a78e
Update TestCases/parallel_regression_AD.py
pcarruscag 14dabda
Update TestCases/user_defined_functions/lam_flatplate.cfg
pcarruscag 130e2dd
Add limits header to ensure gcc11 compatibility
30f0b2e
gcc4.8 fix
pcarruscag 1ea8b02
Merge remote-tracking branch 'upstream/develop' into custom_objective…
pcarruscag File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3466,10 +3466,10 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i | |
nObjW = nObj; | ||
} | ||
else if(nObj>1) { | ||
SU2_MPI::Error(string("When using more than one OBJECTIVE_FUNCTION, MARKER_MONITORING must be the same length or length 1.\n ") + | ||
string("For multiple surfaces per objective, either use one objective or list the objective multiple times.\n") + | ||
string("For multiple objectives per marker either use one marker or list the marker multiple times.\n")+ | ||
string("Similar rules apply for multi-objective optimization using OPT_OBJECTIVE rather than OBJECTIVE_FUNCTION."), | ||
SU2_MPI::Error("When using more than one OBJECTIVE_FUNCTION, MARKER_MONITORING must be the same length or length 1.\n" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess this |
||
"For multiple surfaces per objective, either use one objective or list the objective multiple times.\n" | ||
"For multiple objectives per marker either use one marker or list the marker multiple times.\n" | ||
"Similar rules apply for multi-objective optimization using OPT_OBJECTIVE rather than OBJECTIVE_FUNCTION.", | ||
CURRENT_FUNCTION); | ||
} | ||
} | ||
|
@@ -3479,8 +3479,8 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i | |
|
||
if (nObjW<nObj) { | ||
if (Weight_ObjFunc!= nullptr && nObjW>1) { | ||
SU2_MPI::Error(string("The option OBJECTIVE_WEIGHT must either have the same length as OBJECTIVE_FUNCTION,\n") + | ||
string("be lenght 1, or be deleted from the config file (equal weights will be applied)."), CURRENT_FUNCTION); | ||
SU2_MPI::Error("The option OBJECTIVE_WEIGHT must either have the same length as OBJECTIVE_FUNCTION,\n" | ||
"be lenght 1, or be deleted from the config file (equal weights will be applied).", CURRENT_FUNCTION); | ||
} | ||
Weight_ObjFunc = new su2double[nObj]; | ||
for (unsigned short iObj=0; iObj<nObj; iObj++) | ||
|
@@ -3512,13 +3512,13 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i | |
case SURFACE_SPECIES_VARIANCE: | ||
case CUSTOM_OBJFUNC: | ||
if (Kind_ObjFunc[iObj] != Obj_0) { | ||
SU2_MPI::Error(string("The following objectives can only be used for the first surface in a multi-objective \n")+ | ||
string("problem or as a single objective applied to multiple monitoring markers:\n")+ | ||
string("INVERSE_DESIGN_PRESSURE, INVERSE_DESIGN_HEATFLUX, THRUST_COEFFICIENT, TORQUE_COEFFICIENT\n")+ | ||
string("FIGURE_OF_MERIT, SURFACE_TOTAL_PRESSURE, SURFACE_STATIC_PRESSURE, SURFACE_MASSFLOW\n")+ | ||
string("SURFACE_UNIFORMITY, SURFACE_SECONDARY, SURFACE_MOM_DISTORTION, SURFACE_SECOND_OVER_UNIFORM\n")+ | ||
string("SURFACE_PRESSURE_DROP, SURFACE_STATIC_TEMPERATURE, SURFACE_SPECIES_0\n")+ | ||
string("SURFACE_SPECIES_VARIANCE, CUSTOM_OBJFUNC.\n"), CURRENT_FUNCTION); | ||
SU2_MPI::Error("The following objectives can only be used for the first surface in a multi-objective \n" | ||
"problem or as a single objective applied to multiple monitoring markers:\n" | ||
"INVERSE_DESIGN_PRESSURE, INVERSE_DESIGN_HEATFLUX, THRUST_COEFFICIENT, TORQUE_COEFFICIENT\n" | ||
"FIGURE_OF_MERIT, SURFACE_TOTAL_PRESSURE, SURFACE_STATIC_PRESSURE, SURFACE_MASSFLOW\n" | ||
"SURFACE_UNIFORMITY, SURFACE_SECONDARY, SURFACE_MOM_DISTORTION, SURFACE_SECOND_OVER_UNIFORM\n" | ||
"SURFACE_PRESSURE_DROP, SURFACE_STATIC_TEMPERATURE, SURFACE_SPECIES_0\n" | ||
"SURFACE_SPECIES_VARIANCE, CUSTOM_OBJFUNC.\n", CURRENT_FUNCTION); | ||
} | ||
break; | ||
default: | ||
|
@@ -8203,15 +8203,8 @@ string CConfig::GetObjFunc_Extension(string val_filename) const { | |
case SURFACE_SPECIES_VARIANCE: AdjExt = "_specvar"; break; | ||
case SURFACE_MACH: AdjExt = "_mach"; break; | ||
case CUSTOM_OBJFUNC: AdjExt = "_custom"; break; | ||
case KINETIC_ENERGY_LOSS: AdjExt = "_ke"; break; | ||
case TOTAL_PRESSURE_LOSS: AdjExt = "_pl"; break; | ||
case FLOW_ANGLE_OUT: AdjExt = "_fao"; break; | ||
case FLOW_ANGLE_IN: AdjExt = "_fai"; break; | ||
case TOTAL_EFFICIENCY: AdjExt = "_teff"; break; | ||
case TOTAL_STATIC_EFFICIENCY: AdjExt = "_tseff"; break; | ||
case EULERIAN_WORK: AdjExt = "_ew"; break; | ||
case MASS_FLOW_IN: AdjExt = "_mfi"; break; | ||
case MASS_FLOW_OUT: AdjExt = "_mfo"; break; | ||
case ENTROPY_GENERATION: AdjExt = "_entg"; break; | ||
case REFERENCE_GEOMETRY: AdjExt = "_refgeom"; break; | ||
case REFERENCE_NODE: AdjExt = "_refnode"; break; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess these are never implemented?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or they were dropped in v7