Skip to content

Commit

Permalink
bring in workflow changes
Browse files Browse the repository at this point in the history
  • Loading branch information
anderson2981 committed May 24, 2024
2 parents 06aa531 + 753e582 commit 5bfaa90
Show file tree
Hide file tree
Showing 71 changed files with 2,925 additions and 90 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ runOutput*
*.msh

__pycache__/

.idea/
runinfo/
2 changes: 1 addition & 1 deletion buildMirge.sh
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ fi
# add a few packages that are required for our development process
source config/activate_env.sh
#conda activate ${conda_env}
python -m pip install flake8 flake8-quotes pylint
python -m pip install flake8 flake8-quotes pylint parsl

# install the git hooks script to get linting on commits
cd ..
Expand Down
3 changes: 3 additions & 0 deletions driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
help="enable lazy evaluation [OFF]")
parser.add_argument("--disable-fallbacks", action="store_true", default=False,
help="prevent lazy compile from using slow fallbacks.")
parser.add_argument("--nolog", action="store_true", default=False,
help="enable sql logging with logpyle [OFF]")
parser.add_argument("--overintegration", action="store_true",
help="use overintegration in the RHS computations")
parser.add_argument("--numpy", action="store_true",
Expand Down Expand Up @@ -78,6 +80,7 @@
main(actx_class, restart_filename=restart_filename,
target_filename=target_filename,
user_input_file=input_file, log_path=log_path,
disable_logpyle=args.nolog,
use_overintegration=args.overintegration or args.esdg,
casename=casename, use_esdg=args.esdg,
disable_fallbacks=args.disable_fallbacks)
101 changes: 66 additions & 35 deletions paraviewViz/paraview-driver.py
Original file line number Diff line number Diff line change
@@ -1,43 +1,57 @@
# Import Paraview functions
import sys
#from contour import *
from slice import SimpleSlice
import slice
from slice import SimpleSlice, SimpleSlice3D, SliceData


def main(user_input_file, viz_path, dump_index):
def main(user_input_file, viz_path, dump_index, fluid_viz_file, wall_viz_file):

# read input file to configure plot

# camera location (x, y, zoom)
# camera location (bigger moves right, bigger moves up , smaller to zoom in)
camera = [0.625, -0.0, 0.023]
pixels = [1300, 700]
#camera = [0.625, -0.0, 0.023]
#pixels = [1300, 700]
prefix = ""

print(f"{viz_path}")
print(f"{dump_index}")
print(f"{prefix}")

slice_data = slice.SliceData(
dataName="cv_mass",
dataRange=[0.02, 0.1],
camera=[0.625, 0.0, 0.023],
colorScheme="erdc_rainbow_dark",
logScale=0,
invert=0,
cbTitle="Density [kg/m^3]",
pixels=[1300, 700],
normal=[0, 0, 1],
origin=[0, 0, 0]
)

print(slice_data)

SimpleSlice(viz_path, dump_index, "cv_mass", [0.02, 0.1], camera,
invert=1, logScale=1, colorScheme="erdc_rainbow_dark",
prefix=prefix, pixels=pixels,
cbTitle="Density [kg/m^3]")
#print(f"{viz_path=}")
#print(f"{dump_index=}")
#print(f"{prefix=}")
sys.path.insert(0, '.')
#print(sys.path)

try:
import viz_config as input_data
# these are really surface plots for 2D
for plt in input_data.slice_data:
print(plt)
SimpleSlice(dir=viz_path, iter=dump_index,
solutionData=fluid_viz_file, sliceData=plt)

# process 3D slices
for plt in input_data.slice_data_3d:
print(plt)
SimpleSlice3D(dir=viz_path, iter=dump_index,
solutionData=fluid_viz_file, sliceData=plt)

except ModuleNotFoundError:
print("WARNING! Missing visualization configuration file, viz_config.py")
print("WARNING! Using default configuration")
slice_data = SliceData(
dataName="cv_mass",
dataRange=[0.02, 0.1],
camera=[0.625, 0.0, 0.023],
colorScheme="erdc_rainbow_dark",
logScale=0,
invert=0,
cbTitle="Density [kg/m^3]",
pixels=[1300, 700],
normal=[0, 0, 1],
origin=[0, 0, 0]
)
print(slice_data)
SimpleSlice(viz_path, dump_index, slice_data)
pass

"""
simpleSlice(dir, dump_index, "dv_pressure", 1500.0, 10000, camera, invert=1,
Expand Down Expand Up @@ -67,8 +81,14 @@ def main(user_input_file, viz_path, dump_index):
description="Y3 paraview visualization driver")
parser.add_argument("-d", "--dump_index", type=int, dest="dump_index",
nargs="?", action="store", help="simulation viz dump index")
parser.add_argument("-p", "--viz_path", type=ascii, dest="viz_path",
nargs="?", action="store", help="full path to viz data")
parser.add_argument("-p", "--path", type=ascii, dest="path",
nargs="?", action="store", help="path for image file")
parser.add_argument("-f", "--fluid_viz_file", type=ascii, dest="fluid_viz_file",
nargs="?", action="store",
help="full path to fluid viz file")
parser.add_argument("-w", "--wall_viz_file", type=ascii, dest="wall_viz_file",
nargs="?", action="store",
help="full path to wall viz file")
parser.add_argument("-i", "--input_file", type=ascii, dest="input_file",
nargs="?", action="store", help="simulation config file")

Expand All @@ -79,15 +99,26 @@ def main(user_input_file, viz_path, dump_index):
input_file = args.input_file.replace("'", "")
print(f"Using user input from file: {input_file}")

viz_path = "viz_data"
if args.viz_path:
viz_path = args.viz_path.replace("'", "")
fluid_viz_file = ""
if args.fluid_viz_file:
fluid_viz_file = args.fluid_viz_file.replace("'", "")

wall_viz_file = ""
if args.wall_viz_file:
wall_viz_file = args.wall_viz_file.replace("'", "")

import os
path = os.getcwd()
if args.path:
path = args.path.replace("'", "")

dump_index = 0
if args.dump_index:
dump_index = args.dump_index.replace("'", "")
dump_index = args.dump_index

print(f"Running {sys.argv[0]}\n")

main(user_input_file=input_file, viz_path=viz_path,
main(user_input_file=input_file, viz_path=path,
fluid_viz_file=fluid_viz_file,
wall_viz_file=wall_viz_file,
dump_index=dump_index)
Loading

0 comments on commit 5bfaa90

Please sign in to comment.