pyPalace API

Submodules

pypalace.analysis module

pypalace.builder module

pypalace.config module

Configuration interface for generating AWS Palace configuration files.

This module provides the Config class for building, validating, and saving Palace JSON configuration files.

class pypalace.config.Config(config_name: str)

Bases: object

Object used to generate AWS Palace configuration files.

This class constructs and manages the JSON configuration structure used for Palace simulations.

Parameters:

config_name (str) – Name of the configuration and path where the JSON file will be saved.

add_Boundaries(BCs, Postprocessing=[])

Add Boundaries block to the Palace configuration.

This corresponds to the config["Boundaries"] section in the AWS Palace configuration file.

Parameters:
  • BCs (list) – List of boundary conditions definitions generated using pypalace.builder.Boundaries boundary condition functions.

  • Postprocessing (list, optional) – List of Boundaries postprocessing definitions generated using pypalace.builder.Boundaries postprocessing functions (SurfaceFlux, Dielectric, FarField, and on recent Palace builds also Impedance and Voltage under Postprocessing).

add_Domains(Materials, Postprocessing=[])

Add Domains block to the Palace configuration.

This corresponds to the config["Domains"] section in the AWS Palace configuration file.

Parameters:
  • Materials (list) – List of material definitions generated using pypalace.builder.Domains.Material().

  • Postprocessing (list, optional) – List of Domains postprocessing definitions generated using pypalace.builder.Domains postprocessing functions.

add_Model(Mesh: str, L0=1e-06, Lc=None, Refinement=None)

Add Model block to the Palace configuration.

This corresponds to the config["Model"] section in the AWS Palace configuration file.

Parameters:
  • Mesh (str) – Path to mesh file to be simulated.

  • L0 (float) – Length scale of mesh units relative to meters (default is 1.0e-6 corresponding to 1 mesh unit = 1 µm)

  • Lc (float, optional) – Characteristic length scale used for nondimensionalization.

  • Refinement (dict, optional) – Mesh refinement settings. This should be a dictionary generated using pypalace.builder.Model.Refinement().

add_Problem(Type: str, Output: str, Verbose=2)

Add Problem block to the Palace configuration.

This corresponds to the config["Problem"] section in the AWS Palace configuration file.

Parameters:
  • Type (str) – Problem type. Must be one of: “Electrostatic”, “Magnetostatic”, “Eigenmode”, “Driven”, “Transient”, or “BoundaryMode”.

  • Output (str) – Directory path where simulation results will be saved.

  • Verbose (int, optional) – Verbosity level of the Palace log file (default is 2).

add_Solver(Simulation, Order=1, Device='CPU', Linear=None)

Add Solver block to the Palace configuration.

This corresponds to the config["Solver"] section in the AWS Palace configuration file.

Parameters:
  • Simulation (dict) – Dictionary of simulation hyperparameters generated using pypalace.builder.Solver parameter functions.

  • Order (int) – Finite element order.

  • Device (str) – Runtime device configuration. Must be one of: “CPU”, “GPU”, “Debug”.

classmethod load_config(config_name)

Creates a new config object from a pre-existing Palace configuration file.

Parameters:

config_name (str) – Path to pre-existing configuration file

print_config()

Print the current configuration as formatted JSON.

save_config(check_validity=True)

Saves Config object as AWS Palace .JSON configuration file.

Parameters:

check_validity (bool, optional) – If True, check that all required configuration blocks have been defined before saving (default True).

pypalace.simulation module

pypalace.tools module

Module contents