Форматы файлов

Назначение страницы

Справочник по всем файлам, которые читают и пишут программы пакета, — для того, кто пишет свою обработку результатов или генератор заданий. Для каждого формата указано, кто его пишет и кто читает, кодировка и концы строк, порядок полей и единицы, пример из реальных файлов пакета (каталог samples/) и подводные камни. Подробности о коде, который пишет и читает файл, — на страницах модулей, ссылки даны в каждом разделе.

Почти все выходные файлы шага получают одно базовое имя — из строки FILE имя; секции #OUTPUT задания — и разные расширения (TMCIndan). Относительные имена в задании отсчитываются от папки задания.

Сводная таблица

Расширение Назначение Кто пишет Кто читает Раздел
.tpl задание на расчёт человек, TPL Designer ядра H и X, TPL Designer задание
_step.h и др. включаемый файл с макросом шага человек, TPL Designer препроцессор ядра включаемые файлы
<имя>.tpl~$Prepr$~<PID> развёрнутое задание препроцессор ядра разборщик ядра, человек (отладка) вывод препроцессора
$$vr$$s<PID>.prc временный файл макросов препроцессор ядра — вывод препроцессора
.s матрица рассеяния (двоичный) ядра, TMCROS (To S-matrix) TMCGROUT, ядра и TMCROS при дописывании файл .s
.t сигналы на портах ядра TMCROS, ядра и TMCROS (пересчёт в .s) файл .t
.soc, .$OC документ TMCGROUT TMCGROUT TMCGROUT документы вьюверов
.tos, .$os документ TMCROS TMCROS TMCROS документы вьюверов
.dop, .$op документ TMC_DN TMC_DN TMC_DN документы вьюверов
.AMP, .FAZ амплитуда и фаза поля на частоте ДН ядра (FIELD_DISTRIBUTION) FieldView, ядро (построение .DAT) файлы ДН
.COS, .SIN квадратуры поля ядра (файловый режим ДН) ядро файлы ДН
.DAT эквивалентные излучатели на контуре ядра, TMC_DN (девиации) TMC_DN файл .DAT
.opt, .dev требуемая ДН, ДН с отклонениями человек / TMC_DN TMC_DN / человек файлы ДН
.ex кадр поля ядра (FIELDS) FieldView файлы поля
.tf кадр поля старых версий — FieldView файлы поля
.ex.frames серия кадров FieldView FieldView серия кадров
.tt топология и сетка ε ядра (TOPOLOGY) FieldView топология
.eps распределение ε (N, B, Y) по узлам ядра (RECT_STAT [имя]), TPL Designer ядра (блоки FILE*), TPL Designer файл .eps
.sig падающая волна из файла TPL Designer, человек ядра, TPL Designer файл .sig
.timing_<H\|X>_<win32\|win64>.txt отчёт о времени расчёта ядра (/Time, Calc. time) человек отчёт /Time
текст HFSS, текст CST S-параметры других САПР внешние программы TMCGROUT импорт
_run.bat, _run.sh, sample.json; STL, OBJ, STEP файлы TPL Designer TPL Designer / внешние САПР человек / TPL Designer TPL Designer
.png, .jpg, .bmp, .gif изображения и анимация поля FieldView — файлы поля
*.conf, *.ini настройки программ все программы все программы настройки

Общие соглашения

Свойство Правило
Кодировка текста 8-битная кодовая страница Windows CP1251: так пишет TPL Designer (свой кодек), так хранятся строки в коде ядер и вьюверов. Символы вне CP1251 (ε, λ, →) в файлы попадать не должны
Концы строк CR LF на всех системах: файлы с явными \r\n (.ex, .tt, .eps, .AMP, отчёт /Time) — по коду; текстовые файлы ядер и вьюверов (.t, .DAT, документы) — через текстовый режим fopen, который на Linux воспроизводит слой совместимости (текстовый режим). Читатели пакета принимают и LF
Двоичные числа порядок байтов машины (x86 / x64 — младший первым); double — 8 байт; номер узла в .eps — 4 байта
Точность значений поле Accuracy / nAccuracy в заголовке = sizeof(_real): 8 (double) в текущих сборках, 4 (float) в части старых файлов. Читатели принимают обе
Числа в тексте printf-форматы %lg, %d; десятичная точка, не запятая
Единицы в выходных файлах СИ: м, с, Гц — кроме .DAT (мм, ГГц, градусы), .sig (единицы задания) и заголовков-подписей

Задание .tpl

Пишет человек в любом текстовом редакторе; TPL Designer (writeTask)
Читает ядра H и X: препроцессор PREPR, затем разборщик TMCIndan; TPL Designer (readTplFile)
Кодировка CP1251; TPL Designer пишет CR LF и при чтении сам распознаёт UTF-8 (по BOM или по корректной последовательности байтов)
Полный справочник языка руководство пользователя «Файл задания .tpl»

Структура. Задание — последовательность шагов #STEP … #END_STEP; каждый шаг — секции #PARM, #TOPOLOGY, #LINK_LIST, #OUTPUT. Первая строка по соглашению #TMC_RT_H (общая для обоих ядер), последняя — #EOF. Строки с # начинаются с первой позиции, остальные — хотя бы с одного пробела; параметры разделяются ;; ! в любом месте строки начинает комментарий.

Фрагмент samples/LR1_wg.tpl (первый шаг):

#TMC_RT_H
#define a   @ ( 58.17 )  ! ширина канала (ПО ВАРИАНТУ)
#define d   @ (  1.0 )   ! шаг сетки (ПО ВАРИАНТУ)
...
#STEP
#PARM
 ANGLE_UNIT radian;
 FREQ_UNIT  GHz;
 LONG_UNIT  mm;
 TIME_UNIT  ns;
 DELTA  d;
 TIME   0.; 115;
 X_MIN  0.0;
 X_MAX  Lt;
 Y_MIN  0.0;
 Y_MAX  W;
 FREQ   3.3;
#END_PARM

#TOPOLOGY
 BLOCK 14;
  RECT_STAT EPS-1; L1; L1+L2; ylo; yhi;     ! диэлектрическая вставка
 END_B
 BLOCK 7;
  INPUT_X ; ylo; yhi; 0; 115; 1; 0;      ! порт 1 (АКТИВНЫЙ)
 END_B
 ...
#END_TOPOLOGY

#LINK_LIST
 T 14; 0.0; 0.0;
 T 7;  0.0; 0.0;
 ...
#END_LINK

#OUTPUT
 FILE wg;
 TOPOLOGY;
 FIELDS;
 SMATRIX wg; 3.3; 100; 110;
#END_OUTPUT
#END_STEP

Сводка секций:

Секция Что задаёт Подробно
#PARM … #END_PARM единицы (ANGLE_UNIT, FREQ_UNIT, LONG_UNIT, TIME_UNIT), шаг сетки DELTA, время TIME, область X_MIN…Y_MAX, частоту FREQ; в шагах после первого может отсутствовать TMCIndan: #PARM
#TOPOLOGY … #END_TOPOLOGY блоки BLOCK n; <примитив> …; END_B: RECT_STAT, CIRCLE_STAT, POLYGON_STAT, FILE, входы INPUT_X/INPUT_Y, плазменные *_N/_B/_Y (X-ядро) TMCIndan: блоки
#LINK_LIST … #END_LINK точка привязки каждого блока: T n; X0; Y0; TMCIndan: топология
#OUTPUT … #END_OUTPUT FILE имя; (обязательна), TOPOLOGY, FIELDS, SMATRIX, FIELD_DISTRIBUTION[_M] TMCIndan: #OUTPUT

Что пишет ядро по секции #OUTPUT. По коду (CTmcRTH_IndanOutput, PutField, PutTopology) из базового имени создаются: .t (всегда), .ex (FIELDS), .tt (TOPOLOGY), .s (SMATRIX; имя задаётся отдельно, без точки — дописывается .s), файлы ДН из FIELD_DISTRIBUTION[_M] (своё базовое имя). Имена .ey, .hz, .em, .ef, .q, .ix, .iy строятся, но ни одно ядро в них не пишет; поле обоих ядер — в .ex.

Ограничения и подводные камни.

  • В выражении ε блока H-ядра записывается Δε=ε−1, а не ε (ядро H).
  • Нет #EOF — ошибка ядра Missing #EOF. Первую строку #TMC_RT_H ядро не проверяет, а TPL Designer без неё задание не открывает.
  • Порядок строк #PARM важен: единица применяется к значениям, прочитанным после неё (TMCIndan).
  • В имени FILE точка запрещена (точка в имени папки допустима).
  • Строка после препроцессора — не длиннее 19998 символов; путь к заданию и к файлу ~$Prepr$~ — короче 260 символов (Windows).
  • В одном .s — не больше 99 частот; ядро проверяет это до расчёта.
  • Экспоненциальную запись чисел (1e-3) в выражениях с операциями вычислитель выражений ядра не понимает — пишите числа без экспоненты, как это делает TPL Designer.

Включаемые файлы и макросы

