pyfebio 0.3.0__tar.gz → 0.3.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. {pyfebio-0.3.0 → pyfebio-0.3.1}/PKG-INFO +1 -1
  2. {pyfebio-0.3.0 → pyfebio-0.3.1}/pyproject.toml +1 -1
  3. {pyfebio-0.3.0 → pyfebio-0.3.1}/src/pyfebio/xplt.py +9 -3
  4. {pyfebio-0.3.0 → pyfebio-0.3.1}/README.md +0 -0
  5. {pyfebio-0.3.0 → pyfebio-0.3.1}/src/pyfebio/__init__.py +0 -0
  6. {pyfebio-0.3.0 → pyfebio-0.3.1}/src/pyfebio/_types.py +0 -0
  7. {pyfebio-0.3.0 → pyfebio-0.3.1}/src/pyfebio/boundary.py +0 -0
  8. {pyfebio-0.3.0 → pyfebio-0.3.1}/src/pyfebio/constraints.py +0 -0
  9. {pyfebio-0.3.0 → pyfebio-0.3.1}/src/pyfebio/contact.py +0 -0
  10. {pyfebio-0.3.0 → pyfebio-0.3.1}/src/pyfebio/control.py +0 -0
  11. {pyfebio-0.3.0 → pyfebio-0.3.1}/src/pyfebio/discrete.py +0 -0
  12. {pyfebio-0.3.0 → pyfebio-0.3.1}/src/pyfebio/globals.py +0 -0
  13. {pyfebio-0.3.0 → pyfebio-0.3.1}/src/pyfebio/include.py +0 -0
  14. {pyfebio-0.3.0 → pyfebio-0.3.1}/src/pyfebio/initial.py +0 -0
  15. {pyfebio-0.3.0 → pyfebio-0.3.1}/src/pyfebio/loaddata.py +0 -0
  16. {pyfebio-0.3.0 → pyfebio-0.3.1}/src/pyfebio/loads.py +0 -0
  17. {pyfebio-0.3.0 → pyfebio-0.3.1}/src/pyfebio/material.py +0 -0
  18. {pyfebio-0.3.0 → pyfebio-0.3.1}/src/pyfebio/mesh.py +0 -0
  19. {pyfebio-0.3.0 → pyfebio-0.3.1}/src/pyfebio/meshadaptor.py +0 -0
  20. {pyfebio-0.3.0 → pyfebio-0.3.1}/src/pyfebio/meshdata.py +0 -0
  21. {pyfebio-0.3.0 → pyfebio-0.3.1}/src/pyfebio/meshdomains.py +0 -0
  22. {pyfebio-0.3.0 → pyfebio-0.3.1}/src/pyfebio/model.py +0 -0
  23. {pyfebio-0.3.0 → pyfebio-0.3.1}/src/pyfebio/module.py +0 -0
  24. {pyfebio-0.3.0 → pyfebio-0.3.1}/src/pyfebio/output.py +0 -0
  25. {pyfebio-0.3.0 → pyfebio-0.3.1}/src/pyfebio/py.typed +0 -0
  26. {pyfebio-0.3.0 → pyfebio-0.3.1}/src/pyfebio/rigid.py +0 -0
  27. {pyfebio-0.3.0 → pyfebio-0.3.1}/src/pyfebio/step.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyfebio
3
- Version: 0.3.0
3
+ Version: 0.3.1
4
4
  Summary: A Python API for the FEBio finite element solver.
5
5
  Author: Scott Sibole
6
6
  Author-email: Scott Sibole <scott.sibole@gmail.com>
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "pyfebio"
3
- version = "0.3.0"
3
+ version = "0.3.1"
4
4
  description = "A Python API for the FEBio finite element solver."
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.11"
@@ -492,6 +492,10 @@ def _parse_domain(buffer: bytes) -> dict[str, Any]:
492
492
  case "PLT_DOM_ELEM_LIST":
493
493
  domain_dict["elements"] = _parse_dom_elem_list(child)
494
494
  i += 8 + offset
495
+ # FEBio writes a name only for solid domains; shell, beam, and discrete domains
496
+ # have none, so fall back to one built from the domain id.
497
+ if not domain_dict.get("name"):
498
+ domain_dict["name"] = f"domain{domain_dict['id'][0]}"
495
499
  return domain_dict
496
500
 
497
501
 
@@ -671,8 +675,10 @@ def parse_mesh(buffer: bytes, mesh_cnt: int, f):
671
675
  i += 8 + offset
672
676
  case "PLT_DOMAIN_SECTION":
673
677
  domains = _parse_domain_section(child)
674
- for domain in domains:
675
- mesh_dict["domains"][domain["id"][0]] = domain["name"]
678
+ # State data refers to domains by 1-based position in this section,
679
+ # not by the header's part id (the material id), so key by position.
680
+ for position, domain in enumerate(domains, start=1):
681
+ mesh_dict["domains"][position] = domain["name"]
676
682
  dset_path = f"/meshes/{mesh_cnt}/domains/{domain['name']}"
677
683
  f.create_dataset(dset_path, data=domain["elements"], dtype=_DTYPES["int32"])
678
684
  for key, value in domain.items():
@@ -686,7 +692,7 @@ def parse_mesh(buffer: bytes, mesh_cnt: int, f):
686
692
  dset_path = f"/meshes/{mesh_cnt}/surfaces/{surface['name']}"
687
693
  f.create_dataset(dset_path, data=surface["faces"], dtype=_DTYPES["int32"])
688
694
  for key, value in surface.items():
689
- if key != "surfaces":
695
+ if key != "faces":
690
696
  f[dset_path].attrs[key] = value
691
697
  i += 8 + offset
692
698
  case "PLT_NODESET_SECTION":
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes