-
Notifications
You must be signed in to change notification settings - Fork 920
Fix objective functions (for shape_optimization.py) #1167
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
Changes from all commits
b39109c
9b4cca2
95cc5b1
7776bef
609e362
7932a50
e099ca2
1c61027
164bb5d
bfa204d
e4dc3aa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -353,7 +353,7 @@ void CVolumetricMovement::ComputenNonconvexElements(CGeometry *geometry, bool Sc | |
| nNonconvexElements++; | ||
| } | ||
| } | ||
| } else { | ||
| } else if (false) { | ||
|
Contributor
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 is the section you refer to in #1171
Member
Author
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. Yep |
||
|
|
||
| /*--- 3D elements ---*/ | ||
| unsigned short iNode, iFace, nFaceNodes; | ||
|
|
@@ -371,6 +371,8 @@ void CVolumetricMovement::ComputenNonconvexElements(CGeometry *geometry, bool Sc | |
|
|
||
| face_point_i = geometry->elem[iElem]->GetNode(geometry->elem[iElem]->GetFaces(iFace, iNode)); | ||
|
|
||
| /// TODO: Faces may have up to 4 nodes, not all posibilities are covered | ||
|
|
||
| if (iNode == 0) { | ||
| face_point_j = geometry->elem[iElem]->GetNode(geometry->elem[iElem]->GetFaces(iFace, nFaceNodes-1)); | ||
| face_point_k = geometry->elem[iElem]->GetNode(geometry->elem[iElem]->GetFaces(iFace, iNode+1)); | ||
|
|
@@ -391,6 +393,9 @@ void CVolumetricMovement::ComputenNonconvexElements(CGeometry *geometry, bool Sc | |
| /*--- Calculate cross product of edge vectors and its length---*/ | ||
| su2double crossProduct[3]; | ||
| GeometryToolbox::CrossProduct(edgeVector_i, edgeVector_j, crossProduct); | ||
|
|
||
| /// TODO: This logic is incorrect, the norm will never be less than 0 | ||
|
|
||
| crossProductLength = GeometryToolbox::Norm(nDim, crossProduct); | ||
|
|
||
| /*--- Check if length is minimum or maximum ---*/ | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -38,8 +38,8 @@ | |
| */ | ||
| class CAvgGrad_NEMO : public CNEMONumerics { | ||
| private: | ||
| unsigned short iDim, iVar; /*!< \brief Iterators in dimension an variable. */ | ||
|
Contributor
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. Did you get those as compiler warnings for unused variables? If yes, did you just use gcc with -Wall -Wextra or did you use any specific tool?
Member
Author
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. Using clang with --warnlevel=2 |
||
| su2double *Mean_PrimVar, /*!< \brief Mean primitive variables. */ | ||
| unsigned short iVar; /*!< \brief Iterators in dimension an variable. */ | ||
| su2double *Mean_PrimVar, /*!< \brief Mean primitive variables. */ | ||
| *Mean_U, | ||
| **Mean_GU, | ||
| *Mean_dTdU, | ||
|
|
@@ -54,9 +54,8 @@ class CAvgGrad_NEMO : public CNEMONumerics { | |
| Mean_Eddy_Viscosity, /*!< \brief Mean value of the eddy viscosity. */ | ||
| Mean_Thermal_Conductivity, /*!< \brief Mean value of the thermal conductivity. */ | ||
| Mean_Thermal_Conductivity_ve, /*!< \brief Mean value of the vib-el. thermal conductivity. */ | ||
| *ProjFlux, /*!< \brief Projection of the viscous fluxes. */ | ||
| dist_ij; /*!< \brief Length of the edge and face. */ | ||
|
|
||
| public: | ||
|
|
||
| /*! | ||
|
|
@@ -109,13 +108,11 @@ class CAvgGradCorrected_NEMO : public CNEMONumerics { | |
| Mean_Eddy_Viscosity, /*!< \brief Mean value of the eddy viscosity. */ | ||
| Mean_Thermal_Conductivity, /*!< \brief Mean value of the thermal conductivity. */ | ||
| Mean_Thermal_Conductivity_ve, /*!< \brief Mean value of the vib-el. thermal conductivity. */ | ||
|
|
||
| *ProjFlux, /*!< \brief Projection of the viscous fluxes. */ | ||
| dist_ij; /*!< \brief Length of the edge and face. */ | ||
| bool implicit; /*!< \brief Implicit calculus. */ | ||
|
|
||
| su2double* Flux = nullptr; /*!< \brief The flux / residual across the edge. */ | ||
|
|
||
| public: | ||
|
|
||
| /*! | ||
|
|
@@ -142,5 +139,5 @@ class CAvgGradCorrected_NEMO : public CNEMONumerics { | |
| * \param[in] config - Definition of the particular problem. | ||
| */ | ||
| ResidualType<> ComputeResidual(const CConfig* config) final; | ||
|
|
||
| }; | ||
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 think this was cheap enough to compute by default.