Run a single CST simulation with given parameters and score against a target. Use when you have a specific metamaterial design to simulate and evaluate.
Execute one CST simulation and return scored results. This is the atomic simulation unit — takes parameters in, returns score + sub-band breakdown out.
E:\cst with valid licenseD:/Claude/auto_cst/engine/ (config.py, runner.py, evaluator.py, vba_builder.py)D:/Claude/auto_cst/configs/If the user specified a config path, use it. Otherwise, look for an appropriate config in D:/Claude/auto_cst/configs/. For broadband 1-5 THz absorber, use configs/broadband_1_5thz_engine.json.
Read the config to understand:
Determine:
cd D:/Claude/auto_cst && python -c "
import sys, json
sys.path.insert(0, '.')
from engine.config import TargetConfig
from engine.runner import GeneralRunner
config = TargetConfig.from_json('configs/CONFIG_FILE.json')
runner = GeneralRunner(config)
result = runner.run(
version='VERSION',
param_overrides=PARAMS_DICT,
material_overrides=MATERIALS_LIST_OR_NONE,
extra_vba='''EXTRA_VBA_OR_EMPTY''',
note='NOTE',
)
print(json.dumps(result, indent=2))
"
Parameter override example:
param_overrides={'p1s': 76.0, 'sp1': 24.0, 'st': 30.0}
Material override example (change polyimide tanδ):
material_overrides=[{'name': 'Polyimide', 'type': 'Normal', 'epsilon': 3.5, 'tand': 0.42, 'colour_r': '0.94', 'colour_g': '0.82', 'colour_b': '0.0'}]
Cross-patch VBA example:
extra_vba = build_cross_patch_vba(arm_ratio=0.55) # from engine.vba_builder
If the runner returned status="success", score the exported CSV:
cd D:/Claude/auto_cst && python -c "
import sys, json
sys.path.insert(0, '.')
from engine.config import TargetConfig
from engine.evaluator import GeneralEvaluator
config = TargetConfig.from_json('configs/CONFIG_FILE.json')
evaluator = GeneralEvaluator(config)
result = evaluator.evaluate_csv('exports/EXPORT_DIR/METRIC.csv')
print(json.dumps(result, indent=2))
"
Present to the user:
Example output format:
Version v37: Score = 0.0283
Mean absorption: 88.4%
Min absorption: 87.0% @ 4.773 THz
Band Mean Min Shortfall
1.0-1.5 88.6% 87.1% 2.9% !!
1.5-2.0 89.2% 88.2% 1.8% !!
...
Available topology transforms (import from engine.vba_builder):
Replaces square patches with crosses. Each cross has two coupled resonances, providing ~1.4× bandwidth per layer.
from engine.vba_builder import build_cross_patch_vba
vba = build_cross_patch_vba(arm_ratio=0.55) # arm_ratio: 0.3-0.7
Adds a thin lossy metal layer between ground plane and first spacer. Provides uniform baseline absorption lift.
from engine.vba_builder import build_resistive_film_vba
vba = build_resistive_film_vba(sigma=500, thickness=0.1) # sigma: 50-2000 S/m
from engine.vba_builder import build_cross_patch_vba, build_resistive_film_vba
vba = build_resistive_film_vba(500) + '\n' + build_cross_patch_vba(0.55)
E:\cst\license.datsolver_timeout_s in config