Пишет человек; TPL Designer — <имя>_step.h при нескольких частотах или угловом свипе
Читает препроцессор ядра (директива #include имя)
Кодировка как у .tpl
Подробно PREPR: #include, #define, TPL Designer: макро-версия

Файл содержит определение макроса шага: #define имя пар1; пар2; … @ и тело, каждая строка которого, кроме последней, кончается ровно двумя обратными слешами \\. Фрагмент samples/VOLNSTEP.H:

#define stepV Freq__; File__; SFile__; Tmin__; Tmax__; @\\
#STEP\\
#PARM\\
 ANGLE_UNIT radian;\\
 ...
 FREQ  Freq__ ;\\
#END_PARM\\
...
#OUTPUT\\
 FILE File__;\\
 SMATRIX SFile__; Freq__; Tmin__; Tmax__;\\
 FIELDS;\\
 TOPOLOGY;\\
#END_OUTPUT\\
#END_STEP\\

и его вызов в samples/VOLN.TPL — по строке на шаг:

#include VOLNSTEP.H
stepV 3.0; vs0; voln; 18; 20;
stepV 3.2; vs1; voln; 18; 20;
  • Включаемый файл ищется только в папке задания и её подпапках; .. и : в имени запрещены. Вложенность — до 64.
  • Один \ — не перенос; ! перед \\ удаляет перенос вместе с комментарием.
  • Имена параметров заменяются везде, где стоят целой лексемой, — отсюда вид Freq__.

Вывод препроцессора

Файл Где Содержимое Срок жизни
<полное имя задания>~$Prepr$~<PID> (например wg.tpl~$Prepr$~12345); без <PID>, если имя с номером длиннее 259 символов рядом с заданием развёрнутый текст: без комментариев, с подставленными #include и макросами; именно его читает разборщик создаётся при открытии задания ядром, удаляется при закрытии
$$vr$$s<PID>.prc папка задания тексты директив #define удаляется в конце каждого прохода препроцессора

PID — номер процесса ядра: два ядра на одном задании не мешают друг другу. Для обоих файлов нужно право записи в папку задания. Файл ~$Prepr$~ — главное средство отладки макросов: в нём видно, сколько получилось шагов #STEP и не осталось ли неподставленных параметров. Подробно — PREPR: отладочный вывод.

Матрица рассеяния .s

Пишут ядра H и X после шага (SMATRIX; при ошибке шага — нулевая матрица); TMCROS (Edit > To S-matrix). Все — через save_S_matrix_element библиотеки SFILE95
Читает TMCGROUT (read_S_matrix_element); писатели — перед дописыванием
Тип двоичный, little-endian
Подробно SFILE95: формат, запись столбца

Типы полей. Целые поля — 2 байта (short); смещения — 4 байта (int); частоты, шаги сетки, элементы матрицы — double. «Паскалева строка» (PS) — длина (2 байта), текст без нуля, разделитель 0D 0A.

Часть Содержимое
Заголовок SMT\0, 102\0, 0D 0A, NS (число PS заголовка, 7 при одной сетке), 0D 0A
PS × 2 метки программы: TAMIC-RTH V 2.00, TAMIC_soft group. TAMIC Rt-H Planar Analyzer. 2000 (одинаковы у H и X)
PS сетки признак сетки (2 байта, 0) и три double — шаги X, Y, Z, м (у файлов пакета нули)
PS × 2 имя задания (у файлов пакета — Tamic Output Signal Viewer) и полное имя самого .s
Таблица смещений длина 2 + 12·NF, число записанных частот, NF записей «частота double, Гц + смещение блока int», 0D 0A
Таблица интерполяции того же вида, всегда пустая
Блоки частот частота (Гц), число входов num, num чисел мод, размерность dim, 0D 0A, dim² пар (Re, Im) по строкам, 0D 0A

Элемент Sij (i — вход-приёмник, j — возбуждаемый вход, по одной моде на входе) лежит по индексу (i-1)*dim + (j-1). Ещё не посчитанные элементы равны FLT_MAX (обе части).

Пример — samples/horn2.s целиком (265 байт, одна частота 8 ГГц, один вход):

00000000: 534d 5400 3130 3200 0d0a 0700 0d0a 1000  SMT.102.........
00000010: 5441 4d49 432d 5254 4820 5620 322e 3030  TAMIC-RTH V 2.00
00000020: 0d0a 3200 5441 4d49 435f 736f 6674 2067  ..2.TAMIC_soft g
00000030: 726f 7570 2e20 5441 4d49 4320 5274 2d48  roup. TAMIC Rt-H
00000040: 2050 6c61 6e61 7220 416e 616c 797a 6572   Planar Analyzer
00000050: 2e20 3230 3030 0d0a 1a00 0000 0000 0000  . 2000..........
00000060: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000070: 0000 0000 0d0a 1a00 5461 6d69 6320 4f75  ........Tamic Ou
00000080: 7470 7574 2053 6967 6e61 6c20 5669 6577  tput Signal View
00000090: 6572 0d0a 2b00 433a 5c74 6d63 5f74 6573  er..+.C:\tmc_tes
000000a0: 745c 6578 616d 706c 655f 7461 736b 5f5f  t\example_task__
000000b0: 5f5c 7361 6d70 6c65 735c 686f 726e 322e  _\samples\horn2.
000000c0: 730d 0a0e 0001 0000 0000 0065 cdfd 41e7  s..........e..A.
000000d0: 0000 000d 0a0e 0000 0000 0000 0000 0000  ................
000000e0: 0000 0000 000d 0a00 0000 0065 cdfd 4101  ...........e..A.
000000f0: 0001 0001 000d 0ad4 0673 407c d795 bf4f  .........s@|...O
00000100: 779a 75b5 2162 3f0d 0a                   w.u.!b?..
Смещение Байты Значение
0x0A 07 00 NS = 7
0x58 1a 00, 26 байт, 0d 0a строка сетки: признак 0 и три нулевых шага
0xC3 0e 00 01 00 длина основной таблицы 14 = 2 + 12·1; записана 1 частота
0xC7 00 00 00 00 65 cd fd 41 e7 00 00 00 частота 8·10⁹ Гц, блок по смещению 231 (0xE7)
0xE7 …65 cd fd 41 01 00 01 00 01 00 0d 0a блок: 8·10⁹ Гц, 1 вход, 1 мода, dim = 1
0xF7 16 байт, 0d 0a S11: Re, Im

Ограничения и подводные камни.

  • Файл дописывается, а не перезаписывается. Новая частота добавляется, частота, которая уже есть, — заменяет столбец. Перед повторным прогоном с другими портами старый .s нужно удалить: при другом числе входов запись отклоняется, файл не меняется.
  • Не больше 99 частот (FREQ_MAX_NUM = 100), не больше 20 входов (MAX_INPUT_NUM), dim ≤ 255, файл — не больше 2 ГБ (смещение 4 байта).
  • Блокировок нет: два процесса не должны писать один .s одновременно — поэтому у частей конвейера заданий TPL Designer разные .s.
  • Частота 0 Гц при слиянии теряется (SFILE95).
  • В .s с одной частотой у графика TMCGROUT одна точка — кривой нет (TMCGROUT).

Сигналы на портах .t

Пишут ядра H и X — на каждом подтакте
Читают TMCROS (графики сигналов); CTmcTtoS / CTmcWideband — пересчёт в .s (в ядре после шага и в TMCROS по Edit > To S-matrix)
Тип текст, CR LF
Подробно ядро H: файл .t, TMCROS: чтение, многочастотный заголовок

Заголовок (DeleteOutputFile, затем PutPortInfo после построения блоков):

Строка Значение
#TMC_GraphicsOutputSignalFile FormVer2.0 2000 метка формата (с пробелом в конце)
!File name <путь> полное имя файла
#TMC_GROTS_Freq <f> частота шага FREQ, Гц
#TMC_GROTS_InpNum -2 всегда −2
!nT<TAB>nBlock<TAB>Up<TAB>Uo подпись столбцов (комментарий)
#TMC_GROTS_Wideband 0\|1 1 — хотя бы у одного порта сигнал из файла .sig; такой .t пересчитывается многочастотным путём
#TMC_GROTS_SigFreq f1 f2 … только если в .sig есть строка #FREQ: частоты тонов, Гц
#TMC_GROTS_Port <блок> <Δ, м> <апертура, м> <f согласования, Гц> <0\|1> по строке на порт: номер блока, шаг сетки, ширина апертуры, частота согласования (= FREQ), признак сигнала из файла

Строки данных — по одной на подтакт; каждая начинается с пробела: номер такта, модельное время (с), затем у каждого порта тройка «номер блока, Up (падающая волна), Uo (уходящая волна)». Форматы чисел — настройки ядра OutputFormat* (по умолчанию %9d, %15.7g, %4d, %15.7g, %15.7g, см. настройки). Порты идут в порядке блоков задания.

Пример — samples/MULTIFREQ/b_wide.t (два порта, сигнал из файла):

#TMC_GraphicsOutputSignalFile FormVer2.0 2000 
!File name C:\TMC_Suite\samples\MULTIFREQ\b_wide.t
#TMC_GROTS_Freq 3.9e+09
#TMC_GROTS_InpNum -2
!nT nBlock  Up  Uo
#TMC_GROTS_Wideband 1
#TMC_GROTS_SigFreq  3000000000 3200000000 3400000000 3600000000 3800000000 4000000000 4200000000 4400000000 4600000000 4800000000
#TMC_GROTS_Port 7 0.0005 0.06 3900000000 1
#TMC_GROTS_Port 12 0.0005 0.06 3900000000 0
        0              0   7              0              0  12              0              0
        1   1.179327e-12   7      0.2887948    -0.08554208  12              0              0
        2   2.358654e-12   7      0.5775897    -0.03940082  12              0              0

Одночастотный файл (samples/horn1.t) отличается строками #TMC_GROTS_Wideband 0 и одной строкой #TMC_GROTS_Port 7 0.001 0.04 6000000000 0; в файлах до появления многочастотной обработки (samples/horn2.t) строк #TMC_GROTS_Wideband/_Port нет.

Ограничения и подводные камни.

  • Читатели считают данными только строки, начинающиеся с пробела; формат номера такта без ширины (%d) делает файл нечитаемым.
  • Номер входа в TMCROS — порядковый номер тройки в строке, а не номер блока.
  • Пока шаг идёт, ядро держит файл открытым с запретом записи для других программ; второе ядро с тем же FILE получает ошибку. Читать файл во время расчёта можно — недописанная последняя строка пропускается.
  • Каждая строка пишется с перевода строки в начале, поэтому файл не кончается переводом строки.
  • Многочастотный путь: портов и частот — не больше 99, отсчётов — не меньше 8.

Документы вьюверов

Файл Программа Метка первой строки Строки графиков ссылаются на
.soc, .$OC TMCGROUT #TMCGROUT .s, текст HFSS/CST, выражение {…}
.tos, .$os TMCROS #TMCGROTS .t, выражение {…}
.dop, .$op TMC_DN #TMCGROTS .DAT, выражение {…}

Тип — текст CR LF. Подробно: TMCGROUT: файл документа, TMCROS: документ, TMC_DN: файл документа.

Как появляется. Открытие файла данных (.s, .t, .DAT) создаёт рядом документ с тем же именем и расширением программы; если такой документ уже есть, создаётся .$OC / .$os / .$op — существующий документ не перезаписывается. Файл, первая строка которого начинается с метки программы, читается как документ.

Устройство. Строки #метка значение — параметры; ! в начале строки или после пробела вне [...] — комментарий; остальные непустые строки — графики. Пробелы и табуляции вне [...] сжимаются до одного. Фрагмент samples/DEMO/TMCGROUT/rths25.soc:

#TMCGROUT
!Graphics parameters
#dXAxiesUnit 0
#dXAxiesName 
#PointDrawFlag 1; 1;
#nXType 0
#nYType 0
...
#sDrawGridColor 0;
#sDrawPointColor 0; 16711680; 0; 75; 65280; 0; 75; ... (16 троек)
!Graphics data
!file name : E:\WORK\Source\SAMPLE_R\TEST_MET\EPS4\rths25.soc
!Data file for draw S-matrix graphics
!SFileName GraphicsName DrawFlag Input1 Mod1 Input2 Mod2
rths25.s rths25.s 1 1 1 2 1

Строка графика: имя подпись показ вход1 мода1 вход2 мода2. TMCGROUT принимает также 6, 5 и 1 поле; в имени допустим префикс *вход1;мода1;вход2;мода2*. Смысл полей у программ разный:

Поле TMCGROUT TMCROS TMC_DN
имя .s или файл HFSS/CST .t .DAT
вход1, мода1 элемент S: вход-приёмник и мода порядковый номер порта в строке .t; 0 — Up, 1 — Uo вход1 не используется; мода1 — признак Reduce (учитывать секторы излучения)
вход2, мода2 возбуждаемый вход и мода не используются не используются

Параметры (#nXType, #nYType, #Xmin…#Ymax, #nAFlagX/Y, шрифт, цвета COLORREF десятичным числом, 16 стилей линий) описаны в таблице TMCGROUT. Пути без : и без начального \\ отсчитываются от папки документа. Значения по умолчанию для новых документов хранятся в настройках одной строкой с разделителем — байтом 0x01.

Подводные камни. У документов TMCROS и TMC_DN одна метка #TMCGROTS: документ TMCROS, открытый в TMC_DN, будет принят за список .DAT. Save As в TMC_DN предлагает .tos — документ ДН нужно сохранять с .dop. Имена и подписи графиков не могут содержать пробелов вне [...].

Файлы диаграммы направленности

Строки FIELD_DISTRIBUTION имя; F; Tmin; Tmax; и FIELD_DISTRIBUTION_M … секции #OUTPUT дают ядру накопить гармонику поля на частоте F и записать файлы с базовым именем имя (TMCIndan: интегрирование).

Файл Когда пишется Содержимое
.COS, .SIN только FIELD_DISTRIBUTION (файловый режим) квадратуры по всей сетке; перечитываются и перезаписываются на каждом шаге по времени
.AMP, .FAZ после окна, кроме режима полос у контура амплитуда и фаза гармоники в каждом узле
.DAT после окна эквивалентные излучатели на контуре — вход TMC_DN
<имя>_<F>MHz.DAT при нескольких тонах падающей волны .DAT на каждый тон; знаков после точки в <F> столько, чтобы имена различались

.AMP, .FAZ, .COS, .SIN — тот же формат, что кадр поля: текстовый заголовок #TMC_GraphicsOutputFieldFile … и nY строк двоичных значений. Фаза — в единицах ANGLE_UNIT задания. Заголовок samples/horn2.AMP:

#TMC_GraphicsOutputFieldFile FormVer2.0 2000 
#TMCGROFLD_nT 21252
#TMCGROFLD_Time 5.01261e-008
#TMCGROFLD_Delta 0.001
#TMCGROFLD_Xmin 0
#TMCGROFLD_Ymin 0
#TMCGROFLD_Accuracy 4
#TMCGROFLD_LongUnit mm 0.001
#TMCGROFLD_TimeUnit ns 1e-009
#TMCGROFLD_nX 242
#TMCGROFLD_nY 172

Файл излучателей .DAT

Пишут ядра (CFieldIntegrated); TMC_DN — копию с отклонениями (окно Make Distribution Deviation)
Читает TMC_DN (c2DArray::ReadData)
Тип текст CR LF
Подробно TMCIndan: .DAT, TMC_DN: входной файл

Строки: Frequence = <F, ГГц> Ghz;, N = <число записей>;, выражение общей ДН элемента (ядро пишет 1.), затем по строке на излучатель: номер, X, Y (мм), Amplitude, Faza (градусы), сектор излучения FiMin…FiMax (градусы) и ДН излучателя. Каждая точка контура даёт три записи: Ez (1.), Hy (cos(f)), Hx (sin(f)). Фрагмент samples/horn2.DAT:

Frequence = 8 Ghz;
N = 2244;
1.
1   X = 10 mm; Y = 10.5 mm; Amplitude = 0; Faza = 121.821 degree; FiMin = 90.001 degree; FiMax = 269.999 degree; 1.
2   X = 10 mm; Y = 10.5 mm; Amplitude = 0; Faza = -247.702 degree; FiMin = 90.001 degree; FiMax = 269.999 degree; cos(f)
3   X = 10 mm; Y = 10.5 mm; Amplitude = 0; Faza = 0 degree; FiMin = 90.001 degree; FiMax = 269.999 degree; sin(f)

TMC_DN принимает и строку излучателя из 5 полей (без сектора и ДН излучателя; тогда сектор −180…180°, излучатель изотропный) — она должна кончаться degree;. Номер в начале строки не проверяется; N — не больше размера файла / 32 + 1.

Вспомогательные файлы TMC_DN

Файл Кто пишет Содержимое
<.DAT>~~tempDia0, …1 TMC_DN листинг расчёта: излучатели, КНД, КИП, точки ДН; удаляется при пересчёте и закрытии
<.DAT>_Temp0, …1, ….chk TMC_DN кэш ДН (угол, модули, фаза) и его подпись; при N ≥ 400 остаётся на диске
.opt человек требуемая ДН: строки «угол в градусах, значение» (не меньше 2 точек)
.dev TMC_DN !Degree AmplitudeDirectPatternRequired AmplitudeDirectPattern, затем по строке на угол через табуляцию

Цифра 0/1 в именах кэша — признак Reduce. Подробно — TMC_DN: временные файлы, девиации.

Подводные камни ДН.

  • Конец окна Tmax округляется вверх до целого числа периодов F; если он выходит за TIME, файлы ДН не пишутся (ошибка шага).
  • При ANGLE_UNIT gradus фазы излучателей в .DAT неверны — задавайте radian.
  • В режиме полос у контура (большая сетка или несколько тонов) .AMP/.FAZ не пишутся.
  • Многочастотная ДН требует FIELD_DISTRIBUTION_M; тоны сверх 99 отбрасываются.

Файлы поля

Пишут ядра H и X — кадр на каждом подтакте при FIELDS (файл <имя>.ex перезаписывается); FieldView — серии, изображения, GIF
Читает FieldView: .ex, .ey, .hz, .em, .tf, .AMP, .FAZ, серии *.frames
Тип текстовый заголовок CR LF + двоичные значения
Подробно FieldView: файл поля, ядро H: вывод

Значение узла — напряжение узла сетки: у H-ядра оно пропорционально Ez, у X-ядра равно Hz; оба ядра пишут его в .ex. .tf — расширение старых версий; FieldView читает его тем же разборщиком.

#TMC_GraphicsOutputFieldFile FormVer2.0 2000 CRLF
#TMCGROFLD_nT <номер такта> CRLF
#TMCGROFLD_Time <модельное время, с> CRLF
#TMCGROFLD_Delta <шаг сетки, м> CRLF
#TMCGROFLD_Xmin <x узла (0,0), м> CRLF
#TMCGROFLD_Ymin <y узла (0,0), м> CRLF
#TMCGROFLD_Accuracy <4|8> CRLF
#TMCGROFLD_LongUnit <имя> <множитель, м> CRLF
#TMCGROFLD_TimeUnit <имя> <множитель, с> CRLF
#TMCGROFLD_nX <число узлов по X> CRLF
#TMCGROFLD_nY <число узлов по Y>
затем nY раз: CRLF + nX значений по Accuracy байт

Строки значений идут снизу вверх, в строке — слева направо; узел (j,i) — значение номер inX+j. Объём данных после заголовка: nYnXa+2nY байт, где a — Accuracy (CR LF стоит перед каждой строкой). Заголовок samples/horn1.ex:

#TMC_GraphicsOutputFieldFile FormVer2.0 2000 
#TMCGROFLD_nT 1
#TMCGROFLD_Time 2.35865e-12
#TMCGROFLD_Delta 0.001
#TMCGROFLD_Xmin 0
#TMCGROFLD_Ymin 0
#TMCGROFLD_Accuracy 8
#TMCGROFLD_LongUnit mm 0.001
#TMCGROFLD_TimeUnit ns 1e-09
#TMCGROFLD_nX 242
#TMCGROFLD_nY 202

Строки заголовка сверяются по началу и строго по порядку; LongUnit и TimeUnit служат только подписям. Условия чтения: nX ≥ 2, nY ≥ 2, Accuracy 4 или 8.

Синхронизация с ядром — через атрибут файла ARCHIVE: ядро после записи кадра снимает его, FieldView после чтения ставит; ядро ждёт прочтения прошлого кадра до 25 с (кроме автозапуска). Свой читатель, работающий параллельно с ядром, должен соблюдать тот же протокол или выключить синхронный вывод (FieldView: протокол).

Серия кадров .ex.frames

Не формат ядра: подряд записанные кадры того же вида, каждый — байт в байт как файл ядра. Пишет FieldView (команда «Сохранить такты серией…»): заголовок каждого кадра — как у ядра, значения — float (Accuracy 4), запись атомарная. Между кадрами допускается до двух байт CR/LF; недописанный последний кадр и кадры с другой сеткой при чтении пропускаются (FieldView: серия).

Изображения

FieldView сохраняет текущую картинку в PNG, JPEG или BMP и анимацию тактов в GIF (FieldView: GIF).

Подводные камни.

  • Если в настройках ядра задан формат вывода поля (OutputFormatdOutField не пуст), кадр и топология пишутся текстом без разделителей строк значений, кроме CR LF; FieldView такие файлы не читает (ошибка «no CR LF after data row …»).
  • Одиночный файл поля больше 2 ГБ FieldView не читает.
  • Вывод поля на каждом подтакте многократно замедляет расчёт: для прогонов без просмотра уберите FIELDS.

Топология .tt

Пишут ядра H и X — при подготовке шага (TOPOLOGY) и по команде меню
Читает FieldView (ищет .tt рядом с файлом поля, с тем же именем)
Тип смешанный: заголовок CR LF, список блоков — строки LF, затем двоичные сетки
Подробно FieldView: файл топологии, ядро X: топология
#TMC_TopologyOutputFile FormVer2.0 2000 CRLF
#BlockListBegin LF
для каждого блока (строки LF):
  <ключевое слово примитива>
  <выражение ε или METAL / ABSORBER / MAGNETIC …>
  <Vx>, <Vy>, <W> — по строке (у входа: амплитуда, фаза, W)
  X0 Xmax Xmin Y0 Ymax Ymin nBlock nMemory nType nXY
  nXY строк «x y» — вершины многоугольника
#BlockListEnd CRLF
#TMCGROFLD_nT, _Time, _Delta, _Xmin, _Ymin, _nX, _nY   (CRLF между ними, без Accuracy и единиц)
сетка ε: nY раз — CRLF + nX значений double
X-ядро: ещё три сетки того же вида — N (м⁻³), Y, B (Тл)

X0, Y0 — точка привязки блока, м; пределы Xmin…Xmax, Ymin…Ymax — в локальных координатах блока, м (у входа Xmin…Xmax — апертура, Ymin…Ymax — окно возбуждения, с); nXY — число вершин многоугольника; nType — код блока (0 — диэлектрик, 100 — поглотитель, 101 — металл, 102…105 — входы, 107 — магнитная стенка, таблица). Сетка ε — полная ε узла (ядро прибавляет 1 к Δε). Фрагмент samples/horn1.tt:

#TMC_TopologyOutputFile FormVer2.0 2000
#BlockListBegin
RECT_STAT 
METAL



0 0.04 0 0 0.08 0.079 1 5032 101 0
...
INPUT_X 

1
0

0 0.12 0.08 0 6e-08 0 7 2624 102 0
#BlockListEnd
#TMCGROFLD_nT 0
#TMCGROFLD_Time 0
#TMCGROFLD_Delta 0.001
#TMCGROFLD_Xmin 0
#TMCGROFLD_Ymin 0
#TMCGROFLD_nX 242
#TMCGROFLD_nY 202

Подводные камни. Значения сетки — всегда double, без поля Accuracy. Топология используется FieldView, только если её сетка совпадает с сеткой файла поля. Выражения mu, Dz, Hx, Hy и силовые параметры блоков в файл не попадают.

Распределение ε .eps

Пишут ядра — блок RECT_STAT (и RECT_STAT_N/_B/_Y X-ядра) с выражением [имя]выражение; TPL Designer (epsFileBytes, окно вспомогательных файлов)
Читают ядра — блоки FILE, FILE_N, FILE_B, FILE_Y; TPL Designer (readEpsHeader, readEpsValues)
Тип текстовый заголовок CR LF + двоичные записи
Подробно ядро H: файлы .eps, ядро X: файлы распределения, TPL Designer: .eps

Строки заголовка (в этом порядке):

Строка Значение
#TamicRTH_planar_DistributionDielectricPermeability_File_V2.00 2000 метка формата
#TopologyPrimitiv <ключевое слово> RECT_STAT или RECT_STAT_N/_B/_Y
#dDelta шаг сетки, м — должен совпадать с DELTA задания (допуск 10⁻⁵ относительный)
#Xmin, #Ymin координаты первого узла относительно точки привязки блока, м
#nX, #nY, #nPoint размеры сетки и число записей nX·nY
#nAccuracy байт на значение: 4 или 8
#sNodeFormat NULL, #sValueFormat NULL наследие, всегда NULL

Затем nPoint записей подряд, без разделителей: значение (nAccuracy байт) и 4-байтовый локальный номер узла j+inX; строки снизу вверх, в строке слева направо. Значение уже умножено на вес узла: 1 внутри, 0,5 на стороне, 0,25 в углу прямоугольника; у блока ε это вес × Δε. Заголовок samples/MULTIFREQ/fulleps.eps:

#TamicRTH_planar_DistributionDielectricPermeability_File_V2.00 2000
#TopologyPrimitiv RECT_STAT 
#dDelta 0.001
#Xmin 0.07
#Ymin 0.012
#nX 61
#nY 61
#nPoint 3721
#nAccuracy 8
#sNodeFormat NULL
#sValueFormat NULL

Поиск при чтении. Имя из блока FILE ищется как задано, затем в папке задания и с расширением .eps. Блоки X-ядра принимают файл своего типа или RECT_STAT: FILE_N → RECT_STAT_N, FILE_B → RECT_STAT_B, FILE_Y → RECT_STAT_Y.

Подводные камни. Номер узла — 4 байта: блок с записью в файл не больше INT_MAX узлов. Файл не зависит от частоты. Узлы, выпавшие за область, при чтении пропускаются; координаты из строки блока FILE ядро не использует — место задают #Xmin, #Ymin и точка привязки.

Падающая волна .sig

Пишут TPL Designer (sigFileText, окно вспомогательных файлов); человек
Читают ядра H и X — вход, у которого вместо амплитуды [имя]; TPL Designer
Тип текст; TPL Designer пишет CP1251, CR LF
Подробно ядро H: падающая волна из файла, TPL Designer: .sig
  • Две колонки: время в TIME_UNIT задания и безразмерное значение a(t); читаются строки, где разобрались два числа.
  • Строки, начинающиеся с ! или #, пропускаются; строка #FREQ f1 f2 … (в FREQ_UNIT) перечисляет тоны многочастотного сигнала — ядро переносит её в заголовок .t в герцах.
  • Время строго возрастает, точек не меньше двух; между точками — линейная интерполяция, вне диапазона файла — 0. Окно Tmin…Tmax входа тоже действует.
  • Имя без точки получает .sig, имя без пути ищется в папке задания.
  • TPL Designer дописывает служебный комментарий ! @TPLD-SIG kind=…; … с параметрами формы — по нему чтение возвращает саму форму, а не таблицу точек.

Фрагмент samples/MULTIFREQ/wg_multi.sig (в задании — INPUT_X ; 12; 72; 0; 40; [wg_multi]; 0;):

! Падающая волна: 10 тонов 3.0 ... 4.8 ГГц с шагом 0.2 ГГц.
! Две колонки: время в TIME_UNIT задания (нс) и безразмерное a(t).
...
#FREQ 3 3.2 3.4 3.6 3.8 4 4.2 4.4 4.6 4.8
! t[ns]              a
    0.00000000   0.000000000e+00
    0.00250000   6.122025351e-01
    0.00500000   1.221958982e+00

Подводные камни. Фаза входа с файлом не используется (ядро выводит предупреждение); FREQ шага остаётся частотой согласования порта. Шаг записи должен быть мельче шага ядра Δ/(c2) — TPL Designer берёт вдвое мельче. Без #FREQ тоны многотона ищутся по спектру и смещаются друг относительно друга.

Отчёт о времени расчёта

Пишут ядра: с ключом /Time после «Run all» — рядом с заданием; кнопкой «Calc. time...» окна статистики — по выбору пользователя
Имя <имя .tpl без расширения>.timing_<H\|X>_<win32\|win64>.txt
Тип текст ASCII (по-английски), CR LF
Подробно Расчёт на видеокарте: отчёт, ядро H: замер времени

Состав: шапка (ядро, платформа, дата сборки, задание, компьютер, процессор, память, таймер), по каждому шагу — сетка, число тактов, dt, delta, строка Compute: (CPU или видеокарта), файлы .eps, таблица этапов A1…E1 и скорость; в конце — сводка по шагам. Фрагмент отчёта прогона на видеокарте:

------------------------------------------------------------------------------
 STEP 1  (finished), started 19:42:56
------------------------------------------------------------------------------
 Grid: nX = 1000, nY = 1000, nodes = 1000000; blocks = 2
 Time steps: 1000 of 1000 done; dt = 2.35865e-12 s; delta = 0.001 m
 Compute: GPU 0: NVIDIA GeForce RTX 5070 Ti (OpenCL 3.0 CUDA, driver 617.42, 15.9 GB)
 Distribution files (.eps): not used

   Phase                                                  h:mm:ss.mmm        seconds  % of step
 A. PREPROCESSOR AND INPUT
   A1 Release of data of the previous step                ...
 ...
 Speed: 0.173 ns per node per time step; 5782.47 million node-updates per second

Отчёт предназначен для чтения человеком; строгих гарантий формата для машинного разбора нет (отчёты старых сборок, например samples/BENCH/*.timing_*.txt, не содержат строк Compute: и Distribution files).

Импорт S-параметров HFSS и CST

TMCGROUT читает элемент S-матрицы не только из .s, но и из текстовых таблиц двух внешних САПР — функцией read_S_matrix_element библиотеки SFILE95, которая пробует форматы по очереди: .s → HFSS → CST. Преобразования в .s нет: файл читается при каждом построении графика. Подробно — SFILE95: чтение одного элемента.

HFSS — Touchstone с картой возбуждений. Строки … -> P<вход>M<мода> до строки !END EXCITATION_MAPS задают порядок пар «вход, мода»; их число — размерность N. Далее на каждую частоту: частота (ГГц, переводится в Гц) и N2 пар (Re, Im) по строкам. Фрагмент src/viewers/Tmcgrout/Dc4.s4p (дерево исходников MFC-версии):

!  symbol   freq-unit  parameter-type  data-format  keyword  impedance-ohms
    #         GHz           S               RI          R        50.000000

!BEGIN EXCITATION_MAPS
! Excitation 1 -> P1M1
! Excitation 2 -> P1M2
! Excitation 3 -> P2M1
! Excitation 4 -> P2M2
!END EXCITATION_MAPS

         9  -0.127846  -0.229426   0.000123  -0.000199  -0.147989  -0.953477   0.000018   0.000011

             0.000123  -0.000199  -0.008452   0.100788  -0.000044   0.000014   0.414125  -0.904583
...

CST — первая строка — заголовок со столбцами WavePort<вход>):Mode(<мода>, их число — размерность N; вторая строка пропускается; далее по строке на частоту: частота (без пересчёта единиц) и N2 пар «модуль, фаза в градусах», переводимых в (Re, Im).

Подводные камни.

  • Строка Touchstone # GHz S RI R 50 не разбирается: частоты HFSS всегда считаются гигагерцами, пары — действительной и мнимой частью. Файл в другой единице или в формате MA/DB читается неверно; файл без блока EXCITATION_MAPS не читается.
  • Частоты CST берутся как есть, а ось TMCGROUT считает их герцами.
  • Номера входа и моды, которых нет в файле, исправляются в допустимые пределы, и в легенде показывается фактически прочитанный элемент; у CST при отсутствии пары в заголовке берётся первый столбец.

Файлы TPL Designer

Отдельного файла проекта у TPL Designer нет: проект — это само задание .tpl. readTplFile восстанавливает модель редактора из файла, написанного им самим или руками; служебные данные редактор хранит в комментариях задания (например ! @TPLD-SWEEP … для углового свипа) и .sig (! @TPLD-SIG …). Подробно — TPL Designer: запись задания.

Файл Когда Содержимое
<имя>.tpl всегда задание; CP1251, CR LF, запись атомарная
<имя>_step.h несколько частот или угловой свип макрос шага (включаемые файлы)
<имя>_001.tpl, <имя>_002.tpl, … конвейер заданий по частотам части задания со своими .t, .s и ДН
<имя>_run.bat, <имя>_run.sh при нескольких частях конвейера удаляют .s каждой части и запускают ядро (planarrt_h/planarrt_x или прежние tmc_rth/tmc_rtx) с ключами /Arb или /Arb /Time
<имя>_in<N>.sig вход с сигналом из файла падающая волна
.eps и другие сопутствующие файлы образцов образец с файлом распределения распределение ε
Документы/TPL Designer/Мои образцы/<название>/sample.json «Сохранить как образец…» JSON с полями title, summary, kernel (H/X), created (ISO 8601); рядом — задание образца. Папку можно переопределить переменной окружения TPLD_USER_SAMPLES

Чужие форматы на входе — 3D-модели для среза плоскостью (импорт 3D): STL (двоичный узнаётся по размеру 84+50N, в текстовом каждое solid <имя> — отдельное тело), OBJ (тело на объект o/g, материал usemtl, цвета из .mtl) и STEP (через OpenCASCADE, единица — мм).

Настройки программ

Qt6-версия не пишет в реестр: настройки хранятся в INI-файлах в папке %APPDATA%\TMC_Suite_Qt\ (Linux — ~/.config/TMC_Suite/). Код, который в MFC-версии работал с реестром (GetProfileString и др.), направлен слоем совместимости в файл <программа>.conf (слой совместимости: настройки).

Файл Программа Основные разделы и ключи
PlanarRT_H.conf, PlanarRT_X.conf ядра H и X [PlanRT_H Config] (у обоих ядер): пути программ просмотра и редактора, BackGroundColor, форматы чисел .t и поля OutputFormat*, флаги вывода поля и синхронизации, SoundEffectsFlag — оболочка ядер
TMCGROUT.conf, TMCROS.conf, TMC_DN.conf вьюверы [#TMCGROTS]: #TMCGROTS — параметры документа по умолчанию одной строкой с разделителем 0x01, #INIWNDVIEWPORT, форматы подписей осей, #TMCGROTS_POINTSIZE — TMCGROUT: настройки
все *.conf ядра и вьюверы [Recent File List] File1…FileN (пути с пометкой utf8:), [Window] — положение окна «x y ширина высота» (общие компоненты)
FieldView.ini FieldView [TMC_GraphicsOutputFieldFile] — флаги и цвета вида (ключи TMC_GraphOutFld_*, цвета #rrggbb), [General] — последняя папка и список файлов — FieldView: настройки
TPL Designer.ini TPL Designer только предпочтения вида ([view], [behaviour]), на содержимое .tpl не влияют — TPL Designer: настройки
Compute.ini ядра H и X [Compute] UseGpu, Device, [LastCheck] Name, Driver, Date, Ok — Compute.ini
Paths.ini ядра ключ TplDesigner — путь к редактору заданий
Common.ini все программы [UI] Language = system \| ru \| en — язык интерфейса

Фрагмент TMCGROUT.conf (символ 0x01 между параметрами не виден):

[#TMCGROTS]
#INIWNDVIEWPORT=20079 14409
#TMCGROTS=#dXAxiesUnit 0#dXAxiesName #PointDrawFlag 1; 1;#nXType 0#nYType 4#Xmin 1.425...
#TMCGROTS_POINTSIZE=1
#TMCGROTS_X_AXIES_FORMAT=%4.3lg

[Recent File List]
File1=utf8:C:/Users/.../msstub.s

Реестр. Читается только для совместимости: установщик пишет в HKCU\Software\TMC Suite пути InstallPath и TplDesignerPath (по ним ядра ищут TPL Designer); FieldView и TPL Designer при первом запуске переносят свои ключи из реестра прежних версий в INI.

Подводные камни.

  • Запись .conf перечитывает файл и перезаписывает его целиком; ошибка записи не сообщается.
  • Разделитель 0x01 в строке #TMCGROTS должен остаться одним байтом: если исходник вьювера пересохранить в другой кодировке, программа перестаёт помнить оси и цвета между запусками.
  • Неверный формат OutputFormat* (нужно одно преобразование d i u x o или g e f, ширина и точность не длиннее 2 цифр) заменяется форматом по умолчанию.

File Formats

Purpose of this page

A reference for every file read and written by the programs of the package — for anyone writing their own result post-processing or task-file generator. For each format the page states who writes it and who reads it, the encoding and line endings, the field order and units, an example from real files of the package (the samples/ directory) and the pitfalls. Details about the code that writes and reads each file are on the module pages; links are given in every section.

Almost all output files of a step share one base name — taken from the FILE name; line of the task's #OUTPUT section — and differ in extension (TMCIndan). Relative names in a task file are resolved against the task folder.

Summary table

Extension Purpose Written by Read by Section
.tpl computation task a person, TPL Designer H and X kernels, TPL Designer task file
_step.h etc. include file with a step macro a person, TPL Designer kernel preprocessor include files
<name>.tpl~$Prepr$~<PID> expanded task file kernel preprocessor kernel parser, a person (debugging) preprocessor output
$$vr$$s<PID>.prc temporary macro file kernel preprocessor — preprocessor output
.s scattering matrix (binary) kernels, TMCROS (To S-matrix) TMCGROUT, kernels and TMCROS when appending .s file
.t signals at the ports kernels TMCROS, kernels and TMCROS (conversion to .s) .t file
.soc, .$OC TMCGROUT document TMCGROUT TMCGROUT viewer documents
.tos, .$os TMCROS document TMCROS TMCROS viewer documents
.dop, .$op TMC_DN document TMC_DN TMC_DN viewer documents
.AMP, .FAZ field amplitude and phase at the RP frequency kernels (FIELD_DISTRIBUTION) FieldView, kernel (building the .DAT) RP files
.COS, .SIN field quadratures kernels (file mode of the RP) kernel RP files
.DAT equivalent radiators on the contour kernels, TMC_DN (deviations) TMC_DN .DAT file
.opt, .dev required RP, RP with deviations a person / TMC_DN TMC_DN / a person RP files
.ex field frame kernels (FIELDS) FieldView field files
.tf field frame of old versions — FieldView field files
.ex.frames frame series FieldView FieldView frame series
.tt topology and ε grid kernels (TOPOLOGY) FieldView topology
.eps distribution of ε (N, B, Y) over the nodes kernels (RECT_STAT [name]), TPL Designer kernels (FILE* blocks), TPL Designer .eps file
.sig incident wave from a file TPL Designer, a person kernels, TPL Designer .sig file
.timing_<H\|X>_<win32\|win64>.txt computation time report kernels (/Time, Calc. time) a person /Time report
HFSS text, CST text S-parameters from other CAD tools external programs TMCGROUT import
_run.bat, _run.sh, sample.json; STL, OBJ, STEP TPL Designer files TPL Designer / external CAD tools a person / TPL Designer TPL Designer
.png, .jpg, .bmp, .gif field images and animation FieldView — field files
*.conf, *.ini program settings all programs all programs settings

General conventions

Property Rule
Text encoding 8-bit Windows code page CP1251: this is how TPL Designer writes (its own codec) and how strings are stored in the code of the kernels and viewers. Characters outside CP1251 (ε, λ, →) must not get into the files
Line endings CR LF on all systems: files with explicit \r\n (.ex, .tt, .eps, .AMP, the /Time report) — by the code; text files of the kernels and viewers (.t, .DAT, documents) — via fopen text mode, which on Linux is reproduced by the compatibility layer (text mode). The package's readers also accept LF
Binary numbers machine byte order (x86 / x64 — little-endian); double — 8 bytes; node number in .eps — 4 bytes
Value precision the Accuracy / nAccuracy header field = sizeof(_real): 8 (double) in current builds, 4 (float) in some old files. Readers accept both
Numbers in text printf formats %lg, %d; decimal point, not comma
Units in output files SI: m, s, Hz — except .DAT (mm, GHz, degrees), .sig (task units) and header captions

Task file .tpl

Written by a person in any text editor; TPL Designer (writeTask)
Read by H and X kernels: the PREPR preprocessor, then the TMCIndan parser; TPL Designer (readTplFile)
Encoding CP1251; TPL Designer writes CR LF and, when reading, detects UTF-8 by itself (by the BOM or by a valid byte sequence)
Full language reference user manual ".tpl task file"

Structure. A task is a sequence of steps #STEP … #END_STEP; each step consists of the sections #PARM, #TOPOLOGY, #LINK_LIST, #OUTPUT. By convention the first line is #TMC_RT_H (common to both kernels) and the last is #EOF. Lines with # start at the first column, all others with at least one space; parameters are separated by ;; ! anywhere in a line starts a comment.

Fragment of samples/LR1_wg.tpl (first step):

#TMC_RT_H
#define a   @ ( 58.17 )  ! channel width (PER VARIANT)
#define d   @ (  1.0 )   ! grid step (PER VARIANT)
...
#STEP
#PARM
 ANGLE_UNIT radian;
 FREQ_UNIT  GHz;
 LONG_UNIT  mm;
 TIME_UNIT  ns;
 DELTA  d;
 TIME   0.; 115;
 X_MIN  0.0;
 X_MAX  Lt;
 Y_MIN  0.0;
 Y_MAX  W;
 FREQ   3.3;
#END_PARM

#TOPOLOGY
 BLOCK 14;
  RECT_STAT EPS-1; L1; L1+L2; ylo; yhi;     ! dielectric insert
 END_B
 BLOCK 7;
  INPUT_X ; ylo; yhi; 0; 115; 1; 0;      ! port 1 (ACTIVE)
 END_B
 ...
#END_TOPOLOGY

#LINK_LIST
 T 14; 0.0; 0.0;
 T 7;  0.0; 0.0;
 ...
#END_LINK

#OUTPUT
 FILE wg;
 TOPOLOGY;
 FIELDS;
 SMATRIX wg; 3.3; 100; 110;
#END_OUTPUT
#END_STEP

Summary of the sections:

Section What it specifies Details
#PARM … #END_PARM units (ANGLE_UNIT, FREQ_UNIT, LONG_UNIT, TIME_UNIT), grid step DELTA, time TIME, region X_MIN…Y_MAX, frequency FREQ; may be absent in steps after the first TMCIndan: #PARM
#TOPOLOGY … #END_TOPOLOGY blocks BLOCK n; <primitive> …; END_B: RECT_STAT, CIRCLE_STAT, POLYGON_STAT, FILE, ports INPUT_X/INPUT_Y, plasma *_N/_B/_Y (X kernel) TMCIndan: blocks
#LINK_LIST … #END_LINK anchor point of each block: T n; X0; Y0; TMCIndan: topology
#OUTPUT … #END_OUTPUT FILE name; (mandatory), TOPOLOGY, FIELDS, SMATRIX, FIELD_DISTRIBUTION[_M] TMCIndan: #OUTPUT

What the kernel writes for the #OUTPUT section. According to the code (CTmcRTH_IndanOutput, PutField, PutTopology), the following are created from the base name: .t (always), .ex (FIELDS), .tt (TOPOLOGY), .s (SMATRIX; the name is given separately, without a dot — .s is appended), RP files from FIELD_DISTRIBUTION[_M] (with their own base name). The names .ey, .hz, .em, .ef, .q, .ix, .iy are constructed, but no kernel writes to them; the field of both kernels goes to .ex.

Limitations and pitfalls.

  • In the ε expression of an H-kernel block you write Δε=ε−1, not ε (H kernel).
  • No #EOF — kernel error Missing #EOF. The kernel does not check the first line #TMC_RT_H, but TPL Designer will not open a task without it.
  • The order of lines in #PARM matters: a unit applies to the values read after it (TMCIndan).
  • A dot is not allowed in the FILE name (a dot in a folder name is fine).
  • A line after preprocessing is at most 19998 characters long; the paths to the task file and to the ~$Prepr$~ file are shorter than 260 characters (Windows).
  • One .s holds at most 99 frequencies; the kernel checks this before the computation.
  • The kernel's expression evaluator does not understand exponential notation (1e-3) in expressions with operators — write numbers without an exponent, as TPL Designer does.

Include files and macros

Written by a person; TPL Designer — <name>_step.h for several frequencies or an angular sweep
Read by the kernel preprocessor (the #include name directive)
Encoding same as .tpl
Details PREPR: #include, #define, TPL Designer: macro version

The file contains a step macro definition: #define name par1; par2; … @ and a body, every line of which except the last ends with exactly two backslashes \\. Fragment of samples/VOLNSTEP.H:

#define stepV Freq__; File__; SFile__; Tmin__; Tmax__; @\\
#STEP\\
#PARM\\
 ANGLE_UNIT radian;\\
 ...
 FREQ  Freq__ ;\\
#END_PARM\\
...
#OUTPUT\\
 FILE File__;\\
 SMATRIX SFile__; Freq__; Tmin__; Tmax__;\\
 FIELDS;\\
 TOPOLOGY;\\
#END_OUTPUT\\
#END_STEP\\

and its invocation in samples/VOLN.TPL — one line per step:

#include VOLNSTEP.H
stepV 3.0; vs0; voln; 18; 20;
stepV 3.2; vs1; voln; 18; 20;
  • The include file is searched for only in the task folder and its subfolders; .. and : are not allowed in the name. Nesting depth is up to 64.
  • A single \ is not a line continuation; ! before \\ removes the continuation together with the comment.
  • Parameter names are replaced wherever they occur as a whole token — hence names like Freq__.

Preprocessor output

File Where Contents Lifetime
<full task file name>~$Prepr$~<PID> (for example wg.tpl~$Prepr$~12345); without <PID> if the name with the number is longer than 259 characters next to the task file expanded text: no comments, #include files and macros substituted; this is what the parser reads created when the kernel opens the task, deleted when it is closed
$$vr$$s<PID>.prc task folder texts of the #define directives deleted at the end of every preprocessor pass

PID is the kernel process ID: two kernels running the same task do not interfere with each other. Both files require write permission in the task folder. The ~$Prepr$~ file is the main tool for debugging macros: it shows how many #STEP steps were produced and whether any parameters were left unsubstituted. Details — PREPR: debug output.

Scattering matrix .s

Written by H and X kernels after a step (SMATRIX; a zero matrix if the step fails); TMCROS (Edit > To S-matrix). All via save_S_matrix_element of the SFILE95 library
Read by TMCGROUT (read_S_matrix_element); the writers — before appending
Type binary, little-endian
Details SFILE95: format, writing a column

Field types. Integer fields are 2 bytes (short); offsets are 4 bytes (int); frequencies, grid steps and matrix elements are double. A "Pascal string" (PS) is a length (2 bytes), text without a terminating zero, and the separator 0D 0A.

Part Contents
Header SMT\0, 102\0, 0D 0A, NS (number of header PS, 7 for a single grid), 0D 0A
PS × 2 program labels: TAMIC-RTH V 2.00, TAMIC_soft group. TAMIC Rt-H Planar Analyzer. 2000 (identical for H and X)
Grid PS grid flag (2 bytes, 0) and three double values — steps X, Y, Z, m (zeros in the package's files)
PS × 2 task name (in the package's files — Tamic Output Signal Viewer) and the full name of the .s itself
Offset table length 2 + 12·NF, number of frequencies written, NF records "frequency double, Hz + block offset int", 0D 0A
Interpolation table of the same form, always empty
Frequency blocks frequency (Hz), number of ports num, num mode counts, dimension dim, 0D 0A, dim² pairs (Re, Im) row by row, 0D 0A

The element Sij (i — receiving port, j — excited port, one mode per port) is stored at index (i-1)*dim + (j-1). Elements not yet computed are equal to FLT_MAX (both parts).

Example — the whole of samples/horn2.s (265 bytes, one frequency of 8 GHz, one port):

00000000: 534d 5400 3130 3200 0d0a 0700 0d0a 1000  SMT.102.........
00000010: 5441 4d49 432d 5254 4820 5620 322e 3030  TAMIC-RTH V 2.00
00000020: 0d0a 3200 5441 4d49 435f 736f 6674 2067  ..2.TAMIC_soft g
00000030: 726f 7570 2e20 5441 4d49 4320 5274 2d48  roup. TAMIC Rt-H
00000040: 2050 6c61 6e61 7220 416e 616c 797a 6572   Planar Analyzer
00000050: 2e20 3230 3030 0d0a 1a00 0000 0000 0000  . 2000..........
00000060: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000070: 0000 0000 0d0a 1a00 5461 6d69 6320 4f75  ........Tamic Ou
00000080: 7470 7574 2053 6967 6e61 6c20 5669 6577  tput Signal View
00000090: 6572 0d0a 2b00 433a 5c74 6d63 5f74 6573  er..+.C:\tmc_tes
000000a0: 745c 6578 616d 706c 655f 7461 736b 5f5f  t\example_task__
000000b0: 5f5c 7361 6d70 6c65 735c 686f 726e 322e  _\samples\horn2.
000000c0: 730d 0a0e 0001 0000 0000 0065 cdfd 41e7  s..........e..A.
000000d0: 0000 000d 0a0e 0000 0000 0000 0000 0000  ................
000000e0: 0000 0000 000d 0a00 0000 0065 cdfd 4101  ...........e..A.
000000f0: 0001 0001 000d 0ad4 0673 407c d795 bf4f  .........s@|...O
00000100: 779a 75b5 2162 3f0d 0a                   w.u.!b?..
Offset Bytes Value
0x0A 07 00 NS = 7
0x58 1a 00, 26 bytes, 0d 0a grid string: flag 0 and three zero steps
0xC3 0e 00 01 00 length of the main table 14 = 2 + 12·1; 1 frequency written
0xC7 00 00 00 00 65 cd fd 41 e7 00 00 00 frequency 8·10⁹ Hz, block at offset 231 (0xE7)
0xE7 …65 cd fd 41 01 00 01 00 01 00 0d 0a block: 8·10⁹ Hz, 1 port, 1 mode, dim = 1
0xF7 16 bytes, 0d 0a S11: Re, Im

Limitations and pitfalls.

  • The file is appended to, not overwritten. A new frequency is added; a frequency that is already present replaces its column. Before rerunning with different ports, the old .s must be deleted: with a different number of ports the write is rejected and the file stays unchanged.
  • At most 99 frequencies (FREQ_MAX_NUM = 100), at most 20 ports (MAX_INPUT_NUM), dim ≤ 255, file size at most 2 GB (4-byte offset).
  • There is no locking: two processes must not write the same .s at the same time — this is why the parts of a TPL Designer task pipeline use different .s files.
  • A frequency of 0 Hz is lost when merging (SFILE95).
  • With a single-frequency .s, the TMCGROUT plot has one point and no curve (TMCGROUT).

Port signals .t

Written by H and X kernels — at every sub-step
Read by TMCROS (signal plots); CTmcTtoS / CTmcWideband — conversion to .s (in the kernel after a step and in TMCROS via Edit > To S-matrix)
Type text, CR LF
Details H kernel: .t file, TMCROS: reading, multi-frequency header

Header (DeleteOutputFile, then PutPortInfo after the blocks are built):

Line Meaning
#TMC_GraphicsOutputSignalFile FormVer2.0 2000 format label (with a trailing space)
!File name <path> full file name
#TMC_GROTS_Freq <f> step frequency FREQ, Hz
#TMC_GROTS_InpNum -2 always −2
!nT<TAB>nBlock<TAB>Up<TAB>Uo column captions (comment)
#TMC_GROTS_Wideband 0\|1 1 — at least one port has a signal from a .sig file; such a .t is converted along the multi-frequency path
#TMC_GROTS_SigFreq f1 f2 … only if the .sig has a #FREQ line: tone frequencies, Hz
#TMC_GROTS_Port <block> <Δ, m> <aperture, m> <matching f, Hz> <0\|1> one line per port: block number, grid step, aperture width, matching frequency (= FREQ), signal-from-file flag

Data lines — one per sub-step; each starts with a space: time step number, model time (s), then for each port a triple "block number, Up (incident wave), Uo (outgoing wave)". The number formats are the kernel settings OutputFormat* (by default %9d, %15.7g, %4d, %15.7g, %15.7g, see settings). Ports are listed in the order of the blocks in the task.

Example — samples/MULTIFREQ/b_wide.t (two ports, signal from a file):

#TMC_GraphicsOutputSignalFile FormVer2.0 2000 
!File name C:\TMC_Suite\samples\MULTIFREQ\b_wide.t
#TMC_GROTS_Freq 3.9e+09
#TMC_GROTS_InpNum -2
!nT nBlock  Up  Uo
#TMC_GROTS_Wideband 1
#TMC_GROTS_SigFreq  3000000000 3200000000 3400000000 3600000000 3800000000 4000000000 4200000000 4400000000 4600000000 4800000000
#TMC_GROTS_Port 7 0.0005 0.06 3900000000 1
#TMC_GROTS_Port 12 0.0005 0.06 3900000000 0
        0              0   7              0              0  12              0              0
        1   1.179327e-12   7      0.2887948    -0.08554208  12              0              0
        2   2.358654e-12   7      0.5775897    -0.03940082  12              0              0

A single-frequency file (samples/horn1.t) differs by the line #TMC_GROTS_Wideband 0 and a single line #TMC_GROTS_Port 7 0.001 0.04 6000000000 0; files created before multi-frequency processing was introduced (samples/horn2.t) have no #TMC_GROTS_Wideband/_Port lines.

Limitations and pitfalls.

  • Readers treat only lines starting with a space as data; a time-step number format without a width (%d) makes the file unreadable.
  • The port number in TMCROS is the ordinal number of the triple in the line, not the block number.
  • While a step is running, the kernel keeps the file open with writing denied to other programs; a second kernel with the same FILE gets an error. The file can be read during the computation — an incomplete last line is skipped.
  • Each line is written with the line break at its beginning, so the file does not end with a line break.
  • Multi-frequency path: at most 99 ports and frequencies, at least 8 samples.

Viewer documents

File Program First-line label Plot lines refer to
.soc, .$OC TMCGROUT #TMCGROUT .s, HFSS/CST text, expression {…}
.tos, .$os TMCROS #TMCGROTS .t, expression {…}
.dop, .$op TMC_DN #TMCGROTS .DAT, expression {…}

Type — text, CR LF. Details: TMCGROUT: document file, TMCROS: document, TMC_DN: document file.

How it is created. Opening a data file (.s, .t, .DAT) creates a document next to it with the same name and the program's extension; if such a document already exists, a .$OC / .$os / .$op is created instead — the existing document is not overwritten. A file whose first line starts with the program's label is read as a document.

Layout. Lines #label value are parameters; ! at the start of a line or after a space outside [...] starts a comment; all other non-empty lines are plots. Spaces and tabs outside [...] are collapsed into one. Fragment of samples/DEMO/TMCGROUT/rths25.soc:

#TMCGROUT
!Graphics parameters
#dXAxiesUnit 0
#dXAxiesName 
#PointDrawFlag 1; 1;
#nXType 0
#nYType 0
...
#sDrawGridColor 0;
#sDrawPointColor 0; 16711680; 0; 75; 65280; 0; 75; ... (16 triples)
!Graphics data
!file name : E:\WORK\Source\SAMPLE_R\TEST_MET\EPS4\rths25.soc
!Data file for draw S-matrix graphics
!SFileName GraphicsName DrawFlag Input1 Mod1 Input2 Mod2
rths25.s rths25.s 1 1 1 2 1

A plot line: name caption show port1 mode1 port2 mode2. TMCGROUT also accepts 6, 5 and 1 fields; the name may carry the prefix *port1;mode1;port2;mode2*. The meaning of the fields differs between programs:

Field TMCGROUT TMCROS TMC_DN
name .s or HFSS/CST file .t .DAT
port1, mode1 S element: receiving port and mode ordinal number of the port in a .t line; 0 — Up, 1 — Uo port1 is not used; mode1 — the Reduce flag (take radiation sectors into account)
port2, mode2 excited port and mode not used not used

The parameters (#nXType, #nYType, #Xmin…#Ymax, #nAFlagX/Y, font, COLORREF colours as a decimal number, 16 line styles) are described in the TMCGROUT table. Paths without : and without a leading \\ are resolved against the document folder. Defaults for new documents are stored in the settings as a single line with the byte 0x01 as the separator.

Pitfalls. TMCROS and TMC_DN documents share the same label #TMCGROTS: a TMCROS document opened in TMC_DN will be taken for a list of .DAT files. Save As in TMC_DN suggests .tos — an RP document must be saved with .dop. Plot names and captions cannot contain spaces outside [...].

Radiation pattern files

The lines FIELD_DISTRIBUTION name; F; Tmin; Tmax; and FIELD_DISTRIBUTION_M … of the #OUTPUT section make the kernel accumulate the field harmonic at frequency F and write files with the base name name (TMCIndan: integration).

File When it is written Contents
.COS, .SIN FIELD_DISTRIBUTION only (file mode) quadratures over the whole grid; re-read and rewritten at every time step
.AMP, .FAZ after the window, except in the contour-strip mode amplitude and phase of the harmonic at every node
.DAT after the window equivalent radiators on the contour — input for TMC_DN
<name>_<F>MHz.DAT for several tones of the incident wave one .DAT per tone; <F> has as many decimal places as needed to keep the names distinct

.AMP, .FAZ, .COS, .SIN — the same format as a field frame: a text header #TMC_GraphicsOutputFieldFile … and nY rows of binary values. The phase is in the task's ANGLE_UNIT. Header of samples/horn2.AMP:

#TMC_GraphicsOutputFieldFile FormVer2.0 2000 
#TMCGROFLD_nT 21252
#TMCGROFLD_Time 5.01261e-008
#TMCGROFLD_Delta 0.001
#TMCGROFLD_Xmin 0
#TMCGROFLD_Ymin 0
#TMCGROFLD_Accuracy 4
#TMCGROFLD_LongUnit mm 0.001
#TMCGROFLD_TimeUnit ns 1e-009
#TMCGROFLD_nX 242
#TMCGROFLD_nY 172

Radiator file .DAT

Written by kernels (CFieldIntegrated); TMC_DN — a copy with deviations (the Make Distribution Deviation window)
Read by TMC_DN (c2DArray::ReadData)
Type text, CR LF
Details TMCIndan: .DAT, TMC_DN: input file

Lines: Frequence = <F, GHz> Ghz;, N = <number of records>;, the expression of the common element pattern (the kernel writes 1.), then one line per radiator: number, X, Y (mm), Amplitude, Faza (degrees), radiation sector FiMin…FiMax (degrees) and the radiator pattern. Each contour point produces three records: Ez (1.), Hy (cos(f)), Hx (sin(f)). Fragment of samples/horn2.DAT:

Frequence = 8 Ghz;
N = 2244;
1.
1   X = 10 mm; Y = 10.5 mm; Amplitude = 0; Faza = 121.821 degree; FiMin = 90.001 degree; FiMax = 269.999 degree; 1.
2   X = 10 mm; Y = 10.5 mm; Amplitude = 0; Faza = -247.702 degree; FiMin = 90.001 degree; FiMax = 269.999 degree; cos(f)
3   X = 10 mm; Y = 10.5 mm; Amplitude = 0; Faza = 0 degree; FiMin = 90.001 degree; FiMax = 269.999 degree; sin(f)

TMC_DN also accepts a radiator line of 5 fields (without the sector and the radiator pattern; the sector is then −180…180° and the radiator is isotropic) — it must end with degree;. The number at the start of the line is not checked; N is at most the file size / 32 + 1.

TMC_DN auxiliary files

File Written by Contents
<.DAT>~~tempDia0, …1 TMC_DN computation listing: radiators, directivity, aperture efficiency, RP points; deleted on recomputation and on closing
<.DAT>_Temp0, …1, ….chk TMC_DN RP cache (angle, magnitudes, phase) and its signature; for N ≥ 400 it stays on disk
.opt a person required RP: lines "angle in degrees, value" (at least 2 points)
.dev TMC_DN !Degree AmplitudeDirectPatternRequired AmplitudeDirectPattern, then one tab-separated line per angle

The digit 0/1 in the cache names is the Reduce flag. Details — TMC_DN: temporary files, deviations.

RP pitfalls.

  • The window end Tmax is rounded up to a whole number of periods of F; if it then exceeds TIME, the RP files are not written (step error).
  • With ANGLE_UNIT gradus the radiator phases in .DAT are wrong — use radian.
  • In the contour-strip mode (a large grid or several tones) .AMP/.FAZ are not written.
  • A multi-frequency RP requires FIELD_DISTRIBUTION_M; tones beyond 99 are discarded.

Field files

Written by H and X kernels — a frame at every sub-step with FIELDS (the file <name>.ex is overwritten); FieldView — series, images, GIF
Read by FieldView: .ex, .ey, .hz, .em, .tf, .AMP, .FAZ, *.frames series
Type text header CR LF + binary values
Details FieldView: field file, H kernel: output

The node value is the grid-node voltage: for the H kernel it is proportional to Ez, for the X kernel it equals Hz; both kernels write it to .ex. .tf is the extension of old versions; FieldView reads it with the same parser.

#TMC_GraphicsOutputFieldFile FormVer2.0 2000 CRLF
#TMCGROFLD_nT <time step number> CRLF
#TMCGROFLD_Time <model time, s> CRLF
#TMCGROFLD_Delta <grid step, m> CRLF
#TMCGROFLD_Xmin <x of node (0,0), m> CRLF
#TMCGROFLD_Ymin <y of node (0,0), m> CRLF
#TMCGROFLD_Accuracy <4|8> CRLF
#TMCGROFLD_LongUnit <name> <factor, m> CRLF
#TMCGROFLD_TimeUnit <name> <factor, s> CRLF
#TMCGROFLD_nX <number of nodes along X> CRLF
#TMCGROFLD_nY <number of nodes along Y>
then nY times: CRLF + nX values of Accuracy bytes each

Value rows go from bottom to top, and within a row from left to right; node (j,i) is value number inX+j. Data size after the header: nYnXa+2nY bytes, where a is Accuracy (CR LF comes before each row). Header of samples/horn1.ex:

#TMC_GraphicsOutputFieldFile FormVer2.0 2000 
#TMCGROFLD_nT 1
#TMCGROFLD_Time 2.35865e-12
#TMCGROFLD_Delta 0.001
#TMCGROFLD_Xmin 0
#TMCGROFLD_Ymin 0
#TMCGROFLD_Accuracy 8
#TMCGROFLD_LongUnit mm 0.001
#TMCGROFLD_TimeUnit ns 1e-09
#TMCGROFLD_nX 242
#TMCGROFLD_nY 202

Header lines are matched by their beginning and strictly in order; LongUnit and TimeUnit are used only for captions. Reading conditions: nX ≥ 2, nY ≥ 2, Accuracy 4 or 8.

Synchronization with the kernel — via the ARCHIVE file attribute: after writing a frame the kernel clears it, and after reading FieldView sets it; the kernel waits up to 25 s for the previous frame to be read (except in autostart). Your own reader running in parallel with the kernel must follow the same protocol or turn off synchronous output (FieldView: protocol).

Frame series .ex.frames

Not a kernel format: frames of the same kind written back to back, each one byte for byte like a kernel file. It is written by FieldView (the "Save time steps as a series…" command): each frame's header is the same as the kernel's, the values are float (Accuracy 4), and the write is atomic. Up to two CR/LF bytes are allowed between frames; an incomplete last frame and frames with a different grid are skipped on reading (FieldView: series).

Images

FieldView saves the current picture as PNG, JPEG or BMP and the time-step animation as GIF (FieldView: GIF).

Pitfalls.

  • If a field output format is set in the kernel settings (OutputFormatdOutField is not empty), the frame and the topology are written as text with no separators between value rows other than CR LF; FieldView cannot read such files (error "no CR LF after data row …").
  • FieldView does not read a single field file larger than 2 GB.
  • Field output at every sub-step slows the computation down many times over: for runs without viewing, remove FIELDS.

Topology .tt

Written by H and X kernels — when preparing a step (TOPOLOGY) and by a menu command
Read by FieldView (looks for a .tt with the same name next to the field file)
Type mixed: CR LF header, block list as LF lines, then binary grids
Details FieldView: topology file, X kernel: topology
#TMC_TopologyOutputFile FormVer2.0 2000 CRLF
#BlockListBegin LF
for each block (LF lines):
  <primitive keyword>
  <ε expression or METAL / ABSORBER / MAGNETIC …>
  <Vx>, <Vy>, <W> — one per line (for a port: amplitude, phase, W)
  X0 Xmax Xmin Y0 Ymax Ymin nBlock nMemory nType nXY
  nXY lines "x y" — polygon vertices
#BlockListEnd CRLF
#TMCGROFLD_nT, _Time, _Delta, _Xmin, _Ymin, _nX, _nY   (CRLF between them, no Accuracy and no units)
ε grid: nY times — CRLF + nX double values
X kernel: three more grids of the same kind — N (m⁻³), Y, B (T)

X0, Y0 — anchor point of the block, m; the limits Xmin…Xmax, Ymin…Ymax are in the local coordinates of the block, m (for a port Xmin…Xmax is the aperture and Ymin…Ymax the excitation window, s); nXY — number of polygon vertices; nType — block code (0 — dielectric, 100 — absorber, 101 — metal, 102…105 — ports, 107 — magnetic wall, table). The ε grid holds the full ε of the node (the kernel adds 1 to Δε). Fragment of samples/horn1.tt:

#TMC_TopologyOutputFile FormVer2.0 2000
#BlockListBegin
RECT_STAT 
METAL



0 0.04 0 0 0.08 0.079 1 5032 101 0
...
INPUT_X 

1
0

0 0.12 0.08 0 6e-08 0 7 2624 102 0
#BlockListEnd
#TMCGROFLD_nT 0
#TMCGROFLD_Time 0
#TMCGROFLD_Delta 0.001
#TMCGROFLD_Xmin 0
#TMCGROFLD_Ymin 0
#TMCGROFLD_nX 242
#TMCGROFLD_nY 202

Pitfalls. Grid values are always double, with no Accuracy field. FieldView uses the topology only if its grid matches the grid of the field file. The expressions mu, Dz, Hx, Hy and the force parameters of the blocks are not written to the file.

ε distribution .eps

Written by kernels — a RECT_STAT block (and RECT_STAT_N/_B/_Y of the X kernel) with an expression [name]expression; TPL Designer (epsFileBytes, auxiliary files window)
Read by kernels — FILE, FILE_N, FILE_B, FILE_Y blocks; TPL Designer (readEpsHeader, readEpsValues)
Type text header CR LF + binary records
Details H kernel: .eps files, X kernel: distribution files, TPL Designer: .eps

Header lines (in this order):

Line Meaning
#TamicRTH_planar_DistributionDielectricPermeability_File_V2.00 2000 format label
#TopologyPrimitiv <keyword> RECT_STAT or RECT_STAT_N/_B/_Y
#dDelta grid step, m — must match the task's DELTA (relative tolerance 10⁻⁵)
#Xmin, #Ymin coordinates of the first node relative to the block's anchor point, m
#nX, #nY, #nPoint grid sizes and the number of records nX·nY
#nAccuracy bytes per value: 4 or 8
#sNodeFormat NULL, #sValueFormat NULL legacy, always NULL

Then nPoint records back to back, with no separators: the value (nAccuracy bytes) and the 4-byte local node number j+inX; rows go from bottom to top, and within a row from left to right. The value is already multiplied by the node weight: 1 inside, 0.5 on a side, 0.25 at a corner of the rectangle; for an ε block it is weight × Δε. Header of samples/MULTIFREQ/fulleps.eps:

#TamicRTH_planar_DistributionDielectricPermeability_File_V2.00 2000
#TopologyPrimitiv RECT_STAT 
#dDelta 0.001
#Xmin 0.07
#Ymin 0.012
#nX 61
#nY 61
#nPoint 3721
#nAccuracy 8
#sNodeFormat NULL
#sValueFormat NULL

Lookup on reading. The name from a FILE block is looked up as given, then in the task folder and with the .eps extension. X-kernel blocks accept a file of their own type or RECT_STAT: FILE_N → RECT_STAT_N, FILE_B → RECT_STAT_B, FILE_Y → RECT_STAT_Y.

Pitfalls. The node number is 4 bytes: a block written to a file has at most INT_MAX nodes. The file does not depend on frequency. Nodes that fall outside the region are skipped on reading; the kernel does not use the coordinates from the FILE block line — the position is given by #Xmin, #Ymin and the anchor point.

Incident wave .sig

Written by TPL Designer (sigFileText, auxiliary files window); a person
Read by H and X kernels — a port with [name] instead of the amplitude; TPL Designer
Type text; TPL Designer writes CP1251, CR LF
Details H kernel: incident wave from a file, TPL Designer: .sig
  • Two columns: time in the task's TIME_UNIT and the dimensionless value a(t); lines in which two numbers were parsed are read.
  • Lines starting with ! or # are skipped; the line #FREQ f1 f2 … (in FREQ_UNIT) lists the tones of a multi-frequency signal — the kernel copies it into the .t header in hertz.
  • Time is strictly increasing, with at least two points; between points — linear interpolation, outside the file's range — 0. The port's Tmin…Tmax window also applies.
  • A name without a dot gets .sig; a name without a path is looked up in the task folder.
  • TPL Designer appends a service comment ! @TPLD-SIG kind=…; … with the waveform parameters — from it, reading restores the waveform itself rather than a table of points.

Fragment of samples/MULTIFREQ/wg_multi.sig (in the task — INPUT_X ; 12; 72; 0; 40; [wg_multi]; 0;):

! Incident wave: 10 tones 3.0 ... 4.8 GHz in steps of 0.2 GHz.
! Two columns: time in the task's TIME_UNIT (ns) and dimensionless a(t).
...
#FREQ 3 3.2 3.4 3.6 3.8 4 4.2 4.4 4.6 4.8
! t[ns]              a
    0.00000000   0.000000000e+00
    0.00250000   6.122025351e-01
    0.00500000   1.221958982e+00

Pitfalls. The phase of a port with a file is not used (the kernel prints a warning); the step's FREQ remains the port matching frequency. The sampling step must be finer than the kernel step Δ/(c2) — TPL Designer uses one half of it. Without #FREQ the tones of a multitone are searched for in the spectrum and are shifted relative to each other.

Computation time report

Written by kernels: with the /Time switch after "Run all" — next to the task file; with the "Calc. time..." button of the statistics window — at a location chosen by the user
Name <.tpl name without extension>.timing_<H\|X>_<win32\|win64>.txt
Type ASCII text (in English), CR LF
Details GPU computing: report, H kernel: timing

Contents: a heading (kernel, platform, build date, task, computer, processor, memory, timer), for each step — the grid, number of time steps, dt, delta, the Compute: line (CPU or GPU), .eps files, a table of phases A1…E1 and the speed; at the end — a summary over the steps. Fragment of a report from a GPU run:

------------------------------------------------------------------------------
 STEP 1  (finished), started 19:42:56
------------------------------------------------------------------------------
 Grid: nX = 1000, nY = 1000, nodes = 1000000; blocks = 2
 Time steps: 1000 of 1000 done; dt = 2.35865e-12 s; delta = 0.001 m
 Compute: GPU 0: NVIDIA GeForce RTX 5070 Ti (OpenCL 3.0 CUDA, driver 617.42, 15.9 GB)
 Distribution files (.eps): not used

   Phase                                                  h:mm:ss.mmm        seconds  % of step
 A. PREPROCESSOR AND INPUT
   A1 Release of data of the previous step                ...
 ...
 Speed: 0.173 ns per node per time step; 5782.47 million node-updates per second

The report is meant to be read by a person; there are no strict format guarantees for machine parsing (reports from old builds, for example samples/BENCH/*.timing_*.txt, contain no Compute: and Distribution files lines).

Importing HFSS and CST S-parameters

TMCGROUT reads an S-matrix element not only from .s but also from text tables of two external CAD tools — via the read_S_matrix_element function of the SFILE95 library, which tries the formats in turn: .s → HFSS → CST. There is no conversion to .s: the file is read every time the plot is built. Details — SFILE95: reading a single element.

HFSS — Touchstone with an excitation map. Lines … -> P<port>M<mode> up to the line !END EXCITATION_MAPS set the order of the "port, mode" pairs; their number is the dimension N. Then for every frequency: the frequency (GHz, converted to Hz) and N2 pairs (Re, Im) row by row. Fragment of src/viewers/Tmcgrout/Dc4.s4p (source tree of the MFC version):

!  symbol   freq-unit  parameter-type  data-format  keyword  impedance-ohms
    #         GHz           S               RI          R        50.000000

!BEGIN EXCITATION_MAPS
! Excitation 1 -> P1M1
! Excitation 2 -> P1M2
! Excitation 3 -> P2M1
! Excitation 4 -> P2M2
!END EXCITATION_MAPS

         9  -0.127846  -0.229426   0.000123  -0.000199  -0.147989  -0.953477   0.000018   0.000011

             0.000123  -0.000199  -0.008452   0.100788  -0.000044   0.000014   0.414125  -0.904583
...

CST — the first line is a header with columns WavePort<port>):Mode(<mode>, whose number is the dimension N; the second line is skipped; then one line per frequency: the frequency (with no unit conversion) and N2 pairs "magnitude, phase in degrees", converted to (Re, Im).

Pitfalls.

  • The Touchstone line # GHz S RI R 50 is not parsed: HFSS frequencies are always taken to be gigahertz, and the pairs to be real and imaginary parts. A file in another unit or in MA/DB format is read incorrectly; a file without an EXCITATION_MAPS block is not read.
  • CST frequencies are taken as they are, while the TMCGROUT axis treats them as hertz.
  • Port and mode numbers that are not in the file are clamped into the valid range, and the legend shows the element actually read; for CST, if the pair is missing from the header, the first column is taken.

TPL Designer files

TPL Designer has no separate project file: the project is the .tpl task file itself. readTplFile restores the editor model from a file written by the editor itself or by hand; the editor keeps its service data in task comments (for example ! @TPLD-SWEEP … for an angular sweep) and in .sig (! @TPLD-SIG …). Details — TPL Designer: writing the task file.

File When Contents
<name>.tpl always the task; CP1251, CR LF, atomic write
<name>_step.h several frequencies or an angular sweep step macro (include files)
<name>_001.tpl, <name>_002.tpl, … task pipeline over frequencies parts of the task with their own .t, .s and RP
<name>_run.bat, <name>_run.sh with several pipeline parts delete the .s of each part and launch the kernel (planarrt_h/planarrt_x or the former tmc_rth/tmc_rtx) with the /Arb or /Arb /Time switches
<name>_in<N>.sig a port with a signal from a file incident wave
.eps and other accompanying sample files a sample with a distribution file ε distribution
Documents/TPL Designer/Мои образцы/<title>/sample.json "Save as sample…" JSON with the fields title, summary, kernel (H/X), created (ISO 8601); the sample's task file lies next to it. The folder can be overridden with the TPLD_USER_SAMPLES environment variable

Foreign input formats — 3D models for slicing with a plane (3D import): STL (binary is recognized by its size 84+50N; in text STL each solid <name> is a separate body), OBJ (a body per o/g object, material usemtl, colours from .mtl) and STEP (via OpenCASCADE, unit — mm).

Program settings

The Qt6 version does not write to the registry: settings are stored in INI files in the folder %APPDATA%\TMC_Suite_Qt\ (Linux — ~/.config/TMC_Suite/). Code that in the MFC version worked with the registry (GetProfileString etc.) is redirected by the compatibility layer to the file <program>.conf (compatibility layer: settings).

File Program Main sections and keys
PlanarRT_H.conf, PlanarRT_X.conf H and X kernels [PlanRT_H Config] (for both kernels): paths of the viewers and the editor, BackGroundColor, number formats of .t and of the field OutputFormat*, field output and synchronization flags, SoundEffectsFlag — kernel shell
TMCGROUT.conf, TMCROS.conf, TMC_DN.conf viewers [#TMCGROTS]: #TMCGROTS — default document parameters as a single line with the 0x01 separator, #INIWNDVIEWPORT, axis label formats, #TMCGROTS_POINTSIZE — TMCGROUT: settings
all *.conf kernels and viewers [Recent File List] File1…FileN (paths marked utf8:), [Window] — window position "x y width height" (common components)
FieldView.ini FieldView [TMC_GraphicsOutputFieldFile] — view flags and colours (keys TMC_GraphOutFld_*, colours #rrggbb), [General] — last folder and the file list — FieldView: settings
TPL Designer.ini TPL Designer view preferences only ([view], [behaviour]); they do not affect the contents of .tpl — TPL Designer: settings
Compute.ini H and X kernels [Compute] UseGpu, Device, [LastCheck] Name, Driver, Date, Ok — Compute.ini
Paths.ini kernels key TplDesigner — path to the task editor
Common.ini all programs [UI] Language = system \| ru \| en — interface language

Fragment of TMCGROUT.conf (the 0x01 character between the parameters is invisible):

[#TMCGROTS]
#INIWNDVIEWPORT=20079 14409
#TMCGROTS=#dXAxiesUnit 0#dXAxiesName #PointDrawFlag 1; 1;#nXType 0#nYType 4#Xmin 1.425...
#TMCGROTS_POINTSIZE=1
#TMCGROTS_X_AXIES_FORMAT=%4.3lg

[Recent File List]
File1=utf8:C:/Users/.../msstub.s

Registry. It is read only for compatibility: the installer writes the paths InstallPath and TplDesignerPath to HKCU\Software\TMC Suite (the kernels use them to find TPL Designer); on first launch FieldView and TPL Designer migrate their keys from the registry of earlier versions to INI.

Pitfalls.

  • Writing a .conf re-reads the file and rewrites it entirely; a write error is not reported.
  • The 0x01 separator in the #TMCGROTS line must remain a single byte: if the viewer's source file is re-saved in a different encoding, the program stops remembering the axes and colours between launches.
  • An invalid OutputFormat* format (it needs exactly one conversion d i u x o or g e f, with a width and precision of at most 2 digits) is replaced with the default format.