Skip to main content

A package used to create and run simulations in Ansys Lumerical FDTD.

Project description

FDTDream

This README and user-guides are not quite finished.

FDTDream is a Python package designed to streamline the process of working with Lumerical FDTD simulations. Built on Lumerical's native Python API, FDTDream simplifies the creation and modification of simulation objects with a more intuitive and manageable syntax. Unlike the native API, FDTDream offers comprehensive auto-completion, well-structured documentation, and additional custom objects like lattices and regular polygons, making it significantly easier to use.


Contents

Installation

Auto-completion and documentation

Example usage

User-Guides

Getting Started

Creating Simulations

Object Basics

Geometry Module

Structures

Material module

Rotation module

Structure Basics


Installation

To use FDTDream, you must have Lumerical FDTD installed on your computer, along with a valid license and the correct path to Lumerical's Python API.

1. Install FDTDream

Run the following command:

pip install fdtdream

2. Set the Lumerical API path

To permanently set the location of Lumerical’s lumapi.py file, run:

from FDTDream import set_lumapi_location

set_lumapi_location("path_to_lumapi.py")

This needs to be done only once, as it updates the default search path for lumapi.py. Unless you reinstall or update FDTDream, no further action is required.

To get the currently set path, use:

from FDTDream import get_lumapi_location

print(get_lumapi_location())

Default lumapi.py location

By default, lumapi.py is typically found at:

C:\Program Files\Lumerical\v241\api\python\lumapi.py

Note: The v241 folder name may vary depending on your Lumerical installation version.


Autocompletion and documentation

One of FDTDream's key features is its powerful auto-completion and structured documentation. Lumerical's FDTD desktop application has a complex interface with deeply nested menus and options, which can be difficult to translate into a pure Python workflow. FDTDream addresses this challenge by organizing simulation objects into well-structured submodules that closely mirror the original application's hierarchy. This design makes navigation intuitive and enables users to explore available options efficiently. To facilitate this, FDTDream leverages auto-completion, allowing users to "scroll" through available properties and methods instead of memorizing their locations.

For instance, adding an FDTD Region and modifying its boundary conditions is as simple as:

from fdtdream import FDTDream

# Create a new simulation
sim = FDTDream.new_simulation("test_simulation")

# Add an FDTD Region
fdtd = sim.add._parent.fdtd_region()
fdtd.settings.boundary_conditions.boundaries.set_boundary_types(
    x_min="anti_symmetric", x_max="anti-symmetric",
    y_min="symmetric", y_max="symmetric"
)

While this structure may seem extensive, auto-completion eliminates the need to remember exact method locations. Additionally, all methods come with clear documentation, including input variables, types, and explanations of how each setting affects the simulation.

In practice, auto-completion hints will appear as follows:

image

image


Example usage:

TBD

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fdtdream-0.2.12.tar.gz (571.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fdtdream-0.2.12-py3-none-any.whl (334.0 kB view details)

Uploaded Python 3

File details

Details for the file fdtdream-0.2.12.tar.gz.

File metadata

  • Download URL: fdtdream-0.2.12.tar.gz
  • Upload date:
  • Size: 571.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.5

File hashes

Hashes for fdtdream-0.2.12.tar.gz
Algorithm Hash digest
SHA256 908152b2f802c3d5d7d1cc1ea1dfc95b8a8a607ea501dff2fa438cb853a63780
MD5 e2ff6b134b1748e712a18035e78bcaea
BLAKE2b-256 1061e86018ca745af3124206f50e943a07f373e8eb25d564d44f545375695df2

See more details on using hashes here.

File details

Details for the file fdtdream-0.2.12-py3-none-any.whl.

File metadata

  • Download URL: fdtdream-0.2.12-py3-none-any.whl
  • Upload date:
  • Size: 334.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.5

File hashes

Hashes for fdtdream-0.2.12-py3-none-any.whl
Algorithm Hash digest
SHA256 42d7d7dc68ec6b8f40a0ac0b2200482a66b45186fb20d55bafb7c5a93fc6e616
MD5 b2ad986d95faffecfc8616f0cd527a37
BLAKE2b-256 a706e37fffc58fc66786331acd9f02bd2b29fda69cbabf68fed761a678f8c9d1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page