ansys.dyna.core.pre.dynasolution#

Module for providing the top object that sets up a DYNA solution.

Attributes#

Classes#

DynaSolution

Contains methods for creating a general LS-DYNA keyword.

Functions#

init_log(log_file)

Initialize a log file.

Module Contents#

ansys.dyna.core.pre.dynasolution.CHUNK_SIZE[source]#
ansys.dyna.core.pre.dynasolution.MAX_MESSAGE_LENGTH[source]#
ansys.dyna.core.pre.dynasolution.SERVER_PRE_VERSION = 'v0.4.6'[source]#
ansys.dyna.core.pre.dynasolution.init_log(log_file)[source]#

Initialize a log file.

Parameters:
log_filestr

Name of the log file.

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

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".

pim_client = None[source]#
remote_instance = None[source]#
stub[source]#
object_list = [][source]#
mainname = ''[source]#
get_download_path()[source]#
static get_appdata_path()[source]#
static downloadfile(url: str, fname: str)[source]#
static grpc_local_server_on() bool[source]#

Check if the server is launched locally.

Returns:
bool

True when successful, False when failed.

property model[source]#

Get model associated with the solution.

get_stub()[source]#

Get the stub of the solution object.

add(obj)[source]#

Add a case in the solution.

Parameters:
obj
get_file_chunks(filename)[source]#

Get file chunks.

Parameters:
filenamestr

Name of the file.

upload(stub_, filename)[source]#

Upload files to the server.

Parameters:
stub_
filenamestr

Name of the file.

download(remote_name, local_name)[source]#

Download files from the server.

Parameters:
stub_
remote_name
local_name
open_files(filenames)[source]#

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.

set_termination(termination_time)[source]#

Set time for terminating the job.

Parameters:
termination_timefloat

Termination time.

Returns:
bool

True when successful, False when failed.

create_database_binary(filetype='D3PLOT', dt=0, maxint=3, ieverp=0, dcomp=1, nintsld=1)[source]#

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.

create_database_ascii(type, dt=0.0, binary=1, lcur=0, ioopt=0)[source]#

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.

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)[source]#

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.

save_file()[source]#

Save keyword files.

Returns:
bool

True when successful, False when failed.

quit()[source]#

Delete remote instance.