Skip to content

Echo-aloha/asphalt-codex-skills-5 / skills/pfc-postprocessing

pfc-postprocessing

Verified

Post-process PFC 5.0 asphalt CSV and image exports into reproducible curves, fields, rose diagrams, animations, and summary tables without relying on a local PFC installation.

FileKindSize
LICENSEother1.1 KB
NOTICE.mdmarkdown725 B
SKILL.mdskill md4.4 KB
agents/openai.yamlconfig300 B
examples/README.mdmarkdown379 B
examples/animation_case/README.mdmarkdown811 B
examples/animation_case/raw_frames/jieguo_1.pngbinary1.3 KB
examples/animation_case/raw_frames/jieguo_2.pngbinary1.4 KB
examples/animation_case/raw_frames/jieguo_3.pngbinary1.4 KB
examples/animation_case/raw_frames/jieguo_4.pngbinary1.3 KB
examples/animation_case/raw_frames/jieguo_5.pngbinary1.4 KB
examples/animation_case/raw_frames/jieguo_6.pngbinary1.4 KB
examples/animation_case/raw_frames/jieguo_7.pngbinary1.4 KB
examples/animation_case/raw_frames/jieguo_8.pngbinary1.4 KB
examples/minimal_case/README.mdmarkdown871 B
examples/minimal_case/data/plotdata_ball_fields.csvother334 B
examples/minimal_case/data/plotdata_fracture_orientations.csvother117 B
examples/minimal_case/data/plotdata_porosity.csvother100 B
examples/minimal_case/data/plotdata_stress.csvother188 B
examples/minimal_case/data/rutting_history.csvother786 B
examples/minimal_case/data/rutting_shear_profile.csvother577 B
examples/minimal_case/data/stress_strain.csvother95 B
examples/plugin_migration_case/legacy_ball_export.datother127 B
examples/plugin_migration_case/legacy_contact_export.txtmarkdown222 B
references/animation-workflow.mdmarkdown633 B
references/data-contract.mdmarkdown2.5 KB
references/overview.mdmarkdown1.6 KB
references/plugin-migration.mdmarkdown1.6 KB
references/script-catalog.mdmarkdown3.6 KB
references/ucs-3d-surface-lollipop.mdmarkdown4.7 KB
scripts/README.mdmarkdown3.5 KB
scripts/_common.pyscript1.9 KB
scripts/convert_legacy_ball_export.pyscript1.4 KB
scripts/convert_legacy_contact_export.pyscript1.5 KB
scripts/export_animation.pyscript1.4 KB
scripts/export_animation_frames.pyscript1.3 KB
scripts/plot_curves.pyscript2.3 KB
scripts/plot_fields.pyscript3.8 KB
scripts/plot_nature_ball_displacement_vectors.pyscript5.9 KB
scripts/plot_nature_ball_velocity_vectors.pyscript5.3 KB
scripts/plot_porosity_3d_surface_zhongguo.pyscript6.7 KB
scripts/plot_rose.pyscript1.9 KB
scripts/plot_rutting_evidence.pyscript7.1 KB
scripts/plot_ucs_3d_surface_lollipop.pyscript9.1 KB
scripts/run_demo.pyscript5.5 KB

scripts/run_demo.py

View on GitHub
from __future__ import annotations

import argparse
import csv
import importlib.util
from pathlib import Path
import shutil
import subprocess
import sys


ROOT = Path(__file__).resolve().parents[1]
SCRIPTS = ROOT / "scripts"
EXAMPLES = ROOT / "examples"
DEMO_OUT = EXAMPLES / "demo_outputs"
MINIMAL_FILES = {
    "stress_strain.csv": {"strain", "stress_mpa"},
    "plotdata_ball_fields.csv": {"x", "y", "disp_x", "disp_y", "vel_x", "vel_y", "radius"},
    "plotdata_stress.csv": {"x", "y", "stress_xx", "stress_yy", "stress_xy"},
    "plotdata_porosity.csv": {"x", "y", "porosity"},
    "plotdata_fracture_orientations.csv": {"angle_deg"},
    "rutting_history.csv": {
        "solver_time_s",
        "equivalent_physical_time_s",
        "time_scale_lambda",
        "solver_cycle",
        "one_way_pass",
        "round_trip",
        "commanded_vertical_n",
        "vertical_reaction_n",
        "commanded_horizontal_n",
        "horizontal_reaction_n",
        "rut_depth_mm",
        "forward_face_deformation_mm",
        "reverse_face_deformation_mm",
        "lateral_heave_mm",
        "surrogate_route",
    },
    "rutting_shear_profile.csv": {
        "sample_id",
        "depth_mid_mm",
        "shear_component",
        "shear_stress_mpa",
        "measure_radius_mm",
        "weighting_rule",
    },
}


def run(*args: str) -> None:
    subprocess.run([sys.executable, *args], check=True)


def validate_inputs() -> None:
    minimal = EXAMPLES / "minimal_case" / "data"
    for name, required in MINIMAL_FILES.items():
        path = minimal / name
        if not path.is_file():
            raise FileNotFoundError(f"missing demo input: {path}")
        with path.open("r", encoding="utf-8", newline="") as handle:
            fields = set(next(csv.reader(handle), []))
        missing = sorted(required - fields)
        if missing:
            raise ValueError(f"{name} missing columns: {', '.join(missing)}")
    if not (EXAMPLES / "plugin_migration_case" / "legacy_contact_export.txt").is_file():
        raise FileNotFoundError("missing legacy contact demo input")
    if not (EXAMPLES / "plugin_migration_case" / "legacy_ball_export.dat").is_file():
        raise FileNotFoundError("missing legacy ball demo input")
    if not list((EXAMPLES / "animation_case" / "raw_frames").glob("*.png")):
        raise FileNotFoundError("missing animation demo frames")


