mesh-generation

Plan mesh resolution and assess quality for PDE simulations.

61|4|Updated Dec 24, 2025
One-click install
npx skills add https://github.com/HeshamFS/materials-simulation-skills --skill mesh-generation
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mesh-generation
Source: https://github.com/HeshamFS/materials-simulation-skills/tree/main/skills/core-numerical/mesh-generation
Command: npx skills add https://github.com/HeshamFS/materials-simulation-skills --skill mesh-generation

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill provides a repeatable workflow to plan mesh resolution, assess mesh quality (aspect ratio, skewness, orthogonality), and guide adaptive refinement for PDE discretizations, helping you achieve reliable accuracy without over-refinement.

Core Features & Use Cases

  • Resolution planning: Estimate dx and cell counts from domain size and feature scales.
  • Quality assessment: Check aspect ratio, skewness, and orthogonality to ensure stable solvers.
  • Refinement guidance: Inform adaptive mesh refinement decisions to balance accuracy and cost.
  • Use Case: For a 2D domain of size 1x1 m, plan the grid to resolve interfaces with at least 5 points across the feature.

Quick Start

Example commands to compute grid sizing and evaluate mesh quality: python3 scripts/grid_sizing.py --length 1.0 --resolution 1000 --json python3 scripts/mesh_quality.py --dx 0.01 --dy 0.01 --dz 0.01 --json

Frequently Asked Questions about mesh-generation

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I plan mesh resolution for PDE simulations?

Mesh resolution planning estimates grid spacing (dx) and cell counts based on domain size and feature scales. Use the grid_sizing.py script with your domain length and desired resolution to compute appropriate discretization that resolves critical features with sufficient points across interfaces, ensuring simulation accuracy without over-refinement.

What mesh quality metrics should I check before running a solver?

Aspect ratio, skewness, and orthogonality are critical quality metrics that affect solver stability and convergence. The mesh_quality.py script evaluates these metrics to identify problematic cells; high skewness or poor aspect ratios can cause numerical instability, so checking these before simulation prevents divergence and accuracy loss.

How do I decide where to refine a mesh adaptively?

Adaptive mesh refinement balances accuracy and computational cost by refining regions where errors are largest. This workflow provides guidance by assessing current mesh quality and feature resolution, helping you identify under-resolved areas and determine optimal refinement locations to improve solution accuracy efficiently.

Can I use this workflow for complex 3D geometries with boundary layers?

Yes, this workflow supports simple to complex geometries in 2D and 3D, including boundary layer handling. It evaluates feature size and aspect ratio across domains, allowing you to plan appropriate mesh spacing near walls and in bulk regions to capture both thin boundary layers and far-field behavior accurately.

What are the computational requirements to run mesh planning and validation?

This workflow requires Python 3.8+ with no external dependencies, making it lightweight and portable across systems. CLI scripts produce structured JSON or human-readable output, supporting rapid iteration on mesh parameters without installing specialized meshing libraries or solvers.

How do I validate that my discretization resolves a specific feature?

Resolution planning ensures features are resolved by calculating the number of grid points across a characteristic length scale. By specifying feature size and desired point count (typically 5+ points minimum), you verify that your chosen dx is fine enough to capture the physics accurately without unnecessary over-refinement.