bdf_merge Module

defines:
  • bdf_merge(bdf_filenames, bdf_filename_out=None, renumber=True, encoding=None, size=8,

    is_double=False, cards_to_skip=None, log=None, skip_case_control_deck=False, blind=False, dup_node_tol=0.0)

  • DuplicateNodeError

exception pyNastran.bdf.mesh_utils.bdf_merge.DuplicateNodeError[source]

Raised by bdf_merge(blind=True) when one GRID id means two different locations. A blind merge welds decks together by node id, so an id collision that is not a coincident point is a modeling error rather than something to silently renumber away.

pyNastran.bdf.mesh_utils.bdf_merge.bdf_merge(bdf_filenames: list[str], bdf_filename_out: str | None = None, renumber: bool = True, encoding: str | None = None, size: int = 8, is_double: bool = False, cards_to_skip: list[str] | None = None, skip_case_control_deck: bool = False, blind: bool = False, dup_node_tol: float = 0.0, log: SimpleLogger | None = None) → tuple[BDF, list[MAPPER]][source]

Merges multiple BDF into one file

Parameters:
bdf_filenameslist[str]

list of bdf filenames

bdf_filename_outstr / None

the output bdf filename (default=None; None -> no writing)

renumberbool

should the bdf be renumbered (default=True)

encodingstr

the unicode encoding (default=None; system default)

sizeint; {8, 16}; default=8

the bdf write precision

is_doublebool; default=False

the field precision to write

cards_to_skiplist[str]; (default=None -> don’t skip any cards)

There are edge cases (e.g. FLUTTER analysis) where things can break due to uncross-referenced cards. You need to disable entire classes of cards in that case (e.g. all aero cards).

skip_case_control_deckbool, optional, defaultFalse

If true, don’t consider the case control deck while merging.

blindbool; default=False

Blind merge: do NOT renumber the GRIDs, so decks that already share a common node numbering are welded together on those ids. A node id present in more than one deck is collapsed to a single GRID when the two locations agree (see dup_node_tol) and raises DuplicateNodeError when they don’t. Everything else (elements, properties, materials, coords, …) is still renumbered to dodge collisions, so only the node numbering is load bearing. Implies renumber=False; the final 1..n compaction would otherwise throw away the very ids that were preserved.

dup_node_tolfloat; default=0.0

Distance below which two GRIDs sharing an id are treated as the same point. The default of 0.0 requires an exact match, which is the right answer when the decks were written by the same tool from the same source points. Raise it only to absorb known round-tripping loss (e.g. ~1e-4 for small-field BDF).

Returns:
modelBDF

Merged model.

mappers_alllist[mapper]
mapperdict[bdf_attribute]old_id_to_new_id_dict

List of mapper dictionaries of original ids to merged

bdf_attributestr

a BDF attribute (e.g., ‘nodes’, ‘elements’)

old_id_to_new_id_dictdict[id_old]id_new

a sub dictionary that is used to map the node/element/etc. ids

mapper = {

‘elements’ : eid_map, ‘nodes’ : nid_map, ‘coords’ : cid_map, …

}

Supports

nodes: GRID coords: Coord elements: CQUAD4, CTRIA3, CTETRA, CPENTA, CHEXA, CELASx, CBAR, CBEAM

CONM1, CONM2, CMASS

properties: PSHELL, PCOMP, PSOLID, PMASS materials: MAT1, MAT8

Todo

doesn’t support SPOINTs/EPOINTs ..

Warning

still very preliminary ..