DynaBase#

class ansys.dyna.core.pre.dynabase.DynaBase#

Contains methods for creating a general LS-DYNA keyword.

Overview#

get_stub

Get the stub of the DynaBase object.

set_parent

set_timestep

Set the structural time step size control using different options.

set_accuracy

Define control parameters that can improve the accuracy of the calculation.

set_energy

Provide controls for energy dissipation options.

set_output

Set miscellaneous output parameters.

set_hourglass

Redefine the default values for the hourglass control type and coefficient.

set_bulk_viscosity

Reset the default values of the bulk viscosity coefficients globally.

set_init_temperature

Define initial nodal point temperatures on all nodes.

create_control_shell

Provide controls for computing shell response.

create_control_solid

Provide controls for a solid element response.

create_control_contact

Change defaults for computation with contact surfaces.

create_damping_global

Define mass-weighted nodal damping.

get_solid_elements

Get solid elements.

create_general_keyword

Create general keyword.

add

Add entities to an object.

set_transform

Include independent input files containing model data, allow for node, element, and set

save_file

Save keyword files.

Import detail#

from ansys.dyna.core.pre.dynabase import DynaBase

Attribute detail#

DynaBase.stub#
DynaBase.mainname = ''#
DynaBase.implicitanalysis#
DynaBase.parts#
DynaBase.boundaryconditions#
DynaBase.initialconditions#
DynaBase.constraints#
DynaBase.contacts#
DynaBase.entities = []#
DynaBase.have_accuracy = False#
DynaBase.have_energy = False#
DynaBase.have_hourglass = False#
DynaBase.have_bulk_viscosity = False#
DynaBase.have_control_shell = False#
DynaBase.init_velocity: List = None#
DynaBase.bdy_spc: List = None#

Method detail#

DynaBase.get_stub()#

Get the stub of the DynaBase object.

DynaBase.set_parent(parent=None)#
DynaBase.set_timestep(tssfac=0.9, isdo=0, timestep_size_for_mass_scaled=0.0, max_timestep=None)#

Set the structural time step size control using different options.

Parameters:
tssfacfloat, optional

Scale factor for computed time step. The default is 0.9.

isdoint, optional

Basis of the time size calculation for four-node shell elements. The default is 0.

timestep_size_for_mass_scaledfloat, optional

Time step size for mass scaled solutions. The default is 0.0.

max_timestepCurve, optional

Load curve that limits the maximum time step size. The default is None.

Returns:
bool

True when successful, False when failed.

DynaBase.set_accuracy(objective_stress_updates=Switch.OFF, invariant_node_number=InvariantNode.OFF, partsetid_for_objective_stress_updates=0, implicit_accuracy_flag=Switch.OFF, explicit_accuracy_flag=Switch.OFF)#

Define control parameters that can improve the accuracy of the calculation.

Parameters:
objective_stress_updatesint

Global flag for 2nd order objective stress updates.

invariant_node_numberint

Invariant node numbering for shell and solid elements.

partsetid_for_objective_stress_updatesint, optional

Part set ID for objective stress updates. The default is 0.

implicit_accuracy_flagint

Implicit accuracy flag.

explicit_accuracy_flagfloat

Explicit accuracy parameter.

  • EQ.0.0: Off

  • GT.0.0: On

Returns:
bool

True when successful, False when failed.

DynaBase.set_energy(hourglass_energy=EnergyFlag.NOT_COMPUTED, rigidwall_energy=EnergyFlag.COMPUTED, sliding_interface_energy=EnergyFlag.NOT_COMPUTED, rayleigh_energy=EnergyFlag.NOT_COMPUTED, initial_reference_geometry_energy=EnergyFlag.COMPUTED)#

Provide controls for energy dissipation options.

Parameters:
hourglass_energyenum

Hourglass energy calculation option.

rigidwall_energyint

Rigidwall energy dissipation option.

  • EQ.1: Energy dissipation is not computed.

  • EQ.2: Energy dissipation is computed.

sliding_interface_energyint

Sliding interface energy dissipation option.

  • EQ.1: Energy dissipation is not computed.

  • EQ.2: Energy dissipation is computed.

rayleigh_energyint

Rayleigh energy dissipation option.

  • EQ.1: Energy dissipation is not computed.

  • EQ.2: Energy dissipation is computed.

