metafold 0.14.dev0__tar.gz → 0.15.dev0__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.14.dev0 → metafold-0.15.dev0}/PKG-INFO +1 -1
- {metafold-0.14.dev0 → metafold-0.15.dev0}/metafold/simulation/compression_simulation.py +15 -1
- {metafold-0.14.dev0 → metafold-0.15.dev0}/metafold/simulation/run_experiment.py +9 -0
- {metafold-0.14.dev0 → metafold-0.15.dev0}/metafold.egg-info/PKG-INFO +1 -1
- {metafold-0.14.dev0 → metafold-0.15.dev0}/pyproject.toml +1 -1
- {metafold-0.14.dev0 → metafold-0.15.dev0}/LICENSE +0 -0
- {metafold-0.14.dev0 → metafold-0.15.dev0}/README.md +0 -0
- {metafold-0.14.dev0 → metafold-0.15.dev0}/metafold/__init__.py +0 -0
- {metafold-0.14.dev0 → metafold-0.15.dev0}/metafold/api.py +0 -0
- {metafold-0.14.dev0 → metafold-0.15.dev0}/metafold/assets.py +0 -0
- {metafold-0.14.dev0 → metafold-0.15.dev0}/metafold/auth.py +0 -0
- {metafold-0.14.dev0 → metafold-0.15.dev0}/metafold/client.py +0 -0
- {metafold-0.14.dev0 → metafold-0.15.dev0}/metafold/exceptions.py +0 -0
- {metafold-0.14.dev0 → metafold-0.15.dev0}/metafold/jobs.py +0 -0
- {metafold-0.14.dev0 → metafold-0.15.dev0}/metafold/materials.py +0 -0
- {metafold-0.14.dev0 → metafold-0.15.dev0}/metafold/projects.py +0 -0
- {metafold-0.14.dev0 → metafold-0.15.dev0}/metafold/simulation/__init__.py +0 -0
- {metafold-0.14.dev0 → metafold-0.15.dev0}/metafold/simulation/compression_experiment.py +0 -0
- {metafold-0.14.dev0 → metafold-0.15.dev0}/metafold/utils.py +0 -0
- {metafold-0.14.dev0 → metafold-0.15.dev0}/metafold/workflows.py +0 -0
- {metafold-0.14.dev0 → metafold-0.15.dev0}/metafold.egg-info/SOURCES.txt +0 -0
- {metafold-0.14.dev0 → metafold-0.15.dev0}/metafold.egg-info/dependency_links.txt +0 -0
- {metafold-0.14.dev0 → metafold-0.15.dev0}/metafold.egg-info/requires.txt +0 -0
- {metafold-0.14.dev0 → metafold-0.15.dev0}/metafold.egg-info/top_level.txt +0 -0
- {metafold-0.14.dev0 → metafold-0.15.dev0}/setup.cfg +0 -0
- {metafold-0.14.dev0 → metafold-0.15.dev0}/tests/test_assets.py +0 -0
- {metafold-0.14.dev0 → metafold-0.15.dev0}/tests/test_compession_experiment.py +0 -0
- {metafold-0.14.dev0 → metafold-0.15.dev0}/tests/test_compression_simulation.py +0 -0
- {metafold-0.14.dev0 → metafold-0.15.dev0}/tests/test_jobs.py +0 -0
- {metafold-0.14.dev0 → metafold-0.15.dev0}/tests/test_materials.py +0 -0
- {metafold-0.14.dev0 → metafold-0.15.dev0}/tests/test_projects.py +0 -0
- {metafold-0.14.dev0 → metafold-0.15.dev0}/tests/test_run_experiment.py +0 -0
- {metafold-0.14.dev0 → metafold-0.15.dev0}/tests/test_shear_simulation.py +0 -0
- {metafold-0.14.dev0 → metafold-0.15.dev0}/tests/test_utils.py +0 -0
- {metafold-0.14.dev0 → metafold-0.15.dev0}/tests/test_workflows.py +0 -0
|
@@ -474,6 +474,8 @@ class CompressionSimulation:
|
|
|
474
474
|
# experiment variants sampled later match the base simulation's density.
|
|
475
475
|
sample_spacing: Optional[float] = None
|
|
476
476
|
|
|
477
|
+
use_experimental_solver: bool = False
|
|
478
|
+
|
|
477
479
|
def __init__(
|
|
478
480
|
self,
|
|
479
481
|
parts: list[ExperimentPart],
|
|
@@ -503,6 +505,7 @@ class CompressionSimulation:
|
|
|
503
505
|
project_name: str = "",
|
|
504
506
|
use_legacy_results_format: bool = False,
|
|
505
507
|
write_ups: bool = True,
|
|
508
|
+
use_experimental_solver: bool = False,
|
|
506
509
|
):
|
|
507
510
|
if not output_path:
|
|
508
511
|
if project_name:
|
|
@@ -542,6 +545,8 @@ class CompressionSimulation:
|
|
|
542
545
|
else:
|
|
543
546
|
self.client = client
|
|
544
547
|
|
|
548
|
+
self.use_experimental_solver = use_experimental_solver
|
|
549
|
+
|
|
545
550
|
def _write_ups(self, content: str, filename: str) -> None:
|
|
546
551
|
if self.write_ups and self.out_dir is not None:
|
|
547
552
|
(self.out_dir / filename).write_text(content)
|
|
@@ -1370,8 +1375,12 @@ class CompressionSimulation:
|
|
|
1370
1375
|
# Only parts that have a volume go into the compress assets list
|
|
1371
1376
|
parts_with_volume = [p for p in part_infos if p.volume_filename]
|
|
1372
1377
|
|
|
1378
|
+
job_type = "sim/custom"
|
|
1379
|
+
if self.use_experimental_solver:
|
|
1380
|
+
job_type = "sim/custom-gpu"
|
|
1381
|
+
|
|
1373
1382
|
self.workflow_jobs[compress_job_name] = {
|
|
1374
|
-
"type":
|
|
1383
|
+
"type": job_type,
|
|
1375
1384
|
}
|
|
1376
1385
|
|
|
1377
1386
|
# compress.volume is a list of volume asset filenames in part order
|
|
@@ -1505,6 +1514,11 @@ class CompressionSimulation:
|
|
|
1505
1514
|
for row in piston_info.part.velocity
|
|
1506
1515
|
]
|
|
1507
1516
|
)
|
|
1517
|
+
if piston_info.part.force_limit:
|
|
1518
|
+
# Switch to using piston particle positions to determine displacement
|
|
1519
|
+
self.workflow_params[f"{job_name_base}.piston_position"] = (
|
|
1520
|
+
f"/material{piston_info.material_index}/position"
|
|
1521
|
+
)
|
|
1508
1522
|
|
|
1509
1523
|
def _add_to_workflow_stress_strain(self, part_infos: list[PartInfo]):
|
|
1510
1524
|
# One stress-strain job per deformable part, each normalizing the shared
|
|
@@ -329,6 +329,12 @@ def _build_simulation_parameters(sim_config: dict) -> SimulationParameters:
|
|
|
329
329
|
return params
|
|
330
330
|
|
|
331
331
|
|
|
332
|
+
def num_simulations(config: dict) -> int:
|
|
333
|
+
"""Count number of simulation variations to be generated by a given configuration.
|
|
334
|
+
"""
|
|
335
|
+
return len(_build_varying(config.get("varying", [])))
|
|
336
|
+
|
|
337
|
+
|
|
332
338
|
def run_experiment(
|
|
333
339
|
config: dict,
|
|
334
340
|
output_path: str = "",
|
|
@@ -373,6 +379,8 @@ def run_experiment(
|
|
|
373
379
|
varying = _build_varying(config.get("varying", []))
|
|
374
380
|
sim_params = _build_simulation_parameters(config.get("simulation", {}))
|
|
375
381
|
|
|
382
|
+
use_experimental_solver = config.get("use_experimental_solver", False)
|
|
383
|
+
|
|
376
384
|
sim_kwargs: dict = dict(
|
|
377
385
|
parts=parts,
|
|
378
386
|
simulation_name=project_name,
|
|
@@ -381,6 +389,7 @@ def run_experiment(
|
|
|
381
389
|
simulation_parameters=sim_params,
|
|
382
390
|
project_id=project_id,
|
|
383
391
|
create_project_if_needed=not bool(project_id),
|
|
392
|
+
use_experimental_solver=use_experimental_solver,
|
|
384
393
|
)
|
|
385
394
|
# Only pass project_name when we have to create a project. When a
|
|
386
395
|
# project_id is supplied the project already exists, and passing the name
|
|
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
|
|
File without changes
|