-
Notifications
You must be signed in to change notification settings - Fork 830
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
Structural stress penalty function for optimization, fix some CConfig problems #1176
Conversation
Omega = (config->GetRotation_Rate(3)/config->GetOmega_Ref()); | ||
Omega = config->GetRotation_Rate(2)/config->GetOmega_Ref(); |
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.
Using static types lets the compiler find bugs for us at compile time :)
Using bare-pointer does not let the compiler do anything :(
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 am curious how the compiler found that now that the underlying Rotation_Rate
is static because is has 3 elements initialized to 0. So how did the compiler know but I guess I miss sth here
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.
Because this is not matlab or fortran xD
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.
Oh man am I blind... insert palmface here
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.
As blind an any programmer, we should have XYZ enums
SetHistoryOutputValue("AVG_NORMALVEL", Tot_Surface_Enthalpy); | ||
SetHistoryOutputValue("AVG_NORMALVEL", Tot_Surface_NormalVelocity); |
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.
Thanks @WallyMaier , I literally changed the line below 2 days ago and missed this.
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.
This looks good to me. I appreciate the clean-up done. Especially getting rid of SU2_MSH!
@@ -1262,8 +1239,8 @@ void CConfig::SetConfig_Options() { | |||
/*!\brief INC_DENSITY_INIT \n DESCRIPTION: Initial density for incompressible flows (1.2886 kg/m^3 by default) \ingroup Config*/ | |||
addDoubleOption("INC_DENSITY_INIT", Inc_Density_Init, 1.2886); | |||
/*!\brief INC_VELOCITY_INIT \n DESCRIPTION: Initial velocity for incompressible flows (1.0,0,0 m/s by default) \ingroup Config*/ | |||
default_vel_inf[0] = 1.0; default_vel_inf[1] = 0.0; default_vel_inf[2] = 0.0; |
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 like the removal of all the default_
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.
Can't say much to the FEA stuff but thanks 💐 for the Config cleanup. Yet another net-code-reduction :)
@@ -117,6 +109,7 @@ class CConfig { | |||
su2double Opt_RelaxFactor; /*!< \brief Scale factor for the line search. */ | |||
su2double Opt_LineSearch_Bound; /*!< \brief Bounds for the line search. */ | |||
su2double StartTime; | |||
unsigned short SmoothNumGrid; /*!< \brief Smooth the numerical grid. */ |
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.
Out of curiosity, what is the numerical grid
(or is it just the mesh) and when is it smoothed?
grep
ing through all cpp,hpp,inl of the code base didn't really enlighten me, just found some evidence in Cpoint
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.
Left over from SU2_MSH I believe, there is some geometry routine that uses those variables of CPoint, but it is never called.
@@ -23,6 +23,7 @@ INC_DENSITY_MODEL= VARIABLE | |||
INC_ENERGY_EQUATION = YES | |||
INC_DENSITY_INIT= 0.00597782417156 | |||
INC_TEMPERATURE_INIT= 288.15 | |||
INC_VELOCITY_INIT= (0, 0, 0) |
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.
Why do you have to add this option here? I might have missed that in the code but if the option is not set I understood your changes that the default remains the same, but with out explicitly having containers for the default value? (default here would be 1,0,0)
Omega = (config->GetRotation_Rate(3)/config->GetOmega_Ref()); | ||
Omega = config->GetRotation_Rate(2)/config->GetOmega_Ref(); |
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 am curious how the compiler found that now that the underlying Rotation_Rate
is static because is has 3 elements initialized to 0. So how did the compiler know but I guess I miss sth here
default_vel_inf[0] = 0.0; default_vel_inf[1] = 0.0; default_vel_inf[2] = 0.0; | ||
/* DESCRIPTION: Coordinates of the rigid motion origin */ | ||
addDoubleArrayOption("MOTION_ORIGIN", 3, Motion_Origin, default_vel_inf); | ||
addDoubleArrayOption("MOTION_ORIGIN", 3, Motion_Origin); |
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.
@TobiKattmann the default velocity was not 1,0,0 because it was being re-used here as the default value for something else.
This trips a lot of people (myself included) but the actual parsing of the options does not take place in this method, it creates a list of option parsing objects but it does not read immediately. Hence the need for the config postprocessing method to check for conflicting things and so on.
vel_init[0] = 1.0; vel_init[1] = 0.0; vel_init[2] = 0.0; | ||
addDoubleArrayOption("INC_VELOCITY_INIT", 3, vel_init); |
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.
@pcarruscag Ok I see. This really seems so straight forward with what it replaces but it isn't
Got my first glasses half a year into Fortran… and never looked back.
From: Pedro Gomes <notifications@github.com>
Sent: 28 January 2021 11:13
To: su2code/SU2 <SU2@noreply.github.com>
Cc: Subscribed <subscribed@noreply.github.com>
Subject: Re: [su2code/SU2] Structural stress penalty function for optimization, fix some CConfig problems (#1176)
@pcarruscag commented on this pull request.
________________________________
In Common/src/grid_movement/CSurfaceMovement.cpp<#1176 (comment)>:
- Omega = (config->GetRotation_Rate(3)/config->GetOmega_Ref());
+ Omega = config->GetRotation_Rate(2)/config->GetOmega_Ref();
As blind an any programmer, we should have XYZ enums
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub<#1176 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AATH4JKAAEAXKNHHCUGOQT3S4FBB7ANCNFSM4WOZ6DBA>.
|
Proposed Changes
A differentiable maximum VM stress function for optimization.
Simplifies the "DoubleArray" option to avoid one array of default values and another of actual values.
PR Checklist