Complete V5 acceptance milestone
This commit is contained in:
@@ -1,17 +1,23 @@
|
||||
# contact_block_sliding
|
||||
|
||||
Small V4.3 sliding-friction example for two C3D8 elastic blocks.
|
||||
V5.3 nonmatching large-sliding mortar-friction benchmark for two elastic C3D8
|
||||
blocks.
|
||||
|
||||
Purpose:
|
||||
|
||||
- Exercise face-to-face contact with Coulomb friction.
|
||||
- Exercise face-to-face contact with Coulomb friction over multiple master
|
||||
facets.
|
||||
- Exercise `FRICTION_REGULARIZATION` inheritance from `*SURFACE INTERACTION`.
|
||||
- Check contact CSV friction work, accumulated slip and tangential force output.
|
||||
- Provide a compact sliding case for future contact history and tangent work.
|
||||
- Check contact CSV friction work, accumulated slip, stick/slip counters,
|
||||
tangential force output and active search statistics.
|
||||
- Provide the compact large-sliding benchmark used by CTest.
|
||||
|
||||
Model:
|
||||
|
||||
- Two 0.10 m x 0.10 m x 0.05 m C3D8 blocks.
|
||||
- Lower block: 0.40 m x 0.10 m x 0.05 m, split into four C3D8 elements on the
|
||||
contact face.
|
||||
- Upper block: 0.10 m x 0.10 m x 0.05 m, one C3D8 element starting near the
|
||||
left side of the lower master surface.
|
||||
- The upper block starts with 0.001 m initial penetration into the lower block.
|
||||
- The lower block is fixed, while the upper block is driven by a horizontal
|
||||
nodal force and compressed by the prescribed top-face z displacement.
|
||||
@@ -34,3 +40,8 @@ Check:
|
||||
```
|
||||
|
||||
The double-click script writes repeatable output to `results\auto_run`.
|
||||
|
||||
The checker verifies active contact on multiple candidates, four available
|
||||
master facets, accumulated sliding, stick/slip counters, positive frictional
|
||||
work, nonzero tangential force and VTK output. It also writes
|
||||
`sliding_profile.csv` in the result directory for benchmark inspection.
|
||||
|
||||
@@ -1,34 +1,49 @@
|
||||
*HEADING
|
||||
FemLite V4.3 two C3D8 blocks sliding friction contact example
|
||||
FemLite V5.3 nonmatching large-sliding mortar-friction benchmark
|
||||
*NODE
|
||||
1, -0.05, -0.05, -0.050
|
||||
2, 0.05, -0.05, -0.050
|
||||
3, 0.05, 0.05, -0.050
|
||||
4, -0.05, 0.05, -0.050
|
||||
5, -0.05, -0.05, 0.000
|
||||
6, 0.05, -0.05, 0.000
|
||||
7, 0.05, 0.05, 0.000
|
||||
8, -0.05, 0.05, 0.000
|
||||
9, -0.05, -0.05, -0.001
|
||||
10, 0.05, -0.05, -0.001
|
||||
11, 0.05, 0.05, -0.001
|
||||
12, -0.05, 0.05, -0.001
|
||||
13, -0.05, -0.05, 0.049
|
||||
14, 0.05, -0.05, 0.049
|
||||
15, 0.05, 0.05, 0.049
|
||||
16, -0.05, 0.05, 0.049
|
||||
1, -0.20, -0.05, -0.050
|
||||
2, -0.10, -0.05, -0.050
|
||||
3, 0.00, -0.05, -0.050
|
||||
4, 0.10, -0.05, -0.050
|
||||
5, 0.20, -0.05, -0.050
|
||||
6, -0.20, 0.05, -0.050
|
||||
7, -0.10, 0.05, -0.050
|
||||
8, 0.00, 0.05, -0.050
|
||||
9, 0.10, 0.05, -0.050
|
||||
10, 0.20, 0.05, -0.050
|
||||
11, -0.20, -0.05, 0.000
|
||||
12, -0.10, -0.05, 0.000
|
||||
13, 0.00, -0.05, 0.000
|
||||
14, 0.10, -0.05, 0.000
|
||||
15, 0.20, -0.05, 0.000
|
||||
16, -0.20, 0.05, 0.000
|
||||
17, -0.10, 0.05, 0.000
|
||||
18, 0.00, 0.05, 0.000
|
||||
19, 0.10, 0.05, 0.000
|
||||
20, 0.20, 0.05, 0.000
|
||||
21, -0.18, -0.05, -0.001
|
||||
22, -0.08, -0.05, -0.001
|
||||
23, -0.08, 0.05, -0.001
|
||||
24, -0.18, 0.05, -0.001
|
||||
25, -0.18, -0.05, 0.049
|
||||
26, -0.08, -0.05, 0.049
|
||||
27, -0.08, 0.05, 0.049
|
||||
28, -0.18, 0.05, 0.049
|
||||
*ELEMENT, TYPE=C3D8, ELSET=LOWER
|
||||
1, 1, 2, 3, 4, 5, 6, 7, 8
|
||||
1, 1, 2, 7, 6, 11, 12, 17, 16
|
||||
2, 2, 3, 8, 7, 12, 13, 18, 17
|
||||
3, 3, 4, 9, 8, 13, 14, 19, 18
|
||||
4, 4, 5, 10, 9, 14, 15, 20, 19
|
||||
*ELEMENT, TYPE=C3D8, ELSET=UPPER
|
||||
2, 9, 10, 11, 12, 13, 14, 15, 16
|
||||
5, 21, 22, 23, 24, 25, 26, 27, 28
|
||||
*ELSET, ELSET=ALLSOLID
|
||||
1, 2
|
||||
1, 2, 3, 4, 5
|
||||
*NSET, NSET=LOWER_ALL
|
||||
1, 2, 3, 4, 5, 6, 7, 8
|
||||
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20
|
||||
*NSET, NSET=UPPER_ALL
|
||||
9, 10, 11, 12, 13, 14, 15, 16
|
||||
21, 22, 23, 24, 25, 26, 27, 28
|
||||
*NSET, NSET=UPPER_TOP
|
||||
13, 14, 15, 16
|
||||
25, 26, 27, 28
|
||||
*MATERIAL, NAME=SOFT_SOLID
|
||||
*DENSITY
|
||||
1000.0
|
||||
@@ -43,7 +58,7 @@ UPPER_ALL, 2, 2, 0.0
|
||||
*BOUNDARY, AMPLITUDE=RAMP
|
||||
UPPER_TOP, 3, 3, -2.0E-3
|
||||
*CLOAD, AMPLITUDE=RAMP
|
||||
UPPER_ALL, 1, 50.0
|
||||
UPPER_ALL, 1, 80.0
|
||||
*SURFACE, NAME=LOWER_TOP, TYPE=ELEMENT
|
||||
LOWER, S2
|
||||
*SURFACE, NAME=UPPER_BOTTOM, TYPE=ELEMENT
|
||||
|
||||
@@ -5,6 +5,10 @@ import glob
|
||||
import os
|
||||
import sys
|
||||
|
||||
MIN_MASTER_FACETS = 4
|
||||
MIN_ACTIVE_CONTACTS = 2
|
||||
MIN_ACCUMULATED_SLIP = 1.0e-1
|
||||
|
||||
|
||||
def read_pair_rows(result_dir: str) -> list[dict[str, str]]:
|
||||
rows: list[dict[str, str]] = []
|
||||
@@ -14,6 +18,46 @@ def read_pair_rows(result_dir: str) -> list[dict[str, str]]:
|
||||
return rows
|
||||
|
||||
|
||||
def write_sliding_profile(result_dir: str, rows: list[dict[str, str]]) -> str:
|
||||
profile_path = os.path.join(result_dir, "sliding_profile.csv")
|
||||
fieldnames = [
|
||||
"sample",
|
||||
"active_count",
|
||||
"stick_count",
|
||||
"slip_count",
|
||||
"accumulated_slip",
|
||||
"friction_work_total",
|
||||
"tangential_force",
|
||||
"gap_residual",
|
||||
"aug_lambda",
|
||||
"search_masters",
|
||||
"search_active",
|
||||
]
|
||||
with open(profile_path, "w", newline="") as stream:
|
||||
writer = csv.DictWriter(stream, fieldnames=fieldnames)
|
||||
writer.writeheader()
|
||||
for index, row in enumerate(rows):
|
||||
ftx = float(row["ftx"])
|
||||
fty = float(row["fty"])
|
||||
ftz = float(row["ftz"])
|
||||
writer.writerow(
|
||||
{
|
||||
"sample": index,
|
||||
"active_count": int(float(row["active_count"])),
|
||||
"stick_count": int(float(row["stick_count"])),
|
||||
"slip_count": int(float(row["slip_count"])),
|
||||
"accumulated_slip": float(row["accumulated_slip"]),
|
||||
"friction_work_total": float(row["friction_work_total"]),
|
||||
"tangential_force": (ftx * ftx + fty * fty + ftz * ftz) ** 0.5,
|
||||
"gap_residual": float(row["gap_residual"]),
|
||||
"aug_lambda": float(row["aug_lambda"]),
|
||||
"search_masters": int(float(row.get("search_masters", "0") or "0")),
|
||||
"search_active": int(float(row.get("search_active", "0") or "0")),
|
||||
}
|
||||
)
|
||||
return profile_path
|
||||
|
||||
|
||||
def main() -> int:
|
||||
result_dir = sys.argv[1] if len(sys.argv) > 1 else "results"
|
||||
pair_rows = read_pair_rows(result_dir)
|
||||
@@ -21,22 +65,44 @@ def main() -> int:
|
||||
print("no contact pair rows found")
|
||||
return 1
|
||||
|
||||
profile_path = write_sliding_profile(result_dir, pair_rows)
|
||||
max_active = max(int(float(row["active_count"])) for row in pair_rows)
|
||||
max_stick_count = max(int(float(row["stick_count"])) for row in pair_rows)
|
||||
max_slip_count = max(int(float(row["slip_count"])) for row in pair_rows)
|
||||
max_slip = max(float(row["accumulated_slip"]) for row in pair_rows)
|
||||
max_fric_work = max(float(row["friction_work_total"]) for row in pair_rows)
|
||||
min_fric_work = min(float(row["friction_work_total"]) for row in pair_rows)
|
||||
max_ft = max(abs(float(row["ftx"])) for row in pair_rows)
|
||||
max_ft = max(
|
||||
(
|
||||
float(row["ftx"]) ** 2
|
||||
+ float(row["fty"]) ** 2
|
||||
+ float(row["ftz"]) ** 2
|
||||
)
|
||||
** 0.5
|
||||
for row in pair_rows
|
||||
)
|
||||
max_reg = max(float(row["friction_regularization"]) for row in pair_rows)
|
||||
max_masters = max(int(float(row.get("search_masters", "0") or "0")) for row in pair_rows)
|
||||
max_search_active = max(int(float(row.get("search_active", "0") or "0")) for row in pair_rows)
|
||||
|
||||
if max_active <= 0:
|
||||
if max_active < MIN_ACTIVE_CONTACTS:
|
||||
print("sliding contact did not activate")
|
||||
return 1
|
||||
if max_masters < MIN_MASTER_FACETS:
|
||||
print("large-sliding master surface did not expose four contact facets")
|
||||
return 1
|
||||
if max_search_active < MIN_ACTIVE_CONTACTS:
|
||||
print("large-sliding search did not retain multiple active candidates")
|
||||
return 1
|
||||
if max_reg <= 0.0:
|
||||
print("friction regularization was not reported")
|
||||
return 1
|
||||
if max_slip <= 0.0 or max_ft <= 0.0:
|
||||
if max_slip < MIN_ACCUMULATED_SLIP or max_ft <= 0.0:
|
||||
print("frictional sliding response was not detected")
|
||||
return 1
|
||||
if max_slip_count <= 0 or max_stick_count <= 0:
|
||||
print("stick/slip transition counters were not reported")
|
||||
return 1
|
||||
if min_fric_work < -1.0e-12 or max_fric_work <= 0.0:
|
||||
print("friction work is not positive dissipative")
|
||||
return 1
|
||||
@@ -45,10 +111,12 @@ def main() -> int:
|
||||
return 1
|
||||
|
||||
print(
|
||||
"ok: max_active={}, max_slip={:.6e}, max_ft={:.6e}, max_friction_work={:.6e}".format(
|
||||
max_active, max_slip, max_ft, max_fric_work
|
||||
"ok: max_active={}, max_masters={}, max_slip={:.6e}, max_ft={:.6e}, "
|
||||
"max_friction_work={:.6e}".format(
|
||||
max_active, max_masters, max_slip, max_ft, max_fric_work
|
||||
)
|
||||
)
|
||||
print(f"wrote {profile_path}")
|
||||
return 0
|
||||
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ del /Q "%OUT_DIR%\elements_*.csv" 2>nul
|
||||
del /Q "%OUT_DIR%\reactions_*.csv" 2>nul
|
||||
del /Q "%OUT_DIR%\contact_*.csv" 2>nul
|
||||
del /Q "%OUT_DIR%\result_*.vtk" 2>nul
|
||||
del /Q "%OUT_DIR%\sliding_profile.csv" 2>nul
|
||||
|
||||
echo Running FemLite...
|
||||
"%EXE%" "%INP%" --output-dir "%OUT_DIR%" --output-interval 10 --run
|
||||
|
||||
Reference in New Issue
Block a user