Skip to content

Commit 3d1a97c

Browse files
committed
Always output VTK files
1 parent 4d5aa09 commit 3d1a97c

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

elastic-tube-1d/fluid-python/FluidSolver.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ def crossSection0(N):
4040
parser = argparse.ArgumentParser()
4141
parser.add_argument("configurationFileName", help="Name of the xml precice configuration file.",
4242
nargs='?', type=str, default="../precice-config.xml")
43-
parser.add_argument(
44-
"--write-vtk", help="Save vtk files of each timestep in the 'VTK' folder.", action='store_true')
4543
parser.add_argument(
4644
"--enable-plot", help="Show a continuously updated plot of the tube while simulating.", action='store_true')
4745
parser.add_argument("--write-video", help="Save a video of the simulation as 'writer_test.mp4'. \
@@ -55,7 +53,6 @@ def crossSection0(N):
5553
print("Try '$ python FluidSolver.py precice-config.xml'")
5654
quit()
5755

58-
output_mode = config.OutputModes.VTK if args.write_vtk else config.OutputModes.OFF
5956
plotting_mode = config.PlottingModes.VIDEO if args.enable_plot else config.PlottingModes.OFF
6057
if args.write_video and not args.enable_plot:
6158
print("")
@@ -64,6 +61,8 @@ def crossSection0(N):
6461
quit()
6562
writeVideoToFile = True if args.write_video else False
6663

64+
print("Plotting Mode: {}".format(plotting_mode))
65+
6766
print("Starting Fluid Solver...")
6867

6968
print("N: " + str(N))
@@ -81,7 +80,6 @@ def crossSection0(N):
8180
crossSectionLength = a0 * np.ones(N + 1)
8281
crossSectionLength_old = a0 * np.ones(N + 1)
8382

84-
8583
if plotting_mode == config.PlottingModes.VIDEO:
8684
fig, ax = plt.subplots(1)
8785
if writeVideoToFile:
@@ -153,9 +151,9 @@ def crossSection0(N):
153151
velocity_old = np.copy(velocity)
154152
pressure_old = np.copy(pressure)
155153
crossSectionLength_old = np.copy(crossSectionLength)
156-
if output_mode is config.OutputModes.VTK:
157-
writeOutputToVTK(time_it, "out_fluid_", dx, datanames=["velocity", "pressure", "diameter"], data=[
158-
velocity_old, pressure_old, crossSectionLength_old])
154+
155+
writeOutputToVTK(time_it, "out_fluid_", dx, datanames=["velocity", "pressure", "diameter"], data=[
156+
velocity_old, pressure_old, crossSectionLength_old])
159157
time_it += 1
160158

161159
print("Exiting FluidSolver")
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/sh
22
set -e -u
33

4-
python3 ./FluidSolver.py ../precice-config.xml --write-vtk
4+
python3 ./FluidSolver.py ../precice-config.xml

0 commit comments

Comments
 (0)