# simos421/cst-matlab-api architecture

> Architecture diagram of the GitHub repository simos421/cst-matlab-api, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-06-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/simos421/cst-matlab-api
- Repository: https://github.com/simos421/cst-matlab-api

## Overview

##### Project type and purpose
- This is an open-source MATLAB API/library that automates CST Microwave Studio model creation, simulation setup, execution, and result extraction from within MATLAB.
- The README confirms it provides functions to define geometry, materials, solvers, and post-process simulation outputs via MATLAB scripts.

##### File structure
- Top-level directories and roles:
- Examples/: ready-to-run scripts illustrating end-to-end workflows
- Home/: “housekeeping” scripts (project creation, saving, quitting, unit definitions)
- Materials/: wrappers to define common dielectric/conductive materials in CST
- Simulation/: functions establishing solver types (frequency/domain, time-domain) and excitations/ports/monitors
- PostProcessing/: functions to export or load S-parameters, far-field results, touchstone files
- No front-end or server; it’s a modular MATLAB codebase invoking CST’s COM API under the hood.
- README and .m filenames indicate a wrapper architecture: each .m calls a CST COM method.

##### README for additional insights
- Emphasizes step-by-step usage in Examples/MicrostripExample.m

##### Elements
- Clear labels: “MATLAB Host,” “CST COM Interface,” each module folder as a subsystem
- From Example → Home → Materials → Modeling → Simulation → CST Engine
- From CST Engine → PostProcessing → Output

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Actors and Environments
    User["User"]:::external
    MATLAB["MATLAB Host Environment"]:::external

    %% Example Scripts
    subgraph "Example Scripts"
        Example["MicrostripExample.m"]:::example
    end

    %% Project Documentation
    subgraph "Project Docs"
        README["README.md"]:::external
        LICENSE["LICENSE.txt"]:::external
    end

    %% API Modules
    subgraph "API Modules"
        HomeModule["Home Module\n(Home/)"]:::init
        MaterialsModule["Materials Module\n(Materials/)"]:::materials
        ModelingModule["Modeling Module\n(Modeling/)"]:::modeling
        SimulationModule["Simulation Module\n(Simulation/)"]:::simulation
        PostProcessingModule["PostProcessing Module\n(PostProcessing/)"]:::post
    end

    %% CST Integration
    CSTCOM["CST COM Interface"]:::bridge
    CSTEngine["CST Simulation Engine"]:::cloud
    Outputs["Simulation Outputs\n(Files, S-params, Far-field)"]:::data

    %% Data Flow
    User -->|"runs script"| Example
    Example -->|"init project"| HomeModule
    Example -->|"define materials"| MaterialsModule
    Example -->|"build geometry"| ModelingModule
    Example -->|"setup simulation"| SimulationModule
    SimulationModule -->|"invoke solver via COM"| CSTCOM
    CSTCOM -->|"runs solver"| CSTEngine
    CSTEngine -->|"raw results"| PostProcessingModule
    PostProcessingModule -->|"export data"| Outputs
    Outputs -->|"loaded into"| MATLAB

    %% Documentation Links
    User -->|"reads"| README
    README -->|"license info"| LICENSE

    %% Click Events
    click Example "https://github.com/simos421/cst-matlab-api/blob/master/Examples/MicrostripExample.m"
    click HomeModule "https://github.com/simos421/cst-matlab-api/tree/master/Home/"
    click MaterialsModule "https://github.com/simos421/cst-matlab-api/tree/master/Materials/"
    click ModelingModule "https://github.com/simos421/cst-matlab-api/tree/master/Modeling/"
    click SimulationModule "https://github.com/simos421/cst-matlab-api/tree/master/Simulation/"
    click PostProcessingModule "https://github.com/simos421/cst-matlab-api/tree/master/PostProcessing/"
    click README "https://github.com/simos421/cst-matlab-api/blob/master/README.md"
    click LICENSE "https://github.com/simos421/cst-matlab-api/blob/master/LICENSE.txt"

    %% Styles
    classDef external fill:#EEEEEE,stroke:#333,stroke-width:1px;
    classDef example fill:#FFDDFF,stroke:#333,stroke-width:1px;
    classDef init fill:#BBCCFF,stroke:#333,stroke-width:1px;
    classDef materials fill:#CCFFCC,stroke:#333,stroke-width:1px;
    classDef modeling fill:#AAEEAA,stroke:#333,stroke-width:1px;
    classDef simulation fill:#FFDD99,stroke:#333,stroke-width:1px;
    classDef post fill:#DDCCFF,stroke:#333,stroke-width:1px;
    classDef bridge fill:#FFCCFF,stroke:#333,stroke-width:1px;
    classDef cloud fill:#CCFFCC,stroke:#333,stroke-width:1px;
    classDef data fill:#FFCCCC,stroke:#333,stroke-width:1px;
```
