ansys.dyna.core.lib.keyword_base#

Classes#

KeywordBase

Base class for all keywords.

Module Contents#

class ansys.dyna.core.lib.keyword_base.KeywordBase(**kwargs)[source]#

Bases: ansys.dyna.core.lib.cards.Cards

Base class for all keywords.

Derived class must provide::
  • _cards

  • keyword

  • subkeyword

property user_comment: str[source]#

Get or set the “user comment” for this keyword.

property format: ansys.dyna.core.lib.format_type.format_type[source]#

Get or set the format for this keyword.

get_title(format_symbol: str = '') str[source]#

Get the title of this keyword.

property cards: List[ansys.dyna.core.lib.card_interface.CardInterface][source]#

Gets the cards of the keyword

is_option_active(option: str) bool[source]#
activate_option(option: str) None[source]#
deactivate_option(option: str) None[source]#
__repr__() str[source]#

Returns a console-friendly representation of the keyword data as it would appear in the .k file

write(buf: TextIO | None = None, format: ansys.dyna.core.lib.format_type.format_type | None = None, deck_format: ansys.dyna.core.lib.format_type.format_type = format_type.default) str[source]#

Renders the keyword in the dyna keyword format.

Parameters:
buf: IO

Optional - buffer to write to.

Returns
_______
If `buf` is None, the output is returned as a string
dumps() str[source]#

Return the string representation of the keyword.

before_read(buf: TextIO) None[source]#
read(buf: TextIO) None[source]#
loads(value: str) None[source]#

Load the keyword from string.