initial_reference_geometry_energyint

Initial reference geometry energy option.

  • EQ.1: Initial reference geometry energy is not computed.

  • EQ.2: Initial reference geometry energy is computed.

Returns:
bool

True when successful, False when failed.

DynaBase.set_output(print_suppression_d3hsp=False, print_suppression_echo=OutputEcho.ALL_DATA_PRINTED)#

Set miscellaneous output parameters.

Parameters:
print_suppression_d3hspbool, optional

Whether to suppress printing during the input phase flag for the D3HSP file. The default is True, which means that none of these are printed: nodal coordinates, element connectivities, rigid wall definitions, nodal SPCs, initial velocities, initial strains, adaptive constraints, and SPR2/SPR3 constraints. If False, no suppression occurs.

print_suppression_echoOutputEcho

Print suppression setting during the input phase flag for the echo file. Options are:

  • ALL_DATA_PRINTED: All data is printed.

  • SUPPRESSED_NODAL_PRINTING: Nodal printing is suppressed.

  • SUPPRESSED_ELEMENT_PRINTING: Element printing is suppressed.

  • SUPPRESSED_NODAL_AND_ELEMENT_PRINTING : Both nodal and element printing is suppressed.

DynaBase.set_hourglass(controltype=HourglassControl.STANDARD_VISCOSITY_FORM, coefficient=0.1)#

Redefine the default values for the hourglass control type and coefficient.

Parameters:
controltypeenum

Default hourglass control type.

coefficientfloat, optional

Default hourglass coefficient. The default is 0..

Returns:
bool

True when successful, False when failed.

DynaBase.set_bulk_viscosity(quadratic_viscosity_coeff=1.5, linear_viscosity_coeff=0.06, bulk_viscosity_type=BulkViscosity.STANDARD_BULK_VISCOSITY)#

Reset the default values of the bulk viscosity coefficients globally.

Parameters:
quadratic_viscosity_coefffloat, optional

Default quadratic viscosity coefficient. The default is 1.5.

linear_viscosity_coefffloat, optional

Default linear viscosity coefficient. The default is 0.06.

bulk_viscosity_typeenum

Default bulk viscosity type.

Returns:
bool

True when successful, False when failed.

DynaBase.set_init_temperature(temp=0)#

Define initial nodal point temperatures on all nodes.

Parameters:
tempfloat, optional

Temperature at node. The default is 0.

Returns:
bool

True when successful, False when failed.

DynaBase.create_control_shell(wrpang=20, esort=0, irnxx=-1, istupd=0, theory=2, bwc=2, miter=1, proj=0, irquad=0)#

Provide controls for computing shell response.

Parameters:
wrpangint, optional

Shell element warpage angle in degrees. The default is 20.

esortint

Sorting of triangular shell elements to automatically switch degenerate quadrilateral shell formulations to more suitable triangular shell formulations. The default is 0.

irnxxint, optional

Shell normal update option. The default is 1.

istupdint, optional

Shell thickness change option for deformable shells. The default is 0.

theoryint, optional

Default shell formulation. The default is 2.

bwcint, optional

Warping stiffness for Belytschko-Tsay shells. The default is 2.

miterint, optional

Plane stress plasticity option. The default is 1.

projint, optional

Projection method for the warping stiffness in the Belytschko-Tsay shell and the Belytschko-Wong-Chiang elements. The default is 0.

irquadint, optional

In-plane integration rule for the eight-node quadratic shell element. The default is 0.

  • EQ.2: 2*2 Gauss quadrature

  • EQ.3: 3*3 Gauss quadrature

Returns:
bool

True when successful, False when failed.

DynaBase.create_control_solid(esort=0, fmatrx=0, niptets=4, swlocl=1, psfail=0, t10jtol=0.0, icoh=0, tet13k=0)#

Provide controls for a solid element response.

Parameters:
esortint, optional

Automatic sorting of tetrahedral and pentahedral elements to avoid use of degenerate formulations for these shapes. The default is 0.

  • EQ.0: No sorting

  • EQ.1: Sort

fmatrxint, optional

Method to use in the calculation of the deformation gradient matrix. The default is 1.

niptetsint, optional

Number of integration points used in the quadratic tetrahedron elements. The default is 4.

swloclint, optional

Output option for stresses in solid elements used as spot welds with material \*MAT_SPOTWELD. The default is 1.

