metafold 0.15.dev2__tar.gz → 0.16.0__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.
- {metafold-0.15.dev2 → metafold-0.16.0}/PKG-INFO +1 -1
- {metafold-0.15.dev2 → metafold-0.16.0}/metafold/simulation/compression_simulation.py +7 -0
- {metafold-0.15.dev2 → metafold-0.16.0}/metafold/simulation/run_experiment.py +2 -0
- {metafold-0.15.dev2 → metafold-0.16.0}/metafold.egg-info/PKG-INFO +1 -1
- {metafold-0.15.dev2 → metafold-0.16.0}/pyproject.toml +1 -1
- {metafold-0.15.dev2 → metafold-0.16.0}/tests/test_compression_simulation.py +14 -0
- {metafold-0.15.dev2 → metafold-0.16.0}/LICENSE +0 -0
- {metafold-0.15.dev2 → metafold-0.16.0}/README.md +0 -0
- {metafold-0.15.dev2 → metafold-0.16.0}/metafold/__init__.py +0 -0
- {metafold-0.15.dev2 → metafold-0.16.0}/metafold/api.py +0 -0
- {metafold-0.15.dev2 → metafold-0.16.0}/metafold/assets.py +0 -0
- {metafold-0.15.dev2 → metafold-0.16.0}/metafold/auth.py +0 -0
- {metafold-0.15.dev2 → metafold-0.16.0}/metafold/client.py +0 -0
- {metafold-0.15.dev2 → metafold-0.16.0}/metafold/exceptions.py +0 -0
- {metafold-0.15.dev2 → metafold-0.16.0}/metafold/jobs.py +0 -0
- {metafold-0.15.dev2 → metafold-0.16.0}/metafold/materials.py +0 -0
- {metafold-0.15.dev2 → metafold-0.16.0}/metafold/projects.py +0 -0
- {metafold-0.15.dev2 → metafold-0.16.0}/metafold/simulation/__init__.py +0 -0
- {metafold-0.15.dev2 → metafold-0.16.0}/metafold/simulation/compression_experiment.py +0 -0
- {metafold-0.15.dev2 → metafold-0.16.0}/metafold/utils.py +0 -0
- {metafold-0.15.dev2 → metafold-0.16.0}/metafold/workflows.py +0 -0
- {metafold-0.15.dev2 → metafold-0.16.0}/metafold.egg-info/SOURCES.txt +0 -0
- {metafold-0.15.dev2 → metafold-0.16.0}/metafold.egg-info/dependency_links.txt +0 -0
- {metafold-0.15.dev2 → metafold-0.16.0}/metafold.egg-info/requires.txt +0 -0
- {metafold-0.15.dev2 → metafold-0.16.0}/metafold.egg-info/top_level.txt +0 -0
- {metafold-0.15.dev2 → metafold-0.16.0}/setup.cfg +0 -0
- {metafold-0.15.dev2 → metafold-0.16.0}/tests/test_assets.py +0 -0
- {metafold-0.15.dev2 → metafold-0.16.0}/tests/test_compession_experiment.py +0 -0
- {metafold-0.15.dev2 → metafold-0.16.0}/tests/test_jobs.py +0 -0
- {metafold-0.15.dev2 → metafold-0.16.0}/tests/test_materials.py +0 -0
- {metafold-0.15.dev2 → metafold-0.16.0}/tests/test_projects.py +0 -0
- {metafold-0.15.dev2 → metafold-0.16.0}/tests/test_run_experiment.py +0 -0
- {metafold-0.15.dev2 → metafold-0.16.0}/tests/test_shear_simulation.py +0 -0
- {metafold-0.15.dev2 → metafold-0.16.0}/tests/test_utils.py +0 -0
- {metafold-0.15.dev2 → metafold-0.16.0}/tests/test_workflows.py +0 -0
|
@@ -260,6 +260,9 @@ class ExperimentPistonBase:
|
|
|
260
260
|
force_limit: ForceLimit | None = None
|
|
261
261
|
"""Apply condition to jump to zero velocity when the given force is reached."""
|
|
262
262
|
|
|
263
|
+
releasable: bool = False
|
|
264
|
+
"""Only constrain contact in normal direction if releasable is True."""
|
|
265
|
+
|
|
263
266
|
|
|
264
267
|
@dataclass
|
|
265
268
|
class ExperimentPistonMesh(ExperimentMesh, ExperimentPistonBase):
|
|
@@ -1308,6 +1311,10 @@ class CompressionSimulation:
|
|
|
1308
1311
|
"conditionValue": info.part.force_limit.value,
|
|
1309
1312
|
"conditionAction": "GoToZeroVelocity",
|
|
1310
1313
|
})
|
|
1314
|
+
if isinstance(info.part, ExperimentPistonBase) and info.part.releasable:
|
|
1315
|
+
kwargs.update({
|
|
1316
|
+
"normal_only": True,
|
|
1317
|
+
})
|
|
1311
1318
|
rigid_contacts.append(
|
|
1312
1319
|
Contact(
|
|
1313
1320
|
type=info.part.contact_type,
|
|
@@ -205,6 +205,8 @@ def _build_parts(parts_config: list[dict]) -> list[ExperimentPart]:
|
|
|
205
205
|
kwargs["material"] = _resolve_material(entry["material"])
|
|
206
206
|
if "force_limit" in entry:
|
|
207
207
|
kwargs["force_limit"] = ForceLimit(**entry["force_limit"])
|
|
208
|
+
if "releasable" in entry:
|
|
209
|
+
kwargs["releasable"] = entry["releasable"]
|
|
208
210
|
parts.append(ExperimentPistonCylinder(**kwargs))
|
|
209
211
|
|
|
210
212
|
elif part_type == "piston_box":
|
|
@@ -748,6 +748,20 @@ class TestSimConfig:
|
|
|
748
748
|
assert contact.find(tag) is not None
|
|
749
749
|
assert contact.find(tag).text == value
|
|
750
750
|
|
|
751
|
+
def test_releasable_contact(self, ply_folder, basic_parts, tmp_path):
|
|
752
|
+
parts = deepcopy(basic_parts)
|
|
753
|
+
parts[0].releasable = True
|
|
754
|
+
sim = CompressionSimulation(
|
|
755
|
+
parts=parts,
|
|
756
|
+
simulation_name="test_sim",
|
|
757
|
+
stl_folder_path=str(ply_folder),
|
|
758
|
+
output_path=str(tmp_path / "out"),
|
|
759
|
+
client=MagicMock(),
|
|
760
|
+
)
|
|
761
|
+
sim.create_sim_config()
|
|
762
|
+
contact = sim.ups.findall("./MaterialProperties/MPM/contact")[0]
|
|
763
|
+
contact.find("normal_only").text == "true"
|
|
764
|
+
|
|
751
765
|
|
|
752
766
|
class TestStressStrainPerPart:
|
|
753
767
|
"""stress-strain runs once per deformable part (not one representative).
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|