Overview#

This section provides an overview of the PySpeos library, explaining its key concepts.

PySpeos overview#

PySpeos is a Python client to communicate with the Ansys SpeosRPC server.

The SpeosRPC server is based on gRPC and provides APIs to interact with Speos Solver.

Warning

Please be aware that the server is intended to work with a single user.

Warning

The server is under development, so all Speos features are not available yet.

Why SpeosRPC server?#

This allows the user to use the Speos capabilities without starting any CAD.

This offers the possibility to manage Speos capabilities with more liberty:

  • Data preparation

  • Running jobs

  • Result post processing

gRPC usage advantages#

There are several advantages to using gRPC.

  • Language independency between client and server. This means that the user has a large choice of languages to write the API calls. The user does not have to write the same language as the server.

  • OS independency between client and server. The client does not have to run on the same OS as the server. The SpeosRPC server is provided for Linux and Windows.

  • The client and server can run on different machines.

Schema#

The schema shows different ways to use Speos capabilities:

  • via CADs / Labs / Viewers GUI

  • via SpeosRPC server APIs

        %%{init: {'theme':'neutral'}}%%

flowchart LR

 SpeosSolver["Speos Solver"]
 SpeosRPCServer["SpeosRPC server"]
 StandardUsers["CADs / Labs / Viewers"]
 StandardUsers --> |uses|SpeosSolver
 SpeosRPCServer --> |uses|SpeosSolver
 User --> |calls APIs from|SpeosRPCServer
 User --> |uses UI|StandardUsers
    

How to use Speos capabilities.#

Speos Solver#

The Speos Solver represents the intelligence that is used to handle the light simulation.

SpeosRPC server#

The SpeosRPC server allows to translate the provided gRPC API calls into features understood by the Speos Solver.

PySpeos layering#

PySpeos is composed of several code layers, each of them having a different level of complexity and range of capabilities:

  • core

  • workflow

  • kernel

Examples of usage for each layer are available in the Examples section.

New users should avoid using kernel layer at a first usage.

Core#

The Core layer is the entry point of PySpeos.

It is designed to be representative of a classic Speos UI usage.

For instance, users can create a project (from scratch or from SPEOS file), add/modify/delete sources, sensors, simulations, materials, geometries, and compute simulations.

Workflow#

The Workflow layer offers a list of user workflows combining several actions into simple usage.

For instance, users can access a workflow that combines several Speos files into a single project. Another workflow allows users to display a simulation result (on windows environment only).

Kernel#

The Kernel layer offers more flexibility and capabilities than Core and Workflow.

It is designed to be a low level wrapper, and is close to the Speos gRPC APIs.

With the Kernel layer, users need to understand the notion about Template and Instances. Refer to the SpeosRPC server documentation on the Developer portal, Speos section to get a full understanding.

Warning

The Kernel layer is recommended for experienced users only.