| name | vibeflow-freefem |
| description | Use when preparing, running, debugging, post-processing, or extending VibeFlow/VibeCAE FreeFEM finite-element scripting workflows from 0-caseDict/caseDict, including .edp PDE scripts, variational formulations, mesh generation/import, boundary labels, parameter studies, MPI runs, and reusable PDE/FEM prototyping templates. |
VibeFlow FreeFEM
This skill is responsible for using FreeFEM as VibeCAE's scriptable finite-element backend for rapid PDE/FEM prototyping and numerical-method validation.
- Usage mode: generate
.edp scripts from caseDict, run FreeFEM, and output fields and charts.
- Development mode: develop reusable variational-form templates, PDE prototypes, mesh importers, parameter sweeps, and post-processing scripts.
When to Use
- A PDE/FEM variational form needs to be implemented quickly, such as Poisson, elasticity, Stokes/Navier-Stokes, heat conduction, wave, optimization, or inverse problems.
- Weak forms need to be expressed more flexibly than in general-purpose FEM software.
- A mathematical method needs to be verified on a small model before being migrated to Elmer, Code_Aster, MOOSE, or OpenFOAM.
First Decide: Usage Mode or Development Mode
- Current PDE prototyping, case execution, and post-processing: use usage mode.
- General
.edp templates, weak-form libraries, parameter sweeps, or mesh interfaces are needed: use development mode.
- If FreeFEM commands are unavailable or the MPI version is abnormal: switch to
vibeflow-toolchain first.
What to Read First
- Equations, variables, boundary conditions, material coefficients, objective functionals, and outputs in
0-caseDict/caseDict.
references/freefem-playbook.md
references/freefem-practical-tips.md: software knowledge base, key concepts, failure interpretation, and adapter design points.
B-mesh/ or existing .msh, .mesh, and .edp files.
Inputs
0-caseDict/caseDict
.edp scripts, mesh files, boundary labels, and parameter tables
Outputs
C-run/freefem/case-*/main.edp
C-run/freefem/case-*/Allrun / Allclean
- VTU/VTK files, CSV files, logs, and charts
D-post/freefem_postprocess.py
Recommended Structure
C-run/freefem/
└── case-1/
├── main.edp
├── meshes/
├── includes/
├── logs/
├── results/
├── Allrun
└── Allclean
Usage Mode Workflow
- Convert
caseDict into a weak form: unknowns, test functions, finite-element spaces, boundary labels, source terms, material coefficients, and outputs.
- Generate or import the mesh, and check that labels match the boundary conditions.
- Write
main.edp, concentrating parameters at the top of the script or in include files.
- Run a short script and check parsing, matrix assembly, boundary application, and output.
- Save result files and post-process them with Python or ParaView.
- Write mathematical assumptions, discretization order, mesh status, and result status back to
caseDict.
Development Mode Workflow
- Define the development target: weak-form template, solver selection, mesh importer, parameter sweep, error estimator, or parallel script.
- Write development notes first, recording variables, function spaces, boundary conditions, linear/nonlinear solvers, and validation problems.
- Templates must provide a minimal runnable example and parameter descriptions.
- For a new weak form, verify it with an analytical solution or convergence-order test whenever possible.
- If it will be migrated to an engineering backend, preserve variable and boundary-name mappings.
Core Rules
- FreeFEM is a mathematical prototyping tool and flexible FEM backend; it must not hide the physical completeness required by engineering solvers.
- Weak forms, boundary terms, sign conventions, and units must be clearly stated.
- Boundary labels are the key interface and must align with the mesh and
caseDict.
- Outputs must be machine-readable and must not rely only on interactive windows.
Validation
- The FreeFEM executable is available.
.edp runs without errors.
- Output files exist and variable names are correct.
- A simple sanity check or benchmark solution passes.
Fallback Rules
- Equations or boundary conditions are unclear: return to
vibeflow-case-dict
- Mesh labels are unclear: return to the mesh stage
- Environment is unavailable: return to
vibeflow-toolchain