53def build_deck(output_path: str | os.PathLike[str] =
"runs/", *,
54 final_time: float = FINAL_TIME, num_steps: int = NUM_STEPS,
55 output_interval: int = 1000,
56 mesh: str | os.PathLike[str] |
None =
None,
57 mesh_size: float |
None =
None,
58 tags: list[str] |
None =
None) -> Deck:
61 Pass ``mesh_size`` to have Gmsh build the disc in memory (no ``.msh`` on
62 disk); otherwise the committed ``mesh_cir_1_0.msh`` is read, which is what
63 the parity run against ``bin/PeriDEM`` uses.
65 d = Deck(dim=2, t_final=final_time, n_steps=num_steps,
66 particle_sim_type=
"Single_Particle")
67 d.set_comment(
"Single-particle circle: fixed SW patch, linear pull on NE "
68 "(PDState), set up in Python")
69 d.set_output(output_path, tags=tags
or TAGS, interval=output_interval,
70 debug=1, tag_pp=
"0", pvd_collection=
True)
72 if mesh_size
is not None:
73 mesh_spec = MeshSpec(size=mesh_size)
75 mesh_spec = MeshSpec(file=Path(mesh)
if mesh
is not None
76 else HERE / MESH_FILE)
77 d.add_particle_type(Geometry(
"circle", [RADIUS, 0.0, 0.0, 0.0]), mesh_spec)
78 d.add_material(horizon=HORIZON, density=DENSITY, K=K,
79 G=to_G(E=peridem.to_E(K, NU), nu=NU), Gc=GC,
84 hold = Geometry(
"rectangle", [-0.001, -0.001, 0.0, -0.0005, -0.0005, 0.0])
85 pull = Geometry(
"rectangle", [0.0005, 0.0005, 0.0, 0.001, 0.001, 0.0])
86 d.add_displacement_bc(region=hold, direction=[1, 2],
87 time_fn_type=
"constant", time_fn_params=[0.0],
88 spatial_fn_type=
"constant", zero_displacement=
True)
89 d.add_displacement_bc(region=pull, direction=[1, 2],
90 time_fn_type=
"linear", time_fn_params=[PULL_RATE],
91 spatial_fn_type=
"constant")
93 d.set_test(
"test_peridynamics")
Deck build_deck(str|os.PathLike[str] output_path="runs/out/", *str preset="short", float|None final_time=None, int|None num_steps=None, int|None output_interval=None, float omega=OMEGA, str|os.PathLike[str] mesh_dir=MESH_DIR, str|os.PathLike[str] csv=CSV)