Paraview Web is a web based application based on the popular open source software Paraview which is used for visualizing simulation cases. Running your Paraview Web simulation on Qarnot is as easy as uploading your case and launching a script. Here’s a walk-through of the steps.
The test case uses Paraview Web 5.6.0, released in 2019.
If you are interested in another version, please send us an email at qlab@qarnot.com.
Please ensure that you have created a Qarnot account.
This test case is based on the pitzDaily tutorial simulation. You can download the case folder here, which contains the results of a pitzDaily case that has been run with OpenFoam. You should put it at the same folder level as the script to launch the calculation. Please note that it needs to be unzipped before it can be used on Qarnot.
Before starting a calculation with the Python SDK, a few steps are required:
Note: in addition to the Python SDK, Qarnot provides C# and Node.js SDKs and a Command Line.
Once everything is set up, the following script needs to be used to start the calculation.
Be sure you have copied your authentication token in the script (instead of <<<MY_SECRET_TOKEN>>>
) to be able to launch the task on Qarnot.
paraview_web.py
#!/usr/bin/env python
# Import the Qarnot SDK
import qarnot
# Create a connection, from which all other objects will be derived
# Enter client token here
conn = qarnot.connection.Connection(client_token='<<<MY_SECRET_TOKEN>>>')
# Create a task
task = conn.create_task("Hello World - Paraview_Web", "paraview-web", 1)
# Create the input bucket and synchronize with a local folder
# Insert a local folder directory
input_bucket = conn.create_bucket("paraview_web-in")
input_bucket.sync_directory("pitzDaily_results")
# Attach the bucket to the task
task.resources.append(input_bucket)
# Submit the task
task.submit()
#Give the parameters for the connection
done = False
while not done:
if task.state == "FullyExecuting":
while(len(task.status.running_instances_info.per_running_instance_info[0].active_forward) == 0):
task.wait(5)
print('** Waiting for the https address to be configured...')
address = "https://forward01.qarnot.net:" + str(task.status.running_instances_info.per_running_instance_info[0].active_forward[0].forwarder_port)
print("Access to the Paraview Web visualizer: " + address)
done = True
To launch this script, simply copy the preceding code in a Python script, put at the same level as the pitzDaily_results folder and execute python3 paraview_web.py
in your terminal. The instance will open a internet port on which you can connect by a web browser.
At any given time, you can monitor the status of your task on the general general web interface Console.
To launch it to view the case, copy the url (https://forward01.qarnot.net:port) provided in the stdout in a new tab. When prompted for login, use the appropriate username and password given in the stdout. The security warning can be discarded.
Do not forget to close the task when it is done by either clicking on Abort or Delete.
To view the case on Paraview Web after succeeding to connect, go to the file explorer (the page icon on the top left) and click on pitzDaily.foam. You can change the current parameter (pressure, velocity, etc.) by clicking on the water droplet icon and opening the drop down menu. You can also change the colors by clicking on the gear icon to the left of the gradient. Here you can see a simulation results example in a Paraview Web tab.
That’s it! If you have any questions, please contact qlab@qarnot.com and we will help you with pleasure!