write_mesh_files Module

Inheritance diagram of pyNastran.bdf.bdf_interface.write_mesh_file
This file defines:
  • WriteMesh

class pyNastran.bdf.bdf_interface.write_mesh_file.WriteMeshs[source]

Bases: pyNastran.bdf.bdf_interface.write_mesh.WriteMesh

Defines methods for writing cards

Major methods:
  • model.write_bdf(…)

  • model.echo_bdf(…)

  • model.auto_reject_bdf(…)

creates methods for writing cards

_write_aero_control_file(bdf_files: Any, size: int = 8, is_double: bool = False, is_long_ids: Optional[bool] = None) → None[source]

Writes the aero control surface cards

_write_aero_file(bdf_files: Any, size: int = 8, is_double: bool = False, is_long_ids: Optional[bool] = None) → None[source]

Writes the aero cards

_write_bdf_includes(out_filenames, bdf_files, relative_dirname=None, is_windows=True)[source]

Writes the INCLUDE files

Parameters
out_filenamesdict[fname]

fname_in - the nominal bdf that was read fname_out - the bdf that will be written

relative_dirnamestr; default=None -> os.curdir

A relative path to reference INCLUDEs. ‘’ : relative to the main bdf None : use the current directory path : absolute path

is_windowsbool; default=None
True/FalseWindows has a special format for writing INCLUDE

files, so the format for a BDF that will run on Linux and Windows is different.

None : Check the platform

_write_common_file(bdf_files: Any, size: int = 8, is_double: bool = False, is_long_ids: Optional[bool] = None) → None[source]

Write the common outputs so none get missed…

Parameters
bdf_filefile

the file object

sizeint (default=8)

the field width

is_doublebool (default=False)

is this double precision

_write_constraints_file(bdf_files: Any, size: int = 8, is_double: bool = False, is_long_ids: Optional[bool] = None) → None[source]

Writes the constraint cards sorted by ID

_write_contact_file(bdf_files: Any, size: int = 8, is_double: bool = False, is_long_ids: Optional[bool] = None) → None[source]

Writes the contact cards sorted by ID

_write_coords_file(bdf_files: Any, size: int = 8, is_double: bool = False, is_long_ids: Optional[bool] = None) → None[source]

Writes the coordinate cards in a sorted order

_write_dloads_file(bdf_files: Any, size: int = 8, is_double: bool = False, is_long_ids: Optional[bool] = None) → None[source]

Writes the dload cards sorted by ID

_write_dmigs_file(bdf_files: Any, size: int = 8, is_double: bool = False, is_long_ids: Optional[bool] = None) → None[source]

Writes the DMIG cards

Parameters
sizeint

large field (16) or small field (8)

_write_dynamic_file(bdf_files: Any, size: int = 8, is_double: bool = False, is_long_ids: Optional[bool] = None) → None[source]

Writes the dynamic cards sorted by ID

_write_elements_file(bdf_files: Any, size: int = 8, is_double: bool = False, is_long_ids: Optional[bool] = None) → None[source]

Writes the elements in a sorted order

_write_flutter_file(bdf_files: Any, size: int = 8, is_double: bool = False, write_aero_in_flutter: bool = True, is_long_ids: Optional[bool] = None) → None[source]

Writes the flutter cards

_write_grids_file(bdf_files: Any, size: int = 8, is_double: bool = False, is_long_ids: Optional[bool] = None) → None[source]

Writes the GRID-type cards

_write_gust_file(bdf_files: Any, size: int = 8, is_double: bool = False, write_aero_in_gust: bool = True, is_long_ids: Optional[bool] = None) → None[source]

Writes the gust cards

_write_loads_file(bdf_files: Any, size: int = 8, is_double: bool = False, is_long_ids: Optional[bool] = None) → None[source]

Writes the load cards sorted by ID

_write_masses_file(bdf_files: Any, size: int = 8, is_double: bool = False, is_long_ids: Optional[bool] = None) → None[source]

Writes the mass cards sorted by ID

_write_materials_file(bdf_files: Any, size: int = 8, is_double: bool = False, is_long_ids: Optional[bool] = None) → None[source]

Writes the materials in a sorted order

_write_nodes_file(bdf_files: Any, size: int = 8, is_double: bool = False, is_long_ids: Optional[bool] = None) → None[source]

Writes the NODE-type cards

_write_nsm_file(bdf_files: Any, size: int = 8, is_double: bool = False, is_long_ids: Optional[bool] = None) → None[source]

Writes the nsm in a sorted order

_write_optimization_file(bdf_files: Any, size: int = 8, is_double: bool = False, is_long_ids: Optional[bool] = None) → None[source]

Writes the optimization cards sorted by ID

