@@ -657,11 +657,6 @@ def __init__(self):
657
657
658
658
## The sensitivity map will be saved to disk during optimization for the given design variable
659
659
## names in the list. Currently only support design variable type FFD and Field
660
- ## The surface sensitivity map is separated from the primal solution because they only have surface mesh.
661
- ## They will be saved to folders such as 1e-11, 2e-11, 3e-11, etc,
662
- ## When loading in paraview, you need to uncheck the "internalMesh", and check "allWalls" on the left panel
663
- ## If your design variable is of field type, the sensitivity map will be saved along with the primal
664
- ## solution because they share the same mesh. The sensitivity files read sens_objFuncName_designVarName
665
660
## NOTE: this function only supports useAD->mode:reverse
666
661
## Example:
667
662
## "writeSensMap" : ["shapex", "shapey"]
@@ -2024,7 +2019,7 @@ def calcTotalDerivsFFD(self, objFuncName, designVarName, dFScaling=1.0, accumula
2024
2019
dFdXsFlatten = dFdXs .flatten ()
2025
2020
XsFlatten = Xs .flatten ()
2026
2021
size = len (dFdXsFlatten )
2027
- timeName = float (self .nSolveAdjoints ) / 1e8
2022
+ timeName = float (self .nSolveAdjoints ) / 1e4
2028
2023
name = "sens_" + objFuncName + "_" + designVarName
2029
2024
self .solver .writeSensMapSurface (name , dFdXsFlatten , XsFlatten , size , timeName )
2030
2025
# assign the total derivative to self.adjTotalDeriv
@@ -2080,7 +2075,7 @@ def calcTotalDerivsField(self, objFuncName, designVarName, fieldType, dFScaling=
2080
2075
2081
2076
# check if we need to save the sensitivity maps
2082
2077
if designVarName in self .getOption ("writeSensMap" ):
2083
- timeName = float (self .nSolveAdjoints ) / 1e8
2078
+ timeName = float (self .nSolveAdjoints ) / 1e4
2084
2079
dFdFieldArray = self .vec2Array (totalDeriv )
2085
2080
name = "sens_" + objFuncName + "_" + designVarName
2086
2081
self .solver .writeSensMapField (name , dFdFieldArray , fieldType , timeName )
@@ -3240,7 +3235,7 @@ def deletePrevPrimalSolTime(self):
3240
3235
def renameSolution (self , solIndex ):
3241
3236
"""
3242
3237
Rename the primal solution folder to specific format for post-processing. The renamed time has the
3243
- format like 1e-8, 2e-8 , etc. One can load these intermediate shapes and fields and
3238
+ format like 0.0001, 0.0002 , etc. One can load these intermediate shapes and fields and
3244
3239
plot them in paraview.
3245
3240
The way it is implemented is that we sort the solution folder and consider the largest time folder
3246
3241
as the solution folder and rename it
@@ -3259,12 +3254,12 @@ def renameSolution(self, solIndex):
3259
3254
3260
3255
latestTime = self .solver .getLatestTime ()
3261
3256
3262
- if latestTime < 1e-4 :
3263
- Info ("Latest solution time %g less than 1e-4 , not renamed." % latestTime )
3257
+ if latestTime < 1.0 :
3258
+ Info ("Latest solution time %g less than 1 , not renamed." % latestTime )
3264
3259
renamed = False
3265
3260
return latestTime , renamed
3266
3261
3267
- distTime = "%g" % (solIndex / 1e8 )
3262
+ distTime = "%g" % (solIndex / 1e4 )
3268
3263
targetTime = "%g" % latestTime
3269
3264
3270
3265
src = os .path .join (checkPath , targetTime )
0 commit comments