DynaSolution#

class ansys.dyna.core.pre.dynasolution.DynaSolution(hostname='localhost', port='50051', channel=None, server_path='')#

Contains methods for creating a general LS-DYNA keyword.

Parameters:
hostnamestr, optional

Host name. The default is "localhost".

portstr, optional

Port. the default is "50051".

Overview#

get_download_path

get_stub

Get the stub of the solution object.

add

Add a case in the solution.

get_file_chunks

Get file chunks.

upload

Upload files to the server.

download

Download files from the server.

open_files

Open initial model files.

set_termination

Set time for terminating the job.

create_database_binary

Request binary output.

create_database_ascii

Obtain output files containing result information.

set_output_database

Obtain output files containing result information.

save_file

Save keyword files.

quit

Delete remote instance.

model

Get model associated with the solution.

get_appdata_path

downloadfile

grpc_local_server_on

Check if the server is launched locally.

Import detail#

from ansys.dyna.core.pre.dynasolution import DynaSolution

Property detail#

property DynaSolution.model#

Get model associated with the solution.

Attribute detail#

DynaSolution.pim_client = None#
DynaSolution.remote_instance = None#
DynaSolution.stub#
DynaSolution.object_list = []#
DynaSolution.mainname = ''#

Method detail#

DynaSolution.get_download_path()#
static DynaSolution.get_appdata_path()#
static DynaSolution.downloadfile(url: str, fname: str)#
static DynaSolution.grpc_local_server_on() bool#

Check if the server is launched locally.

Returns:
bool

True when successful, False when failed.

DynaSolution.get_stub()#

Get the stub of the solution object.

DynaSolution.add(obj)#

Add a case in the solution.

Parameters:
obj
DynaSolution.get_file_chunks(filename)#

Get file chunks.

Parameters:
filenamestr

Name of the file.

DynaSolution.upload(stub_, filename)#

Upload files to the server.

Parameters:
stub_
filenamestr

Name of the file.

DynaSolution.download(remote_name, local_name)#

Download files from the server.

Parameters:
stub_
remote_name
local_name
DynaSolution.open_files(filenames)#

Open initial model files.

Parameters:
filenameslist

List of filenames. The main file is [0]. The others are subfiles.

Returns:
bool

True when successful, False when failed.

DynaSolution.set_termination(termination_time)#

Set time for terminating the job.

Parameters:
termination_timefloat

Termination time.

Returns:
bool

True when successful, False when failed.

DynaSolution.create_database_binary(filetype='D3PLOT', dt=0, maxint=3, ieverp=0, dcomp=1, nintsld=1)#

Request binary output.

Parameters:
filetypestr, optional

Type of file. The default is "D3PLOT".

dtfloat, optional

Time interval between output states. The default is 0.

maxintint, optional

Number of shell and thick shell through-thickness integration points to output to the d3plot. The default is 3.

ieverpint, optional

How to plot output states on plot files. The default is 0. Every output state for the d3plot database is written to a separate file. Options are:

  • EQ.0: More than one state can be on each plot file.

  • EQ.1: Only one state can be on each plot file.

dcompint, optional

Data compression to eliminate rigid body data. The default is 1.

nintsldint, optional

Number of solid element integration points written to the LS-DYNA database. The default is 1.

Returns:
bool

True when successful, False when failed.

DynaSolution.create_database_ascii(type, dt=0.0, binary=1, lcur=0, ioopt=0)#

Obtain output files containing result information.

Parameters:
typestr

Type of the database. Options are:

  • BNDOUT

  • GLSTAT

  • MATSUM

  • NODFOR

  • RCFORC

  • SLEOUT

dtfloat, optional

Time interval between outputs. The default is 0.0.

binaryint, optional

Flag for whether to generate binary output. The default is 1.

lcurint, optional

Curve ID specifying the time interval between outputs. The default is 0.

iooptint, optional

Flag for governing the behavior of the output frequency load curve defined by the lcur parameter. The default is 0.

Returns:
bool

True when successful, False when failed.

DynaSolution.set_output_database(matsum=0, glstat=0, elout=0, nodout=0, nodfor=0, rbdout=0, rcforc=0, secforc=0, rwforc=0, abstat=0, bndout=0, sleout=0, sphmassflow=0)#

Obtain output files containing result information.

Parameters:
matsumfloat, optional

Time interval between outputs of part energies. The default is 0.

glstatfloat, optional

Time interval between outputs of global statistics and energies. The default is 0.

elout
nodout
modfor
rbdout
secforc
rwforce
bndout
sleout
sphmassflow
Returns:
bool

True when successful, False when failed.

DynaSolution.save_file()#

Save keyword files.

Returns:
bool

True when successful, False when failed.

DynaSolution.quit()#

Delete remote instance.