Skip to content

Commit

Permalink
Fixing material database to read in a stack database
Browse files Browse the repository at this point in the history
  • Loading branch information
kbonney committed Aug 30, 2023
1 parent b5bdb9c commit a112d54
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/pynumad/objects/materialdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ def generate(self, materials: dict, stackdb: StackDatabase):
n_webs, n_stations = swstacks.shape

# prepare material database ==========================================
self.matdb = dict()

# add base materials
for mat_name in materials:
Expand All @@ -38,7 +37,7 @@ def generate(self, materials: dict, stackdb: StackDatabase):
cur_entry.prxz = cur_material.prxz
cur_entry.dens = cur_material.density
cur_entry.reference = cur_material.reference
self.matdb[mat_name] = cur_entry
self[mat_name] = cur_entry

# add component stacks
flat_stacks = stacks.flatten("F")
Expand Down Expand Up @@ -83,7 +82,7 @@ def generate(self, materials: dict, stackdb: StackDatabase):
cur_plygroup = cur_stack.plygroups[j]
cur_layer = Layer()
matid = cur_plygroup.materialid
cur_layer.layerName = self.matdb[matid].name
cur_layer.layerName = self[matid].name
cur_layer.thicknessA = (
mm_to_m * cur_plygroup.thickness
)
Expand Down

0 comments on commit a112d54

Please sign in to comment.