_write_params_file(bdf_files: Any, size: int = 8, is_double: bool = False, is_long_ids: Optional[bool] = None) → None[source]

Writes the PARAM cards

_write_properties_file(bdf_files: Any, size: int = 8, is_double: bool = False, is_long_ids: Optional[bool] = None) → None[source]

Writes the properties in a sorted order

_write_rejects_file(bdf_files: Any, size: int = 8, is_double: bool = False, is_long_ids: Optional[bool] = None) → None[source]

Writes the rejected (processed) cards and the rejected unprocessed cardlines

_write_rigid_elements_file(bdf_files: Any, size: int = 8, is_double: bool = False, is_long_ids: Optional[bool] = None) → None[source]

Writes the rigid elements in a sorted order

_write_sets_file(bdf_files: Any, size: int = 8, is_double: bool = False, is_long_ids: Optional[bool] = None) → None[source]

Writes the SETx cards sorted by ID

_write_static_aero_file(bdf_files: Any, size: int = 8, is_double: bool = False, is_long_ids: Optional[bool] = None) → None[source]

Writes the static aero cards

_write_superelements_file(bdf_files: Any, size: int = 8, is_double: bool = False, is_long_ids: Optional[bool] = None) → None[source]

Writes the Superelement cards

Parameters
sizeint

large field (16) or small field (8)

_write_tables_file(bdf_files: Any, size: int = 8, is_double: bool = False, is_long_ids: Optional[bool] = None) → None[source]

Writes the TABLEx cards sorted by ID

_write_thermal_file(bdf_files: Any, size: int = 8, is_double: bool = False, is_long_ids: Optional[bool] = None) → None[source]

Writes the thermal cards

_write_thermal_materials_file(bdf_files: Any, size: int = 8, is_double: bool = False, is_long_ids: Optional[bool] = None) → None[source]

Writes the thermal materials in a sorted order

write_bdfs(out_filenames: Optional[Union[str, StringIO]], relative_dirname: Optional[str] = None, encoding: Optional[str] = None, size: int = 8, is_double: bool = False, enddata: Optional[bool] = None, close: bool = True, is_windows: Optional[bool] = None) → None[source]

Writes the BDF.

Parameters
out_filenamevaries; default=None

str - the name to call the output bdf file - a file object StringIO() - a StringIO object None - pops a dialog

relative_dirnamestr; default=None -> os.curdir

A relative path to reference INCLUDEs. ‘’ : relative to the main bdf None : use the current directory path : absolute path

encodingstr; default=None -> system specified encoding

the unicode encoding latin1, and utf8 are generally good options

sizeint; {8, 16}

the field size

is_doublebool; default=False

False : small field True : large field

enddatabool; default=None

bool - enable/disable writing ENDDATA None - depends on input BDF

closebool; default=True

should the output file be closed

is_windowsbool; default=None
True/FalseWindows has a special format for writing INCLUDE

files, so the format for a BDF that will run on Linux and Windows is different.

None : Check the platform

pyNastran.bdf.bdf_interface.write_mesh_file._get_ifiles_dict(cards_dict)[source]

gets the ids for a dictionary by file number

pyNastran.bdf.bdf_interface.write_mesh_file._get_ifiles_dict_list(cards)[source]

gets the ids for a dictionary of lists by file number

pyNastran.bdf.bdf_interface.write_mesh_file._map_filenames_to_ifile_filname_dict(out_filenames, active_filenames)[source]

Converts a old_filename->new_filename dict to a ifile->new_filename dict.

pyNastran.bdf.bdf_interface.write_mesh_file._open_bdf_files(ifile_out_filenames, active_filenames, encoding)[source]

opens N bdf files

pyNastran.bdf.bdf_interface.write_mesh_file._write_bdf_dict_cards(bdf_file, cards, size, is_double, is_long_ids)[source]

writes a dictionary

pyNastran.bdf.bdf_interface.write_mesh_file.write_bdf_dict_ids(bdf_file, cards, ids, size, is_double, is_long_ids)[source]

writes a dictionary by ifile

pyNastran.bdf.bdf_interface.write_mesh_file.write_bdfs_dict(bdf_files, cards, size, is_double, is_long_ids)[source]

writes a dictionary by ifile

pyNastran.bdf.bdf_interface.write_mesh_file.write_bdfs_dict_list(bdf_files, cards, size, is_double, is_long_ids)[source]

writes a dictionary of lists by ifile

pyNastran.bdf.bdf_interface.write_mesh_file.write_bdfs_list(bdf_files, cards, size, is_double, is_long_ids)[source]

writes a list by ifile

pyNastran.bdf.bdf_interface.write_mesh_file.write_xpoints_file(bdf_files, cardtype, points, comment='')[source]

writes SPOINTs/EPOINTs