def require_runtime_dependencies() -> None:
    required = ["numpy", "pandas", "matplotlib", "scipy", "imageio", "PIL"]
    missing = [name for name in required if importlib.util.find_spec(name) is None]
    if missing:
        raise SystemExit(
            "Missing demo dependencies: "
            + ", ".join(missing)
            + ". Install the package requirements.txt in an isolated environment."
        )


def main() -> None:
    parser = argparse.ArgumentParser(description="Run or validate the public post-processing demo")
    parser.add_argument(
        "--check-only",
        action="store_true",
        help="validate bundled inputs without plotting dependencies or output writes",
    )
    args = parser.parse_args()

    validate_inputs()
    if args.check_only:
        run(
            str(SCRIPTS / "plot_rutting_evidence.py"),
            "--input-dir",
            str(EXAMPLES / "minimal_case" / "data"),
            "--output-dir",
            str(DEMO_OUT / "figures"),
            "--check-only",
        )
        print("demo inputs: ok")
        return
    require_runtime_dependencies()

    if DEMO_OUT.exists():
        shutil.rmtree(DEMO_OUT)
    (DEMO_OUT / "figures").mkdir(parents=True, exist_ok=True)
    (DEMO_OUT / "animations").mkdir(parents=True, exist_ok=True)
    (DEMO_OUT / "tables").mkdir(parents=True, exist_ok=True)

    minimal = EXAMPLES / "minimal_case" / "data"
    plugin = EXAMPLES / "plugin_migration_case"
    anim = EXAMPLES / "animation_case" / "raw_frames"

    run(str(SCRIPTS / "plot_curves.py"), "--input-dir", str(minimal), "--output-dir", str(DEMO_OUT / "figures"), "--case-name", "minimal_case", "--stage", "demo")
    run(str(SCRIPTS / "plot_fields.py"), "--input-dir", str(minimal), "--output-dir", str(DEMO_OUT / "figures"), "--case-name", "minimal_case", "--stage", "demo")
    run(str(SCRIPTS / "plot_rose.py"), "--input-dir", str(minimal), "--output-dir", str(DEMO_OUT / "figures"), "--case-name", "minimal_case", "--stage", "demo")
    run(str(SCRIPTS / "plot_rutting_evidence.py"), "--input-dir", str(minimal), "--output-dir", str(DEMO_OUT / "figures"), "--case-name", "minimal_intersection_rutting", "--stage", "demo")

    converted = DEMO_OUT / "converted_plugin"
    run(str(SCRIPTS / "convert_legacy_contact_export.py"), "--input-file", str(plugin / "legacy_contact_export.txt"), "--output-dir", str(converted))
    run(str(SCRIPTS / "plot_rose.py"), "--input-dir", str(converted), "--output-dir", str(DEMO_OUT / "figures"), "--case-name", "plugin_contact_case", "--stage", "demo")

    run(str(SCRIPTS / "convert_legacy_ball_export.py"), "--input-file", str(plugin / "legacy_ball_export.dat"), "--output-dir", str(converted))
    run(str(SCRIPTS / "plot_fields.py"), "--input-dir", str(converted), "--output-dir", str(DEMO_OUT / "figures"), "--case-name", "plugin_ball_case", "--stage", "demo")

    ordered = DEMO_OUT / "ordered_frames"
    run(str(SCRIPTS / "export_animation_frames.py"), "--input-dir", str(anim), "--output-dir", str(ordered), "--glob", "*.png")
    run(str(SCRIPTS / "export_animation.py"), "--input-dir", str(ordered), "--output-dir", str(DEMO_OUT / "animations"), "--stem", "demo_animation", "--fps", "4")
    print(DEMO_OUT)


if __name__ == "__main__":
    main()
deprecation-and-migrationaddyosmani/agent-skillsManages deprecation and migration. Use when removing old systems, APIs, or features. Use when migrating users from one implementation to another. Use when migrating a database schema in production, such as renaming or dropping a column without downtime (expand/contract). Use when deciding whether to maintain or sunset existing code.Stars: 119kUpdated Claude CodeCodexVerifiedInstall
performance-optimizationaddyosmani/agent-skillsOptimizes application performance across frontend, backend, queries, and databases. Use when performance requirements exist, when you suspect performance regressions, when Core Web Vitals or load times need improvement, when N+1 query patterns need fixing, or when profiling reveals bottlenecks.Stars: 119kUpdated Claude CodeCodexVerifiedInstall
Agent Cost Reportthedotmack/claude-memBelievable agent cost report for any period, default the last 7 full days PT, not counting today. Measured tokens from Claude Code transcripts priced at OpenRouter list prices (ESTIMATED), measured provider spend when a sanctioned source exists, note-taker cost separate, Timing-style HTML/PDF plus report.json, line-items.csv, evidence.json.Stars: 118kUpdated Claude CodeCodexVerifiedInstall
Agent Cost Reportthedotmack/claude-memBelievable agent cost report for any period, default the last 7 full days PT, not counting today. Measured tokens from Claude Code transcripts priced at OpenRouter list prices (ESTIMATED), measured provider spend when a sanctioned source exists, note-taker cost separate, Timing-style HTML/PDF plus report.json, line-items.csv, evidence.json.Stars: 118kUpdated Claude CodeCodexVerifiedInstall