write_mesh_files Module

digraph inheritancec7154e621d { bgcolor=transparent; rankdir=LR; size=""; "pyNastran.bdf.bdf_interface.attributes.BDFAttributes" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="defines attributes of the BDF"]; "pyNastran.bdf.bdf_interface.write_mesh.WriteMesh" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="Defines methods for writing cards"]; "pyNastran.bdf.bdf_interface.attributes.BDFAttributes" -> "pyNastran.bdf.bdf_interface.write_mesh.WriteMesh" [arrowsize=0.5,style="setlinewidth(0.5)"]; "pyNastran.bdf.bdf_interface.write_mesh_file.TrashWriter" [URL="#pyNastran.bdf.bdf_interface.write_mesh_file.TrashWriter",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "pyNastran.bdf.bdf_interface.write_mesh_file.WriteMeshs" [URL="#pyNastran.bdf.bdf_interface.write_mesh_file.WriteMeshs",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Defines methods for writing cards"]; "pyNastran.bdf.bdf_interface.write_mesh.WriteMesh" -> "pyNastran.bdf.bdf_interface.write_mesh_file.WriteMeshs" [arrowsize=0.5,style="setlinewidth(0.5)"]; }
This file defines:
  • WriteMesh

class pyNastran.bdf.bdf_interface.write_mesh_file.TrashWriter(log, filename: str | PurePath = '')[source]

Bases: object

close()[source]
write(msg)[source]
class pyNastran.bdf.bdf_interface.write_mesh_file.WriteMeshs[source]

Bases: WriteMesh

Defines methods for writing cards

Major methods:
  • model.write_bdf(…)

  • model.echo_bdf(…)

  • model.auto_reject_bdf(…)

creates methods for writing cards

write_bdfs(out_files_map: dict[str, str], relative_dirname: str | PurePath = '', encoding: str | None = None, size: int = 8, is_double: bool = False, enddata: bool | None = None, close: bool = True, is_windows: bool | None = None) None[source]

Writes the BDF.

Parameters:
out_files_mapdict[source_bdf, out_bdf]
source_bdfstr

the name of the original bdf

out_bdfstr

the name of the output bdf

relative_dirnamestr; default=’’

A relative path to reference INCLUDEs. ‘’ : relative to the first bdf in out_files_map 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

out_files_map = {}
out_files_map[fem.active_filenames[0]] = bdf_filename[:-4] + “_NEW” + bdf_filename[-4:]
for ifile, include_filenames in model.include_filenames.items():
for include_filename in include_filenames:

base, ext = os.path.splitext(include_filename) new_filename = base + “_NEW” + ext out_files_map[include_filename] = new_filename

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: str, points: dict[int, Any], comment: str = '') None[source]

writes SPOINTs/EPOINTs