Skip to content

Commit

Permalink
Import VTKFile at top level
Browse files Browse the repository at this point in the history
  • Loading branch information
cpjordan committed Jun 7, 2024
1 parent 1fdc2b5 commit 576f2a0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions examples/channel_inversion/inverse_problem.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from thetis import *
import firedrake as fd
from firedrake.adjoint import *
from firedrake.output.vtk_output import VTKFile
import numpy
import thetis.inversion_tools as inversion_tools
from model_config import construct_solver
Expand Down Expand Up @@ -134,4 +134,4 @@
oc.rename(name)
print_function_value_range(oc, prefix='Optimal')
if not no_exports:
VTKFile(f'{options.output_directory}/{name}_optimised.pvd').write(oc)
fd.VTKFile(f'{options.output_directory}/{name}_optimised.pvd').write(oc)
4 changes: 2 additions & 2 deletions thetis/inversion_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ def initialize(self):
create_directory(self.output_dir + '/hdf5')
for i in range(len(self.control_coeff_list)):
self.outfiles_m.append(
fd.output.vtk_output.VTKFile(f'{self.output_dir}/control_progress_{i:02d}.pvd'))
fd.VTKFile(f'{self.output_dir}/control_progress_{i:02d}.pvd'))
self.outfiles_dJdm.append(
fd.output.vtk_output.VTKFile(f'{self.output_dir}/gradient_progress_{i:02d}.pvd'))
fd.VTKFile(f'{self.output_dir}/gradient_progress_{i:02d}.pvd'))
self.initialized = True

def add_control(self, f):
Expand Down

0 comments on commit 576f2a0

Please sign in to comment.