psfailint, optional

Solid element erosion from negative volume is limited only to solid elements in the part set indicated by PSFAIL. The default is 0.

t10jtolfloat, optional

Tolerance for Jacobian in four-point, 10-noded quadratic tetrahedra. The default is 0.0.

icohint, optional

Breaking LS-DYNA convention ICOH is interpreted digit-wise. The default is 0.

tet13kint, optional

Flag for whether to invoke a consistent tangent stiffness matrix for the pressure averaged tetrahedron. The default is 0, in which case this matrix is not invoked. If this parameter is set to 1, this matrix is invoked.

Returns:
bool

True when successful, False when failed.

DynaBase.create_control_contact(rwpnal, shlthk=0, orien=1, ssthk=0, ignore=0, igactc=0)#

Change defaults for computation with contact surfaces.

Parameters:
rwpnalfloat

Scale factor for rigid wall penalties, which treat nodal points interacting with rigid walls.

shlthkint, optional

Flag for whether to consider shell thickness offsets in non-automatic surface-to-surface and non-automatic nodes-to-surface type contacts. The default is 0, in which case these offsets are not considered. If this parameter is set to 1, these offsets are considered.

orienint, optional

Flag for whether to automatically reorient contact interface segments during initialization. The default is 1, in which case reorientation automatically occurs. If this parameter is set to 0, reorientation does not occur.

ssthkint, optional

Flag for whether to determine default contact thickness for shells in single surface contact types. The default is 0, in which case default contact thickness is not determined. If this parameter is set to 1, default contact thickness is determined.

ignoreint, optional

Flag for whether to ignore initial penetrations in the \*CONTACT_AUTOMATIC options. The default is 0, in which case initial penetrations are ignored. If this parameter is set to 1, initial penetrations are not ignored.

igactcint, optional

Flag for whether to use isogeometric shells for contact detection when the contact involves isogeometric shells. The default is 0, which means isogeometric shells are not used. If this parameter is set to 1, isogeometric shells are used.

Returns:
bool

True when successful, False when failed.

DynaBase.create_damping_global(lcid=0, valdmp=0.0)#

Define mass-weighted nodal damping.

Mass-weighted nodal damping applies globally to the nodes of deformable bodies and to the mass center of rigid bodies.

Parameters:
lcidint, optional

Load curve ID, which specifies the system damping constant versus the time. The default is 0.

valdmpfloat, optional

System damping constant. The default is 0.0.

Returns:
bool

True when successful, False when failed.

DynaBase.get_solid_elements()#

Get solid elements.

Returns:
list

list[0],solid element connectivity,list[0] = [[n1,n2,n3,n4,n5,n6,n7,n8],[…],…] list[1],node coordinates,list[1] = [[x1,y1,z1],[x2,y2,z2],…]

DynaBase.create_general_keyword(opcode, keyworddata)#

Create general keyword.

Parameters:
opcodestr

Keyword card name.

keyworddatastring

Keyword data.

Example::

Create a \*INITIAL_VELOCITY keyword.

$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ *INITIAL_VELOCITY

& vx vy vz vxr vyr vzr 1.480E+01 0.000E+00 0.000E+00 0.000E+00 0.000E+00 0.000E+00 $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$

opcode = “INITIAL_VELOCITY” keyworddata = “0

1.480E+01,0.000E+00,0.000E+00,0.000E+00,0.000E+00,0.000E+00”

create_general_keyword(opcode = opcode,keyworddata=keyworddata)

DynaBase.add(obj)#

Add entities to an object.

DynaBase.set_transform(filename=None, idnoff=0, ideoff=0, idpoff=0, idmoff=0, idsoff=0, idfoff=0, transform=None)#

Include independent input files containing model data, allow for node, element, and set IDs to be offset and for coordinates and constitutive parameters to be transformed and scaled.

Parameters:
filenamestr

Name of file to include in the keyword file.

idnoffint

Offset to node ID.

ideoffint

Offset to element ID.

idpoffint

Offset to part ID.

idmoffint

Offset to material ID.

idsoffint

Offset to set ID.

idfoffint

Offset to function ID, table ID, and curve ID.

transformTransform

Definition for the transformation.

DynaBase.save_file()#

Save keyword files.

Returns:
bool

True when successful, False when failed.