Files
shenw 0440ed5a64
FemLite CI / build-test (push) Has been cancelled
Release FemLite 0.6.4
2026-07-05 17:23:34 +08:00

54 lines
1.4 KiB
Batchfile

@echo off
setlocal
set "CASE_DIR=%~dp0"
set "ROOT_DIR=%CASE_DIR%..\.."
set "EXE=%ROOT_DIR%\build-win-gcc-16\femlite.exe"
set "PYTHON=%ROOT_DIR%\Python\.venv\Scripts\python.exe"
set "INP=%CASE_DIR%two_blocks_compression.inp"
set "OUT_DIR=%CASE_DIR%results\auto_run"
echo FemLite contact_two_blocks_compression
echo.
if not exist "%EXE%" (
echo femlite.exe was not found. Trying to build build-win-gcc-16...
cmake --build "%ROOT_DIR%\build-win-gcc-16" --config Release
if errorlevel 1 goto fail
)
if not exist "%OUT_DIR%" mkdir "%OUT_DIR%"
del /Q "%OUT_DIR%\history.csv" 2>nul
del /Q "%OUT_DIR%\nodes_*.csv" 2>nul
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_*.vtu" 2>nul
del /Q "%OUT_DIR%\results.pvd" 2>nul
del /Q "%OUT_DIR%\pressure_profile.csv" 2>nul
echo Running FemLite...
"%EXE%" "%INP%" --output-dir "%OUT_DIR%" --output-interval 10 --run
if errorlevel 1 goto fail
if exist "%PYTHON%" (
echo.
echo Checking results...
"%PYTHON%" "%CASE_DIR%check_contact_results.py" "%OUT_DIR%"
if errorlevel 1 goto fail
) else (
echo.
echo Python virtual environment not found; skipping result checker.
)
echo.
echo Case completed successfully.
if not "%FEMLITE_NO_PAUSE%"=="1" pause
exit /b 0
:fail
echo.
echo Case failed.
if not "%FEMLITE_NO_PAUSE%"=="1" pause
exit /b 1