From d651557353326158ce84df8c0329f45c97e2fa21 Mon Sep 17 00:00:00 2001 From: sbosse Date: Fri, 29 Nov 2024 16:30:54 +0100 Subject: [PATCH] Fri 29 Nov 2024 04:30:50 PM CET --- src/main.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/main.py diff --git a/src/main.py b/src/main.py new file mode 100644 index 0000000..e350212 --- /dev/null +++ b/src/main.py @@ -0,0 +1,29 @@ +import json +import os +import sys +import numpy as np +# from SimNDT.run_setup.SimulationVideo import create_vector_field_video +from SimNDT.run_setup.runSimulator import openSim, runEngine #, saveVideo + +def main(json_filepath): + try: + # Read the JSON file from the provided file path + with open(json_filepath, "r") as f: + sim_params = json.load(f) + + # Setup simulation environment with the provided parameters + simPack = openSim(sim_params) + + # Run the simulation engine and save the results + runEngine(simPack) + + except Exception as e: + print(e) + +if __name__ == "__main__": + if len(sys.argv) != 2: + print("Usage: python main.py ") + sys.exit(1) + + json_filepath = sys.argv[1] + main(json_filepath)