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: pyNastran.bdf.bdf.BDF, model2_renumber: pyNastran.bdf.bdf.BDF) → None[source]

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

pyNastran.bdf.mesh_utils.bdf_merge._assemble_mapper(mappers: List[MAPPER], mapper_0: MAPPER, data_members: List[str], mapper_renumber: Optional[MAPPER] = None) → None[source]

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

Parameters
mappersList[mapper]
mapperdict[key]value
key???

???

value???

???

mapper_0mapper
key???

???

value???

???

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

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

]

mapper_renumberdict[key]: value; default=None
keystr

a BDF attribute

valuedict[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_allList[mappers]

One mapper for each bdf_filename

pyNastran.bdf.mesh_utils.bdf_merge._dict_key_to_key(dictionary) → Dict[int, int][source]

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

pyNastran.bdf.mesh_utils.bdf_merge._dicts_key_to_key(dictionaries: List[Dict[int, Any]]) → Dict[int, int][source]

Creates a dummy map from the nominal key to the nominal key for multiple input dictionaries. This is intended for use with:

  • SPCs, MPCs, Loads

pyNastran.bdf.mesh_utils.bdf_merge._get_mapper_0(model: BDF) → MAPPER[source]

Get the mapper for the first model.

Parameters
modelBDF()

the bdf model object

Returns
mapperdict[key]: value
keystr

a BDF attribute

valuedict[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, mapper_renumber: MAPPER)[source]

Renumbers a mapper

Parameters
mapper_0dict[key]: value
keystr

a BDF attribute

valuedict[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
mapperdict[map_type]
map_type???

???

sub_mapperdict[key]value
key???

???

value???

???

pyNastran.bdf.mesh_utils.bdf_merge.bdf_merge(bdf_filenames: List[str], bdf_filename_out: Optional[str] = None, renumber: bool = True, encoding: Optional[str] = None, size: int = 8, is_double: bool = False, cards_to_skip: Optional[List[str]] = None, skip_case_control_deck: bool = False, log: Optional[SimpleLogger] = 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, default

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

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: 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 ..