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)
pyNastran.bdf.mesh_utils.bdf_merge._apply_scalar_cards(model, model2_renumber)[source]

apply cards from model2 to model if they don’t exist in model

pyNastran.bdf.mesh_utils.bdf_merge._assemble_mapper(mappers, mapper_0, data_members, mapper_renumber=None)[source]

Assemble final mappings from all original ids to the ids in the merged and possibly renumbered model.

Parameters:
mappers : List[mapper]
mapper : dict[key] : value
key : ???

???

value : ???

???

mapper_0 : mapper
key : ???

???

value : ???

???

data_members : List[str]
list of things to include in the mappers?
data_members = [

‘coords’, ‘nodes’, ‘elements’, ‘masses’, ‘properties’, ‘properties_mass’, ‘materials’, ‘sets’, ‘rigid_elements’, ‘mpcs’,

]

mapper_renumber : dict[key]: value; default=None
key : str

a BDF attribute

value : dict[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, …

}

Returns:
mappers_all : List[mappers]

One mapper for each bdf_filename

pyNastran.bdf.mesh_utils.bdf_merge._dict_key_to_key(dictionary)[source]

creates a dummy map from the nominal key to the nominal key

pyNastran.bdf.mesh_utils.bdf_merge._dicts_key_to_key(dictionaries)[source]

creates a dummy map from the nominal key to the nominal key for multiple input dictionaries

pyNastran.bdf.mesh_utils.bdf_merge._get_mapper_0(model)[source]

Get the mapper for the first model.

Parameters:
model : BDF()

the bdf model object

Returns:
mapper : dict[key]: value
key : str

a BDF attribute

value : dict[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, …

}

pyNastran.bdf.mesh_utils.bdf_merge._renumber_mapper(mapper_0, mapper_renumber)[source]

Renumbers a mapper

Parameters:
mapper_0 : dict[key]: value
key : str

a BDF attribute

value : dict[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, …

}

mapper_renumber : ???

???

Returns:
mapper : dict[map_type]
map_type : ???

???

sub_mapper : dict[key] : value
key : ???

???

value : ???

???

pyNastran.bdf.mesh_utils.bdf_merge.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)[source]

Merges multiple BDF into one file

Parameters:
bdf_filenames : List[str]

list of bdf filenames

bdf_filename_out : str / None

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

renumber : bool

should the bdf be renumbered (default=True)

encoding : str

the unicode encoding (default=None; system default)

size : int; {8, 16}; default=8

the bdf write precision

is_double : bool; default=False

the field precision to write

cards_to_skip : List[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_deck : bool, optional, default

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

Returns:
model : BDF

Merged model.

mappers_all : List[mapper]
mapper : Dict[bdf_attribute] : old_id_to_new_id_dict

List of mapper dictionaries of original ids to merged

bdf_attribute : str

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

old_id_to_new_id_dict : dict[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: CORDx 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 ..