REMI Lab
OPEN KNOWLEDGE / TOOLS

Geometry and Materials

이 페이지의 내용

Geometry should stay explicit in public examples. The documented API includes the shapes and named materials below. An available constructor alone does not establish RF accuracy; pair it with a configuration listed in Recommended Configuration and Support Boundaries.

Shapes

ShapeSignatureTypical use
BoxBox(corner_lo, corner_hi)substrates, ground planes, patch metal, dielectric blocks
SphereSphere(center, radius)resonators, scatterers, simple inclusions
CylinderCylinder(center, radius, height, axis="z")vias, posts, cylindrical inclusions
PolylineWirepolyline-defined wire geometrywire-like studies and routed conductors
ViaVia(center=..., drill_radius=..., pad_radius=..., layers=..., material="pec")PCB-style interconnects
CurvedPatchCurvedPatch(center=..., length=..., width=..., radius=..., axis="x")curved-conductor studies; constructor arguments are keyword-only
MeshShapeMeshShape.from_file(path, scale=..., translate=(0,0,0))CAD import — STL/OBJ/PLY, plus STEP/STP via the cad extra. Rasterizes host-side (trimesh containment): NOT differentiable — a traced coordinate raises, so CAD geometry cannot carry gradients

Material registration

Setup used by the snippets below:

from rfx import Simulation
sim = Simulation(
freq_max=5e9,
domain=(0.04, 0.03, 0.02),
dx=2e-3,
boundary="cpml",
cpml_layers=6,
)
from rfx import DebyePole, LorentzPole
sim.add_material("fr4", eps_r=4.3, sigma=0.02)
sim.add_material("resistive_medium", sigma=5.0e5)
sim.add_material(
"custom_dielectric",
eps_r=6.0,
debye_poles=[DebyePole(delta_eps=12.0, tau=9.4e-12)],
)

Material arguments

ArgumentMeaningNotes
eps_rrelative permittivitydefault is 1.0
sigmaconductivitylossy dielectrics and below-threshold conductors; sigma >= 1e6 S/m is represented by the PEC mask
mu_rrelative permeabilitydefault is 1.0
debye_polesdispersive Debye termsDebyePole(delta_eps, tau)
lorentz_polesdispersive Lorentz termsLorentzPole(omega_0, delta, kappa)
chi3third-order nonlinearityspecialized nonlinear-material workflows

Materials such as the built-in "copper" and "aluminum" have conductivity above the 1e6 S/m threshold and therefore behave as PEC in the compiled grid; their bulk skin depth and ohmic loss are not resolved. Use add_thin_conductor(...) when a subcell sheet model is appropriate. That helper also maps sigma_bulk >= 1e6 S/m (including its default copper value) to PEC; a finite sheet resistance requires an explicitly justified sigma_bulk < 1e6 S/m. Use a below-threshold volumetric conductivity only when its cells and loss model match the intended physical approximation.

Configuration limits

Geometry and materials are covered only when paired with a documented boundary, source or port, mesh, and observable combination. Check Support Boundaries before reporting RF accuracy for a structure that uses a limited configuration.

Two current opt-in conductor realizations have narrower contracts:

  • add(shape, material="pec", two_plane=True) is hard-PEC-only and face-registers a one-cell PEC body on both node planes. A non-PEC material raises ValueError. It is supported only on the uniform run()/forward() scan and the single-device non-uniform runner.
  • add_thin_conductor(shape, surface_impedance_f0=...) applies a band-centre Leontovich sheet resistance to any rasterizable patterned shape that occupies exactly one cell layer and at least one cell. Unsupported solver, boundary, overlap, and port-family combinations fail explicitly.
Back to top ↑