# meep-getting-started > resolution = 20 dpml = 1.0 - Author: Tao E. Li - Repository: TEL-Research-Group/meep - Version: 20260207225459 - Stars: 0 - Forks: 0 - Last Updated: 2026-02-08 - Source: https://github.com/TEL-Research-Group/meep - Web: https://mule.run/skillshub/@@TEL-Research-Group/meep~meep-getting-started:20260207225459 --- --- name: meep-getting-started description: Quickstart Meep/PyMeep usage: choose Python vs Scheme vs C++, set units, build a minimal simulation (cell/geometry/source/PML/run), and avoid common first-run pitfalls. --- # meep: Getting Started ## Route The Question - Installation/build issues: use `meep-build-and-install`. - Time-stepping / outputs / stopping conditions / parallel runs: use `meep-simulation-workflows`. - Flux/DFT/near2far/eigenmodes/adjoint/frequency-domain solver: use `meep-api-and-scripting`. - Geometry/material modeling (dispersion, smoothing, symmetry, GDS): use `meep-inputs-and-modeling`. ## Quick Triage Questions (Ask Early) - Interface: Python (PyMeep) vs Scheme vs C++? - Dimensionality: 1D/2D/3D or cylindrical? - Units: what is the chosen length unit `a` (e.g. 1 um), and what wavelength/frequency band? - Boundary conditions: PML vs periodic/Bloch (`k_point`) vs metallic? - Output goal: fields/flux spectrum/modes/forces/near-to-far? ## Minimal PyMeep Skeleton (2D, cartesian) Use this as the default starting point and then specialize: ```py import meep as mp resolution = 20 dpml = 1.0 cell = mp.Vector3(16, 8, 0) boundary_layers = [mp.PML(dpml)] geometry = [ mp.Block( size=mp.Vector3(mp.inf, 1, mp.inf), center=mp.Vector3(), material=mp.Medium(epsilon=12), ) ] sources = [ mp.Source( mp.GaussianSource(0.15, fwidth=0.1), component=mp.Ez, center=mp.Vector3(-7, 0), ) ] sim = mp.Simulation( cell_size=cell, boundary_layers=boundary_layers, geometry=geometry, sources=sources, resolution=resolution, ) sim.run( mp.at_beginning(mp.output_epsilon), mp.to_appended("ez", mp.at_every(0.5, mp.output_efield_z)), until_after_sources=mp.stop_when_fields_decayed(50, mp.Ez, mp.Vector3(), 1e-9), ) ``` ## Units And "What Numbers Mean" - Pick a length unit `a` (e.g. `a = 1 um`). All geometry values are in units of `a`. - Frequency `f` in Meep is `a / lambda0` (vacuum wavelength). Equivalently: `lambda0 = 1 / f`. - Time is in units of `a/c` (with `c=1` in Meep units). - Use `wavelength=...` for sources if that is more natural than `frequency=...`. ## First-Run Pitfalls (Most Common) - Leave padding between sources/geometry and PML; don’t interpret fields inside the PML. - Start with a broadband Gaussian source; only switch to CW once you trust the setup. - Do not guess a run time; use `until_after_sources=...` with a decay condition. - Converge: increase `resolution`, and increase/double PML thickness until results stop changing. ## Primary Documentation References - `doc/docs/Introduction.md` - `doc/docs/C++_Tutorial.md` - `doc/bfast/fixed_angle_broadband_simulations_in_Meep.md` - `doc/docs/Scheme_Tutorials/Basics.md` - `doc/docs/Python_Tutorials/Basics.md` ## Workflow - Start with the primary references above. - If details are missing, inspect `references/doc_map.md` for the complete topic document list. - Use tutorials/examples as executable usage patterns when available. - Use tests as behavior or regression references when available. - If ambiguity remains after docs, inspect `references/source_map.md` and start with the ranked source entry points. - Cite exact documentation file paths in responses. ## Tutorials and examples - `python/examples` - `scheme/examples` ## Test references - `tests` ## Optional deeper inspection - `python` - `src` ## Source entry points for unresolved issues - `python/solver.py` - `python/simulation.py` - `src/meepgeom.hpp` - `src/meepgeom.cpp` - `src/meep_internals.hpp` - `src/meep.hpp` - `src/fix_boundary_sources.cpp` - `python/meep.i` - Prefer targeted source search (for example: `rg -n "" python src`).