Test case

References

Define case name

This is the solver case to be analysed


In [1]:
case_name = 'mycase'

Define Data Location

For remote data the interaction will use ssh to securely interact with the data
This uses the reverse connection capability in paraview so that the paraview server can be submitted to a job scheduler
Note: The default paraview server connection will use port 11111


In [2]:
remote_data = True

data_dir='mydir'
data_host='jappa@login02'

remote_server_auto = True

paraview_cmd='mpiexec ~/apps/Paraview/bin/pvserver -rc --client-host=localhost -sp=11113'
if not remote_server_auto:
    paraview_cmd=None

if not remote_data:
    data_host='localhost'
    paraview_cmd=None

Initialise Environment


In [3]:
%pylab inline
from paraview.simple import *
paraview.simple._DisableFirstRenderCameraReset()
import pylab as pl
import math
#import numpy as np


Welcome to pylab, a matplotlib-based Python environment [backend: module://IPython.kernel.zmq.pylab.backend_inline].
For more information, type 'help(pylab)'.
paraview version 4.0.0-RC3-7-g2682284

Data Connection

This starts paraview server on remote host and connects


In [4]:
from zutil.post import pvserver_connect
if remote_data:
    pvserver_connect(data_host,data_dir,paraview_cmd)


[jappa@login02] Executing task 'pvserver'
[jappa@login02] run: sleep 2;sleep 2; mpiexec ~/apps/Paraview/bin/pvserver -rc --client-host=localhost -sp=11113</dev/null &>/dev/null&

Get control dictionary


In [5]:
from zutil.post import get_case_parameters,print_html_parameters
parameters=get_case_parameters(data_host,data_dir,case_name)

Get status file


In [6]:
from zutil.post import get_status_dict
status=get_status_dict(data_host,data_dir,case_name)
num_procs = str(status['num processor'])

Define test conditions


In [7]:
from IPython.display import HTML
HTML(print_html_parameters(parameters))


Out[7]:
pressure101325.0
temperature294.5
Reynolds No2784000.0
Ref length1.044
Speed1.0
Mach No0.0

Convergence


In [14]:
from zutil.post import residual_plot, get_case_report
residual_plot(get_case_report(case_name))
show()


Cleaning up


In [15]:
if remote_data:
    #print 'Disconnecting from remote paraview server connection'
    Disconnect()

In [15]: