/simulacion-numerica:mesh-generationfrom Simulación numérica
Estimates grid resolution from physics scales, checks mesh quality, and selects mesh type for CFD/FEA simulations. Use when setting up a mesh or diagnosing solver convergence issues.
Ships in Simulación numérica. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Provide a consistent workflow for selecting mesh resolution and checking mesh quality for PDE simulations.
| Input | Description | Example |
|---|---|---|
| Domain size | Physical dimensions | 1.0 × 1.0 m |
| Feature size | Smallest feature to resolve | 0.01 m |
| Points per feature | Resolution requirement | 10 points |
| Aspect ratio limit | Maximum dx/dy ratio | 5:1 |
| Quality threshold | Skewness limit | < 0.8 |
What is the smallest feature size?
├── Interface width → dx ≤ width / 5
├── Boundary layer → dx ≤ layer_thickness / 10
├── Wave length → dx ≤ lambda / 20
└── Diffusion length → dx ≤ sqrt(D × dt) / 2
| Problem | Recommended Mesh |
|---|---|
| Simple geometry, uniform | Structured Cartesian |
| Complex geometry | Unstructured triangular/tetrahedral |
| Boundary layers | Hybrid (structured near walls) |
| Adaptive refinement | Quadtree/Octree or AMR |
All scripts emit a top-level object with inputs (the echoed CLI values) and
results (the computed fields below). Index as result["results"]["..."].
| Script | results Fields |
|---|---|
scripts/grid_sizing.py | dx, counts (list of per-dimension cell counts, length == dims), notes |
scripts/mesh_quality.py | aspect_ratio, skewness, size_anisotropy, quality_flags, dims, notes |
mesh_quality.py describes axis-aligned (orthogonal Cartesian) cells defined
purely by edge spacings. For such cells every interior angle is 90°, so the true
angular skewness is always 0.0 and high_skewness is never flagged.
Cell elongation is reported separately via aspect_ratio and the redundant
convenience field size_anisotropy (= 1 - 1/aspect_ratio).
scripts/grid_sizing.pyscripts/mesh_quality.pyUser: I need to mesh a 1mm × 1mm domain for a phase-field simulation with interface width of 10 μm.
Agent workflow:
python3 scripts/grid_sizing.py --length 0.001 --resolution 200 --json
# Compute grid sizing for 1D domain
python3 scripts/grid_sizing.py --length 1.0 --resolution 200 --json
# Check mesh quality (3D cell)
python3 scripts/mesh_quality.py --dx 1.0 --dy 0.5 --dz 0.5 --json
# High aspect ratio check (2D cell; --dz omitted is treated as 2D)
python3 scripts/mesh_quality.py --dx 1.0 --dy 0.1 --json
All validation errors are written to stderr and the script exits with code 2.
| Error message | Cause | Resolution |
|---|---|---|
length must be positive, got ... | Non-positive domain size | Use a positive value |
resolution must be positive, got ... | Non-positive resolution (resolution=1 is a valid single-cell mesh) | Use a positive integer |
dims must be one of (1, 2, 3), got ... | Unsupported dimension count | Use 1, 2, or 3 |
<name> must be a finite positive number, got ... | dx/dy/dz not finite or not positive | Use a finite positive value |
<name> exceeds maximum (...), got ... | Input above the resource-exhaustion bound | Use a smaller value |
| Aspect Ratio | Quality | Impact |
|---|---|---|
| 1:1 | Excellent | Optimal accuracy |
| 1:1 - 3:1 | Good | Acceptable |
| 3:1 - 5:1 | Fair | May affect accuracy |
| > 5:1 | Poor | Solver issues likely |
Skewness is the angular deviation from the ideal cell shape
(max(|90° - θ_i|) / 90° for quads/hexes — see references/quality_metrics.md).
mesh_quality.py works from axis-aligned edge spacings, which describe
orthogonal Cartesian cells whose interior angles are all exactly 90°; it
therefore always reports skewness = 0.0 for these cells. The thresholds below
apply when a genuine skewness value is obtained from real cell-corner geometry
(e.g. from an unstructured mesh), not from dx/dy/dz spacings.
| Skewness | Quality | Impact |
|---|---|---|
| 0 - 0.25 | Excellent | Optimal |
| 0.25 - 0.50 | Good | Acceptable |
| 0.50 - 0.80 | Fair | May affect accuracy |
| > 0.80 | Poor | Likely problems |
Note: cell elongation is not skewness. An anisotropic but orthogonal cell (e.g. a wall-aligned boundary-layer cell) has high
aspect_ratio/size_anisotropybut zero skewness, and is often perfectly acceptable.
| Application | Points per Feature |
|---|---|
| Phase-field interface | 5-10 |
| Boundary layer | 10-20 |
| Shock | 3-5 (with capturing) |
| Wave propagation | 10-20 per wavelength |
| Smooth gradients | 5-10 |
dx and counts from grid_sizing.py --json and confirmed the smallest physical feature gets enough points (interface ≥5×dx, boundary layer ≥10×dx, wavelength ≥20×dx per Resolution Selection above).grid_sizing.py once per differing edge length (or applied --dx per axis) — did NOT apply a single --length-derived count to unequal edges.notes field for "Grid does not fully cover length" and resolved any partial-coverage warning before trusting counts.aspect_ratio and quality_flags from mesh_quality.py --json; confirmed high_aspect_ratio is absent OR that the elongation is intentional and physics-aligned (e.g. wall-aligned boundary-layer cell with AR≤100 along the wall).skewness = 0.0 is the expected orthogonal-Cartesian result, NOT a measured quality pass — for unstructured/non-orthogonal cells, obtained a real angle-based skewness from cell-corner geometry and checked it against the <0.8 threshold.dx also satisfies the solver's stability constraint (cross-check with numerical-stability) before committing to the resolution.| Tempting shortcut | Why it's wrong / what to do |
|---|---|
"skewness came back 0.0, so the mesh quality is fine." | mesh_quality.py always returns skewness = 0.0 for axis-aligned spacings — it is a definitional property of orthogonal cells, not a measurement. Real skewness needs cell-corner angles from an unstructured mesh; don't read 0.0 as a passing quality check. |
| "Two grids gave nearly the same answer, so the mesh is converged." | Two grids cannot establish the observed order or the asymptotic range. Use ≥3 successively refined grids and confirm the quantity of interest is converging before quoting any result as mesh-independent. |
"High aspect_ratio was flagged, so the cell is bad." | Elongation is not skewness. A wall-aligned boundary-layer cell with AR up to ~100 is acceptable when aligned with the flow/field; check size_anisotropy and the physics, not just the high_aspect_ratio flag. |
"I'll set one --length and reuse the counts for all axes." | grid_sizing.py is isotropic per call — it applies the single derived count to every dimension. For unequal edges this over/under-resolves axes; run it per edge length or supply --dx per axis. |
"dx = length/resolution resolves my feature because resolution is large." | Points-per-domain is not points-per-feature. A fine global dx can still place too few cells across a thin interface/layer; check feature_size / dx against the Resolution Guidelines (5-10 for interfaces, 10-20 for boundary layers). |
| "The mesh is fine enough, so I can ignore the time step." | Mesh resolution and temporal stability are coupled: shrinking dx tightens explicit CFL/diffusion limits. A refined mesh that violates the solver's stability constraint diverges — re-check dt against numerical-stability after any refinement. |
length, resolution, dx, dy, dz) are validated as finite positive numbers with upper bounds to prevent resource exhaustiondims is restricted to {1, 2, 3}argparse type parameters reject non-numeric input at the CLI boundary before any processing occursallowed-tools excludes Bash to prevent the agent from executing arbitrary commands when processing user-provided inputseval(), exec(), or dynamic code generationshell=True)Read and Write to prepare inputs and capture outputs rather than constructing shell commands from user textgrid_sizing.py takes a single --length and applies the resulting count to every dimension. For an anisotropic domain (e.g. 10 cm × 5 cm), run it once per differing edge length, or compute dx from physics and apply it per axis (e.g. --length 0.10 --dx 5e-5, then --length 0.05 --dx 5e-5).references/mesh_types.md - Structured vs unstructuredreferences/quality_metrics.md - Aspect ratio/skewness thresholdssize_anisotropy, made mesh_quality.py --dz optional (2D cells), fixed grid_sizing off-by-one for resolution-derived counts, surfaced dx-override note, corrected output/error-handling docsWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
mesh-generation, numerical-simulation, cfd, fea, grid-resolution, mesh-quality
2 plugins ship this exact skill · first indexed Jun 25, 2026
17 skills in this plugin
/benchmark-and-mms-plannerPlan verification and validation campaigns for simulation codes using manufactured solutions, canonical benchmark problems, grid/time refinement, uncertainty propagation, and pass/fail acceptance criteria. Use when an agent needs to prove a solver, model, or result is trustworthy rather than only plausible.
/convergence-studyPerform spatial and temporal convergence analysis for solution verification — compute observed convergence orders from grid or timestep refinement studies, apply Richardson extrapolation to estimate discretization error, and calculate the Grid Convergence Index (GCI) per ASME V&V 20 standards. Use when verifying that a numerical solution converges at the expected rate, estimating the error on the finest mesh, checking whether grids are in the asymptotic range, or preparing formal verification reports, even if the user only asks "is my mesh fine enough" or "how accurate is my solution."
/differentiation-schemesSelect and apply numerical differentiation schemes for PDE and ODE discretization — generate finite-difference stencils at arbitrary order and accuracy, choose between central, upwind, compact (Pade), and spectral methods, handle boundary stencils, and estimate truncation error scaling. Use when discretizing spatial derivatives, picking a scheme for advection- or diffusion-dominated problems, building custom stencils for nonstandard operators, or comparing dispersion and dissipation properties of candidate schemes, even if the user just says "how do I approximate this derivative" or "my solution is too diffusive."
/linear-solversSelect and configure linear solvers for Ax=b systems arising in numerical simulations — choose between direct (LU, Cholesky) and iterative (CG, GMRES, BiCGSTAB, MINRES) methods, analyze sparsity patterns and matrix conditioning, recommend preconditioners (AMG, ILU, IC), apply row/column scaling, and diagnose convergence stagnation from residual histories. Use when setting up a linear solve for FEM/FVM assembly, debugging slow or stalled Krylov iterations, choosing a preconditioner for SPD or nonsymmetric systems, or investigating ill-conditioning, even if the user only says "my solver is slow" or "GMRES won't converge."
/md-analysis-plannerPlan molecular dynamics post-processing for materials simulations, including RDF, MSD and diffusion, VACF/VDOS, coordination numbers, bond-angle distributions, stress-strain curves, equilibration detection, PBC unwrapping, and trajectory format choices. Use before writing MD analysis scripts or trusting trajectory-derived results.
/nonlinear-solversSelect and configure nonlinear solvers for root-finding f(x)=0, optimization min F(x), and least-squares problems — choose among Newton, Newton-Krylov, quasi-Newton (BFGS, L-BFGS), Broyden, Anderson acceleration, and Levenberg-Marquardt methods, configure line search or trust-region globalization, diagnose convergence rate (quadratic, linear, stagnated), and assess Jacobian quality and conditioning. Use when a Newton solver converges slowly or diverges, choosing between line search and trust region, debugging nonlinear iteration failures in FEM or phase-field codes, or selecting a solver for large-scale unconstrained optimization, even if the user only says "my Newton iterations aren't converging."
npx claudepluginhub lagzgabrielmuller-dot/kit-ingenieria-3d --plugin simulacion-numericaOther plugins' skills for the same job