qd.cae.beta

Module for CAE stuff related to software from Beta CAE Systems.

MetaCommunicator

class qd.cae.beta.MetaCommunicator(meta_path=None, ip_address='127.0.0.1', meta_listen_port=4342)

Constructor for a MetaCommunicator

Parameters
meta_filepathstr

optional path or command for the META executable

ip_addressstr

ip-adress to connect to. Localhost by default.

meta_listen_portint

port on which meta is listening (or in case of startup will listen)

Notes

The constructor checks for a running and listening instance of META and connects to it. I there is no running instance it will start one and will wait for it to be ready to operate. If META has to be started, either provide a filepath or simply set the environment variable META_PATH to the executable.

Examples

>>> mc = MetaCommunicator() # starts META , if not listening
>>> mc.is_runnning()
True
>>> # Send arbitrary Meta commands ... hihihi
>>> mc.send_command("read geom auto path/to/file")
>>> mc.show_pids( [11,12,13] ) # show only 3 pids
>>> mc.hide_pids() # hide all
>>> mc.show_pids() # show all

Methods

hide_pids

is_running

read_d3plot

read_geometry

send_command

show_pids

__init__(self, meta_path=None, ip_address='127.0.0.1', meta_listen_port=4342)

Constructor for a MetaCommunicator

Parameters
meta_filepathstr

optional path or command for the META executable

ip_addressstr

ip-adress to connect to. Localhost by default.

meta_listen_portint

port on which meta is listening (or in case of startup will listen)

Notes

The constructor checks for a running and listening instance of META and connects to it. I there is no running instance it will start one and will wait for it to be ready to operate. If META has to be started, either provide a filepath or simply set the environment variable META_PATH to the executable.

Examples

>>> mc = MetaCommunicator() # starts META , if not listening
>>> mc.is_runnning()
True
>>> # Send arbitrary Meta commands ... hihihi
>>> mc.send_command("read geom auto path/to/file")
>>> mc.show_pids( [11,12,13] ) # show only 3 pids
>>> mc.hide_pids() # hide all
>>> mc.show_pids() # show all
__init__(self, meta_path=None, ip_address='127.0.0.1', meta_listen_port=4342)

Constructor for a MetaCommunicator

Parameters
meta_filepathstr

optional path or command for the META executable

ip_addressstr

ip-adress to connect to. Localhost by default.

meta_listen_portint

port on which meta is listening (or in case of startup will listen)

Notes

The constructor checks for a running and listening instance of META and connects to it. I there is no running instance it will start one and will wait for it to be ready to operate. If META has to be started, either provide a filepath or simply set the environment variable META_PATH to the executable.

Examples

>>> mc = MetaCommunicator() # starts META , if not listening
>>> mc.is_runnning()
True
>>> # Send arbitrary Meta commands ... hihihi
>>> mc.send_command("read geom auto path/to/file")
>>> mc.show_pids( [11,12,13] ) # show only 3 pids
>>> mc.hide_pids() # hide all
>>> mc.show_pids() # show all
__weakref__

list of weak references to the object (if defined)

hide_pids(self, partlist=None)

Tell META to make parts invisible.

Parameters
partlistlist(int)

list of pids

Notes

Hides all pids by default. If partlist is given, META performs a hide command for these pids.

Examples

>>> # hide two pids
>>> mc.hide_pids( [13,111] ) 
>>> # hide all pids
>>> mc.hide_pids()
is_running(self, timeout_seconds=None)

Check whether META is up running

Parameters
timeout_secondsint

seconds of waiting until timeout

Returns
is_runningbool

True if META is running. False otherwise

Examples

>>> mc = MetaCommunicator()
>>> mc.is_running()
True
>>> # Pretty unfunny here, but I actually closed META now
>>> mc.is_running()
False
read_d3plot(self, filepath)

Open a d3plot in META and read geometry, displacement and plastic-strain.

Parameters
filepathstr

path to d3plot result file

Examples

>>> mc.read_d3plot("path/to/d3plot")
read_geometry(self, filepath)

Read the geometry from a file

Parameters
filepathstr

path to the result file

Examples

>>> mc.read_geometry("path/to/result/file")
>>> # yay we see in meta some geometry ... but not here
send_command(self, command, timeout=20)

Send a command to a remote META

Parameters
commandstr

command to send to META

timeoutint

timeout to wait until the command finishes

Notes

The commands send over to META are identical as if they would be typed into the command line window.

Examples

>>> mc = MetaCommunicator()
>>> mc.send_command("read geom auto path/to/file")
>>> mc.send_command("add pid 4,5,3")
show_pids(self, partlist=None, show_only=False)

Tell META to make parts visible

Parameters
partlistlist(int)

list of pids

show_onlybool

whether to show only these parts (removes all others)

Notes

Shows all pids by default. If partlist is given, META performs a show command for these pids. If show_only is used, all other parts will be removed from vision.

Examples

>>> # show all pids
>>> mc.show_pids()
>>> # make two pids visible
>>> mc.show_pids( [13,111] ) 
>>> # let's show only two pids
>>> mc.show_pids( [13,111], show_only=True)