Skip to content

Commit

Permalink
Fixed an issue for. deformedFFD
Browse files Browse the repository at this point in the history
  • Loading branch information
friedenhe committed Apr 7, 2024
1 parent 3bd4b61 commit a8b8f33
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions dafoam/mphys/mphys_dafoam.py
Original file line number Diff line number Diff line change
Expand Up @@ -962,27 +962,27 @@ def solve_linear(self, d_outputs, d_residuals, mode):
# to check if a recompute is needed. In other words, we only recompute the PC for the first obj func
# adjoint solution

if DASolver.getOption("writeDeformedFFDs"):
if self.DVGeo is None:
raise RuntimeError(
"writeDeformedFFDs is set but no DVGeo object found! Please call add_dvgeo in the run script!"
)
else:
self.DVGeo.writeTecplot("deformedFFDs_%d.dat" % self.solution_counter)

if DASolver.getOption("writeDeformedConstraints"):
if self.DVCon is None:
raise RuntimeError(
"writeDeformedConstraints is set but no DVCon object found! Please call add_dvcon in the run script!"
)
else:
self.DVCon.writeTecplot("deformedConstraints_%d.dat" % self.solution_counter)

solutionTime, renamed = DASolver.renameSolution(self.solution_counter)

if renamed:
# write the deformed FFD for post-processing
# DASolver.writeDeformedFFDs(self.solution_counter)
if DASolver.getOption("writeDeformedFFDs"):
if self.DVGeo is None:
raise RuntimeError(
"writeDeformedFFDs is set but no DVGeo object found! Please call add_dvgeo in the run script!"
)
else:
self.DVGeo.writeTecplot("deformedFFDs_%d.dat" % self.solution_counter)

# write the deformed constraints for post-processing
if DASolver.getOption("writeDeformedConstraints"):
if self.DVCon is None:
raise RuntimeError(
"writeDeformedConstraints is set but no DVCon object found! Please call add_dvcon in the run script!"
)
else:
self.DVCon.writeTecplot("deformedConstraints_%d.dat" % self.solution_counter)

# print the solution counter
if self.comm.rank == 0:
print("Driver total derivatives for iteration: %d" % self.solution_counter)
Expand Down

0 comments on commit a8b8f33

Please sign in to comment.