Skip to content

Commit

Permalink
Merge branch 'application2' of github.com:sean-engelstad/funtofem int…
Browse files Browse the repository at this point in the history
…o application2
  • Loading branch information
sean-engelstad committed Nov 1, 2023
2 parents 38003e8 + 29f28b8 commit e64f12e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
13 changes: 7 additions & 6 deletions funtofem/interface/caps2fun/fun3d_aim.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ def mapbc_filepaths(self, new_filepaths):
self._mapbc_filepaths = new_filepaths
return

def _move_grid_files(self):
def _move_grid_files(self, include_mapbc=False):
"""
move each of the grid files in the preAnalysis after a new grid is
destination files are all called fun3d_CAPS.lb8.ugrid
Expand All @@ -211,11 +211,12 @@ def _move_grid_files(self):
shutil.copy(src, dest)

# also move the mapbc files to each scenario from fun3d aim dir
if self.comm.rank == 0:
print(f"copying mapbc files")
src = self.mapbc_file
for dest in self.mapbc_filepaths:
shutil.copy(src, dest)
if include_mapbc:
if self.comm.rank == 0:
print(f"copying mapbc files")
src = self.mapbc_file
for dest in self.mapbc_filepaths:
shutil.copy(src, dest)
return

def _move_sens_files(self, src):
Expand Down
6 changes: 6 additions & 0 deletions funtofem/interface/fun3d_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,9 @@ def initialize(self, scenario, bodies):
flow_dir = os.path.join(self.fun3d_dir, scenario.name, "Flow")
os.chdir(flow_dir)

if self.comm.rank == 0:
print(f"Funtofem starting forward analysis on scenario {scenario.name}")

if self._debug:
print(
f"Comm {self.comm.Get_rank()} check at the start of fun3d_interface:initialize."
Expand Down Expand Up @@ -667,6 +670,9 @@ def initialize_adjoint(self, scenario, bodies):
adjoint_dir = os.path.join(self.fun3d_dir, scenario.name, "Adjoint")
os.chdir(adjoint_dir)

if self.comm.rank == 0:
print(f"Funtofem starting adjoint analysis of scenario {scenario.name}")

# copy the *_body1.dat file for fun3d mesh morphing from the Fun3dAim folder to the scenario folder
# if mesh morphing is online
if self.model.flow is not None:
Expand Down

0 comments on commit e64f12e

Please sign in to comment.