Allsolve SDK API Reference
allsolve SDK 0.3.1-beta
Section titled “allsolve SDK 0.3.1-beta”decorators
Section titled “decorators”deprecated
Section titled “deprecated”def deprecated(reason)This is a decorator which can be used to mark functions as deprecated. It will result in a warning being emitted when the function is used.
allsolve
Section titled “allsolve”allsolve.export_format
Section titled “allsolve.export_format”Shared constants for output YAML aliases used by import, export, and codegen.
allsolve.import_project
Section titled “allsolve.import_project”Contains a PoC of a convenience import format parser.
import_project
Section titled “import_project”def import_project(file_or_data: str | dict, project_to_modify: Project | None = None) -> ProjectImport a project from a file or a dictionary.
Takes a file in YAML or JSON format, an example with all supported fields etc. is given in example/import_project/project-format.yaml.
Arguments:
file_or_data- The path to the file to import or a dictionary.project_to_modify- The project to modify. If not provided, a new project is created.
Returns:
The imported project object.
parse_tuple
Section titled “parse_tuple”def parse_tuple( value: dict | tuple | list | None, expected_dimensions: int = 3) -> tuple[float | str, ...] | NoneParse a tuple value from YAML/JSON dictionary format. Accepts dictionary format with x, y, z keys (or x, y for 2D).
import_physics_and_interactions
Section titled “import_physics_and_interactions”def import_physics_and_interactions(project: Project, physics_list: list[dict] | None, regions: dict[str, Region], verbose: bool = False)Import physics and nested interactions.
Expected format: physics: - type: solidMechanics # or solid_mechanics target: cubes # region name or id interactions: - type: load name: Load target: some_surface_region force: “[0; 0; -1000]“
import_interactions_for_physics
Section titled “import_interactions_for_physics”def import_interactions_for_physics(project: Project, physic: Physic, interactions: list[dict], regions: dict[str, Region], verbose: bool = False)Import interactions nested under a physics entry.
Parameters are provided at the top level of each interaction entry (camelCase or snake_case keys).
import_outputs_for_simulation
Section titled “import_outputs_for_simulation”def import_outputs_for_simulation(project: Project, simulation: Simulation, outputs: list[dict] | None, verbose: bool = False)Import simulation output interactions (e.g. fieldOutput) nested under a simulation entry.
Output parameters are provided at the top level (camelCase or snake_case keys). Friendly aliases are supported::
expression → {outputType} (e.g. fieldOutput)skinOnly → {outputType}SkinOnly (e.g. fieldOutputSkinOnly)deformedMesh→ {outputType}DeformedMesh(e.g. fieldOutputDeformedMesh)A filter key is expanded into the raw filter parameters; see
:func:_expand_output_filter.
allsolve.material
Section titled “allsolve.material”MaterialProperty Objects
Section titled “MaterialProperty Objects”class MaterialProperty()MaterialProperty is a base class for managing material properties.
Material Objects
Section titled “Material Objects”class Material()Material is a class for managing materials in a project.
create
Section titled “create”@classmethoddef create(cls, name: str, color: str, description: str | None = None, properties: List[MaterialProperty.PhysicalProperty] = [], target_region: Region | None = None, abbreviation: str | None = None, orientation: str | Tuple[float | int, float | int, float | int] | None = None, enabled: str | None = None, project_id: str | None = None) -> SelfCreate a new material.
Arguments:
name- The name of the material.color- The color of the material. Format: “#RRGGBB”description- Optional description of the material.properties- List of PhysicalProperty objects of the material.target_region- The target Region of the material.abbreviation- Optional abbreviation of the material.orientation- Optional orientation of the material. Can be a tuple of 3 floats or a string like “[90; 0; 0]”enabled- Optional enabled expression of the material. Can be a string expression like “eq(my_variable, 1)”project_id- The ID of the project.
Returns:
The created Material.
@classmethoddef get(cls, material_id: str, project_id: str | None = None) -> SelfGet a material by its ID.
get_all
Section titled “get_all”@classmethoddef get_all(cls, project_id: str | None = None) -> List[Self]Get all materials in a project.
get_all_from_library
Section titled “get_all_from_library”@classmethoddef get_all_from_library(cls) -> List[rawapi.Material]Get all library materials.
Returns:
List of library rawapi.Material objects.
create_from_library
Section titled “create_from_library”@classmethoddef create_from_library(cls, name: str, target_region: Region | None = None, enabled: str | None = None, project_id: str | None = None) -> SelfCreate a new material from a library material by name.
Arguments:
name- The name of the library material to copy.target_region- The target Region of the material.enabled- Optional enabled expression of the material. Can be a string expression like “eq(my_variable, 1)”project_id- The ID of the project.
Returns:
The created Material.
Raises:
ValueError- If no library material with the given name is found.
@property@prevent_deleteddef id() -> strGet the ID of the material.
@property@prevent_deleteddef name() -> strGet the name of the material.
@name.setter@prevent_deleteddef name(name: str) -> NoneSet the name of the material. Use save() to commit the change.
description
Section titled “description”@property@prevent_deleteddef description() -> str | NoneGet the description of the material.
description
Section titled “description”@description.setter@prevent_deleteddef description(description: str) -> NoneSet the description of the material. Use save() to commit the change.
@property@prevent_deleteddef color() -> strGet the color of the material.
@color.setter@prevent_deleteddef color(color: str) -> NoneSet the color of the material. Use save() to commit the change.
target
Section titled “target”@property@prevent_deleteddef target() -> str | NoneGet the target of the material.
target
Section titled “target”@target.setter@prevent_deleteddef target(target: str) -> NoneSet the target of the material. Use save() to commit the change.
properties
Section titled “properties”@property@prevent_deleteddef properties() -> List[rawapi.PhysicalProperty]Get the properties of the material.
properties
Section titled “properties”@properties.setter@prevent_deleteddef properties(properties: List[rawapi.PhysicalProperty]) -> NoneSet the properties of the material. Use save() to commit the change.
abbreviation
Section titled “abbreviation”@property@prevent_deleteddef abbreviation() -> str | NoneGet the abbreviation of the material.
abbreviation
Section titled “abbreviation”@abbreviation.setter@prevent_deleteddef abbreviation(abbreviation: str) -> NoneSet the abbreviation of the material. Use save() to commit the change.
orientation
Section titled “orientation”@property@prevent_deleteddef orientation() -> str | NoneGet the orientation of the material.
orientation
Section titled “orientation”@orientation.setter@prevent_deleteddef orientation( orientation: str | Tuple[float | int, float | int, float | int] | None) -> NoneSet the orientation of the material. Can be a tuple of 3 floats or a string like “[90; 0; 0]” Use save() to commit the change.
enabled
Section titled “enabled”@property@prevent_deleteddef enabled() -> str | NoneGet the enabled status of the material.
enabled
Section titled “enabled”@enabled.setter@prevent_deleteddef enabled(enabled: str) -> NoneSet the enabled status of the material. Use save() to commit the change.
delete
Section titled “delete”@prevent_deleteddef delete() -> NoneDelete the material.
@prevent_deleteddef save() -> NoneExplicitly save the changes to the cloud made by
setting properties name, description, color, and properties.
allsolve.token
Section titled “allsolve.token”allsolve.intcomp
Section titled “allsolve.intcomp”Integer compression library for efficient storage of integer sequences.
Uses differential encoding combined with optional zstd compression or RLE.
Scheme Objects
Section titled “Scheme Objects”class Scheme(IntEnum)Compression scheme used for encoding.
Simple differential encoding
DIFF_RLE
Section titled “DIFF_RLE”Differential + run-length encoding
DIFF_ZSTD
Section titled “DIFF_ZSTD”Differential + zstd compression
encode
Section titled “encode”def encode(ints: List[int], zstd_compressor: Optional[zstd.ZstdCompressor] = None) -> bytesEncode a list of integers using differential compression.
Automatically selects the best compression scheme:
- DIFF for small arrays (≤4 elements)
- DIFF_RLE for constant-difference sequences
- DIFF_ZSTD for larger variable arrays
Arguments:
ints- List of integers to compress.zstd_compressor- Optional pre-created zstd compressor for reuse. If None, a new one will be created when needed.
Returns:
Compressed bytes.
decode
Section titled “decode”def decode( encoded: bytes, zstd_decompressor: Optional[zstd.ZstdDecompressor] = None) -> List[int]Decode compressed integer data.
Arguments:
encoded- Compressed bytes from encode().zstd_decompressor- Optional pre-created zstd decompressor for reuse. If None, a new one will be created when needed.
Returns:
List of decoded integers.
allsolve.util
Section titled “allsolve.util”NotInitializedError Objects
Section titled “NotInitializedError Objects”class NotInitializedError(Exception)Exception for when a class or data is not initialized.
DeletedError Objects
Section titled “DeletedError Objects”class DeletedError(Exception)Exception for when an object is deleted.
NotProjectAPIKeyError Objects
Section titled “NotProjectAPIKeyError Objects”class NotProjectAPIKeyError(Exception)Exception for when a project API key is not set.
prevent_deleted
Section titled “prevent_deleted”def prevent_deleted(f)Decorator to prevent access to methods/properties of deleted objects. Raises DeletedError if the object’s _deleted attribute is True.
allsolve.job
Section titled “allsolve.job”Job Objects
Section titled “Job Objects”class Job()Job for a project.
Jobs are created when a geometry or a mesh is processed, or when a simulation is run.
@propertydef id() -> strGet the job ID
get_status
Section titled “get_status”def get_status() -> str | NoneGet the current status of the job.
Returns:
The status of the job.
refresh_status
Section titled “refresh_status”def refresh_status(delay_s: float = DEFAULT_DELAY_S) -> str | NoneRefresh the status of the job from the server.
Arguments:
delay_s- Optional time to wait before refreshing the status
Returns:
The status of the job.
is_running
Section titled “is_running”def is_running(refresh_delay_s: float | None = None) -> boolCheck if the job is still running.
Arguments:
refresh_delay_s- Optional time to wait before checking the status
Returns:
True if the job is still running, False otherwise.
get_logs
Section titled “get_logs”def get_logs(limit: int = 100) -> List[str]Get log messages, starting from where we left off previously
Arguments:
limit- Optional maximum number of logs to retrieve
Returns:
A list of log messages.
print_new_loglines
Section titled “print_new_loglines”def print_new_loglines(file: TextIO = sys.stdout, limit: int = 100) -> NonePrint new log lines to the specified output
Arguments:
file- Optional file to print the logs to.limit- Optional maximum number of logs to retrieve and print.
get_status_reason
Section titled “get_status_reason”def get_status_reason() -> str | NoneGet the reason for the current job status, if available
Returns:
The reason for the current job status, if available.
allsolve.region
Section titled “allsolve.region”RegionOperation Objects
Section titled “RegionOperation Objects”class RegionOperation(Enum)Enum for the RegionOperation.
Region Objects
Section titled “Region Objects”class Region()Region of a geometry.
get_all
Section titled “get_all”@classmethoddef get_all(cls, project_id: str | None = None) -> List[Self]Get all regions in the project.
Arguments:
project_id- The ID of the project. Can be omitted if project API key is used.
Returns:
A list of Region objects.
create
Section titled “create”@classmethoddef create(cls, name: str, entity_type: rawapi.EntityType, entity_tags: List[int], region_rule: rawapi.RegionRule | None = None, project_id: str | None = None) -> SelfCreate a region in the project.
Arguments:
name- The name of the region.entity_type- The type of the entity.entity_tags- The tags of the entity.region_rule- Optional region rule of the region.project_id- The ID of the project. Can be omitted if project API key is used.
Returns:
The created region.
@property@prevent_deleteddef id() -> strGet the ID of the region.
@property@prevent_deleteddef name() -> strGet the name of the region.
entity_tags
Section titled “entity_tags”@property@prevent_deleteddef entity_tags() -> List[int]Get the entity tags of the region.
entity_type
Section titled “entity_type”@property@prevent_deleteddef entity_type() -> rawapi.EntityTypeGet the entity type of the region.
delete
Section titled “delete”@prevent_deleteddef delete() -> NoneDelete the region.
KeyValueAttributePath Objects
Section titled “KeyValueAttributePath Objects”class KeyValueAttributePath(rawapi.AttributePath)KeyValueAttributePath.
RegionRule Objects
Section titled “RegionRule Objects”class RegionRule(Region)RegionRule.
create
Section titled “create”@classmethoddef create(cls, name: str, entity_type: rawapi.EntityType, attribute_path: rawapi.AttributePath | list[tuple[str, str]] | None = None, bounding_box: rawapi.ExpressionBoundingBox | None = None, min_size: rawapi.ExpressionVector | None = None, max_size: rawapi.ExpressionVector | None = None, project_id: str | None = None) -> SelfCreate a region rule in the project.
Arguments:
name- The name of the region.entity_type- The type of the entity.attribute_path- The attribute path of the region. Can be a list of tuples (key, value).Example- [(“LayerName”, “Polysilicon”)]bounding_box- The bounding box of the region.min_size- The minimum size of the region.max_size- The maximum size of the region.project_id- The ID of the project. Can be omitted if project API key is used.
Returns:
The created region rule.
ComputedRegion Objects
Section titled “ComputedRegion Objects”class ComputedRegion(Region)ComputedRegion.
create
Section titled “create”@classmethoddef create(cls, name: str, entity_type: rawapi.EntityType, operation: rawapi.RegionRuleOperation, source_region_ids: List[str], project_id: str | None = None) -> SelfCreate a computed region in the project.
Arguments:
name- The name of the region.entity_type- The type of the entity.operation- The operation to perform on the source regions.source_region_ids- The IDs of the source regions.project_id- The ID of the project. Can be omitted if project API key is used.
Returns:
The created computed region.
allsolve.quota
Section titled “allsolve.quota”get_quota
Section titled “get_quota”def get_quota() -> rawapi.OrganizationQuotaGet the organization’s quota information.
Returns the current quota status including core hours, used core seconds, and concurrent core limits.
allsolve.simulation.simulation
Section titled “allsolve.simulation.simulation”CPU Objects
Section titled “CPU Objects”class CPU(Enum)Enum for the type of CPU.
Runtime Objects
Section titled “Runtime Objects”class Runtime()Runtime for a simulation.
DisableableSection Objects
Section titled “DisableableSection Objects”class DisableableSection(Enum)Enum for generated simulation script sections that can be disabled. The generated script can be seen in Allsolve GUI.
A simulation script is generated from the project configuration. It consists of
generated sections interleaved with custom injection
points (see CustomSection). Disabling a generated section causes its code to
be emitted as comments, allowing users to replace it entirely using the surrounding
custom sections.
Use Simulation.disabled_script_sections to disable sections.
Values:
SETUP— Namespace declarations (variables, mesh, fields, etc.) and pre-mesh configuration.MESH— Mesh loading, PML layers, skin meshes, partitioning.FIELDS— Field creation for all physics.DERIVED_FIELDS— Derived field definitions.CONSTRAINTS— Physics boundary conditions and constraints.PORTS— Port and lump interaction definitions.FIELD_INITS— Field state initializations (initial conditions).FORMULATIONS— Formulation assembly and regular interaction definitions.SOLVE— Solver execution (transient loop, eigenvalue solve, or steady-state solve).
CustomSection Objects
Section titled “CustomSection Objects”class CustomSection(Enum)Enum for injection points for custom Python code in the generated simulation script. The generated script can be seen in Allsolve GUI.
A simulation script is composed of generated sections interleaved with custom
sections. Custom sections let you insert your own Python code at specific points
in the script. Use Simulation.set_scripts to assign code to a section.
Script structure example::
# importsimport quanscient as qsfrom utils import Mesh, Variables, Empty, Fields, DerivedFields
# AFTER_IMPORTS
# setupvar = Variables()mesh = Mesh()
# BEFORE_MESH_LOAD
# meshmesh.mesh = qs.mesh()mesh.mesh.setphysicalregions(*reg.get_region_data())
# AFTER_MESH_LOAD
# fieldsfld.u = qs.field("h1xyz", [1])fld.u.setorder(reg.all, 2)
# AFTER_FIELDS_CREATED
# derivedFieldsdf.sigma = qs.parameter(6, 1)df.vm = qs.parameter(1, 1)
# AFTER_DERIVED_FIELDS_CREATED
# constraintsfld.u.setconstraint(reg.clamp)
# AFTER_CONSTRAINTS_CREATED
# portsport.lump.V = qs.port([2, 3])
# AFTER_PORTS_CREATED
# fieldInits
# AFTER_FIELD_INITS
# formulationsform = qs.formulation()form += qs.integral(reg.solid_mechanics, qs.predefinedelasticity(qs.dof(fld.u), qs.tf(fld.u), par.H()))
# AFTER_FORMULATIONS_CREATED
# solve. Contains analysis-type-specific sub-sectionsform.allsolve(relrestol=1e-06, maxnumit=1000, nltol=1e-05, maxnumnlit=-1, relaxvalue=-1)
# AFTER_SOLVE and other analysis-type-specific sections
#AFTER_ALLValues:
AFTER_IMPORTS— After all module imports. Import additional Python modules or define global variables.BEFORE_MESH_LOAD— After setup (namespace and variable declarations). Modify setup variables before mesh loading.AFTER_MESH_LOAD— After the mesh is loaded and partitioned. Inspect or modify the mesh object.AFTER_FIELDS_CREATED— After all fields are created. Modify field properties or add custom fields.AFTER_DERIVED_FIELDS_CREATED— After derived fields are created. Modify derived field definitions.AFTER_CONSTRAINTS_CREATED— After physics constraints are applied. Add or modify boundary conditions.AFTER_PORTS_CREATED— After port/lump interaction definitions. Modify port configurations.AFTER_FIELD_INITS— After field state initializations. Override initial conditions.AFTER_FORMULATIONS_CREATED— After formulations and regular interactions are created. Modify the formulation before solving.AFTER_SOLVE— After the solve section.AFTER_ALL— After the solve section and all outputs. Post-processing, custom outputs, or cleanup.
Analysis-type-specific sections (only available when the analysis type matches):
AFTER_TIMESTEPPER_CREATED— Transient only. After the timestepper is created and configured, before the time loop.BEFORE_TRANSIENT_SOLVE— Transient only. Inside the time loop, before each solve step. Update time-dependent parameters or log per-step info.AFTER_EIGENVALUE_SOLVER_CREATED— Eigenmode only. After the eigenvalue solver is created, before eigenfrequency computation.AFTER_SOLVE_REAL— Eigenmode only. After the real part of the eigenmode solve.AFTER_SOLVE_IMAGINARY— Eigenmode only. After the imaginary part of the eigenmode solve.
Script Objects
Section titled “Script Objects”class Script()A script attached to a simulation.
The script can be a custom section script, a module, or a main script replacement.
- Custom section script: Injects code at a specific
CustomSectionpoint in the generated simulation script. Setsection_nameto the desired injection point. - Module: A helper file that other scripts can import. Created when
section_nameisNoneandis_mainisFalse(the defaults). - Main script replacement: Replaces the entire generated main script
with your own. Set
is_main=True.
Provide code via content (inline string) or filepath (path to a .py
file on disk). When using filepath, the file is read at the time
Simulation.set_scripts is called.
Arguments:
-
filepath- Path to a.pyfile whose contents will be used as the script. -
is_main- IfTrue, this script replaces the generated main script. -
section_name- TheCustomSectioninjection point where this script’s code will be inserted.Nonefor main scripts and modules. -
name- Script file name (e.g."afterMeshLoad.py"). Required when usingcontent; inferred fromfilepathotherwise. A.pysuffix is added automatically if missing. -
content- Inline Python code as a string.Example::
Custom section script
Section titled “Custom section script”sim.set_scripts([ allsolve.Script( name=“afterMeshLoad.py”, section_name=allsolve.CustomSection.AFTER_MESH_LOAD, content=“print(‘mesh loaded’)”, ) ])
SolverMode Objects
Section titled “SolverMode Objects”class SolverMode()Solver mode for a simulation.
TimestepAlgorithm Objects
Section titled “TimestepAlgorithm Objects”class TimestepAlgorithm()Timestep algorithm for a transient simulation.
AnalysisType Objects
Section titled “AnalysisType Objects”class AnalysisType()Simulation analysis type.
Simulation Objects
Section titled “Simulation Objects”class Simulation(JobMixin)Simulation of a project.
@classmethoddef get(cls, simulation_id: str, project_id: str | None = None) -> SelfGet a simulation by its ID.
Arguments:
simulation_id- The ID of the simulation.project_id- The ID of the project. Can be omitted if project API key is used.
Returns:
The simulation.
get_all
Section titled “get_all”@classmethoddef get_all(cls, project_id: str | None = None) -> List[Self]Get all simulations in the given project.
Arguments:
project_id- The ID of the project. Can be omitted if project API key is used.
Returns:
A list of simulations.
copy_simulation
Section titled “copy_simulation”@classmethoddef copy_simulation(cls, simulation_id: str, project_id: str | None = None) -> SelfMake a copy of the given simulation identified by its ID. Useful for creating simulations from a template.
Arguments:
simulation_id- The id of the source simulation.project_id- The id of the project where the source and target simulation exist. If project API key is used, this is optional.
Returns:
The copied simulation.
create
Section titled “create”@classmethoddef create(cls, name: str, description: str, max_run_time_minutes: int, solver_mode: rawapi.DistributedSolverMode, mesh_id: str | None = None, variable_overrides_id: str | None = None, analysis_type: rawapi.AnalysisType | None = None, harmonics: List[int] | None = None, physics: List[str] | None = None, transient_start_time: str | None = None, transient_end_time: str | None = None, transient_timestep_size: str | None = None, timestep_algorithm: rawapi.TimestepAlgorithm | None = None, fundamental_frequency: str | None = None, num_fft_samples: int | None = None, num_requested_eigenmodes: str | None = None, target_eigenfrequency: str | None = None, eigenmode_port_analysis: bool | None = None, solver_tolerance: str | None = None, nonlinear_solver_tolerance: str | None = None, nonlinear_solver_max_iterations: str | None = None, eigenmode_solver_tolerance: str | None = None, eigenmode_solver_max_iterations: str | None = None, target_frequency: str | None = None, numerical_jacobian: bool | None = None, project_id: str | None = None) -> SelfCreate a new simulation in the given project.
Arguments:
name- The name of the new simulation.description- The description of the new simulation.max_run_time_minutes- The maximum run time of the simulation.solver_mode- The solver mode of the simulation.mesh_id- The ID of the mesh to use in the simulation.variable_overrides_id- The optional ID of the VariableOverrides to use in the simulation.analysis_type- The analysis type of the simulation. Defaults to STATIC.harmonics- The harmonics of the simulation.physics- List of physics IDs to simulate.transient_start_time- The transient start time expression (for transient simulations).transient_end_time- The transient end time expression (for transient simulations).transient_timestep_size- The transient timestep size expression (for transient simulations).timestep_algorithm- The timestep algorithm (for transient simulations).fundamental_frequency- The fundamental frequency expression (for harmonic simulations).num_fft_samples- The number of FFT samples (minimum 3).num_requested_eigenmodes- The number of requested eigenmodes expression.target_eigenfrequency- The target eigenfrequency expression.eigenmode_port_analysis- Whether eigenmode port analysis is enabled.solver_tolerance- The solver tolerance expression.nonlinear_solver_tolerance- The nonlinear solver tolerance expression.nonlinear_solver_max_iterations- The nonlinear solver maximum iterations expression.eigenmode_solver_tolerance- The eigenmode solver tolerance expression.eigenmode_solver_max_iterations- The eigenmode solver maximum iterations expression.target_frequency- The target frequency expression.numerical_jacobian- Whether numerical Jacobian is enabled.project_id- The id of the project where the new simulation should be created. If project API key is used, this is optional.
Returns:
The created simulation.
@property@prevent_deleteddef id() -> strGet the ID of the simulation.
@property@prevent_deleteddef name() -> strGet the name of the simulation.
@name.setter@prevent_deleteddef name(name: str) -> NoneSet the name of the simulation.
description
Section titled “description”@property@prevent_deleteddef description() -> str | NoneGet the description of the simulation.
description
Section titled “description”@description.setter@prevent_deleteddef description(description: str) -> NoneSet the description of the simulation.
mesh_id
Section titled “mesh_id”@property@prevent_deleteddef mesh_id() -> str | NoneGet the ID of the mesh used in the simulation.
mesh_id
Section titled “mesh_id”@mesh_id.setter@prevent_deleteddef mesh_id(mesh_id: str) -> NoneSet the ID of the mesh used in the simulation.
max_run_time_minutes
Section titled “max_run_time_minutes”@property@prevent_deleteddef max_run_time_minutes() -> intGet the maximum run time of the simulation.
max_run_time_minutes
Section titled “max_run_time_minutes”@max_run_time_minutes.setter@prevent_deleteddef max_run_time_minutes(max_run_time_minutes: int) -> NoneSet the maximum run time of the simulation.
solver_mode
Section titled “solver_mode”@property@prevent_deleteddef solver_mode() -> rawapi.DistributedSolverModeGet the solver mode of the simulation.
solver_mode
Section titled “solver_mode”@solver_mode.setter@prevent_deleteddef solver_mode(solver_mode: rawapi.DistributedSolverMode) -> NoneSet the solver mode of the simulation.
node_count
Section titled “node_count”@property@prevent_deleteddef node_count() -> int | NoneGet the number of nodes used in the simulation.
node_type
Section titled “node_type”@property@prevent_deleteddef node_type() -> CPUGet the type of nodes used in the simulation.
shared_files
Section titled “shared_files”@property@prevent_deleteddef shared_files() -> List[rawapi.InputFile]Get the shared files used in the simulation.
@property@prevent_deleteddef files() -> List[rawapi.InputFile]Get the files used in the simulation.
get_input_files
Section titled “get_input_files”@prevent_deleteddef get_input_files() -> List[rawapi.SimulationInputFile]Get all input files used in the simulation.
Returns:
Unified list of all simulation input files.
set_input_files
Section titled “set_input_files”@prevent_deleteddef set_input_files(input_files: List[rawapi.SimulationInputFile]) -> NoneSet all input files used in the simulation.
Any existing input files missing from the provided list are removed.
Arguments:
input_files- Full list of input files to use in the simulation.
variable_overrides
Section titled “variable_overrides”@property@prevent_deleteddef variable_overrides() -> VariableOverrides | NoneGet the variable overrides of the simulation.
variable_overrides
Section titled “variable_overrides”@variable_overrides.setter@prevent_deleteddef variable_overrides(variable_overrides: VariableOverrides | None) -> NoneSet the variable overrides of the simulation.
analysis_type
Section titled “analysis_type”@property@prevent_deleteddef analysis_type() -> rawapi.AnalysisType | NoneGet the analysis type of the simulation.
analysis_type
Section titled “analysis_type”@analysis_type.setter@prevent_deleteddef analysis_type(value: rawapi.AnalysisType | None) -> NoneSet the analysis type of the simulation.
harmonics
Section titled “harmonics”@property@prevent_deleteddef harmonics() -> List[int] | NoneGet the harmonics of the simulation.
harmonics
Section titled “harmonics”@harmonics.setter@prevent_deleteddef harmonics(value: List[int] | None) -> NoneSet the harmonics of the simulation.
disabled_script_sections
Section titled “disabled_script_sections”@property@prevent_deleteddef disabled_script_sections() -> List[DisableableSection]Generated script sections that are currently disabled.
When a section is disabled, its generated code is emitted as comments in
the simulation script. This lets you replace the generated logic entirely
by providing your own code in the surrounding CustomSection injection
points.
Returns:
List of disabled sections.
See Also:
DisableableSection for the list of sections and what each one
generates.
disabled_script_sections
Section titled “disabled_script_sections”@disabled_script_sections.setter@prevent_deleteddef disabled_script_sections(value: List[DisableableSection]) -> NoneSet which generated script sections to disable.
Disabled sections have their generated code commented out, allowing you to
replace them with custom code via Simulation.set_scripts.
Arguments:
-
value- List of sections to disable.Example::
sim.disabled_script_sections = [ allsolve.DisableableSection.SETUP, allsolve.DisableableSection.MESH, ] sim.save()
physics
Section titled “physics”@property@prevent_deleteddef physics() -> List[str] | NoneGet the list of physics IDs to simulate.
physics
Section titled “physics”@physics.setter@prevent_deleteddef physics(value: List[str] | None) -> NoneSet the list of physics IDs to simulate.
transient_start_time
Section titled “transient_start_time”@property@prevent_deleteddef transient_start_time() -> str | NoneGet the transient start time expression.
transient_start_time
Section titled “transient_start_time”@transient_start_time.setter@prevent_deleteddef transient_start_time(value: str | None) -> NoneSet the transient start time expression.
transient_end_time
Section titled “transient_end_time”@property@prevent_deleteddef transient_end_time() -> str | NoneGet the transient end time expression.
transient_end_time
Section titled “transient_end_time”@transient_end_time.setter@prevent_deleteddef transient_end_time(value: str | None) -> NoneSet the transient end time expression.
transient_timestep_size
Section titled “transient_timestep_size”@property@prevent_deleteddef transient_timestep_size() -> str | NoneGet the transient timestep size expression.
transient_timestep_size
Section titled “transient_timestep_size”@transient_timestep_size.setter@prevent_deleteddef transient_timestep_size(value: str | None) -> NoneSet the transient timestep size expression.
timestep_algorithm
Section titled “timestep_algorithm”@property@prevent_deleteddef timestep_algorithm() -> rawapi.TimestepAlgorithm | NoneGet the timestep algorithm.
timestep_algorithm
Section titled “timestep_algorithm”@timestep_algorithm.setter@prevent_deleteddef timestep_algorithm(value: rawapi.TimestepAlgorithm | None) -> NoneSet the timestep algorithm.
fundamental_frequency
Section titled “fundamental_frequency”@property@prevent_deleteddef fundamental_frequency() -> str | NoneGet the fundamental frequency expression.
fundamental_frequency
Section titled “fundamental_frequency”@fundamental_frequency.setter@prevent_deleteddef fundamental_frequency(value: str | None) -> NoneSet the fundamental frequency expression.
num_fft_samples
Section titled “num_fft_samples”@property@prevent_deleteddef num_fft_samples() -> int | NoneGet the number of FFT samples.
num_fft_samples
Section titled “num_fft_samples”@num_fft_samples.setter@prevent_deleteddef num_fft_samples(value: int | None) -> NoneSet the number of FFT samples (minimum 3).
num_requested_eigenmodes
Section titled “num_requested_eigenmodes”@property@prevent_deleteddef num_requested_eigenmodes() -> str | NoneGet the number of requested eigenmodes expression.
num_requested_eigenmodes
Section titled “num_requested_eigenmodes”@num_requested_eigenmodes.setter@prevent_deleteddef num_requested_eigenmodes(value: str | None) -> NoneSet the number of requested eigenmodes expression.
target_eigenfrequency
Section titled “target_eigenfrequency”@property@prevent_deleteddef target_eigenfrequency() -> str | NoneGet the target eigenfrequency expression.
target_eigenfrequency
Section titled “target_eigenfrequency”@target_eigenfrequency.setter@prevent_deleteddef target_eigenfrequency(value: str | None) -> NoneSet the target eigenfrequency expression.
eigenmode_port_analysis
Section titled “eigenmode_port_analysis”@property@prevent_deleteddef eigenmode_port_analysis() -> bool | NoneGet whether eigenmode port analysis is enabled.
eigenmode_port_analysis
Section titled “eigenmode_port_analysis”@eigenmode_port_analysis.setter@prevent_deleteddef eigenmode_port_analysis(value: bool | None) -> NoneSet whether eigenmode port analysis is enabled.
solver_tolerance
Section titled “solver_tolerance”@property@prevent_deleteddef solver_tolerance() -> str | NoneGet the solver tolerance expression.
solver_tolerance
Section titled “solver_tolerance”@solver_tolerance.setter@prevent_deleteddef solver_tolerance(value: str | None) -> NoneSet the solver tolerance expression.
nonlinear_solver_tolerance
Section titled “nonlinear_solver_tolerance”@property@prevent_deleteddef nonlinear_solver_tolerance() -> str | NoneGet the nonlinear solver tolerance expression.
nonlinear_solver_tolerance
Section titled “nonlinear_solver_tolerance”@nonlinear_solver_tolerance.setter@prevent_deleteddef nonlinear_solver_tolerance(value: str | None) -> NoneSet the nonlinear solver tolerance expression.
nonlinear_solver_max_iterations
Section titled “nonlinear_solver_max_iterations”@property@prevent_deleteddef nonlinear_solver_max_iterations() -> str | NoneGet the nonlinear solver maximum iterations expression.
nonlinear_solver_max_iterations
Section titled “nonlinear_solver_max_iterations”@nonlinear_solver_max_iterations.setter@prevent_deleteddef nonlinear_solver_max_iterations(value: str | None) -> NoneSet the nonlinear solver maximum iterations expression.
eigenmode_solver_tolerance
Section titled “eigenmode_solver_tolerance”@property@prevent_deleteddef eigenmode_solver_tolerance() -> str | NoneGet the eigenmode solver tolerance expression.
eigenmode_solver_tolerance
Section titled “eigenmode_solver_tolerance”@eigenmode_solver_tolerance.setter@prevent_deleteddef eigenmode_solver_tolerance(value: str | None) -> NoneSet the eigenmode solver tolerance expression.
eigenmode_solver_max_iterations
Section titled “eigenmode_solver_max_iterations”@property@prevent_deleteddef eigenmode_solver_max_iterations() -> str | NoneGet the eigenmode solver maximum iterations expression.
eigenmode_solver_max_iterations
Section titled “eigenmode_solver_max_iterations”@eigenmode_solver_max_iterations.setter@prevent_deleteddef eigenmode_solver_max_iterations(value: str | None) -> NoneSet the eigenmode solver maximum iterations expression.
target_frequency
Section titled “target_frequency”@property@prevent_deleteddef target_frequency() -> str | NoneGet the target frequency expression.
target_frequency
Section titled “target_frequency”@target_frequency.setter@prevent_deleteddef target_frequency(value: str | None) -> NoneSet the target frequency expression.
numerical_jacobian
Section titled “numerical_jacobian”@property@prevent_deleteddef numerical_jacobian() -> bool | NoneGet whether numerical Jacobian is enabled.
numerical_jacobian
Section titled “numerical_jacobian”@numerical_jacobian.setter@prevent_deleteddef numerical_jacobian(value: bool | None) -> NoneSet whether numerical Jacobian is enabled.
field_initializations
Section titled “field_initializations”@property@prevent_deleteddef field_initializations() -> List[rawapi.FieldInitialization] | NoneGet the field initializations of the simulation.
get_outputs
Section titled “get_outputs”@prevent_deleteddef get_outputs() -> List[OutputInteraction]Get the output interactions of the simulation.
add_outputs
Section titled “add_outputs”@prevent_deleteddef add_outputs(outputs: List[OutputInteraction]) -> List[OutputInteraction]Add output interactions to the simulation.
set_scripts
Section titled “set_scripts”@prevent_deleteddef set_scripts(scripts: List[Script]) -> NoneUpload scripts attached to this simulation.
Scripts can inject custom Python code at specific points in the generated
simulation script (see CustomSection for the full list of injection
points), or replace the main script entirely.
Arguments:
-
scripts- List ofScriptobjects to upload.Example::
sim.set_scripts([ allsolve.Script( name=“afterMeshLoad.py”, section_name=allsolve.CustomSection.AFTER_MESH_LOAD, content=“print(‘mesh loaded’)”, ), allsolve.Script( name=“afterAll.py”, section_name=allsolve.CustomSection.AFTER_ALL, filepath=“my_postprocessing.py”, ), ])
get_scripts
Section titled “get_scripts”@prevent_deleteddef get_scripts() -> List[Script]Retrieve all scripts attached to this simulation.
Returns user-provided custom scripts.
Each returned Script has its name, content,
and section_name (if applicable) populated.
Returns:
List of Script objects.
refresh_status
Section titled “refresh_status”@prevent_deleteddef refresh_status(delay_s: float = 1) -> str | NoneRefresh the status of the processing of the simulation.
Arguments:
delay_s- Optional delay in seconds between checking the status of the simulation.
Returns:
The status of the processing of the simulation.
get_status
Section titled “get_status”@prevent_deleteddef get_status() -> str | NoneGet the status of the processing of the simulation.
Returns:
The status of the processing of the simulation.
is_running
Section titled “is_running”@prevent_deleteddef is_running(refresh_delay_s: float | None = None) -> boolCheck if the processing of the simulation is running.
Arguments:
refresh_delay_s- Optional delay in seconds between checking the status of the simulation.
Returns:
True if the simulation is running, False otherwise.
get_status_reason
Section titled “get_status_reason”@prevent_deleteddef get_status_reason() -> str | NoneGet the status reason of the simulation.
Returns:
The status reason of the simulation.
get_logs
Section titled “get_logs”@prevent_deleteddef get_logs(limit: int = 100) -> List[str]Get the logs of the simulation.
Arguments:
limit- Optional maximum number of logs to return.
Returns:
The logs of the simulation.
print_new_loglines
Section titled “print_new_loglines”@prevent_deleteddef print_new_loglines(file: TextIO = sys.stdout, limit: int = 100) -> NonePrint the new log lines of the simulation.
Arguments:
file- Optional file to print the logs to.limit- Optional maximum number of logs to print.
set_runtime
Section titled “set_runtime”@prevent_deleteddef set_runtime(runtime: Runtime) -> NoneSet the runtime of the simulation.
@prevent_deleteddef save() -> NoneExplicitly save the changes to the cloud made by set_runtime or by
setting any of the following properties:
name, description, mesh_id, max_run_time_minutes,
solver_mode, variable_overrides, analysis_type, harmonics,
disabled_script_sections, physics, transient_start_time,
transient_end_time, transient_timestep_size, timestep_algorithm,
fundamental_frequency, num_fft_samples, num_requested_eigenmodes,
target_eigenfrequency, eigenmode_port_analysis, solver_tolerance,
nonlinear_solver_tolerance, nonlinear_solver_max_iterations,
eigenmode_solver_tolerance, eigenmode_solver_max_iterations,
target_frequency, numerical_jacobian.
Otherwise the changes are saved automatically when start() is called.
set_shared_files
Section titled “set_shared_files”@prevent_deleteddef set_shared_files(handles: List[rawapi.InputFile]) -> NoneTakes a list of project shared file handles and marks them to be used with this simulation. To remove files, remove them from the list and set again.
Arguments:
handles- List of project shared file handles to use in the simulation
add_input_file_from_simulation
Section titled “add_input_file_from_simulation”@prevent_deleteddef add_input_file_from_simulation( source_simulation: Self | str, source_file_name: str, target_file_name: str, source_sweep_step: int | None = None, target_sweep_step: int | None = None, target_rank: int | None = None) -> rawapi.SimulationInputFileAdd a simulation output file written by another simulation as an input file for this simulation.
Arguments:
source_simulation- Source simulation or source simulation ID.source_file_name- Source file name in the source simulation.target_file_name- Target file name in this simulation.source_sweep_step- Optional source sweep step index.target_sweep_step- Optional target sweep step index in this simulation.target_rank- Optional target rank index.
Returns:
The created input file handle.
add_input_value_outputs_from_simulation
Section titled “add_input_value_outputs_from_simulation”@prevent_deleteddef add_input_value_outputs_from_simulation( source_simulation: Self | str, target_file_name: str, source_sweep_step: int | None = None, target_sweep_step: int | None = None, target_rank: int | None = None) -> rawapi.SimulationInputFileAdd a simulation value outputs written by another simulation as an input for this simulation.
Arguments:
source_simulation- Source simulation or source simulation ID.target_file_name- Target file name in this simulation.source_sweep_step- Optional source sweep step index.target_sweep_step- Optional target sweep step index in this simulation.target_rank- Optional target rank index.
Returns:
The created input file handle.
add_file
Section titled “add_file”@prevent_deleteddef add_file(filepath: str) -> rawapi.InputFileAdd the file in the given path to the simulation as an input file.
Arguments:
filepath- path to a file in the local system. If used in a simulation, it is available with its basename.
Returns:
The file handle.
Raises:
FileExistsError- If a file with the same name already exists and is fully uploaded.
add_json_file
Section titled “add_json_file”@prevent_deleteddef add_json_file(name: str, content: dict) -> rawapi.InputFileAdd a JSON file to the simulation with the given dictionary serialized into JSON as content.
Arguments:
name- The name for the file during the simulationcontent- dictionary containing your data
Returns:
The file handle.
Raises:
FileExistsError- If a file with the same name already exists and is fully uploaded.
@prevent_deleteddef run(print_logs: bool = False, refresh_delay_s: float = 1) -> NoneRuns the simulation and returns when the processing is complete.
Arguments:
print_logs- If True, print logs to the console.refresh_delay_s- Optional delay in seconds between checking the status of the job.
@prevent_deleteddef start() -> NoneStart the simulation.
@prevent_deleteddef abort() -> NoneAbort the simulation.
get_output_csv
Section titled “get_output_csv”@prevent_deleteddef get_output_csv( delimiter=",", refresh: bool = False, csv_format: CsvExportFormat = CsvExportFormat.EXPLODED) -> strGet the output of the simulation in CSV format.
Arguments:
delimiter- The delimiter to use in the CSV file.refresh- Whether to refresh the output data.csv_format- The format of the CSV file.
Returns:
String containing the output of the simulation in CSV format.
get_output_data
Section titled “get_output_data”@prevent_deleteddef get_output_data(refresh: bool = True) -> SimulationOutputDataReturns the output data of the simulation.
Arguments:
refresh- Whether to refresh the output data.
Returns:
allsolve.sim.SimulationOutputData object
get_output_values
Section titled “get_output_values”@prevent_deleteddef get_output_values(sweep_index: int = 0, refresh: bool = False) -> dictGet the output values of the simulation.
Arguments:
sweep_index- The index of the sweep.refresh- Whether to refresh the output values.
Returns:
The output values of the simulation.
clean_output_data_cache
Section titled “clean_output_data_cache”@prevent_deleteddef clean_output_data_cache() -> NoneClean the output data cache for this simulation. This invalidates any existing SimulationOutputData objects for this simulation.
save_output_field
Section titled “save_output_field”@prevent_deleteddef save_output_field(name: str, output_dir: str = "./", sweep_index: int = 0, step_index: int | None = None) -> NoneSave the output field of the simulation.
Arguments:
name- The name of the field to save.output_dir- The directory to save the field to.sweep_index- The optional index of the sweep.step_index- The optional index of the step or None.
save_output_mesh
Section titled “save_output_mesh”@prevent_deleteddef save_output_mesh(name: str, output_dir: str = "./", sweep_index: int = 0, step_index: int | None = None) -> NoneSave the output mesh of the simulation.
Arguments:
name- The name of the mesh to save.output_dir- The directory to save the mesh to.sweep_index- The optional index of the sweep.step_index- The optional index of the step or None.
save_output_files
Section titled “save_output_files”@prevent_deleteddef save_output_files(filenames: List[str], output_dir: str = "./", sweep_index: int = 0, step_index: int | None = None) -> NoneSave the output files of the simulation.
Arguments:
filenames- The names of the files to save.output_dir- The directory to save the files to.sweep_index- The optional index of the sweep.step_index- The optional index of the step or None.
@prevent_deleteddef copy() -> SelfMake a copy of the simulation. Useful for creating simulations from a template.
Returns:
The copied simulation.
delete
Section titled “delete”@prevent_deleteddef delete() -> NoneDelete the simulation from the project. After deletion, the Simulation object cannot be used and should be discarded.
allsolve.simulation.simulation_output_database
Section titled “allsolve.simulation.simulation_output_database”InfoRow Objects
Section titled “InfoRow Objects”class InfoRow(_Row)parent_job_id
Section titled “parent_job_id”The root job id in case of sweep simulations.
SimulationOutput Objects
Section titled “SimulationOutput Objects”class SimulationOutput()job_id
Section titled “job_id”Sweep step job id or the main job id in case of non-sweep simulations.
job_index
Section titled “job_index”Sweep step index.
overrides
Section titled “overrides”Sweep step overrides by variable name.
SimulationStepRow Objects
Section titled “SimulationStepRow Objects”class SimulationStepRow(_Row)raw_step
Section titled “raw_step”The raw string representation of the step. This is needed to preserve the format used in the field output files.
The step as a float. None if no step was specified when the value was created in the simulation.
FieldOutputDefinitionRow Objects
Section titled “FieldOutputDefinitionRow Objects”class FieldOutputDefinitionRow(_Row)The type of the field.
The user specified name for the field output.
specifier
Section titled “specifier”An optional specifier added by the user or by the code generator. For example,
some field outputs produce both real and imaginary parts, even though the user
has just specified a single output. In this case the name of both fields will
be the user specified name, but the specifier will be "real" or "imaginary".
Users can also give any specifier they want in modified or custom scripts.
file_name_format
Section titled “file_name_format”A format string to produce the file names of field outputs. The format string
will have placeholders {step} and {rank}. To get the file name, use the raw
string step SimulationStepRow._step to replace {step} and the rank integer
to replace {rank}.
file_name_prefix
Section titled “file_name_prefix”The prefix part of file_name_format. Only contains the name and optionally
the specifier in a filename friendly format.
The ranks that produced this field output.
ValueOutputDefinitionRow Objects
Section titled “ValueOutputDefinitionRow Objects”class ValueOutputDefinitionRow(_Row)The user specified name for the value output.
specifier
Section titled “specifier”An optional specifier added by the user or by the code generator. For example,
some value outputs produce both real and imaginary parts, even though the user
has just specified a single output. In this case the name of both values will
be the user specified name, but the specifier will be "real" or "imaginary".
BlobDatabase Objects
Section titled “BlobDatabase Objects”class BlobDatabase()All the data of the blob database. To get the data of the blob with id blob_id,
use db.data[db.offsets[blob_id - 1] : db.offsets[blob_id]])].
SimulationOutputDatabase Objects
Section titled “SimulationOutputDatabase Objects”class SimulationOutputDatabase()get_value_data
Section titled “get_value_data”def get_value_data(value: ValueOutput) -> array.array[float]Get data for a value output.
allsolve.simulation
Section titled “allsolve.simulation”allsolve.simulation.simulation_output_data
Section titled “allsolve.simulation.simulation_output_data”CsvExportFormat Objects
Section titled “CsvExportFormat Objects”class CsvExportFormat(Enum)The format of the CSV file. EXPLODED format outputs one row per value. Exploded format is slower with large datasets. NORMAL format outputs one row per step. When multiple values are present per step, the values are output as an array. Normal format is faster with large datasets.
ValueId
Section titled “ValueId”Value identifier consists of the name and the specifier.
ValueHeaderOrId
Section titled “ValueHeaderOrId”Value header or value id. Value header is the value name followed by the specifier in parentheses. If the specifier is None, the parentheses are not included.
SimulationOutputData Objects
Section titled “SimulationOutputData Objects”class SimulationOutputData()refresh
Section titled “refresh”def refresh() -> NoneDownload the simulation output data. Data is stored in the cache directory.
clean_cache
Section titled “clean_cache”def clean_cache() -> NoneClean the local output data cache directory for this simulation. To use output data again, you need to call refresh to download the data again.
to_dict
Section titled “to_dict”def to_dict( sweep_index: int = 0, include_overrides: bool = False) -> dict[str, dict[str, list[float]]]Returns the value output data of a single sweep step as a dictionary.
Arguments:
sweep_index- The sweep step index.include_overrides- If True, variable override values for the sweep step are included as additional entries in each step’s dictionary.
to_csv_stream
Section titled “to_csv_stream”def to_csv_stream(delimiter=",", stream: TextIO | None = None, csv_format: CsvExportFormat = CsvExportFormat.EXPLODED, include_overrides: bool = False) -> StringIO | NoneWrite CSV data to a stream.
Arguments:
delimiter- The delimiter to use in the CSV output.stream- Optional stream to write to.include_overrides- If True, variable override values for each sweep step are included as additional columns in the CSV output.
Returns:
None if stream was provided, StringIO if no stream was provided.
Examples:
Get a StringIO
Section titled “Get a StringIO”csv_stream = data.to_csv_stream()
Stream directly to a file
Section titled “Stream directly to a file”with open(“output.csv”, “w”) as f: data.to_csv_stream(stream=f)
get_value_headers
Section titled “get_value_headers”def get_value_headers() -> list[str]Returns header strings of all value outputs. The header equals the name of the value output plus the specifier if it was provided. The specifier is included after the name in parentheses.
Examples:
- Name “Resistance” and no specifier —> “Resistance”
- Name “Impedance” and specifier “real” —> “Impedance (real)“
get_value_ids
Section titled “get_value_ids”def get_value_ids() -> list[ValueId]Returns the identifier tuples of all value outputs. An identifier tuple consists of the name and the specifier.
Examples:
- Name “Resistance” and no specifier —> (“Resistance”, None)
- Name “Impedance” and specifier “real” —> (“Impedance”, “real”)
get_sweep_step_overrides
Section titled “get_sweep_step_overrides”def get_sweep_step_overrides() -> list[dict[str, list[float]]]Returns the variable overrides for each sweep step. The returned list can be used to find the sweep index based on a variable’s value.
The following example finds the index of the sweep step where “my_variable” had the value 42:
overrides = data.get_sweep_step_overrides()sweep_index = -1for i, step_overrides in enumerate(overrides): if step_overrides["my_variable"][0] == 42: sweep_index = i breakThe found sweep index can then be passed into various methods of this class to get the data of that sweep step.
For simple key-value pairs, use the get_sweep_index method.
get_sweep_index
Section titled “get_sweep_index”def get_sweep_index(variable_name: str, value: float | list[float]) -> intFinds the sweep index based on a variable name and a value.
If multiple sweep steps have the same variable name and value, the first one found is returned.
Examples:
# Get the sweep index for the variable "my_variable" with the value 42sweep_index = data.get_sweep_index("my_variable", 42)
# Get the sweep index for the variable "my_variable" with the value [1.0, 2.0]sweep_index = data.get_sweep_index("my_variable", [1.0, 2.0])If you meed more fine-grained control, use the get_sweep_step_overrides method.
get_sweep_count
Section titled “get_sweep_count”def get_sweep_count() -> intReturns the total number of sweep steps.
get_step_count
Section titled “get_step_count”def get_step_count(sweep_index: int | None = None) -> intReturns the total number of steps. This function returns the number of time steps in transient simulations and the number of eigenmodes in eigenvalue simulations. This is not to be confused with sweep steps. Each sweep step can have multiple steps.
If no value is passed in, the total number of steps is returned. Note that each sweep step can have different set of steps. All steps are not necessarily present in all sweep steps.
If a sweep index is passed in, the number of steps in that sweep step is returned.
get_step_labels
Section titled “get_step_labels”def get_step_labels() -> list[str]Returns the labels of all steps. A label is the string representation of a step. A step here means the time step in a transient simulation or the eigenmode index in an eigenvalue simulation. This is not to be confused with sweep steps. Each sweep step can have multiple steps.
The label can either be a stringified numeric value or the special string
SimulationOutputData.NO_STEP. NO_STEP is used as the step label when
data is saved without specifying a step.
get_step_label
Section titled “get_step_label”def get_step_label(step_index: int) -> strReturns the step_indexth value of the get_step_labels list.
get_step_index
Section titled “get_step_index”def get_step_index(step_label: str | float | int | None) -> intFinds the step index based on a label or a numeric value. A step here means the time step in a transient simulation or the eigenmode index in an eigenvalue simulation. This is not to be confused with sweep steps. Each sweep step can have multiple steps.
Examples:
# Get the step index for the step label "0.2"step_index = data.get_step_index("0.2")
# Get the step index for the step whose numeric value is 1.0step_index = data.get_step_index(1.0)
# Get the the step index for data that was saved without specifying a stepstep_index = data.get_step_index(SimulationOutputData.NO_STEP)NOTE- It’s always better find using a float value than the string string label. If you use the string representation of a float value, it needs to be exactly the same as the one stored in the database. There’s no guarantee that the string representation was produced usingstr(float_value).
get_array_index_count_at
Section titled “get_array_index_count_at”def get_array_index_count_at(sweep_index: int, step_index: int, value_header: ValueHeaderOrId) -> intEquivalent to len(get_values_at(sweep_index, step_index, value_header)).
get_value_at
Section titled “get_value_at”def get_value_at(sweep_index: int, step_index: int, value_header: ValueHeaderOrId, array_index: int | None = None) -> float | NoneEquivalent to get_values_at(sweep_index, step_index, value_header)[array_index].
get_values_at
Section titled “get_values_at”def get_values_at(sweep_index: int, step_index: int, value_header: ValueHeaderOrId) -> list[float] | NoneReturns the value output data of the value identified by value_header at the
given sweep index and step index. See the get_sweep_index and get_step_index
methods for more information on how to determine the sweep index and step index.
The value_header can either be:
-
A string representing the value header. For example, “Impedance (real)” where “Impedance” is the name and “real” is the specifier. If there’s no specifier, the header is just the value output’s name, so in this case “Impedance”.
-
A tuple consisting of the name and the specifier. For example, (“Impedance”, “real”) where “Impedance” is the name and “real” is the specifier. If there’s no specifier, the tuple still needs to contain two elements: the name and
None. For example (“Impedance”, None). But in case there’s no specifier, you can just pass in the name as a string since it matches the header format.
Examples:
sweep_index = data.get_sweep_index("my_variable", 42)step_index = data.get_step_index(0.1)
# Get the resistance at the given sweep index and step index.values = data.get_values_at(sweep_index, step_index, "Resistance")
# Get the real part of the impedance at the given sweep index and step index.values = data.get_values_at(sweep_index, step_index, ("Impedance", "real"))
# Get the real part of the impedance using a header stringvalues = data.get_values_at(sweep_index, step_index, "Impedance (real)")allsolve.mesh
Section titled “allsolve.mesh”ExtrusionLayerDefinition Objects
Section titled “ExtrusionLayerDefinition Objects”class ExtrusionLayerDefinition()A layer definition for SlantedExtrusion, PathExtrusion and FlattenAndRebuildExtrusion.
Arguments:
relative_height- The relative height of the layer.sublayer_count- The number of sublayers in the layer.
MeshRefinement Objects
Section titled “MeshRefinement Objects”class MeshRefinement()A refinement for a mesh.
Arguments:
region- The region to refine.max_size- The maximum size of the refinement.
SlantedExtrusion Objects
Section titled “SlantedExtrusion Objects”class SlantedExtrusion()A slanted extrusion for a mesh.
Arguments:
volumes- The volumes to extrude.from_surfaces- The surfaces to extrude from.to_surfaces- The surfaces to extrude to.layers- The layers of the extrusion.quadrangles- Whether to use quadrangles for the extrusion.
PathExtrusion Objects
Section titled “PathExtrusion Objects”class PathExtrusion()A path extrusion for a mesh.
Arguments:
volumes- The volumes to extrude.from_surfaces- The surfaces to extrude from.to_surfaces- The surfaces to extrude to.layers- The layers of the extrusion.quadrangles- Whether to use quadrangles for the extrusion.
FlattenAndRebuildExtrusion Objects
Section titled “FlattenAndRebuildExtrusion Objects”class FlattenAndRebuildExtrusion()A flatten and rebuild extrusion for a mesh.
Arguments:
volumes- The volumes to extrude.layers- The layers of the extrusion.quadrangles- Whether to use quadrangles for the extrusion.direction_vector- The direction vector for the extrusion.
MeshExtrusion Objects
Section titled “MeshExtrusion Objects”class MeshExtrusion()A simple extrusion for a mesh.
Arguments:
regions- The regions to extrude.sub_layer_counts- The number of sublayers for each layer.extrusion_overlap_mode- The overlap mode for the extrusion.
MeshDensity Objects
Section titled “MeshDensity Objects”class MeshDensity(Enum)Enum for the density of a mesh.
MeshQuality Objects
Section titled “MeshQuality Objects”class MeshQuality(Enum)Enum for the quality of a mesh. @deprecated: Use MeshDensity instead.
MeshSettings Objects
Section titled “MeshSettings Objects”class MeshSettings()Container for settings that can be configured when creating a mesh.
Mesh Objects
Section titled “Mesh Objects”class Mesh(JobMixin)Mesh of a project geometry.
create
Section titled “create”@classmethoddef create(cls, project_id: str, mesh_settings: MeshSettings | None = None) -> SelfCreate a new mesh in the project.
Arguments:
project_id- The ID of the project to create the mesh in.mesh_settings- Optional settings for the mesh.
Returns:
The created mesh.
@classmethoddef get(cls, mesh_id: str, project_id: str | None = None) -> SelfGet a mesh by its ID.
Arguments:
mesh_id- The ID of the mesh.project_id- The ID of the project. Can be omitted if project API key is used.
Returns:
The mesh.
get_all
Section titled “get_all”@classmethoddef get_all(cls, project_id: str | None = None) -> List[Self]Get all meshes in the project.
Arguments:
project_id- The ID of the project. Can be omitted if project API key is used.
Returns:
A list of Mesh objects.
@property@prevent_deleteddef id() -> strGet the ID of the mesh.
@property@prevent_deleteddef name() -> strGet the name of the mesh.
@name.setter@prevent_deleteddef name(name: str) -> NoneSet the name of the mesh. Use save() to commit the change.
quality
Section titled “quality”@property@prevent_deleteddef quality() -> MeshQualityGet the quality of the mesh.
quality
Section titled “quality”@quality.setter@prevent_deleteddef quality(quality: MeshQuality) -> NoneSet the quality of the mesh. Use save() to commit the change.
density
Section titled “density”@property@prevent_deleteddef density() -> MeshDensityGet the density of the mesh.
density
Section titled “density”@density.setter@prevent_deleteddef density(density: MeshDensity) -> NoneSet the density of the mesh. Use save() to commit the change.
node_type
Section titled “node_type”@property@prevent_deleteddef node_type() -> str | NoneGet the node type of the mesh.
node_type
Section titled “node_type”@node_type.setter@prevent_deleteddef node_type(node_type: str) -> NoneSet the node type of the mesh. Use save() to commit the change.
max_run_time_minutes
Section titled “max_run_time_minutes”@property@prevent_deleteddef max_run_time_minutes() -> intGet the maximum run time of the mesh.
max_run_time_minutes
Section titled “max_run_time_minutes”@max_run_time_minutes.setter@prevent_deleteddef max_run_time_minutes(max_run_time_minutes: int) -> NoneSet the maximum run time of the mesh. Use save() to commit the change.
use_mesh_refiner
Section titled “use_mesh_refiner”@property@prevent_deleteddef use_mesh_refiner() -> boolGet whether the mesh uses the mesh refiner.
use_mesh_refiner
Section titled “use_mesh_refiner”@use_mesh_refiner.setter@prevent_deleteddef use_mesh_refiner(use_mesh_refiner: bool) -> NoneSet whether the mesh uses the mesh refiner. Use save() to commit the change.
mesh_size_min
Section titled “mesh_size_min”@property@prevent_deleteddef mesh_size_min() -> float | NoneGet the minimum mesh size of the mesh.
mesh_size_min
Section titled “mesh_size_min”@mesh_size_min.setter@prevent_deleteddef mesh_size_min(mesh_size_min: float) -> NoneSet the minimum mesh size of the mesh. Use save() to commit the change.
mesh_size_max
Section titled “mesh_size_max”@property@prevent_deleteddef mesh_size_max() -> float | NoneGet the maximum mesh size of the mesh.
mesh_size_max
Section titled “mesh_size_max”@mesh_size_max.setter@prevent_deleteddef mesh_size_max(mesh_size_max: float) -> NoneSet the maximum mesh size of the mesh. Use save() to commit the change.
scale_factor
Section titled “scale_factor”@property@prevent_deleteddef scale_factor() -> float | NoneGet the scale factor of the mesh.
scale_factor
Section titled “scale_factor”@scale_factor.setter@prevent_deleteddef scale_factor(scale_factor: float) -> NoneSet the scale factor of the mesh. Use save() to commit the change.
curvature_enhancement
Section titled “curvature_enhancement”@property@prevent_deleteddef curvature_enhancement() -> float | NoneGet the curvature enhancement of the mesh.
curvature_enhancement
Section titled “curvature_enhancement”@curvature_enhancement.setter@prevent_deleteddef curvature_enhancement(curvature_enhancement: float) -> NoneSet the curvature enhancement of the mesh. Use save() to commit the change.
curved_mesh
Section titled “curved_mesh”@property@prevent_deleteddef curved_mesh() -> boolGet whether the mesh is curved.
curved_mesh
Section titled “curved_mesh”@curved_mesh.setter@prevent_deleteddef curved_mesh(curved_mesh: bool) -> NoneSet whether the mesh is curved. Use save() to commit the change.
target_width_to_height_ratio
Section titled “target_width_to_height_ratio”@property@prevent_deleteddef target_width_to_height_ratio() -> float | NoneGet the target width to height ratio of the mesh.
target_width_to_height_ratio
Section titled “target_width_to_height_ratio”@target_width_to_height_ratio.setter@prevent_deleteddef target_width_to_height_ratio(target_width_to_height_ratio: float) -> NoneSet the target width to height ratio of the mesh. Use save() to commit the change.
refinements
Section titled “refinements”@property@prevent_deleteddef refinements() -> List[MeshRefinement] | NoneGet the refinements of the mesh.
refinements
Section titled “refinements”@refinements.setter@prevent_deleteddef refinements(refinements: List[MeshRefinement]) -> NoneSet the refinements of the mesh. Use save() to commit the change.
extrusion
Section titled “extrusion”@property@prevent_deleteddef extrusion() -> MeshExtrusion | NoneGet the extrusion of the mesh.
extrusion
Section titled “extrusion”@extrusion.setter@prevent_deleteddef extrusion(extrusion: MeshExtrusion) -> NoneSet the extrusion of the mesh. Use save() to commit the change.
slanted_extrusions
Section titled “slanted_extrusions”@property@prevent_deleteddef slanted_extrusions() -> List[SlantedExtrusion] | NoneGet the extrusions of the mesh.
set_slanted_extrusions
Section titled “set_slanted_extrusions”@slanted_extrusions.setter@prevent_deleteddef set_slanted_extrusions( slanted_extrusions: List[SlantedExtrusion] | None) -> NoneSet the slanted extrusions of the mesh. Use save() to commit the change.
path_extrusions
Section titled “path_extrusions”@property@prevent_deleteddef path_extrusions() -> List[PathExtrusion] | NoneGet the path extrusions of the mesh.
set_path_extrusions
Section titled “set_path_extrusions”@path_extrusions.setter@prevent_deleteddef set_path_extrusions(path_extrusions: List[PathExtrusion] | None) -> NoneSet the path extrusions of the mesh. Use save() to commit the change.
flatten_and_rebuild_extrusions
Section titled “flatten_and_rebuild_extrusions”@property@prevent_deleteddef flatten_and_rebuild_extrusions() -> List[FlattenAndRebuildExtrusion] | NoneGet the flatten and rebuild extrusions of the mesh.
set_flatten_and_rebuild_extrusions
Section titled “set_flatten_and_rebuild_extrusions”@flatten_and_rebuild_extrusions.setter@prevent_deleteddef set_flatten_and_rebuild_extrusions( flatten_and_rebuild_extrusions: List[FlattenAndRebuildExtrusion] | None) -> NoneSet the flatten and rebuild extrusions of the mesh. Use save() to commit the change.
variable_overrides
Section titled “variable_overrides”@property@prevent_deleteddef variable_overrides() -> List[VariableOverrides] | NoneGet the variable overrides of the mesh.
variable_overrides
Section titled “variable_overrides”@variable_overrides.setter@prevent_deleteddef variable_overrides( variable_overrides: List[VariableOverrides] | None) -> NoneSet the variable overrides of the mesh. Use save() to commit the change.
@prevent_deleteddef save() -> NoneExplicitly save the changes to the cloud made by
setting properties name, quality, node_type, max_run_time_minutes,
mesh_size_min, mesh_size_max, scale_factor, curvature_enhancement,
curved_mesh, refinements and variable_overrides.
@prevent_deleteddef start(variable_overrides_id: str | None = None) -> NoneStart processing the mesh.
Arguments:
variable_overrides_id- Optional VariableOverrides id to use for the mesh.
@prevent_deleteddef run(variable_overrides_id: str | None = None, print_logs: bool = False, refresh_delay_s: float = 1) -> NoneProcess the mesh and returns when the processing is complete.
Arguments:
variable_overrides_id- Optional VariableOverrides id to use for the mesh.print_logs- If True, print logs to the console.refresh_delay_s- Optional delay in seconds between checking the status of the job.
@prevent_deleteddef abort() -> NoneAbort the processing of the mesh.
get_status
Section titled “get_status”@prevent_deleteddef get_status() -> str | NoneGet the status of the processing of the mesh.
Returns:
The status of the processing of the mesh.
is_running
Section titled “is_running”@prevent_deleteddef is_running(refresh_delay_s: float | None = None) -> boolCheck if the processing of the mesh is running.
Arguments:
refresh_delay_s- Optional delay in seconds between checking the status of the job.
Returns:
True if the processing of the mesh is running, False otherwise.
refresh_status
Section titled “refresh_status”@prevent_deleteddef refresh_status(delay_s: float = 1) -> str | NoneRefresh the status of the processing of the mesh.
Arguments:
delay_s- Optional delay in seconds between checking the status of the job.
Returns:
The status of the processing of the mesh.
get_logs
Section titled “get_logs”@prevent_deleteddef get_logs(limit: int = 100) -> List[str]Get the logs of the processing of the mesh.
Arguments:
limit- Optional maximum number of logs to return.
Returns:
The logs of the processing of the mesh.
print_new_loglines
Section titled “print_new_loglines”@prevent_deleteddef print_new_loglines(file: TextIO = sys.stdout, limit: int = 100) -> NonePrint the new log lines of the processing of the mesh.
Arguments:
file- Optional file to print the logs to.limit- Optional maximum number of logs to print.
delete
Section titled “delete”@prevent_deleteddef delete() -> NoneDelete the mesh from the project.
@prevent_deleteddef copy(name: str | None = None) -> SelfCopy the mesh.
Arguments:
name- Optional name of the new mesh.
Returns:
The copied mesh.
save_mesh_file
Section titled “save_mesh_file”@prevent_deleteddef save_mesh_file(output_dir: str = "./", filename: str = "mesh.msh", variable_overrides_id: str | None = None) -> NoneSave the mesh file to a file on local file system.
By default, the mesh file is saved to the current working directory as
mesh.msh.
Arguments:
output_dir- The optional directory to save the mesh file to.filename- The optional filename to save the mesh file to.variable_overrides_id- The optional variable overrides id to use for the mesh.
allsolve.export_project
Section titled “allsolve.export_project”Export project data to a dictionary format compatible with import_project().
This module provides functionality to export project data including:
- Project metadata (name, description, dimension, labels)
- Variables and functions
- Geometries (CAD elements)
- Regions (basic, computed, region rules)
- Materials
- Physics (with nested interactions)
- Variable overrides
- Meshes
- Simulations (with output interactions)
Notes:
CAD file paths and shared file paths are exported as placeholders. When re-importing, you must provide the actual files at those paths. Future versions may support optional file downloading.
export_project_data
Section titled “export_project_data”def export_project_data(project: Project, include_meshes: bool = True) -> dictExport project data to a dictionary compatible with import_project().
The exported dictionary contains:
- Project metadata (name, description, dimension, labels)
- Variables (topologically sorted)
- Functions (regular and interpolated)
- Geometries (CAD elements with placeholder paths for files)
- Regions (basic, computed, region rules)
- Materials
- Physics (with nested interactions)
- Variable overrides
- Meshes (optional)
- Simulations (optional, with output interactions)
Arguments:
project- The project to export.include_meshes- Whether to include mesh definitions (default True).Note- Exported meshes are definitions only; mesh data is not included.
Returns:
Dictionary containing the project data, compatible with import_project().
Notes:
CAD file paths (STEP, IGES, etc.) and shared file paths are exported as placeholders in the format “placeholder:original_path”. When re-importing, you must provide the actual files at the specified paths.
Future versions may support optional file downloading.
Example:
from allsolve import Project project = Project.get(“my-project-id”) data = export_project_data(project)
Modify as needed
Section titled “Modify as needed”data[“name”] = “Modified Project”
Re-import to new project
Section titled “Re-import to new project”from allsolve import import_project new_project = import_project(data)
allsolve.api
Section titled “allsolve.api”is_setup
Section titled “is_setup”def is_setup() -> boolCheck if the Allsolve API client has been initialized.
get_cache_dir
Section titled “get_cache_dir”def get_cache_dir() -> str | NoneGet the cache directory path. The cache directory is created in the cache_base_dir directory, which can be set in setup method.
def setup(api_key: str, api_secret: str, host="http://localhost:3001", cache_base_dir: str = os.getcwd())Initialize the Allsolve API client and perform authentication.
Arguments:
api_key- The API key.api_secret- The API secret.host- The host to use.cache_base_dir- Optional directory path for caching simulation data. If not provided, then cache directory will be created in the current working directory.
Raises:
Can raise exception if the authentication request to the Allsolve API fails.
clean_cache
Section titled “clean_cache”def clean_cache() -> NoneDelete the cache directory used by all Allsolve projects.
allsolve.file
Section titled “allsolve.file”delete_file
Section titled “delete_file”def delete_file(handle: rawapi.InputFile, project_id: str | None = None) -> NoneDelete a file from the project.
Arguments:
handle- The handle of the file to delete.project_id- The project ID. Can be omitted when using a project API key.
allsolve.geometry.geometry_element
Section titled “allsolve.geometry.geometry_element”GDSUnit Objects
Section titled “GDSUnit Objects”class GDSUnit()GDSUnit describes a unit in GDS2 file.
@propertydef value() -> str | NoneGet the value of the GDS unit.
@value.setterdef value(value: str | None) -> NoneSet the value of the GDS unit.
GDSAbsoluteLayer Objects
Section titled “GDSAbsoluteLayer Objects”class GDSAbsoluteLayer()GDSAbsoluteLayer describes a layer in GDS2 file with thickness and absolute z0.
@propertydef name() -> strGet the name of the layer.
@name.setterdef name(value: str) -> NoneSet the name of the layer.
absolute_z0
Section titled “absolute_z0”@propertydef absolute_z0() -> GDSUnitGet the absolute z0 of the layer.
absolute_z0
Section titled “absolute_z0”@absolute_z0.setterdef absolute_z0(value: GDSUnit) -> NoneSet the absolute z0 of the layer.
disabled
Section titled “disabled”@propertydef disabled() -> boolGet the disabled state of the layer.
disabled
Section titled “disabled”@disabled.setterdef disabled(value: bool) -> NoneSet the disabled state of the layer.
GDSStackedLayer Objects
Section titled “GDSStackedLayer Objects”class GDSStackedLayer()GDSStackedLayer describes a layer in GDS2 file with thickness. Z0 is calculated from previous layers.
@propertydef name() -> strGet the name of the layer.
@name.setterdef name(value: str) -> NoneSet the name of the layer.
thickness
Section titled “thickness”@propertydef thickness() -> GDSUnitGet the thickness of the layer.
thickness
Section titled “thickness”@thickness.setterdef thickness(value: GDSUnit) -> NoneSet the thickness of the layer.
disabled
Section titled “disabled”@propertydef disabled() -> boolGet the disabled state of the layer.
disabled
Section titled “disabled”@disabled.setterdef disabled(value: bool) -> NoneSet the disabled state of the layer.
GDS2ImportConfig Objects
Section titled “GDS2ImportConfig Objects”class GDS2ImportConfig()GDS2ImportConfig holds parameters for importing a geometry from a GDS2 file. Configuration requires an unit and layers defined in absolute or/and stacked order. Each layer should have thickness and a name as defined in the GDS2 file. Absolute layers should have also absolute z0.
@propertydef unit() -> GeometryUnitGet the unit of the GDSImportConfig.
GeometryElement Objects
Section titled “GeometryElement Objects”class GeometryElement()GeometryElement is a base class for importing a geometry to a project.
ImportGeometry Objects
Section titled “ImportGeometry Objects”class ImportGeometry()ImportGeometry is a base class for importing a geometry to a project from a file.
ImportStep Objects
Section titled “ImportStep Objects”class ImportStep(ImportGeometry)ImportStep is a class for importing a STEP file to a project.
ImportIges Objects
Section titled “ImportIges Objects”class ImportIges(ImportGeometry)ImportIges is a class for importing an IGES file to a project.
ImportBrep Objects
Section titled “ImportBrep Objects”class ImportBrep(ImportGeometry)ImportBrep is a class for importing a BREP file to a project.
ImportSat Objects
Section titled “ImportSat Objects”class ImportSat(ImportGeometry)ImportSat is a class for importing a SAT file to a project.
ImportMsh Objects
Section titled “ImportMsh Objects”class ImportMsh(ImportGeometry)ImportMsh is a class for importing a MSH file to a project.
ImportNas Objects
Section titled “ImportNas Objects”class ImportNas(ImportGeometry)ImportNas is a class for importing a NAS file to a project.
ImportGds2 Objects
Section titled “ImportGds2 Objects”class ImportGds2(ImportGeometry)ImportGds2 is a class for importing a GDS2 file to a project.
allsolve.geometry.cad_geometry_type
Section titled “allsolve.geometry.cad_geometry_type”CadGeometryType Objects
Section titled “CadGeometryType Objects”class CadGeometryType(Enum)Enum for CAD geometry element types.
allsolve.geometry.cad_geometry_element
Section titled “allsolve.geometry.cad_geometry_element”CadGeometryElement Objects
Section titled “CadGeometryElement Objects”class CadGeometryElement(abc.ABC)CadGeometryElement is a base class for creating CAD geometry programmatically. Subclasses provide convenient ways to create specific geometry types like boxes, cylinders, etc.
@property@prevent_deleteddef id() -> str | NoneGet the ID of the geometry element.
project_id
Section titled “project_id”@property@prevent_deleteddef project_id() -> strGet the project ID of the geometry element.
@property@prevent_deleteddef name() -> str | NoneGet the name of the geometry element.
@name.setterdef name(value: str | None) -> NoneSet the name of the geometry element.
enabled
Section titled “enabled”@property@prevent_deleteddef enabled() -> str | bool | NoneGet the enabled state of the geometry element. Can be a boolean or a string expression.
enabled
Section titled “enabled”@enabled.setterdef enabled(value: str | bool | None) -> NoneSet the enabled state of the geometry element. Can be a boolean or a string expression.
@property@abc.abstractmethoddef type() -> CadGeometryTypeGet the type of the geometry element.
Returns:
The CadGeometryType enum value for this geometry element.
delete
Section titled “delete”@prevent_deleteddef delete() -> NoneDelete the geometry element from the project.
@prevent_deleteddef save() -> NoneSave the changes to the geometry element. Calling save() on a geometry element that is not added to the project using GeometryBuilder will raise a ValueError.
allsolve.geometry.cad_simple_operation
Section titled “allsolve.geometry.cad_simple_operation”CadTranslate Objects
Section titled “CadTranslate Objects”class CadTranslate(CadGeometryElement)CadTranslate represents a translate of a CAD geometry element.
@property@prevent_deleteddef type() -> CadGeometryTypeGet the type of the geometry element.
entity_tags
Section titled “entity_tags”@property@prevent_deleteddef entity_tags() -> list[int] | NoneGet the entity tags of the translate.
entity_tags
Section titled “entity_tags”@entity_tags.setter@prevent_deleteddef entity_tags(entity_tags: list[int] | None) -> NoneSet the entity tags of the translate.
cad_names
Section titled “cad_names”@property@prevent_deleteddef cad_names() -> list[str] | NoneGet the CAD names of the union.
cad_names
Section titled “cad_names”@cad_names.setter@prevent_deleteddef cad_names(cad_names: list[str] | None) -> NoneSet the CAD names of the translate.
cad_paths
Section titled “cad_paths”@property@prevent_deleteddef cad_paths() -> list[CadPath] | NoneGet the CAD paths of the translate.
cad_paths
Section titled “cad_paths”@cad_paths.setter@prevent_deleteddef cad_paths(cad_paths: list[CadPath] | None) -> NoneSet the CAD paths of the translate.
translation
Section titled “translation”@property@prevent_deleteddef translation() -> tuple[float | str, float | str, float | str] | NoneGet the translation vector.
translation
Section titled “translation”@translation.setter@prevent_deleteddef translation( translation: tuple[float | str, float | str, float | str]) -> NoneSet the translation vector.
copy_object
Section titled “copy_object”@property@prevent_deleteddef copy_object() -> boolGet the copy_object flag.
copy_object
Section titled “copy_object”@copy_object.setter@prevent_deleteddef copy_object(copy_object: bool) -> NoneSet the copy_object flag.
repeat
Section titled “repeat”@property@prevent_deleteddef repeat() -> int | str | NoneGet the repeat count.
repeat
Section titled “repeat”@repeat.setter@prevent_deleteddef repeat(repeat: int | str | None) -> NoneSet the repeat count.
CadRotate Objects
Section titled “CadRotate Objects”class CadRotate(CadGeometryElement)CadRotate represents a rotation of a CAD geometry element.
@property@prevent_deleteddef type() -> CadGeometryTypeGet the type of the geometry element.
entity_tags
Section titled “entity_tags”@property@prevent_deleteddef entity_tags() -> list[int] | NoneGet the entity tags of the rotate.
entity_tags
Section titled “entity_tags”@entity_tags.setter@prevent_deleteddef entity_tags(entity_tags: list[int] | None) -> NoneSet the entity tags of the rotate.
cad_names
Section titled “cad_names”@property@prevent_deleteddef cad_names() -> list[str] | NoneGet the CAD names of the rotate.
cad_names
Section titled “cad_names”@cad_names.setter@prevent_deleteddef cad_names(cad_names: list[str] | None) -> NoneSet the CAD names of the rotate.
cad_paths
Section titled “cad_paths”@property@prevent_deleteddef cad_paths() -> list[CadPath] | NoneGet the CAD paths of the rotate.
cad_paths
Section titled “cad_paths”@cad_paths.setter@prevent_deleteddef cad_paths(cad_paths: list[CadPath] | None) -> NoneSet the CAD paths of the rotate.
@property@prevent_deleteddef axis() -> tuple[float | str, float | str, float | str]Get the rotation axis vector.
@axis.setter@prevent_deleteddef axis(axis: tuple[float | str, float | str, float | str]) -> NoneSet the rotation axis vector.
center
Section titled “center”@property@prevent_deleteddef center() -> tuple[float | str, float | str, float | str]Get the center point for rotation.
center
Section titled “center”@center.setter@prevent_deleteddef center(center: tuple[float | str, float | str, float | str]) -> NoneSet the center point for rotation.
@property@prevent_deleteddef angle() -> float | strGet the rotation angle.
@angle.setter@prevent_deleteddef angle(angle: float | str) -> NoneSet the rotation angle.
copy_object
Section titled “copy_object”@property@prevent_deleteddef copy_object() -> boolGet the copy_object flag.
copy_object
Section titled “copy_object”@copy_object.setter@prevent_deleteddef copy_object(copy_object: bool) -> NoneSet the copy_object flag.
repeat
Section titled “repeat”@property@prevent_deleteddef repeat() -> int | str | NoneGet the repeat count.
repeat
Section titled “repeat”@repeat.setter@prevent_deleteddef repeat(repeat: int | str | None) -> NoneSet the repeat count.
CadGrid Objects
Section titled “CadGrid Objects”class CadGrid(CadGeometryElement)CadGrid represents a grid pattern of CAD geometry elements.
@property@prevent_deleteddef type() -> CadGeometryTypeGet the type of the geometry element.
entity_tags
Section titled “entity_tags”@property@prevent_deleteddef entity_tags() -> list[int] | NoneGet the entity tags of the grid.
entity_tags
Section titled “entity_tags”@entity_tags.setter@prevent_deleteddef entity_tags(entity_tags: list[int] | None) -> NoneSet the entity tags of the grid.
cad_names
Section titled “cad_names”@property@prevent_deleteddef cad_names() -> list[str] | NoneGet the CAD names of the grid.
cad_names
Section titled “cad_names”@cad_names.setter@prevent_deleteddef cad_names(cad_names: list[str] | None) -> NoneSet the CAD names of the grid.
cad_paths
Section titled “cad_paths”@property@prevent_deleteddef cad_paths() -> list[CadPath] | NoneGet the CAD paths of the grid.
cad_paths
Section titled “cad_paths”@cad_paths.setter@prevent_deleteddef cad_paths(cad_paths: list[CadPath] | None) -> NoneSet the CAD paths of the grid.
translation
Section titled “translation”@property@prevent_deleteddef translation() -> tuple[float | str, float | str, float | str]Get the translation vector for grid spacing.
translation
Section titled “translation”@translation.setter@prevent_deleteddef translation( translation: tuple[float | str, float | str, float | str]) -> NoneSet the translation vector for grid spacing.
@property@prevent_deleteddef size() -> tuple[int | str, int | str, int | str]Get the grid size as a tuple of 3 positive integers (x, y, z).
@size.setter@prevent_deleteddef size(size: tuple[int | str, int | str, int | str]) -> NoneSet the grid size as a tuple of 3 positive integers (x, y, z).
CadRemove Objects
Section titled “CadRemove Objects”class CadRemove(CadGeometryElement)CadRemove represents a removal of CAD geometry elements.
@property@prevent_deleteddef type() -> CadGeometryTypeGet the type of the geometry element.
entity_tags
Section titled “entity_tags”@property@prevent_deleteddef entity_tags() -> list[int] | NoneGet the entity tags of the remove.
entity_tags
Section titled “entity_tags”@entity_tags.setter@prevent_deleteddef entity_tags(entity_tags: list[int] | None) -> NoneSet the entity tags of the remove.
cad_names
Section titled “cad_names”@property@prevent_deleteddef cad_names() -> list[str] | NoneGet the CAD names of the remove.
cad_names
Section titled “cad_names”@cad_names.setter@prevent_deleteddef cad_names(cad_names: list[str] | None) -> NoneSet the CAD names of the remove.
cad_paths
Section titled “cad_paths”@property@prevent_deleteddef cad_paths() -> list[CadPath] | NoneGet the CAD paths of the remove.
cad_paths
Section titled “cad_paths”@cad_paths.setter@prevent_deleteddef cad_paths(cad_paths: list[CadPath] | None) -> NoneSet the CAD paths of the remove.
allsolve.geometry
Section titled “allsolve.geometry”allsolve.geometry.cad_boolean_operation
Section titled “allsolve.geometry.cad_boolean_operation”CadUnion Objects
Section titled “CadUnion Objects”class CadUnion(CadGeometryElement)CadUnion represents a union of two or more CAD geometry elements.
@property@prevent_deleteddef type() -> CadGeometryTypeGet the type of the geometry element.
entity_tags
Section titled “entity_tags”@property@prevent_deleteddef entity_tags() -> list[int] | NoneGet the entity tags of the union.
entity_tags
Section titled “entity_tags”@entity_tags.setter@prevent_deleteddef entity_tags(entity_tags: list[int] | None) -> NoneSet the entity tags of the union.
cad_names
Section titled “cad_names”@property@prevent_deleteddef cad_names() -> list[str] | NoneGet the CAD names of the union.
cad_names
Section titled “cad_names”@cad_names.setter@prevent_deleteddef cad_names(cad_names: list[str] | None) -> NoneSet the CAD names of the union.
cad_paths
Section titled “cad_paths”@property@prevent_deleteddef cad_paths() -> list[CadPath] | NoneGet the CAD paths of the union.
cad_paths
Section titled “cad_paths”@cad_paths.setter@prevent_deleteddef cad_paths(cad_paths: list[CadPath] | None) -> NoneSet the CAD paths of the union.
CadDifference Objects
Section titled “CadDifference Objects”class CadDifference(_CadBinaryBooleanOperation)CadDifference represents a difference of two or more CAD geometry elements.
@property@prevent_deleteddef type() -> CadGeometryTypeGet the type of the geometry element.
CadIntersection Objects
Section titled “CadIntersection Objects”class CadIntersection(_CadBinaryBooleanOperation)CadIntersectionOperation represents an intersection of two or more CAD geometry elements.
@property@prevent_deleteddef type() -> CadGeometryTypeGet the type of the geometry element.
CadFragments Objects
Section titled “CadFragments Objects”class CadFragments(_CadBinaryBooleanOperation)CadFragments represents a fragments operation of two or more CAD geometry elements.
@property@prevent_deleteddef type() -> CadGeometryTypeGet the type of the geometry element.
CadFragmentAll Objects
Section titled “CadFragmentAll Objects”class CadFragmentAll(CadGeometryElement)CadFragmentAll represents a fragment all operation that fragments all CAD geometry elements.
@property@prevent_deleteddef type() -> CadGeometryTypeGet the type of the geometry element.
allsolve.geometry.cad_utils
Section titled “allsolve.geometry.cad_utils”Utility functions for converting between Python types and CAD geometry API types.
This module provides conversion functions for creating and extracting values from raw API CAD geometry objects.
to_str_list
Section titled “to_str_list”def to_str_list(value: str | list[str] | None) -> list[str] | NonePython runtime allows for a single string to be passed as a list of strings. This function converts a single string to a list of strings.
extract_entities_from_elements
Section titled “extract_entities_from_elements”def extract_entities_from_elements( elements: list[rawapi.CadEntity]) -> tuple[list[int], list[str], list[CadPath]]Extract entity_tags, cad_names from rawapi CadEntity elements.
validate_cad_path
Section titled “validate_cad_path”def validate_cad_path(cad_path: CadPath) -> NoneValidate a CAD path.
validate_entity_set
Section titled “validate_entity_set”def validate_entity_set(entity_tags: list[int] | None, cad_names: list[str] | None, cad_paths: list[CadPath] | None, set_name: str, operation_name: str) -> NoneValidate that at least one entity set is provided and non-empty.
create_cad_entities_from_lists
Section titled “create_cad_entities_from_lists”def create_cad_entities_from_lists( entity_tags: list[int] | None, cad_names: list[str] | None, cad_paths: list[CadPath] | None) -> list[rawapi.CadEntity]Create CadEntity list from entity_tags, cad_names, cad_paths.
create_boolean
Section titled “create_boolean”def create_boolean(value: bool | str | None) -> rawapi.CadBoolean | NoneCreate a CadBoolean from a boolean or string expression.
create_scalar
Section titled “create_scalar”def create_scalar(value: float | str) -> rawapi.CadScalarCreate a CadScalar from a numeric value or expression string.
create_angular_unit
Section titled “create_angular_unit”def create_angular_unit(unit: str | None) -> rawapi.CadAngularUnit | NoneCreate a CadAngularUnit from a string. Allowed values are: degree, radian.
create_distance_unit
Section titled “create_distance_unit”def create_distance_unit(unit: str | None) -> rawapi.CadDistanceUnit | NoneCreate a CadDistanceUnit from a string. Allowed values are: m, meter, mm, millimeter, um, micrometer, nm, nanometer, yard, foot, inch.
create_distance
Section titled “create_distance”def create_distance(value: float | str | tuple[float | str, str], default_unit: str | None = None) -> rawapi.CadDistanceCreate a CadDistance from a value with optional unit.
create_angle
Section titled “create_angle”def create_angle(value: float | str, default_unit: str | None = "degree") -> rawapi.CadAngleCreate a CadAngle from a value with optional unit.
create_vector
Section titled “create_vector”def create_vector( coords: tuple[float | str, float | str, float | str]) -> rawapi.CadVectorCreate a CadVector from a tuple of coordinates.
create_vector_2d
Section titled “create_vector_2d”def create_vector_2d( coords: tuple[float | str, float | str]) -> rawapi.CadVectorCreate a CadVector from a 2D tuple of coordinates (z will be 0).
create_euler_angles
Section titled “create_euler_angles”def create_euler_angles( angles: tuple[float | str, float | str, float | str]) -> rawapi.CadEulerAnglesCreate CadEulerAngles from a tuple of angles in degrees.
from_boolean
Section titled “from_boolean”def from_boolean(boolean: rawapi.CadBoolean | None) -> bool | str | NoneConvert a CadBoolean to a boolean or string expression.
from_scalar
Section titled “from_scalar”def from_scalar(scalar: rawapi.CadScalar) -> float | strConvert a CadScalar to a float or string.
Returns:
The numeric value if set, or the expression string if set.
Raises:
ValueError- If neither value nor expression is set.
from_distance
Section titled “from_distance”def from_distance(distance: rawapi.CadDistance) -> float | strConvert a CadDistance to a value or expression.
Note: Unit information is not preserved in the conversion.
Returns:
The numeric value if set, or the expression string if set.
Raises:
ValueError- If the distance value is not set.
from_angle
Section titled “from_angle”def from_angle(angle: rawapi.CadAngle) -> float | strConvert a CadAngle to a float or string.
Returns:
The numeric value if set, or the expression string if set.
Raises:
ValueError- If the angle value is not set.
from_vector
Section titled “from_vector”def from_vector( vector: rawapi.CadVector) -> tuple[float | str, float | str, float | str]Convert a CadVector to a tuple of coordinates.
Returns:
Tuple of (x, y, z) where each is float or str.
Raises:
ValueError- If any component is not set.
from_vector_2d
Section titled “from_vector_2d”def from_vector_2d( vector: rawapi.CadVector) -> tuple[float | str, float | str]Convert a CadVector to a tuple of 2D coordinates.
from_euler_angles
Section titled “from_euler_angles”def from_euler_angles( angles: rawapi.CadEulerAngles | None) -> tuple[float | str, float | str, float | str] | NoneConvert CadEulerAngles to a tuple of angles.
Returns:
Tuple of (x, y, z) angles, or None if input is None.
Raises:
ValueError- If angles is not None but any component is not set.
allsolve.geometry.geometry
Section titled “allsolve.geometry.geometry”Geometry Objects
Section titled “Geometry Objects”class Geometry(JobMixin)Geometry for a project.
create
Section titled “create”@classmethod@deprecated("Use geometry pipeline version V2 for new projects")def create(cls, geometry_imports: List[GeometryElement.ImportGeometry], project_id: str) -> SelfCreate a new geometry element in the given project. Uploads the geometry file to the project.
Arguments:
geometry_imports- A list of geometry import objects. Currently only one geometry import per project is supported.project_id- The id of the project where the new geometry element should be created.
Returns:
The created geometry element.
@classmethoddef get(cls, project_id: str) -> List[Self]Get list of Geometry objects in the given project. Currently only one Geometry per project is supported.
Arguments:
project_id- The ID of the project. Can be omitted if project API key is used.
Returns:
A list of Geometry objects.
delete_geometry
Section titled “delete_geometry”@classmethoddef delete_geometry(cls: type[Self], project_id: str) -> NoneDelete the geometry from the project.
@property@prevent_deleteddef id() -> strGet the ID of the geometry element.
@property@prevent_deleteddef name() -> strGet the name of the geometry element.
file_uploaded_at
Section titled “file_uploaded_at”@property@prevent_deleteddef file_uploaded_at() -> datetime | NoneGet the time the geometry file was uploaded.
@deprecated("Use geometry pipeline version V2 for new projects")@prevent_deleteddef start() -> NoneStart processing the imported geometry file.
@deprecated("Use geometry pipeline version V2 for new projects")@prevent_deleteddef run(print_logs: bool = False, refresh_delay_s: float = 1) -> NoneProcesses the imported geometry file and returns when the processing is complete.
Arguments:
print_logs- If True, print logs to the console.refresh_delay_s- Optional delay in seconds between checking the status of the job.
@prevent_deleteddef abort() -> NoneAbort the processing of the geometry file.
get_status
Section titled “get_status”@prevent_deleteddef get_status() -> str | NoneGet the status of the processing of the geometry file.
Returns:
The status of the processing of the geometry file.
is_running
Section titled “is_running”@prevent_deleteddef is_running(refresh_delay_s: float | None = None) -> boolCheck if the processing of the geometry file is running.
Arguments:
refresh_delay_s- Optional delay in seconds between checking the status of the job.
Returns:
True if the processing of the geometry file is running, False otherwise.
refresh_status
Section titled “refresh_status”@prevent_deleteddef refresh_status(delay_s: float = 1) -> str | NoneRefresh the status of the processing of the geometry file.
Arguments:
delay_s- Optional delay in seconds between checking the status of the job.
Returns:
The status of the processing of the geometry file.
get_logs
Section titled “get_logs”@prevent_deleteddef get_logs(limit: int = 100) -> List[str]Get the logs of the processing of the imported geometry file.
Arguments:
limit- Optional maximum number of logs to return.
Returns:
A list of log messages.
print_new_loglines
Section titled “print_new_loglines”@prevent_deleteddef print_new_loglines(file: TextIO = sys.stdout, limit: int = 100) -> NonePrint the new log lines of the processing of the imported geometry file.
Arguments:
file- Optional file to print the logs to.limit- Optional maximum number of logs to print.
delete
Section titled “delete”@prevent_deleteddef delete() -> NoneDelete the geometry from the project.
allsolve.geometry.cad_basic_geometry
Section titled “allsolve.geometry.cad_basic_geometry”CadPoint Objects
Section titled “CadPoint Objects”class CadPoint()CadPoint is a class for representing a CAD point.
from_region
Section titled “from_region”@classmethoddef from_region(cls, region: Region) -> SelfCreate a CadPoint from a Region. Region must contain exactly one point entity tag.
CadBox Objects
Section titled “CadBox Objects”class CadBox(CadGeometryElement)Box represents a rectangular box geometry.
position
Section titled “position”@property@prevent_deleteddef position() -> tuple[float | str, float | str, float | str]Get the position of the box.
position
Section titled “position”@position.setter@prevent_deleteddef position(position: tuple[float | str, float | str, float | str]) -> NoneSet the position of the box.
@property@prevent_deleteddef size() -> tuple[float | str, float | str, float | str]Get the size of the box.
@size.setter@prevent_deleteddef size(size: tuple[float | str, float | str, float | str]) -> NoneSet the size of the box.
rotation
Section titled “rotation”@property@prevent_deleteddef rotation() -> tuple[float | str, float | str, float | str] | NoneGet the rotation of the box.
rotation
Section titled “rotation”@rotation.setter@prevent_deleteddef rotation( rotation: tuple[float | str, float | str, float | str] | None) -> NoneSet the rotation of the box.
@property@prevent_deleteddef type() -> CadGeometryTypeGet the type of the geometry element.
CadCylinder Objects
Section titled “CadCylinder Objects”class CadCylinder(CadGeometryElement)Cylinder represents a cylindrical geometry.
position
Section titled “position”@property@prevent_deleteddef position() -> tuple[float | str, float | str, float | str]Get the position of the cylinder.
position
Section titled “position”@position.setter@prevent_deleteddef position(position: tuple[float | str, float | str, float | str]) -> NoneSet the position of the cylinder.
@property@prevent_deleteddef axis() -> tuple[float | str, float | str, float | str]Get the axis of the cylinder.
@axis.setter@prevent_deleteddef axis(axis: tuple[float | str, float | str, float | str]) -> NoneSet the axis of the cylinder.
radius
Section titled “radius”@property@prevent_deleteddef radius() -> float | strGet the radius of the cylinder.
radius
Section titled “radius”@radius.setter@prevent_deleteddef radius(radius: float | str) -> NoneSet the radius of the cylinder.
@property@prevent_deleteddef angle() -> float | str | NoneGet the angle of the cylinder.
@angle.setter@prevent_deleteddef angle(angle: float | str | None) -> NoneSet the angle of the cylinder.
rotation
Section titled “rotation”@property@prevent_deleteddef rotation() -> tuple[float | str, float | str, float | str] | NoneGet the rotation of the cylinder.
rotation
Section titled “rotation”@rotation.setter@prevent_deleteddef rotation( rotation: tuple[float | str, float | str, float | str] | None) -> NoneSet the rotation of the cylinder.
@property@prevent_deleteddef type() -> CadGeometryTypeGet the type of the geometry element.
CadSphere Objects
Section titled “CadSphere Objects”class CadSphere(CadGeometryElement)Sphere represents a spherical geometry.
position
Section titled “position”@property@prevent_deleteddef position() -> tuple[float | str, float | str, float | str]Get the position of the sphere.
position
Section titled “position”@position.setter@prevent_deleteddef position(position: tuple[float | str, float | str, float | str]) -> NoneSet the position of the sphere.
radius
Section titled “radius”@property@prevent_deleteddef radius() -> float | strGet the radius of the sphere.
radius
Section titled “radius”@radius.setter@prevent_deleteddef radius(radius: float | str) -> NoneSet the radius of the sphere.
angle1
Section titled “angle1”@property@prevent_deleteddef angle1() -> float | str | NoneGet the first angle of the sphere.
angle1
Section titled “angle1”@angle1.setter@prevent_deleteddef angle1(angle1: float | str | None) -> NoneSet the first angle of the sphere.
angle2
Section titled “angle2”@property@prevent_deleteddef angle2() -> float | str | NoneGet the second angle of the sphere.
angle2
Section titled “angle2”@angle2.setter@prevent_deleteddef angle2(angle2: float | str | None) -> NoneSet the second angle of the sphere.
angle3
Section titled “angle3”@property@prevent_deleteddef angle3() -> float | str | NoneGet the third angle of the sphere.
angle3
Section titled “angle3”@angle3.setter@prevent_deleteddef angle3(angle3: float | str | None) -> NoneSet the third angle of the sphere.
rotation
Section titled “rotation”@property@prevent_deleteddef rotation() -> tuple[float | str, float | str, float | str] | NoneGet the rotation of the sphere.
rotation
Section titled “rotation”@rotation.setter@prevent_deleteddef rotation( rotation: tuple[float | str, float | str, float | str] | None) -> NoneSet the rotation of the sphere.
@property@prevent_deleteddef type() -> CadGeometryTypeGet the type of the geometry element.
CadCone Objects
Section titled “CadCone Objects”class CadCone(CadGeometryElement)Cone represents a conical geometry.
position
Section titled “position”@property@prevent_deleteddef position() -> tuple[float | str, float | str, float | str]Get the position of the cone.
position
Section titled “position”@position.setter@prevent_deleteddef position(position: tuple[float | str, float | str, float | str]) -> NoneSet the position of the cone.
@property@prevent_deleteddef axis() -> tuple[float | str, float | str, float | str]Get the axis of the cone.
@axis.setter@prevent_deleteddef axis(axis: tuple[float | str, float | str, float | str]) -> NoneSet the axis of the cone.
radius1
Section titled “radius1”@property@prevent_deleteddef radius1() -> float | strGet the base radius of the cone.
radius1
Section titled “radius1”@radius1.setter@prevent_deleteddef radius1(radius1: float | str) -> NoneSet the base radius of the cone.
radius2
Section titled “radius2”@property@prevent_deleteddef radius2() -> float | strGet the top radius of the cone.
radius2
Section titled “radius2”@radius2.setter@prevent_deleteddef radius2(radius2: float | str) -> NoneSet the top radius of the cone.
@property@prevent_deleteddef angle() -> float | str | NoneGet the angle of the cone.
@angle.setter@prevent_deleteddef angle(angle: float | str | None) -> NoneSet the angle of the cone.
rotation
Section titled “rotation”@property@prevent_deleteddef rotation() -> tuple[float | str, float | str, float | str] | NoneGet the rotation of the cone.
rotation
Section titled “rotation”@rotation.setter@prevent_deleteddef rotation( rotation: tuple[float | str, float | str, float | str] | None) -> NoneSet the rotation of the cone.
@property@prevent_deleteddef type() -> CadGeometryTypeGet the type of the geometry element.
CadTorus Objects
Section titled “CadTorus Objects”class CadTorus(CadGeometryElement)Torus represents a toroidal geometry.
position
Section titled “position”@property@prevent_deleteddef position() -> tuple[float | str, float | str, float | str]Get the position of the torus.
position
Section titled “position”@position.setter@prevent_deleteddef position(position: tuple[float | str, float | str, float | str]) -> NoneSet the position of the torus.
radius1
Section titled “radius1”@property@prevent_deleteddef radius1() -> float | strGet the outer radius of the torus.
radius1
Section titled “radius1”@radius1.setter@prevent_deleteddef radius1(radius1: float | str) -> NoneSet the outer radius of the torus.
radius2
Section titled “radius2”@property@prevent_deleteddef radius2() -> float | strGet the width of the torus ring.
radius2
Section titled “radius2”@radius2.setter@prevent_deleteddef radius2(radius2: float | str) -> NoneSet the width of the torus ring.
@property@prevent_deleteddef angle() -> float | str | NoneGet the angle of the torus.
@angle.setter@prevent_deleteddef angle(angle: float | str | None) -> NoneSet the angle of the torus.
rotation
Section titled “rotation”@property@prevent_deleteddef rotation() -> tuple[float | str, float | str, float | str] | NoneGet the rotation of the torus.
rotation
Section titled “rotation”@rotation.setter@prevent_deleteddef rotation( rotation: tuple[float | str, float | str, float | str] | None) -> NoneSet the rotation of the torus.
@property@prevent_deleteddef type() -> CadGeometryTypeGet the type of the geometry element.
CadSurfaceRectangle Objects
Section titled “CadSurfaceRectangle Objects”class CadSurfaceRectangle(CadGeometryElement)CadSurfaceRectangle represents a surface rectangle geometry.
@property@prevent_deleteddef size() -> tuple[float | str, float | str]Get the size of the surface rectangle.
@size.setter@prevent_deleteddef size(size: tuple[float | str, float | str]) -> NoneSet the size of the surface rectangle.
offset
Section titled “offset”@property@prevent_deleteddef offset() -> tuple[float | str, float | str, float | str]Get the offset of the surface rectangle.
offset
Section titled “offset”@offset.setter@prevent_deleteddef offset(offset: tuple[float | str, float | str, float | str]) -> NoneSet the offset of the surface rectangle.
origin_point
Section titled “origin_point”@property@prevent_deleteddef origin_point() -> CadPointGet the origin point CAD entity.
origin_point
Section titled “origin_point”@origin_point.setter@prevent_deleteddef origin_point(origin_point: CadPoint) -> NoneSet the origin point CAD entity.
main_axis_point
Section titled “main_axis_point”@property@prevent_deleteddef main_axis_point() -> CadPointGet the main axis point CAD entity.
main_axis_point
Section titled “main_axis_point”@main_axis_point.setter@prevent_deleteddef main_axis_point(main_axis_point: CadPoint) -> NoneSet the main axis point CAD entity.
secondary_axis_point
Section titled “secondary_axis_point”@property@prevent_deleteddef secondary_axis_point() -> CadPointGet the secondary axis point CAD entity.
secondary_axis_point
Section titled “secondary_axis_point”@secondary_axis_point.setter@prevent_deleteddef secondary_axis_point(secondary_axis_point: CadPoint) -> NoneSet the secondary axis point CAD entity.
@property@prevent_deleteddef type() -> CadGeometryTypeGet the type of the geometry element.
CadDisk Objects
Section titled “CadDisk Objects”class CadDisk(CadGeometryElement)Disk represents a circular disk geometry.
position
Section titled “position”@property@prevent_deleteddef position() -> tuple[float | str, float | str]Get the position of the disk.
position
Section titled “position”@position.setter@prevent_deleteddef position(position: tuple[float | str, float | str]) -> NoneSet the position of the disk.
radius
Section titled “radius”@property@prevent_deleteddef radius() -> float | strGet the radius of the disk.
radius
Section titled “radius”@radius.setter@prevent_deleteddef radius(radius: float | str) -> NoneSet the radius of the disk.
rotation
Section titled “rotation”@property@prevent_deleteddef rotation() -> tuple[float | str, float | str, float | str] | NoneGet the rotation of the disk.
rotation
Section titled “rotation”@rotation.setter@prevent_deleteddef rotation( rotation: tuple[float | str, float | str, float | str] | None) -> NoneSet the rotation of the disk.
@property@prevent_deleteddef type() -> CadGeometryTypeGet the type of the geometry element.
CadRectangle Objects
Section titled “CadRectangle Objects”class CadRectangle(CadGeometryElement)Rectangle represents a rectangular geometry.
position
Section titled “position”@property@prevent_deleteddef position() -> tuple[float | str, float | str]Get the position of the rectangle.
position
Section titled “position”@position.setter@prevent_deleteddef position(position: tuple[float | str, float | str]) -> NoneSet the position of the rectangle.
@property@prevent_deleteddef size() -> tuple[float | str, float | str]Get the size of the rectangle.
@size.setter@prevent_deleteddef size(size: tuple[float | str, float | str]) -> NoneSet the size of the rectangle.
rotation
Section titled “rotation”@property@prevent_deleteddef rotation() -> tuple[float | str, float | str, float | str] | NoneGet the rotation of the rectangle.
rotation
Section titled “rotation”@rotation.setter@prevent_deleteddef rotation( rotation: tuple[float | str, float | str, float | str] | None) -> NoneSet the rotation of the rectangle.
@property@prevent_deleteddef type() -> CadGeometryTypeGet the type of the geometry element.
allsolve.geometry.cad_path
Section titled “allsolve.geometry.cad_path”CadGlob Objects
Section titled “CadGlob Objects”class CadGlob(Enum)Wildcard patterns for CAD path matching.
Matches a single level in the CAD hierarchy.
DOUBLESTAR
Section titled “DOUBLESTAR”Matches zero or more levels in the CAD hierarchy.
CadPath
Section titled “CadPath”A path to select CAD entities in a hierarchical structure.
A CAD path is a list of segments, where each segment can be:
- A string: Name of a geometry element at that level
- A tuple of (key, value): Attribute filter matching entities with the given attribute
- A CadGlob enum: Wildcard pattern for matching multiple entities
CAD paths are used in geometry operations (union, difference, intersection, translate, rotate, grid, remove, etc.) to select which entities to operate on.
allsolve.geometry.cad_file_import
Section titled “allsolve.geometry.cad_file_import”CadFileImport Objects
Section titled “CadFileImport Objects”class CadFileImport(CadGeometryElement)cleanup
Section titled “cleanup”@property@prevent_deleteddef cleanup() -> boolGet the cleanup setting.
CadStepFile Objects
Section titled “CadStepFile Objects”class CadStepFile(CadFileImport)CadStepFile represents a STEP file geometry import.
@property@prevent_deleteddef type() -> CadGeometryTypeGet the type of the geometry element.
CadIgesFile Objects
Section titled “CadIgesFile Objects”class CadIgesFile(CadFileImport)CadIgesFile represents an IGES file geometry import.
@property@prevent_deleteddef type() -> CadGeometryTypeGet the type of the geometry element.
CadSatFile Objects
Section titled “CadSatFile Objects”class CadSatFile(CadFileImport)CadSatFile represents a SAT (ACIS) file geometry import.
@property@prevent_deleteddef type() -> CadGeometryTypeGet the type of the geometry element.
CadBrepFile Objects
Section titled “CadBrepFile Objects”class CadBrepFile(CadFileImport)CadBrepFile represents a BREP (OpenCASCADE) file geometry import.
@property@prevent_deleteddef type() -> CadGeometryTypeGet the type of the geometry element.
CadMshFile Objects
Section titled “CadMshFile Objects”class CadMshFile(CadFileImport)CadMshFile represents a Gmsh MSH file geometry import. Only one MSH file can exist in a project and it cannot coexist with other geometry elements.
@property@prevent_deleteddef type() -> CadGeometryTypeGet the type of the geometry element.
CadNasFile Objects
Section titled “CadNasFile Objects”class CadNasFile(CadFileImport)CadNasFile represents a NASTRAN NAS file geometry import. Only one NAS file can exist in a project and it cannot coexist with other geometry elements.
@property@prevent_deleteddef type() -> CadGeometryTypeGet the type of the geometry element.
CadGdsExtrudeParameters Objects
Section titled “CadGdsExtrudeParameters Objects”class CadGdsExtrudeParameters()Parameters controlling the GDS boundary curve processing pipeline: layer unification, merge tolerance, feature detection thresholds, circle recognition, and spline fitting.
CadGds2File Objects
Section titled “CadGds2File Objects”class CadGds2File(CadFileImport)CadGds2File represents a GDS2 file geometry import.
@property@prevent_deleteddef type() -> CadGeometryTypeGet the type of the geometry element.
layers
Section titled “layers”@property@prevent_deleteddef layers() -> List[CadGdsLayer]Get the GDS2 import configuration.
extrude_parameters
Section titled “extrude_parameters”@property@prevent_deleteddef extrude_parameters() -> CadGdsExtrudeParameters | NoneGet the GDS2 extrude parameters.
@property@prevent_deleteddef unit() -> rawapi.CadDistanceUnitGet the default distance unit for all GDS numeric values.
allsolve.geometry.geometry_builder
Section titled “allsolve.geometry.geometry_builder”GeometryBuilder Objects
Section titled “GeometryBuilder Objects”class GeometryBuilder(JobMixin)Geometry builder for a project. Use with projects that have the GeometryPipelineVersion.V2
def add(geometry: List[CadElement] | CadElement) -> SelfCreates new geometry elements in the project.
Arguments:
geometry- A list of CAD geometry elements or a single CAD geometry element.
Returns:
The GeometryBuilder object.
add_box
Section titled “add_box”def add_box(name: str, position: tuple[float | str, float | str, float | str], size: tuple[float | str, float | str, float | str], rotation: tuple[float | str, float | str, float | str] | None = None, enabled: str | bool | None = None) -> SelfAdds a box to the project.
Arguments:
name- Name for the geometry element.position- The position of the box center as (x, y, z).size- The size of the box as (width, height, depth).rotation- Optional rotation as Euler angles (x, y, z) in degrees.enabled- Optional enabled state of the geometry element. Can be a boolean or a string expression. By default, the geometry element is enabled.
Returns:
The GeometryBuilder object.
add_cone
Section titled “add_cone”def add_cone(name: str, position: tuple[float | str, float | str, float | str], axis: tuple[float | str, float | str, float | str], radius1: float | str, radius2: float | str, angle: float | str | None = None, rotation: tuple[float | str, float | str, float | str] | None = None, enabled: str | bool | None = None) -> SelfAdds a cone to the project.
Arguments:
name- Name for the geometry element.position- The position of the cone center as (x, y, z).axis- The axis direction vector as (x, y, z).radius1- The base radius of the cone.radius2- The top radius of the cone (0 for pointy cone).angle- Optional angle for partial cones (in degrees by default).rotation- Optional rotation as Euler angles (x, y, z) in degrees.enabled- Optional enabled state of the geometry element. Can be a boolean or a string expression. By default, the geometry element is enabled.
Returns:
The GeometryBuilder object.
add_cylinder
Section titled “add_cylinder”def add_cylinder(name: str, position: tuple[float | str, float | str, float | str], axis: tuple[float | str, float | str, float | str], radius: float | str, angle: float | str | None = None, rotation: tuple[float | str, float | str, float | str] | None = None, enabled: str | bool | None = None) -> SelfAdds a cylinder to the project.
Arguments:
name- Name for the geometry element.position- The position of the cylinder center as (x, y, z).axis- The axis direction vector as (x, y, z).radius- The radius of the cylinder.angle- Optional angle for partial cylinders (in degrees by default).rotation- Optional rotation as Euler angles (x, y, z) in degrees.enabled- Optional enabled state of the geometry element. Can be a boolean or a string expression. By default, the geometry element is enabled.
Returns:
The GeometryBuilder object.
add_disk
Section titled “add_disk”def add_disk(name: str, position: tuple[float | str, float | str], radius: float | str, rotation: tuple[float | str, float | str, float | str] | None = None, enabled: str | bool | None = None) -> SelfAdds a disk to the project.
Arguments:
name- Name for the geometry element.position- The position of the disk center as (x, y).radius- The radius of the disk.rotation- Optional rotation as Euler angles (x, y, z) in degrees.enabled- Optional enabled state of the geometry element. Can be a boolean or a string expression. By default, the geometry element is enabled.
Returns:
The GeometryBuilder object.
add_rectangle
Section titled “add_rectangle”def add_rectangle(name: str, position: tuple[float | str, float | str], size: tuple[float | str, float | str], rotation: tuple[float | str, float | str, float | str] | None = None, enabled: str | bool | None = None) -> SelfAdds a rectangle to the project.
Arguments:
name- Name for the geometry element.position- The position of the rectangle center as (x, y).size- The size of the rectangle as (width, height).rotation- Optional rotation as Euler angles (x, y, z) in degrees.enabled- Optional enabled state of the geometry element. Can be a boolean or a string expression. By default, the geometry element is enabled.
Returns:
The GeometryBuilder object.
add_sphere
Section titled “add_sphere”def add_sphere(name: str, position: tuple[float | str, float | str, float | str], radius: float | str, angle1: float | str | None = None, angle2: float | str | None = None, angle3: float | str | None = None, rotation: tuple[float | str, float | str, float | str] | None = None, enabled: str | bool | None = None) -> SelfAdds a sphere to the project.
Arguments:
name- Name for the geometry element.position- The position of the sphere center as (x, y, z).radius- The radius of the sphere.angle1- Optional first angle for partial spheres (in degrees by default).angle2- Optional second angle for partial spheres (in degrees by default).angle3- Optional third angle for partial spheres (in degrees by default).rotation- Optional rotation as Euler angles (x, y, z) in degrees.enabled- Optional enabled state of the geometry element. Can be a boolean or a string expression. By default, the geometry element is enabled.
Returns:
The GeometryBuilder object.
add_surface_rectangle
Section titled “add_surface_rectangle”def add_surface_rectangle(name: str, size: tuple[float | str, float | str], offset: tuple[float | str, float | str, float | str], origin_point: CadPoint, main_axis_point: CadPoint, secondary_axis_point: CadPoint, enabled: str | bool | None = None) -> SelfAdds a surface rectangle to the project.
Arguments:
name- Name for the geometry element.size- The size of the rectangle as (x, y).offset- The offset from the origin point as (x, y, z).origin_point- CAD entity reference for the origin point.main_axis_point- CAD entity reference for the main axis point.secondary_axis_point- CAD entity reference for the secondary axis point.enabled- Optional enabled state of the geometry element. Can be a boolean or a string expression. By default, the geometry element is enabled.
Returns:
The GeometryBuilder object.
add_torus
Section titled “add_torus”def add_torus(name: str, position: tuple[float | str, float | str, float | str], radius1: float | str, radius2: float | str, angle: float | str | None = None, rotation: tuple[float | str, float | str, float | str] | None = None, enabled: str | bool | None = None) -> SelfAdds a torus to the project.
Arguments:
name- Name for the geometry element.position- The position of the torus center as (x, y, z).radius1- The outer radius of the torus.radius2- The width of the torus ring.angle- Optional angle for partial toruses (in degrees by default).rotation- Optional rotation as Euler angles (x, y, z) in degrees.enabled- Optional enabled state of the geometry element. Can be a boolean or a string expression. By default, the geometry element is enabled.
Returns:
The GeometryBuilder object.
add_difference
Section titled “add_difference”def add_difference(name: str, entity_tags_1: list[int] | None = None, cad_names_1: list[str] | None = None, cad_paths_1: list[CadPath] | None = None, entity_tags_2: list[int] | None = None, cad_names_2: list[str] | None = None, cad_paths_2: list[CadPath] | None = None, delete_tool: bool = True, enabled: str | bool | None = None) -> SelfAdds a difference operation to the project.
Arguments:
name- Name for the geometry element.entity_tags_1- The list of entity tags for the first set.cad_names_1- The list of CAD names for the first set.cad_paths_1- The list of CAD paths for the first set.entity_tags_2- The list of entity tags for the second set.cad_names_2- The list of CAD names for the second set.cad_paths_2- The list of CAD paths for the second set.delete_tool- Boolean flag to delete the tool entities after the operation. Default is True.enabled- Optional enabled state of the geometry element. Can be a boolean or a string expression. By default, the geometry element is enabled.
Returns:
The GeometryBuilder object.
add_fragment_all
Section titled “add_fragment_all”def add_fragment_all(name: str, enabled: str | bool | None = None) -> SelfAdds a fragment all operation to the project.
Arguments:
name- Name for the geometry element.enabled- Optional enabled state of the geometry element. Can be a boolean or a string expression. By default, the geometry element is enabled.
Returns:
The GeometryBuilder object.
add_fragments
Section titled “add_fragments”def add_fragments(name: str, entity_tags_1: list[int] | None = None, cad_names_1: list[str] | None = None, cad_paths_1: list[CadPath] | None = None, entity_tags_2: list[int] | None = None, cad_names_2: list[str] | None = None, cad_paths_2: list[CadPath] | None = None, delete_tool: bool = True, enabled: str | bool | None = None) -> SelfAdds a fragments operation to the project.
Arguments:
name- Name for the geometry element.entity_tags_1- The list of entity tags for the first set.cad_names_1- The list of CAD names for the first set.cad_paths_1- The list of CAD paths for the first set.entity_tags_2- The list of entity tags for the second set.cad_names_2- The list of CAD names for the second set.cad_paths_2- The list of CAD paths for the second set.delete_tool- Boolean flag to delete the tool entities after the operation. Default is True.enabled- Optional enabled state of the geometry element. Can be a boolean or a string expression. By default, the geometry element is enabled.
Returns:
The GeometryBuilder object.
add_intersection
Section titled “add_intersection”def add_intersection(name: str, entity_tags_1: list[int] | None = None, cad_names_1: list[str] | None = None, cad_paths_1: list[CadPath] | None = None, entity_tags_2: list[int] | None = None, cad_names_2: list[str] | None = None, cad_paths_2: list[CadPath] | None = None, delete_tool: bool = True, enabled: str | bool | None = None) -> SelfAdds an intersection operation to the project.
Arguments:
name- Name for the geometry element.entity_tags_1- The list of entity tags for the first set.cad_names_1- The list of CAD names for the first set.cad_paths_1- The list of CAD paths for the first set.entity_tags_2- The list of entity tags for the second set.cad_names_2- The list of CAD names for the second set.cad_paths_2- The list of CAD paths for the second set.delete_tool- Boolean flag to delete the tool entities after the operation. Default is True.enabled- Optional enabled state of the geometry element. Can be a boolean or a string expression. By default, the geometry element is enabled.
Returns:
The GeometryBuilder object.
add_union
Section titled “add_union”def add_union(name: str, entity_tags: list[int] | None = None, cad_names: list[str] | None = None, cad_paths: list[CadPath] | None = None, enabled: str | bool | None = None) -> SelfAdds a union operation to the project.
Arguments:
name- Name for the geometry element.entity_tags- The list of entity tags to union.cad_names- The list of CAD names to union.cad_paths- The list of CAD paths to union.enabled- Optional enabled state of the geometry element. Can be a boolean or a string expression. By default, the geometry element is enabled.
Returns:
The GeometryBuilder object.
add_grid
Section titled “add_grid”def add_grid(name: str, translation: tuple[float | str, float | str, float | str], size: tuple[int | str, int | str, int | str], entity_tags: list[int] | None = None, cad_names: list[str] | None = None, cad_paths: list[CadPath] | None = None, enabled: str | bool | None = None) -> SelfAdds a grid pattern to the project.
Arguments:
name- Name for the geometry element.translation- The translation vector for grid spacing.size- The grid size as a tuple of 3 positive integers (x, y, z).entity_tags- The list of entity tags to create grid from.cad_names- The list of CAD names to create grid from.cad_paths- The list of CAD paths to create grid from.enabled- Optional enabled state of the geometry element. Can be a boolean or a string expression. By default, the geometry element is enabled.
Returns:
The GeometryBuilder object.
add_remove
Section titled “add_remove”def add_remove(name: str, entity_tags: list[int] | None = None, cad_names: list[str] | None = None, cad_paths: list[CadPath] | None = None, enabled: str | bool | None = None) -> SelfAdds a remove operation to the project.
Arguments:
name- Name for the geometry element.entity_tags- The list of entity tags to remove.cad_names- The list of CAD names to remove.cad_paths- The list of CAD paths to remove.enabled- Optional enabled state of the geometry element. Can be a boolean or a string expression. By default, the geometry element is enabled.
Returns:
The GeometryBuilder object.
add_rotate
Section titled “add_rotate”def add_rotate(name: str, axis: tuple[float | str, float | str, float | str], center: tuple[float | str, float | str, float | str], angle: float | str, entity_tags: list[int] | None = None, cad_names: list[str] | None = None, cad_paths: list[CadPath] | None = None, copy_object: bool = False, repeat: int | str | None = None, enabled: str | bool | None = None) -> SelfAdds a rotation operation to the project.
Arguments:
name- Name for the geometry element.axis- The rotation axis vector.center- The center point for rotation.angle- The rotation angle.entity_tags- The list of entity tags to rotate.cad_names- The list of CAD names to rotate.cad_paths- The list of CAD paths to rotate.copy_object- Copy the object instead of rotating. Default is False.repeat- Number of times to repeat the rotation. Default is None.enabled- Optional enabled state of the geometry element. Can be a boolean or a string expression. By default, the geometry element is enabled.
Returns:
The GeometryBuilder object.
add_translate
Section titled “add_translate”def add_translate(name: str, translation: tuple[float | str, float | str, float | str], entity_tags: list[int] | None = None, cad_names: list[str] | None = None, cad_paths: list[CadPath] | None = None, copy_object: bool = False, repeat: int | str | None = None, enabled: str | bool | None = None) -> SelfAdds a translate operation to the project.
Arguments:
name- Name for the geometry element.translation- The translation vector.entity_tags- The list of entity tags to translate.cad_names- The list of CAD names to translate.cad_paths- The list of CAD paths to translate.copy_object- Copy the object instead of translating. Default is False.repeat- Number of times to repeat the translation. Default is None.enabled- Optional enabled state of the geometry element. Can be a boolean or a string expression. By default, the geometry element is enabled.
Returns:
The GeometryBuilder object.
add_brep_file
Section titled “add_brep_file”def add_brep_file(filepath: str, name: str | None = None, cleanup: bool = True, enabled: str | bool | None = None) -> SelfAdds a BREP file import to the project.
Arguments:
filepath- Path to a local BREP file. The file will be uploaded automatically.name- Optional name for the geometry element.cleanup- Whether to clean up the imported file (default: True).enabled- Optional enabled state of the geometry element. Can be a boolean or a string expression. By default, the geometry element is enabled.
Returns:
The GeometryBuilder object.
add_gds2_file
Section titled “add_gds2_file”def add_gds2_file( filepath: str, layers: List[CadGdsLayer] | List[Tuple[int, int, int | float, int | float]], name: str | None = None, cleanup: bool = True, enabled: str | bool | None = None, extrude_parameters: CadGdsExtrudeParameters | None = None, unit: rawapi.CadDistanceUnit = rawapi.CadDistanceUnit.MICROMETER) -> SelfAdds a GDS2 file import to the project.
Arguments:
filepath- Path to a local GDS2 file. The file will be uploaded automatically.layers- List of CadGdsLayer or tuples of (layer number, layer type number, absolute_z0, thickness).name- Optional name for the geometry element.cleanup- Whether to clean up the imported file (default: True).enabled- Optional enabled state of the geometry element. Can be a boolean or a string expression. By default, the geometry element is enabled.extrude_parameters- Optional GDS2 extrusion parameters.unit- Default distance unit for distance values in layers and extrude_parameters. Defaults to CadDistanceUnit.MICROMETER.
Returns:
The GeometryBuilder object.
add_iges_file
Section titled “add_iges_file”def add_iges_file(filepath: str, name: str | None = None, cleanup: bool = True, enabled: str | bool | None = None) -> SelfAdds an IGES file import to the project.
Arguments:
filepath- Path to a local IGES file. The file will be uploaded automatically.name- Optional name for the geometry element.cleanup- Whether to clean up the imported file (default: True).enabled- Optional enabled state of the geometry element. Can be a boolean or a string expression. By default, the geometry element is enabled.
Returns:
The GeometryBuilder object.
add_sat_file
Section titled “add_sat_file”def add_sat_file(filepath: str, name: str | None = None, cleanup: bool = True, enabled: str | bool | None = None) -> SelfAdds a SAT file import to the project.
Arguments:
filepath- Path to a local SAT file. The file will be uploaded automatically.name- Optional name for the geometry element.cleanup- Whether to clean up the imported file (default: True).enabled- Optional enabled state of the geometry element. Can be a boolean or a string expression. By default, the geometry element is enabled.
Returns:
The GeometryBuilder object.
add_step_file
Section titled “add_step_file”def add_step_file(filepath: str, name: str | None = None, cleanup: bool = True, enabled: str | bool | None = None) -> SelfAdds a STEP file import to the project.
Arguments:
filepath- Path to a local STEP file. The file will be uploaded automatically.name- Optional name for the geometry element.cleanup- Whether to clean up the imported file (default: True).enabled- Optional enabled state of the geometry element. Can be a boolean or a string expression. By default, the geometry element is enabled.
Returns:
The GeometryBuilder object.
add_msh_file
Section titled “add_msh_file”def add_msh_file(filepath: str) -> SelfAdds a MSH file import to the project. Only one MSH file can exist in a project and it cannot coexist with other geometry elements.
Arguments:
filepath- Path to a local MSH file. The file will be uploaded automatically.
Returns:
The GeometryBuilder object.
add_nas_file
Section titled “add_nas_file”def add_nas_file(filepath: str) -> SelfAdds a NAS file import to the project. Only one NAS file can exist in a project and it cannot coexist with other geometry elements.
Arguments:
filepath- Path to a local NAS file. The file will be uploaded automatically.
Returns:
The GeometryBuilder object.
def build(print_logs: bool = False, refresh_delay_s: float = 1, raise_on_error: bool = False) -> SelfProcesses the geometry elements in the project and returns when the processing is complete.
Arguments:
print_logs- If True, print logs to the console.refresh_delay_s- Optional delay in seconds between checking the status of the job.raise_on_error- If True, raise an error if the building of the geometry fails. If False, you can use get_status() to check the status of the geometry processing job.
Returns:
The GeometryBuilder object.
create_element
Section titled “create_element”def create_element(geometry: CadElement) -> CadElementCreates new geometry elements in the project.
Arguments:
geometry- A list of CAD geometry elements or a single CAD geometry element.
Returns:
A list of created CAD geometry elements or a single created CAD geometry element.
create_elements
Section titled “create_elements”def create_elements(geometries: List[CadElement]) -> List[CadElement]Creates new geometry elements in the project.
Arguments:
geometry- A list of CAD geometry elements or a single CAD geometry element.
Returns:
A list of created CAD geometry elements or a single created CAD geometry element.
get_elements
Section titled “get_elements”def get_elements() -> List[CadElement]Gets the list of CAD geometry elements in the project.
Returns:
A list of CAD geometry elements.
def start(last_element_id: str | None = None) -> NoneStarts processing the geometry elements in the project.
Arguments:
last_element_id- Optional last geometry element id to process in the project. If not provided, all geometry elements in the project will be processed.
def run(print_logs: bool = False, refresh_delay_s: float = 1, last_element_id: str | None = None) -> NoneProcesses the geometry elements in the project and returns when the processing is complete. Use get_status() to check the status of the processing after running.
Arguments:
print_logs- If True, print logs to the console.refresh_delay_s- Optional delay in seconds between checking the status of the job.last_element_id- Optional last geometry element id to process in the project. If not provided, all geometry elements in the project will be processed.
def abort() -> NoneAborts the processing of the geometry.
get_status
Section titled “get_status”def get_status() -> str | NoneGet the status of the processing of the geometry elements in the project.
Returns:
The status of the processing of the geometry elements in the project.
is_running
Section titled “is_running”def is_running(refresh_delay_s: float | None = None) -> boolCheck if the processing of the geometry elements in the project is running.
Arguments:
refresh_delay_s- Optional delay in seconds between checking the status of the job.
Returns:
True if the processing of the geometry file is running, False otherwise.
refresh_status
Section titled “refresh_status”def refresh_status(delay_s: float = 1) -> str | NoneRefresh the status of the processing of the geometry elements in the project.
Arguments:
delay_s- Optional delay in seconds between checking the status of the job.
Returns:
The status of the processing of the geometry file.
get_logs
Section titled “get_logs”def get_logs(limit: int = 100) -> List[str]Get the logs of the processing of the geometry elements in the project.
Arguments:
limit- Optional maximum number of logs to return.
Returns:
A list of log messages.
print_new_loglines
Section titled “print_new_loglines”def print_new_loglines(file: TextIO = sys.stdout, limit: int = 100) -> NonePrint the new log lines of the processing of the geometry elements in the project.
Arguments:
file- Optional file to print the logs to.limit- Optional maximum number of logs to print.
delete
Section titled “delete”def delete(geometry: CadElement | None = None) -> NoneDeletes a geometry element in the project, or all geometry elements if no geometry element is provided.
Arguments:
geometry- Optional geometry element to delete. If not provided, all geometry elements in the project will be deleted.
allsolve.physics.generated.enums
Section titled “allsolve.physics.generated.enums”Auto-generated enum definitions for interaction parameters.
This file is generated by generate_physics_helpers.py - DO NOT EDIT MANUALLY.
AcousticWavesPeriodicityType Objects
Section titled “AcousticWavesPeriodicityType Objects”class AcousticWavesPeriodicityType(_Enum)TRANSLATION
Section titled “TRANSLATION”Translation
ROTATION
Section titled “ROTATION”Rotation
AcousticWavesPmlType Objects
Section titled “AcousticWavesPmlType Objects”class AcousticWavesPmlType(_Enum)AML
Box PML
CurrentFlowLumpActuationMode Objects
Section titled “CurrentFlowLumpActuationMode Objects”class CurrentFlowLumpActuationMode(_Enum)VOLTAGE
Section titled “VOLTAGE”Voltage
CURRENT
Section titled “CURRENT”Current
CIRCUIT_COUPLING
Section titled “CIRCUIT_COUPLING”Circuit coupling
CurrentFlowLumpVICutActuationMode Objects
Section titled “CurrentFlowLumpVICutActuationMode Objects”class CurrentFlowLumpVICutActuationMode(_Enum)CURRENT
Section titled “CURRENT”Current
VOLTAGE
Section titled “VOLTAGE”Voltage
CIRCUIT_COUPLING
Section titled “CIRCUIT_COUPLING”Circuit coupling
CurrentFlowPeriodicityType Objects
Section titled “CurrentFlowPeriodicityType Objects”class CurrentFlowPeriodicityType(_Enum)TRANSLATION
Section titled “TRANSLATION”Translation
ROTATION
Section titled “ROTATION”Rotation
ElasticWavesLumpActuationMode Objects
Section titled “ElasticWavesLumpActuationMode Objects”class ElasticWavesLumpActuationMode(_Enum)DISPLACEMENT
Section titled “DISPLACEMENT”Displacement
Force
CIRCUIT_COUPLING
Section titled “CIRCUIT_COUPLING”Circuit coupling
ElasticWavesPeriodicityType Objects
Section titled “ElasticWavesPeriodicityType Objects”class ElasticWavesPeriodicityType(_Enum)TRANSLATION
Section titled “TRANSLATION”Translation
ROTATION
Section titled “ROTATION”Rotation
ElasticWavesPmlType Objects
Section titled “ElasticWavesPmlType Objects”class ElasticWavesPmlType(_Enum)AML
Box PML
ElectromagneticWavesEigenmodePortTargetEigenvalueType Objects
Section titled “ElectromagneticWavesEigenmodePortTargetEigenvalueType Objects”class ElectromagneticWavesEigenmodePortTargetEigenvalueType(_Enum)Target eigenvalue type
PROPAGATION_CONSTANT
Section titled “PROPAGATION_CONSTANT”Propagation constant
EFFECTIVE_REFRACTIVE_INDEX
Section titled “EFFECTIVE_REFRACTIVE_INDEX”Effective refractive index
ElectromagneticWavesLumpVIActuationMode Objects
Section titled “ElectromagneticWavesLumpVIActuationMode Objects”class ElectromagneticWavesLumpVIActuationMode(_Enum)VOLTAGE
Section titled “VOLTAGE”Voltage
CURRENT
Section titled “CURRENT”Current
RESISTOR
Section titled “RESISTOR”Resistor
INDUCTOR
Section titled “INDUCTOR”Inductor
CAPACITOR
Section titled “CAPACITOR”Capacitor
CIRCUIT_COUPLING
Section titled “CIRCUIT_COUPLING”Circuit coupling
ElectromagneticWavesPeriodicityType Objects
Section titled “ElectromagneticWavesPeriodicityType Objects”class ElectromagneticWavesPeriodicityType(_Enum)TRANSLATION
Section titled “TRANSLATION”Translation
ROTATION
Section titled “ROTATION”Rotation
ElectromagneticWavesPmlType Objects
Section titled “ElectromagneticWavesPmlType Objects”class ElectromagneticWavesPmlType(_Enum)AML
Box PML
ElectromagneticWavesRectangularPortModeType Objects
Section titled “ElectromagneticWavesRectangularPortModeType Objects”class ElectromagneticWavesRectangularPortModeType(_Enum)Mode type
TE
TM
ElectrostaticsLumpActuationMode Objects
Section titled “ElectrostaticsLumpActuationMode Objects”class ElectrostaticsLumpActuationMode(_Enum)VOLTAGE
Section titled “VOLTAGE”Voltage
CHARGE
Section titled “CHARGE”Charge
CIRCUIT_COUPLING
Section titled “CIRCUIT_COUPLING”Circuit coupling
ElectrostaticsPeriodicityType Objects
Section titled “ElectrostaticsPeriodicityType Objects”class ElectrostaticsPeriodicityType(_Enum)TRANSLATION
Section titled “TRANSLATION”Translation
ROTATION
Section titled “ROTATION”Rotation
FieldOutputFilterType Objects
Section titled “FieldOutputFilterType Objects”class FieldOutputFilterType(_Enum)How to select which steps to save.
Output every step
EVERY_NTH_STEP
Section titled “EVERY_NTH_STEP”Output every Nth step
STEP_INDICES
Section titled “STEP_INDICES”Output specific steps
EXPRESSION
Section titled “EXPRESSION”Filter by expression
FieldStateFilterType Objects
Section titled “FieldStateFilterType Objects”class FieldStateFilterType(_Enum)How to select which steps to save.
FINAL_ONLY
Section titled “FINAL_ONLY”Output only the final state
EVERY_STEP
Section titled “EVERY_STEP”Output every step
EVERY_NTH_STEP
Section titled “EVERY_NTH_STEP”Output every Nth step
STEP_INDICES
Section titled “STEP_INDICES”Output specific steps
EXPRESSION
Section titled “EXPRESSION”Filter by expression
HeatFluidPeriodicityType Objects
Section titled “HeatFluidPeriodicityType Objects”class HeatFluidPeriodicityType(_Enum)TRANSLATION
Section titled “TRANSLATION”Translation
ROTATION
Section titled “ROTATION”Rotation
HeatTransferLumpTPhiActuationMode Objects
Section titled “HeatTransferLumpTPhiActuationMode Objects”class HeatTransferLumpTPhiActuationMode(_Enum)TEMPERATURE
Section titled “TEMPERATURE”Temperature
HEAT_POWER
Section titled “HEAT_POWER”Heat power
CIRCUIT_COUPLING
Section titled “CIRCUIT_COUPLING”Circuit coupling
HeatTransferPeriodicityType Objects
Section titled “HeatTransferPeriodicityType Objects”class HeatTransferPeriodicityType(_Enum)TRANSLATION
Section titled “TRANSLATION”Translation
ROTATION
Section titled “ROTATION”Rotation
LaminarFlowLumpPMActuationMode Objects
Section titled “LaminarFlowLumpPMActuationMode Objects”class LaminarFlowLumpPMActuationMode(_Enum)PRESSURE
Section titled “PRESSURE”Pressure
MASS_FLOW_RATE
Section titled “MASS_FLOW_RATE”Mass flow rate
CIRCUIT_COUPLING
Section titled “CIRCUIT_COUPLING”Circuit coupling
LaminarFlowLumpVFvActuationMode Objects
Section titled “LaminarFlowLumpVFvActuationMode Objects”class LaminarFlowLumpVFvActuationMode(_Enum)VELOCITY
Section titled “VELOCITY”Velocity
VISCOUS_FORCE
Section titled “VISCOUS_FORCE”Viscous force
CIRCUIT_COUPLING
Section titled “CIRCUIT_COUPLING”Circuit coupling
LaminarFlowPressurePeriodicityType Objects
Section titled “LaminarFlowPressurePeriodicityType Objects”class LaminarFlowPressurePeriodicityType(_Enum)TRANSLATION
Section titled “TRANSLATION”Translation
ROTATION
Section titled “ROTATION”Rotation
LaminarFlowVelocityPeriodicityType Objects
Section titled “LaminarFlowVelocityPeriodicityType Objects”class LaminarFlowVelocityPeriodicityType(_Enum)TRANSLATION
Section titled “TRANSLATION”Translation
ROTATION
Section titled “ROTATION”Rotation
MagnetismAPeriodicityType Objects
Section titled “MagnetismAPeriodicityType Objects”class MagnetismAPeriodicityType(_Enum)TRANSLATION
Section titled “TRANSLATION”Translation
ROTATION
Section titled “ROTATION”Rotation
MagnetismHPeriodicityType Objects
Section titled “MagnetismHPeriodicityType Objects”class MagnetismHPeriodicityType(_Enum)TRANSLATION
Section titled “TRANSLATION”Translation
ROTATION
Section titled “ROTATION”Rotation
MagnetismPhiLumpIVActuationMode Objects
Section titled “MagnetismPhiLumpIVActuationMode Objects”class MagnetismPhiLumpIVActuationMode(_Enum)CURRENT
Section titled “CURRENT”Current
VOLTAGE
Section titled “VOLTAGE”Voltage
CIRCUIT_COUPLING
Section titled “CIRCUIT_COUPLING”Circuit coupling
MagnetismPhiLumpPhiPhiBActuationMode Objects
Section titled “MagnetismPhiLumpPhiPhiBActuationMode Objects”class MagnetismPhiLumpPhiPhiBActuationMode(_Enum)MAGENTIC_SCALAR_POTENTIAL
Section titled “MAGENTIC_SCALAR_POTENTIAL”Magnetic scalar potential
MAGNETIC_FLUX
Section titled “MAGNETIC_FLUX”Magnetic flux
CIRCUIT_COUPLING
Section titled “CIRCUIT_COUPLING”Circuit coupling
MagnetismPhiPeriodicityType Objects
Section titled “MagnetismPhiPeriodicityType Objects”class MagnetismPhiPeriodicityType(_Enum)TRANSLATION
Section titled “TRANSLATION”Translation
ROTATION
Section titled “ROTATION”Rotation
MeshDeformationPeriodicityType Objects
Section titled “MeshDeformationPeriodicityType Objects”class MeshDeformationPeriodicityType(_Enum)TRANSLATION
Section titled “TRANSLATION”Translation
ROTATION
Section titled “ROTATION”Rotation
SolidMechanicsLumpActuationMode Objects
Section titled “SolidMechanicsLumpActuationMode Objects”class SolidMechanicsLumpActuationMode(_Enum)DISPLACEMENT
Section titled “DISPLACEMENT”Displacement
Force
CIRCUIT_COUPLING
Section titled “CIRCUIT_COUPLING”Circuit coupling
SolidMechanicsPeriodicityType Objects
Section titled “SolidMechanicsPeriodicityType Objects”class SolidMechanicsPeriodicityType(_Enum)TRANSLATION
Section titled “TRANSLATION”Translation
ROTATION
Section titled “ROTATION”Rotation
allsolve.physics.generated
Section titled “allsolve.physics.generated”Auto-generated physics helpers. Do not edit files in this package manually.
allsolve.physics.generated.physics
Section titled “allsolve.physics.generated.physics”Auto-generated physics classes.
This file is generated by generate_physics_helpers.py - DO NOT EDIT MANUALLY.
SolidMechanics Objects
Section titled “SolidMechanics Objects”class SolidMechanics(Physic)Solid mechanics physics.
CurrentFlow Objects
Section titled “CurrentFlow Objects”class CurrentFlow(Physic)Current flow physics.
AcousticWaves Objects
Section titled “AcousticWaves Objects”class AcousticWaves(Physic)Acoustic waves physics.
ElectromagneticWaves Objects
Section titled “ElectromagneticWaves Objects”class ElectromagneticWaves(Physic)Electromagnetic waves physics.
Electrostatics Objects
Section titled “Electrostatics Objects”class Electrostatics(Physic)Electrostatics physics.
MagnetismA Objects
Section titled “MagnetismA Objects”class MagnetismA(Physic)Magnetism A physics.
MagnetismPhi Objects
Section titled “MagnetismPhi Objects”class MagnetismPhi(Physic)magnetism phi physics.
MagnetismH Objects
Section titled “MagnetismH Objects”class MagnetismH(Physic)Magnetism H physics.
LaminarFlow Objects
Section titled “LaminarFlow Objects”class LaminarFlow(Physic)Laminar flow physics.
HeatTransfer Objects
Section titled “HeatTransfer Objects”class HeatTransfer(Physic)Heat solid physics.
HeatFluid Objects
Section titled “HeatFluid Objects”class HeatFluid(Physic)Heat fluid physics.
ElasticWaves Objects
Section titled “ElasticWaves Objects”class ElasticWaves(Physic)Elastic waves physics.
MeshDeformation Objects
Section titled “MeshDeformation Objects”class MeshDeformation(Physic)Mesh deformation physics.
allsolve.physics.generated.interactions
Section titled “allsolve.physics.generated.interactions”Auto-generated interaction classes.
This file is generated by generate_physics_helpers.py - DO NOT EDIT MANUALLY.
SolidMechanicsLoad Objects
Section titled “SolidMechanicsLoad Objects”class SolidMechanicsLoad(Interaction)Load interaction.
SolidMechanicsConstraint Objects
Section titled “SolidMechanicsConstraint Objects”class SolidMechanicsConstraint(Interaction)Constraint interaction.
SolidMechanicsClamp Objects
Section titled “SolidMechanicsClamp Objects”class SolidMechanicsClamp(Interaction)Clamp interaction.
SolidMechanicsLump Objects
Section titled “SolidMechanicsLump Objects”class SolidMechanicsLump(Interaction)Lump U/F interaction.
SolidMechanicsThermalExpansion Objects
Section titled “SolidMechanicsThermalExpansion Objects”class SolidMechanicsThermalExpansion(Interaction)Thermal expansion interaction.
SolidMechanicsPiezoelectricity Objects
Section titled “SolidMechanicsPiezoelectricity Objects”class SolidMechanicsPiezoelectricity(Interaction)Piezoelectricity interaction.
SolidMechanicsElectricForce Objects
Section titled “SolidMechanicsElectricForce Objects”class SolidMechanicsElectricForce(Interaction)Electric force interaction.
SolidMechanicsMagneticForce Objects
Section titled “SolidMechanicsMagneticForce Objects”class SolidMechanicsMagneticForce(Interaction)Magnetic force interaction.
SolidMechanicsLargeDisplacement Objects
Section titled “SolidMechanicsLargeDisplacement Objects”class SolidMechanicsLargeDisplacement(Interaction)Large displacement interaction.
SolidMechanicsPressure Objects
Section titled “SolidMechanicsPressure Objects”class SolidMechanicsPressure(Interaction)Pressure interaction.
SolidMechanicsPrestress Objects
Section titled “SolidMechanicsPrestress Objects”class SolidMechanicsPrestress(Interaction)Prestress interaction.
SolidMechanicsPeriodicity Objects
Section titled “SolidMechanicsPeriodicity Objects”class SolidMechanicsPeriodicity(Interaction)Periodicity interaction.
SolidMechanicsSymmetry Objects
Section titled “SolidMechanicsSymmetry Objects”class SolidMechanicsSymmetry(Interaction)Symmetry interaction.
SolidMechanicsProportionalDamping Objects
Section titled “SolidMechanicsProportionalDamping Objects”class SolidMechanicsProportionalDamping(Interaction)Proportional damping interaction.
SolidMechanicsGeometricNonlinearity Objects
Section titled “SolidMechanicsGeometricNonlinearity Objects”class SolidMechanicsGeometricNonlinearity(Interaction)Geometric nonlinearity interaction.
SolidMechanicsContact Objects
Section titled “SolidMechanicsContact Objects”class SolidMechanicsContact(Interaction)Contact interaction.
CurrentFlowConstraint Objects
Section titled “CurrentFlowConstraint Objects”class CurrentFlowConstraint(Interaction)Constraint interaction.
CurrentFlowCurrentDensity Objects
Section titled “CurrentFlowCurrentDensity Objects”class CurrentFlowCurrentDensity(Interaction)Current density source interaction.
CurrentFlowLump Objects
Section titled “CurrentFlowLump Objects”class CurrentFlowLump(Interaction)Lump V/I interaction.
CurrentFlowLumpVICut Objects
Section titled “CurrentFlowLumpVICut Objects”class CurrentFlowLumpVICut(Interaction)Lump V/I cut interaction.
CurrentFlowPeriodicity Objects
Section titled “CurrentFlowPeriodicity Objects”class CurrentFlowPeriodicity(Interaction)Periodicity interaction.
AcousticWavesPml Objects
Section titled “AcousticWavesPml Objects”class AcousticWavesPml(Interaction)Perfectly matched layer interaction.
AcousticWavesConstraint Objects
Section titled “AcousticWavesConstraint Objects”class AcousticWavesConstraint(Interaction)Constraint interaction.
AcousticWavesAcousticStructure Objects
Section titled “AcousticWavesAcousticStructure Objects”class AcousticWavesAcousticStructure(Interaction)Acoustic structure interaction.
AcousticWavesAcousticStructureForElasticWaves Objects
Section titled “AcousticWavesAcousticStructureForElasticWaves Objects”class AcousticWavesAcousticStructureForElasticWaves(Interaction)Acoustic structure interaction.
AcousticWavesAbsorbingBoundary Objects
Section titled “AcousticWavesAbsorbingBoundary Objects”class AcousticWavesAbsorbingBoundary(Interaction)Absorbing boundary interaction.
AcousticWavesPeriodicity Objects
Section titled “AcousticWavesPeriodicity Objects”class AcousticWavesPeriodicity(Interaction)Periodicity interaction.
AcousticWavesAcousticDamping Objects
Section titled “AcousticWavesAcousticDamping Objects”class AcousticWavesAcousticDamping(Interaction)Acoustic damping interaction.
AcousticWavesNormalAcceleration Objects
Section titled “AcousticWavesNormalAcceleration Objects”class AcousticWavesNormalAcceleration(Interaction)Normal acceleration interaction.
AcousticWavesContinuity Objects
Section titled “AcousticWavesContinuity Objects”class AcousticWavesContinuity(Interaction)Continuity interaction.
ElectromagneticWavesConstraint Objects
Section titled “ElectromagneticWavesConstraint Objects”class ElectromagneticWavesConstraint(Interaction)Constraint interaction.
ElectromagneticWavesPml Objects
Section titled “ElectromagneticWavesPml Objects”class ElectromagneticWavesPml(Interaction)Perfectly matched layer interaction.
ElectromagneticWavesRectangularPort Objects
Section titled “ElectromagneticWavesRectangularPort Objects”class ElectromagneticWavesRectangularPort(Interaction)Rectangular port interaction.
ElectromagneticWavesPerfectConductor Objects
Section titled “ElectromagneticWavesPerfectConductor Objects”class ElectromagneticWavesPerfectConductor(Interaction)Perfect conductor interaction.
ElectromagneticWavesEigenmodePort Objects
Section titled “ElectromagneticWavesEigenmodePort Objects”class ElectromagneticWavesEigenmodePort(Interaction)Eigenmode port interaction.
ElectromagneticWavesDielectricLoss Objects
Section titled “ElectromagneticWavesDielectricLoss Objects”class ElectromagneticWavesDielectricLoss(Interaction)Dielectric loss interaction.
ElectromagneticWavesLumpVI Objects
Section titled “ElectromagneticWavesLumpVI Objects”class ElectromagneticWavesLumpVI(Interaction)Lump V/I interaction.
ElectromagneticWavesPeriodicity Objects
Section titled “ElectromagneticWavesPeriodicity Objects”class ElectromagneticWavesPeriodicity(Interaction)Periodicity interaction.
ElectromagneticWavesAbsorbingBoundary Objects
Section titled “ElectromagneticWavesAbsorbingBoundary Objects”class ElectromagneticWavesAbsorbingBoundary(Interaction)Absorbing boundary interaction.
ElectromagneticWavesBoundaryImpedance Objects
Section titled “ElectromagneticWavesBoundaryImpedance Objects”class ElectromagneticWavesBoundaryImpedance(Interaction)Boundary impedance interaction.
ElectrostaticsConstraint Objects
Section titled “ElectrostaticsConstraint Objects”class ElectrostaticsConstraint(Interaction)Constraint interaction.
ElectrostaticsPiezoelectricity Objects
Section titled “ElectrostaticsPiezoelectricity Objects”class ElectrostaticsPiezoelectricity(Interaction)Piezoelectricity interaction.
ElectrostaticsLump Objects
Section titled “ElectrostaticsLump Objects”class ElectrostaticsLump(Interaction)Lump V/Q interaction.
ElectrostaticsLargeDisplacement Objects
Section titled “ElectrostaticsLargeDisplacement Objects”class ElectrostaticsLargeDisplacement(Interaction)Large displacement interaction.
ElectrostaticsElasticWavesPiezoelectricity Objects
Section titled “ElectrostaticsElasticWavesPiezoelectricity Objects”class ElectrostaticsElasticWavesPiezoelectricity(Interaction)Piezoelectricity interaction.
ElectrostaticsPeriodicity Objects
Section titled “ElectrostaticsPeriodicity Objects”class ElectrostaticsPeriodicity(Interaction)Periodicity interaction.
MagnetismAMagneticWall Objects
Section titled “MagnetismAMagneticWall Objects”class MagnetismAMagneticWall(Interaction)Magnetic wall interaction.
MagnetismAElectromagneticCoupling Objects
Section titled “MagnetismAElectromagneticCoupling Objects”class MagnetismAElectromagneticCoupling(Interaction)A-v coupling interaction.
MagnetismABackgroundField Objects
Section titled “MagnetismABackgroundField Objects”class MagnetismABackgroundField(Interaction)Remanence interaction.
MagnetismAPeriodicity Objects
Section titled “MagnetismAPeriodicity Objects”class MagnetismAPeriodicity(Interaction)Periodicity interaction.
MagnetismPhiConstraint Objects
Section titled “MagnetismPhiConstraint Objects”class MagnetismPhiConstraint(Interaction)Constraint interaction.
MagnetismPhiBackgroundField Objects
Section titled “MagnetismPhiBackgroundField Objects”class MagnetismPhiBackgroundField(Interaction)Remanence interaction.
MagnetismPhiLumpPhiPhiB Objects
Section titled “MagnetismPhiLumpPhiPhiB Objects”class MagnetismPhiLumpPhiPhiB(Interaction)magnetism phi lump phi phi b interaction.
MagnetismPhiLumpIV Objects
Section titled “MagnetismPhiLumpIV Objects”class MagnetismPhiLumpIV(Interaction)Lump I/V cut interaction.
MagnetismPhiExternalField Objects
Section titled “MagnetismPhiExternalField Objects”class MagnetismPhiExternalField(Interaction)External field interaction.
MagnetismPhiPeriodicity Objects
Section titled “MagnetismPhiPeriodicity Objects”class MagnetismPhiPeriodicity(Interaction)Periodicity interaction.
MagnetismPhiContinuity Objects
Section titled “MagnetismPhiContinuity Objects”class MagnetismPhiContinuity(Interaction)Continuity interaction.
MagnetismHConstraint Objects
Section titled “MagnetismHConstraint Objects”class MagnetismHConstraint(Interaction)Constraint interaction.
MagnetismHHPhiCoupling Objects
Section titled “MagnetismHHPhiCoupling Objects”class MagnetismHHPhiCoupling(Interaction)h phi coupling interaction.
MagnetismHElectricalInsulator Objects
Section titled “MagnetismHElectricalInsulator Objects”class MagnetismHElectricalInsulator(Interaction)Electrical insulator interaction.
MagnetismHPeriodicity Objects
Section titled “MagnetismHPeriodicity Objects”class MagnetismHPeriodicity(Interaction)Periodicity interaction.
LaminarFlowVelocityConstraint Objects
Section titled “LaminarFlowVelocityConstraint Objects”class LaminarFlowVelocityConstraint(Interaction)Velocity constraint interaction.
LaminarFlowPressureConstraint Objects
Section titled “LaminarFlowPressureConstraint Objects”class LaminarFlowPressureConstraint(Interaction)Pressure constraint interaction.
LaminarFlowThermalFluid Objects
Section titled “LaminarFlowThermalFluid Objects”class LaminarFlowThermalFluid(Interaction)Thermal fluid interaction.
LaminarFlowForce Objects
Section titled “LaminarFlowForce Objects”class LaminarFlowForce(Interaction)Force interaction.
LaminarFlowVelocityPeriodicity Objects
Section titled “LaminarFlowVelocityPeriodicity Objects”class LaminarFlowVelocityPeriodicity(Interaction)Velocity periodicity interaction.
LaminarFlowPressurePeriodicity Objects
Section titled “LaminarFlowPressurePeriodicity Objects”class LaminarFlowPressurePeriodicity(Interaction)Pressure periodicity interaction.
LaminarFlowLargeDisplacement Objects
Section titled “LaminarFlowLargeDisplacement Objects”class LaminarFlowLargeDisplacement(Interaction)Large displacement interaction.
LaminarFlowFluidStructure Objects
Section titled “LaminarFlowFluidStructure Objects”class LaminarFlowFluidStructure(Interaction)Fluid structure interaction.
LaminarFlowVelocitySymmetry Objects
Section titled “LaminarFlowVelocitySymmetry Objects”class LaminarFlowVelocitySymmetry(Interaction)Velocity symmetry interaction.
LaminarFlowPressureSymmetry Objects
Section titled “LaminarFlowPressureSymmetry Objects”class LaminarFlowPressureSymmetry(Interaction)Pressure symmetry interaction.
LaminarFlowLumpPM Objects
Section titled “LaminarFlowLumpPM Objects”class LaminarFlowLumpPM(Interaction)Lump P/M interaction.
LaminarFlowLumpVFv Objects
Section titled “LaminarFlowLumpVFv Objects”class LaminarFlowLumpVFv(Interaction)Lump V/Fv interaction.
LaminarFlowLinear Objects
Section titled “LaminarFlowLinear Objects”class LaminarFlowLinear(Interaction)Linear interaction.
HeatTransferTemperatureConstraint Objects
Section titled “HeatTransferTemperatureConstraint Objects”class HeatTransferTemperatureConstraint(Interaction)Constraint interaction.
HeatTransferHeatSource Objects
Section titled “HeatTransferHeatSource Objects”class HeatTransferHeatSource(Interaction)Heat source interaction.
HeatTransferJouleHeating Objects
Section titled “HeatTransferJouleHeating Objects”class HeatTransferJouleHeating(Interaction)Joule heating interaction.
HeatTransferPeriodicity Objects
Section titled “HeatTransferPeriodicity Objects”class HeatTransferPeriodicity(Interaction)Periodicity interaction.
HeatTransferConvection Objects
Section titled “HeatTransferConvection Objects”class HeatTransferConvection(Interaction)Convection interaction.
HeatTransferLumpTPhi Objects
Section titled “HeatTransferLumpTPhi Objects”class HeatTransferLumpTPhi(Interaction)heat transfer lump t phi interaction.
HeatFluidConstraint Objects
Section titled “HeatFluidConstraint Objects”class HeatFluidConstraint(Interaction)Constraint interaction.
HeatFluidHeatSource Objects
Section titled “HeatFluidHeatSource Objects”class HeatFluidHeatSource(Interaction)Heat source interaction.
HeatFluidPeriodicity Objects
Section titled “HeatFluidPeriodicity Objects”class HeatFluidPeriodicity(Interaction)Periodicity interaction.
ElasticWavesLoad Objects
Section titled “ElasticWavesLoad Objects”class ElasticWavesLoad(Interaction)Load interaction.
ElasticWavesConstraint Objects
Section titled “ElasticWavesConstraint Objects”class ElasticWavesConstraint(Interaction)Constraint interaction.
ElasticWavesClamp Objects
Section titled “ElasticWavesClamp Objects”class ElasticWavesClamp(Interaction)Clamp interaction.
ElasticWavesLump Objects
Section titled “ElasticWavesLump Objects”class ElasticWavesLump(Interaction)Lump U/F interaction.
ElasticWavesPiezoelectricity Objects
Section titled “ElasticWavesPiezoelectricity Objects”class ElasticWavesPiezoelectricity(Interaction)Piezoelectricity interaction.
ElasticWavesPml Objects
Section titled “ElasticWavesPml Objects”class ElasticWavesPml(Interaction)Perfectly matched layer interaction.
ElasticWavesThermalExpansion Objects
Section titled “ElasticWavesThermalExpansion Objects”class ElasticWavesThermalExpansion(Interaction)Thermal expansion interaction.
ElasticWavesViscoelasticity Objects
Section titled “ElasticWavesViscoelasticity Objects”class ElasticWavesViscoelasticity(Interaction)Viscoelasticity interaction.
ElasticWavesPressure Objects
Section titled “ElasticWavesPressure Objects”class ElasticWavesPressure(Interaction)Pressure interaction.
ElasticWavesPeriodicity Objects
Section titled “ElasticWavesPeriodicity Objects”class ElasticWavesPeriodicity(Interaction)Periodicity interaction.
ElasticWavesAbsorbingBoundary Objects
Section titled “ElasticWavesAbsorbingBoundary Objects”class ElasticWavesAbsorbingBoundary(Interaction)Absorbing boundary interaction.
ElasticWavesSymmetry Objects
Section titled “ElasticWavesSymmetry Objects”class ElasticWavesSymmetry(Interaction)Symmetry interaction.
ElasticWavesElectricForce Objects
Section titled “ElasticWavesElectricForce Objects”class ElasticWavesElectricForce(Interaction)Electric force interaction.
ElasticWavesProportionalDamping Objects
Section titled “ElasticWavesProportionalDamping Objects”class ElasticWavesProportionalDamping(Interaction)Proportional damping interaction.
ElasticWavesContinuity Objects
Section titled “ElasticWavesContinuity Objects”class ElasticWavesContinuity(Interaction)Continuity interaction.
ElasticWavesViscousDamping Objects
Section titled “ElasticWavesViscousDamping Objects”class ElasticWavesViscousDamping(Interaction)Viscous damping interaction.
MeshDeformationConstraint Objects
Section titled “MeshDeformationConstraint Objects”class MeshDeformationConstraint(Interaction)Constraint interaction.
MeshDeformationClamp Objects
Section titled “MeshDeformationClamp Objects”class MeshDeformationClamp(Interaction)Clamp interaction.
MeshDeformationPeriodicity Objects
Section titled “MeshDeformationPeriodicity Objects”class MeshDeformationPeriodicity(Interaction)Periodicity interaction.
MeshDeformationSymmetry Objects
Section titled “MeshDeformationSymmetry Objects”class MeshDeformationSymmetry(Interaction)Symmetry interaction.
allsolve.physics.generated.registries
Section titled “allsolve.physics.generated.registries”Auto-generated registries for physics and interactions.
This file is generated by generate_physics_helpers.py - DO NOT EDIT MANUALLY.
allsolve.physics.generated.namespaces
Section titled “allsolve.physics.generated.namespaces”Auto-generated namespaces for physics and interactions.
This file is generated by generate_physics_helpers.py - DO NOT EDIT MANUALLY.
Physics Objects
Section titled “Physics Objects”class Physics()Namespace for generated physics classes.
Interaction Objects
Section titled “Interaction Objects”class Interaction()Namespace for generated interaction classes.
Output Objects
Section titled “Output Objects”class Output()Namespace for generated output interaction classes.
allsolve.physics.generated.outputs
Section titled “allsolve.physics.generated.outputs”Auto-generated output interaction classes.
This file is generated by generate_physics_helpers.py - DO NOT EDIT MANUALLY.
AcousticWavesRadiationPattern Objects
Section titled “AcousticWavesRadiationPattern Objects”class AcousticWavesRadiationPattern(OutputInteraction)Acoustic radiation pattern output interaction.
ValueOutput Objects
Section titled “ValueOutput Objects”class ValueOutput(OutputInteraction)Value output output interaction.
Eigenfrequencies Objects
Section titled “Eigenfrequencies Objects”class Eigenfrequencies(OutputInteraction)Eigenfrequencies output interaction.
Eigenvalues Objects
Section titled “Eigenvalues Objects”class Eigenvalues(OutputInteraction)Eigenvalues output interaction.
ElectromagneticWavesRadiationPattern Objects
Section titled “ElectromagneticWavesRadiationPattern Objects”class ElectromagneticWavesRadiationPattern(OutputInteraction)EM radiation pattern output interaction.
FieldOutput Objects
Section titled “FieldOutput Objects”class FieldOutput(OutputInteraction)Field output output interaction.
FieldState Objects
Section titled “FieldState Objects”class FieldState(OutputInteraction)Field state output interaction.
FinalHPhiState Objects
Section titled “FinalHPhiState Objects”class FinalHPhiState(OutputInteraction)final h phi state output interaction.
MagneticForce Objects
Section titled “MagneticForce Objects”class MagneticForce(OutputInteraction)Magnetic force output interaction.
QFactors Objects
Section titled “QFactors Objects”class QFactors(OutputInteraction)Q-factors output interaction.
SParameters Objects
Section titled “SParameters Objects”class SParameters(OutputInteraction)S-parameters output interaction.
TransientState Objects
Section titled “TransientState Objects”class TransientState(OutputInteraction)Transient state output interaction.
allsolve.physics.interaction
Section titled “allsolve.physics.interaction”InteractionParameter Objects
Section titled “InteractionParameter Objects”class InteractionParameter()InteractionParameter is a class for managing interaction parameters.
@propertydef value() -> strGet the value of the parameter.
@value.setterdef value(value: str) -> NoneSet the value of the parameter.
definition
Section titled “definition”@propertydef definition() -> strGet the definition of the parameter.
InteractionBase Objects
Section titled “InteractionBase Objects”class InteractionBase()InteractionBase is a base class for interactions and output interactions in a project.
target_definition_ids
Section titled “target_definition_ids”Mapping of Python parameter name to target definition ID for multi-target interactions.
@property@prevent_deleteddef id() -> strGet the ID of the interaction.
@property@prevent_deleteddef name() -> strGet the name of the interaction.
@name.setter@prevent_deleteddef name(name: str) -> NoneSet the name of the shared expression. Use save() to commit the change.
definition
Section titled “definition”@property@prevent_deleteddef definition() -> strGet the definition of the interaction.
enabled
Section titled “enabled”@property@prevent_deleteddef enabled() -> boolGet whether the interaction is enabled.
enabled
Section titled “enabled”@enabled.setter@prevent_deleteddef enabled(enabled: bool) -> NoneSet whether the interaction is enabled. Use save() to commit the change.
namespace
Section titled “namespace”@property@prevent_deleteddef namespace() -> str | NoneGet the namespace of the interaction.
namespace
Section titled “namespace”@namespace.setter@prevent_deleteddef namespace(namespace: str | None) -> NoneSet the namespace of the interaction. Use save() to commit the change.
target_region_id
Section titled “target_region_id”@prevent_deleteddef target_region_id(target_definition: str | None = None) -> str | NoneGet the targets of the interaction.
set_target_region_id
Section titled “set_target_region_id”@prevent_deleteddef set_target_region_id(region_id: str, target_definition: str | None = None) -> NoneSet the target region ID for a specific target definition. Use save() to commit the change.
Arguments:
region_id- The region ID to set.target_definition- The target definition to update. If None, updates the first target.
parameters
Section titled “parameters”@property@prevent_deleteddef parameters() -> List[InteractionParameter]Get the parameters of the interaction.
parameters
Section titled “parameters”@parameters.setter@prevent_deleteddef parameters(parameters: List[InteractionParameter]) -> NoneSet the parameters of the interaction. Use save() to commit the change.
@prevent_deleteddef save() -> NoneSave the changes to the cloud made by
setting properties like name, enabled, target_region_id, or parameters.
delete
Section titled “delete”@prevent_deleteddef delete() -> NoneDelete the interaction from the project.
Interaction Objects
Section titled “Interaction Objects”class Interaction(InteractionBase)Interaction is a class for managing interactions in a project.
create
Section titled “create”@classmethoddef create(cls, physics_id: str, name: str, definition: str, target_region_id: str | None = None, enabled: "BooleanValue | None" = None, project_id: str | None = None, parameters: List[InteractionParameter] | None = None, target_definition: str | None = None, interaction_targets: List[Tuple[str, str]] | None = None, namespace: str | None = None) -> SelfCreate a new interaction for a physics in the project.
Recommended to use the physics.add_interactions() method to create an interaction. First you need to add physics to the project.
Example:
physic = project.add_physics(allsolve.Physics.SolidMechanics())physic.add_interactions([allsolve.Interaction.SolidMechanicsClamp(name="clamp", target=region_clamp_surface)])Arguments:
physics_id- The ID of the physics this interaction belongs to.name- The name of the interaction.definition- The definition of the interaction (e.g., “clamp”).enabled- The enabled expression for the interaction (bool or string).target_region_id- The region ID this interaction targets (single-target).project_id- The ID of the project. Can be omitted if project API key is used.parameters- Optional list of interaction parameters.target_definition- Optional target definition for single-target interactions (e.g., “clampTarget”).interaction_targets- Optional list of (definition_id, region_id) tuples for multi-target interactions. Takes precedence over target_definition/target_region_id if provided.
Returns:
The created Interaction.
OutputInteraction Objects
Section titled “OutputInteraction Objects”class OutputInteraction(InteractionBase)OutputInteraction is a class for managing output interactions in a simulation.
create
Section titled “create”@classmethoddef create(cls, simulation_id: str, name: str, definition: str, project_id: str | None = None, parameters: List[InteractionParameter] | None = None, enabled: bool = True) -> SelfCreate a new output interaction for a simulation.
Arguments:
simulation_id- The ID of the simulation this interaction belongs to.name- The name of the interaction.definition- The definition of the interaction (e.g., “fieldOutput”).project_id- The ID of the project. Can be omitted if project API key is used.parameters- Optional list of interaction parameters.enabled- Whether the interaction is enabled (default: True).
Returns:
The created Interaction.
allsolve.physics.conversions
Section titled “allsolve.physics.conversions”vector_to_str
Section titled “vector_to_str”def vector_to_str(value: VectorValue) -> strConvert a vector value to allsolve string format.
Arguments:
value- A vector as a string, tuple, or list.- If string, returned as-is (assumed to be in correct format).
- If tuple/list, converted to “[x; y; z]” format.
Returns:
The vector in allsolve format “[x; y; z]”.
Examples:
vector_to_str((0, 0, -1000)) ‘[0; 0; -1000]’ vector_to_str([1.5, 2.0, 3.0]) ‘[1.5; 2.0; 3.0]’ vector_to_str(“[0; 0; -1000]”) ‘[0; 0; -1000]‘
vector_from_str
Section titled “vector_from_str”def vector_from_str(value: str) -> VectorValueParse a vector string back to a list of values.
Arguments:
value- A string in allsolve vector format “[x; y; z]”.
Returns:
A list of floats (or strings if not numeric).
Examples:
vector_from_str(“[0; 0; -1000]”) [0.0, 0.0, -1000.0] vector_from_str(“[1.5; 2.0; 3.0]”) [1.5, 2.0, 3.0] vector_from_str(“[x; y; z]”) [‘x’, ‘y’, ‘z’]
matrix_to_str
Section titled “matrix_to_str”def matrix_to_str(value: MatrixValue) -> strConvert a matrix value to allsolve string format.
Arguments:
value- A matrix as a string or nested sequence.- If string, returned as-is (assumed to be in correct format).
- If nested sequence, converted to “[r0c0, r0c1; r1c0, r1c1; …]” format. Rows are separated by semicolons, columns by commas.
Returns:
The matrix in allsolve format.
Examples:
matrix_to_str([[1, 0], [0, 1], [0, 0]]) ‘[1, 0; 0, 1; 0, 0]’ matrix_to_str(“[1, 0; 0, 42; 0, 0]”) ‘[1, 0; 0, 42; 0, 0]‘
matrix_from_str
Section titled “matrix_from_str”def matrix_from_str(value: str) -> MatrixValueParse a matrix string back to a nested list of values.
Arguments:
value- A string in allsolve matrix format “[r0c0, r0c1; r1c0, r1c1; …]”.
Returns:
A nested list of floats (or strings if not numeric).
Examples:
matrix_from_str(“[1, 0; 0, 1; 0, 0]”) [[1.0, 0.0], [0.0, 1.0], [0.0, 0.0]] matrix_from_str(“[1.5, 2.0; 3.0, 4.5]”) [[1.5, 2.0], [3.0, 4.5]]
boolean_to_str
Section titled “boolean_to_str”def boolean_to_str(value: BooleanValue) -> strConvert a boolean value to allsolve string format.
Arguments:
value- A boolean value as string or bool.- If string, returned as-is.
- If bool, converted to “1” (True) or “0” (False).
Returns:
The boolean as “1” or “0”.
Examples:
boolean_to_str(True) ‘1’ boolean_to_str(False) ‘0’ boolean_to_str(“1”) ‘1’
boolean_from_str
Section titled “boolean_from_str”def boolean_from_str(value: str) -> boolParse a boolean string back to a Python bool.
Arguments:
value- A string “1” or “0”.
Returns:
True if value is “1”, False if value is “0”.
Raises:
ValueError- If value is not “1” or “0”.
Examples:
boolean_from_str(“1”) True boolean_from_str(“0”) False
allsolve.physics
Section titled “allsolve.physics”allsolve.physics.physic
Section titled “allsolve.physics.physic”Physic Objects
Section titled “Physic Objects”class Physic()Physic is a class for managing physics in a project.
get_all
Section titled “get_all”@classmethoddef get_all(cls, project_id: str | None = None) -> List["Physic"]Get all physics in a project.
Arguments:
project_id- The ID of the project. Can be omitted if project API key is used.
Returns:
A list of Physics objects.
create
Section titled “create”@classmethoddef create(cls, definition: str, project_id: str | None = None, target_region_id: str | None = None) -> "Physic"Create a new physic.
Arguments:
definition- The definition of the physic (e.g., “solidMechanics”).project_id- The ID of the project. Can be omitted if project API key is used.target_region_id- Optional target region ID.
Returns:
The created Physics.
@property@prevent_deleteddef id() -> strGet the ID of the physic.
definition
Section titled “definition”@property@prevent_deleteddef definition() -> strGet the definition of the physic.
target_region_id
Section titled “target_region_id”@property@prevent_deleteddef target_region_id() -> str | NoneGet the target region ID of the physic.
target_region_id
Section titled “target_region_id”@target_region_id.setter@prevent_deleteddef target_region_id(target_region_id: str | None) -> NoneSet the target region ID of the physic. Use save() to commit the change.
interactions
Section titled “interactions”@property@prevent_deleteddef interactions() -> List[Interaction]Get the interactions of the physic.
get_interactions
Section titled “get_interactions”@prevent_deleteddef get_interactions() -> List[Interaction]Get the interactions of the physic.
add_interactions
Section titled “add_interactions”@prevent_deleteddef add_interactions(interactions: List[Interaction]) -> List[Interaction]Add interactions to this physic.
interaction
Section titled “interaction”@prevent_deleteddef interaction(definition: str) -> Interaction | NoneGet the interaction of the physic by interaction definition.
field_ids
Section titled “field_ids”@property@prevent_deleteddef field_ids() -> List[str]Get the field IDs of the physic.
Returns:
A list of field IDs.
get_field_interpolation_order
Section titled “get_field_interpolation_order”@prevent_deleteddef get_field_interpolation_order(field_id: str | None = None) -> str | NoneGet the interpolation order for a field.
Arguments:
field_id- The ID of the field. If None, uses the first field.
Returns:
The interpolation order of the field, or None if not set.
Raises:
ValueError- If the physic has no fields or the field_id is not found.
set_field_interpolation_order
Section titled “set_field_interpolation_order”@prevent_deleteddef set_field_interpolation_order(interpolation_order: str | int, field_id: str | None = None) -> NoneSet the interpolation order for a field. Use save() to commit the change.
Arguments:
interpolation_order- The interpolation order to set.field_id- The ID of the field. If None, uses the first field.
Raises:
ValueError- If the physic has no fields or the field_id is not found.
@prevent_deleteddef save() -> NoneExplicitly save the changes to the cloud made by
setting properties like target_region_id or set_field_interpolation_order.
delete
Section titled “delete”@prevent_deleteddef delete() -> NoneDelete the physic from the project.
allsolve.varint
Section titled “allsolve.varint”Variable-length integer encoding (varint) implementation.
Uses 7-bit groups with continuation bits, and zig-zag encoding for signed integers.
encode_one
Section titled “encode_one”def encode_one(value: int) -> bytesEncode a single unsigned integer using variable-length encoding.
Uses 7 bits for data and 1 bit (MSB) as continuation flag for bytes 1-8. The 9th byte (if needed) uses all 8 bits.
encode_one_signed
Section titled “encode_one_signed”def encode_one_signed(value: int) -> bytesEncode a single signed integer using zig-zag encoding followed by varint encoding.
Zig-zag encoding maps negative numbers to positive ones: 0 -> 0, -1 -> 1, 1 -> 2, -2 -> 3, 2 -> 4, …
encode
Section titled “encode”def encode(values: List[int]) -> bytesEncode multiple unsigned integers using variable-length encoding.
encode_signed
Section titled “encode_signed”def encode_signed(values: List[int]) -> bytesEncode multiple signed integers using zig-zag encoding followed by varint encoding.
Zig-zag encoding maps negative numbers to positive ones: 0 -> 0, -1 -> 1, 1 -> 2, -2 -> 3, 2 -> 4, …
decode
Section titled “decode”def decode(buffer: bytes | bytearray | memoryview) -> List[int]Decode all variable-length encoded unsigned integers from the buffer.
Returns a list of decoded values. Raises ValueError if the buffer is invalid.
decode_signed
Section titled “decode_signed”def decode_signed(buffer: bytes | bytearray | memoryview) -> List[int]Decode all zig-zag encoded signed integers from the buffer.
Returns a list of decoded values.
decode_one
Section titled “decode_one”def decode_one(buffer: bytes | bytearray | memoryview) -> Tuple[int, int]Decode a single variable-length encoded unsigned integer from the buffer.
Returns a tuple of (decoded_value, bytes_consumed). Raises ValueError if the buffer is invalid.
decode_one_signed
Section titled “decode_one_signed”def decode_one_signed( buffer: bytes | bytearray | memoryview) -> Tuple[int, int]Decode a single zig-zag encoded signed integer from the buffer.
Returns a tuple of (decoded_value, bytes_consumed).
allsolve.expression
Section titled “allsolve.expression”SharedExpression Objects
Section titled “SharedExpression Objects”class SharedExpression()SharedExpression is for managing shared expressions.
The “Shared” means that they are stored in the system so that they can referred to in other places using their identifier.
@classmethoddef get(cls, expr_id: str, project_id: str | None = None) -> SelfGet a shared expression by its ID.
get_all
Section titled “get_all”@classmethoddef get_all(cls, project_id: str | None = None) -> List[Self]Get all shared expressions in a project.
@property@prevent_deleteddef id() -> strGet the ID of the shared expression.
@property@prevent_deleteddef name() -> strGet the name of the shared expression.
@name.setter@prevent_deleteddef name(name: str) -> NoneSet the name of the shared expression. Use save() to commit the change.
description
Section titled “description”@property@prevent_deleteddef description() -> strGet the description of the shared expression.
description
Section titled “description”@description.setter@prevent_deleteddef description(description: str) -> NoneSet the description of the shared expression. Use save() to commit the change.
@property@prevent_deleteddef type() -> rawapi.SharedExpressionTypeGet the type of the shared expression.
@type.setter@prevent_deleteddef type(expression_type: rawapi.SharedExpressionType) -> NoneSet the type of the shared expression. Use save() to commit the change.
origin
Section titled “origin”@property@prevent_deleteddef origin() -> Optional[str]Get the origin (original shared expression ID if this is a copy).
origin
Section titled “origin”@origin.setter@prevent_deleteddef origin(origin: Optional[str]) -> NoneSet the origin of the shared expression. Use save() to commit the change.
@property@prevent_deleteddef args() -> Optional[List[rawapi.SharedExpressionArg]]Get the arguments of the shared expression.
@args.setter@prevent_deleteddef args(args: Optional[List[rawapi.SharedExpressionArg]]) -> NoneSet the arguments of the shared expression. Use save() to commit the change.
expression
Section titled “expression”@property@prevent_deleteddef expression() -> Optional[str]Get the expression string.
expression
Section titled “expression”@expression.setter@prevent_deleteddef expression(expression: Optional[str]) -> NoneSet the expression string. Use save() to commit the change.
values
Section titled “values”@property@prevent_deleteddef values() -> Optional[List[Union[float, int]]]Get the values of the shared expression.
values
Section titled “values”@values.setter@prevent_deleteddef values(values: Optional[List[Union[float, int]]]) -> NoneSet the values of the shared expression. Use save() to commit the change.
cubic_interpolation
Section titled “cubic_interpolation”@property@prevent_deleteddef cubic_interpolation() -> Optional[bool]Get whether cubic spline interpolation is used (for interpolated functions). When True, values are interpolated using a natural cubic spline. When False or None, linear interpolation is used.
cubic_interpolation
Section titled “cubic_interpolation”@cubic_interpolation.setter@prevent_deleteddef cubic_interpolation(cubic_interpolation: Optional[bool]) -> NoneSet whether cubic spline interpolation is used. Use save() to commit the change.
delete
Section titled “delete”@prevent_deleteddef delete() -> NoneDelete the shared expression.
@prevent_deleteddef save() -> NoneExplicitly save the changes to the cloud made by
setting properties like name, description, type, expression, args, origin, values and cubic_interpolation.
Variable Objects
Section titled “Variable Objects”class Variable(SharedExpression)A variable expression in the project. Variables are SharedExpressions with type EXPRESSION.
create
Section titled “create”@classmethoddef create(cls, name: str, expression: str | float | int, description: str = "", project_id: str | None = None) -> SelfCreate a variable in the project.
Arguments:
name- The name of the variable.expression- The expression of the variable.description- The description of the variable.project_id- The ID of the project.
Returns:
The created variable.
get_all
Section titled “get_all”@classmethoddef get_all(cls, project_id: str | None = None) -> List[Self]Get all variables in a project.
get_by_name
Section titled “get_by_name”@classmethoddef get_by_name(cls, name: str, project_id: str | None = None) -> Self | NoneGet a variable by its name. Returns None if no variable matches the given name.
Arguments:
name- The name of the variable.project_id- The ID of the project.
Returns:
The variable that matches the given name.
Function Objects
Section titled “Function Objects”class Function(SharedExpression)A function expression in the project. Functions are SharedExpressions with type FUNCTION.
create
Section titled “create”@classmethoddef create(cls, name: str, args: List[str], expression: str, description: str = "", project_id: str | None = None) -> SelfCreate a function in the project.
Arguments:
name- The name of the function.args- The arguments of the function.expression- The expression of the function.description- The description of the function.project_id- The ID of the project.
Returns:
The created function.
get_all
Section titled “get_all”@classmethoddef get_all(cls, project_id: str | None = None) -> List[Self]Get all functions in a project.
get_by_name
Section titled “get_by_name”@classmethoddef get_by_name(cls, name: str, project_id: str | None = None) -> Self | NoneGet a function by its name. Returns None if no function matches the given name.
Arguments:
name- The name of the function.project_id- The ID of the project.
Returns:
The function that matches the given name.
InterpolatedFunction Objects
Section titled “InterpolatedFunction Objects”class InterpolatedFunction(SharedExpression)An interpolated function expression in the project. Interpolated functions are SharedExpressions with type INTERPOLATED_FUNCTION.
create
Section titled “create”@classmethoddef create(cls, name: str, args: List[Tuple[str, List[float]]], values: List[float], description: str = "", cubic_interpolation: bool | None = None, project_id: str | None = None) -> SelfCreate an interpolated function in the project.
Arguments:
name- The name of the interpolated function.args- The arguments of the interpolated function.values- The values of the interpolated function.description- The description of the interpolated function.cubic_interpolation- If True, values are interpolated using a natural cubic spline. If False or None, linear interpolation is used.project_id- The ID of the project.
Returns:
The created interpolated function.
get_all
Section titled “get_all”@classmethoddef get_all(cls, project_id: str | None = None) -> List[Self]Get all interpolated functions in a project.
get_by_name
Section titled “get_by_name”@classmethoddef get_by_name(cls, name: str, project_id: str | None = None) -> Self | NoneGet an interpolated function by its name. Returns None if no interpolated function matches the given name.
Arguments:
name- The name of the interpolated function.project_id- The ID of the project.
Returns:
The interpolated function that matches the given name.
allsolve.job_mixin
Section titled “allsolve.job_mixin”JobMixin Objects
Section titled “JobMixin Objects”class JobMixin()Mixin class that provides common job-related methods for classes that manage a Job instance.
Classes using this mixin should have a _job attribute of type Job | None.
Subclasses can override _get_job() to customize job retrieval logic.
def abort() -> NoneAbort the processing of the job.
get_status
Section titled “get_status”def get_status() -> str | NoneGet the status of the processing of the job.
Returns:
The status of the processing, or Job.NOT_STARTED if no job exists.
is_running
Section titled “is_running”def is_running(refresh_delay_s: float | None = None) -> boolCheck if the processing of the job is running.
Arguments:
refresh_delay_s- Optional delay in seconds between checking the status of the job.
Returns:
True if the processing is running, False otherwise.
refresh_status
Section titled “refresh_status”def refresh_status(delay_s: float = 1) -> str | NoneRefresh the status of the processing of the job.
Arguments:
delay_s- Optional delay in seconds between checking the status of the job.
Returns:
The status of the processing, or Job.NOT_STARTED if no job exists.
get_logs
Section titled “get_logs”def get_logs(limit: int = 100) -> List[str]Get the logs of the processing of the job.
Arguments:
limit- Optional maximum number of logs to return.
Returns:
A list of log messages, or an empty list if no job exists.
print_new_loglines
Section titled “print_new_loglines”def print_new_loglines(file: TextIO = sys.stdout, limit: int = 100) -> NonePrint the new log lines of the processing of the job.
Arguments:
file- Optional file to print the logs to.limit- Optional maximum number of logs to print.
allsolve.project
Section titled “allsolve.project”ProjectType Objects
Section titled “ProjectType Objects”class ProjectType(Enum)Enum for the type of project.
GeometryPipelineVersion Objects
Section titled “GeometryPipelineVersion Objects”class GeometryPipelineVersion(Enum)Enum for the version of the geometry pipeline. For new projects, use V2 (default). V1 is deprecated.
Project Objects
Section titled “Project Objects”class Project()A project in the AllSolve.
from_token
Section titled “from_token”@classmethoddef from_token(cls) -> SelfGet the project associated with the project API key.
Returns:
The project associated with the project API key.
Raises:
NotProjectAPIKeyError- If not authenticated with a project API key.
@classmethoddef get(cls, project_id: str) -> SelfGet a project using the project ID.
Arguments:
project_id- The ID of the project to get.
Returns:
The project with the given ID.
get_all
Section titled “get_all”@classmethoddef get_all(cls) -> List[Self]Get all projects.
Returns:
A list of projects that the authentication has access to.
get_all_by_name
Section titled “get_all_by_name”@classmethoddef get_all_by_name(cls, name: str) -> List[Self]Get all projects that match the given name.
Arguments:
name- The name of the project to search for.
Returns:
A list of projects that match the given name.
get_by_name
Section titled “get_by_name”@classmethoddef get_by_name(cls, name: str) -> Self | NoneGet project that matches the given name. Returns None if no project matches the given name. Raises ValueError if multiple projects match the given name.
Arguments:
name- The name of the project to search for.
Returns:
The project that matches the given name.
create
Section titled “create”@classmethoddef create(cls, name: str, description: str = "", organization_write_access: bool | None = None, labels: List[str] | None = None, type: ProjectType = ProjectType.NORMAL, geometry_pipeline_version: GeometryPipelineVersion = GeometryPipelineVersion.V2, dimension: int = 3, geometry_no_implicit_fragment: bool = False) -> SelfCreate a new project.
Arguments:
name- The name of the project.description- The description of the project.organization_write_access- Optional boolean whether the organization has write access to the project.labels- Optional list of labels for the project.type- OptionalProjectType. Default isProjectType.NORMAL. UseProjectType.SCRIPT_ONLYfor projects that do not have geometry.geometry_pipeline_version- Optional GeometryPipelineVersion. Default is V2.dimension- Optional dimension of the project. Default is 3.geometry_no_implicit_fragment- Optional boolean whether to disable the automatic final Fragment All operation. Default is False. By default, the final Fragment All operation splits intersecting geometric entities into non-intersecting, disjoint parts. Setting parameter to True prevents automatic splitting, preserving the original geometric entities as-is.
Returns:
The created project.
@property@prevent_deleteddef id() -> strGet the ID of the project.
@property@prevent_deleteddef name() -> strGet the name of the project.
@name.setter@prevent_deleteddef name(name: str) -> NoneSet the name of the project.
description
Section titled “description”@property@prevent_deleteddef description() -> strGet the description of the project.
description
Section titled “description”@description.setter@prevent_deleteddef description(description: str) -> NoneSet the description of the project.
readonly
Section titled “readonly”@property@prevent_deleteddef readonly() -> boolGet whether the project is read-only.
labels
Section titled “labels”@property@prevent_deleteddef labels() -> List[str]Get the labels of the project.
script_only
Section titled “script_only”@property@prevent_deleteddef script_only() -> boolGet whether the project is script-only.
geometry_pipeline_version
Section titled “geometry_pipeline_version”@property@prevent_deleteddef geometry_pipeline_version() -> GeometryPipelineVersionGet the geometry pipeline version of the project.
dimension
Section titled “dimension”@property@prevent_deleteddef dimension() -> intGet the dimension of the project.
geometry_no_implicit_fragment
Section titled “geometry_no_implicit_fragment”@property@prevent_deleteddef geometry_no_implicit_fragment() -> boolGet whether the project geometry has NO implicit Fragment all operation.
pml_num_layers
Section titled “pml_num_layers”@property@prevent_deleteddef pml_num_layers() -> int | NoneGet the number of Perfectly Matched Layers, or None if not set.
pml_num_layers
Section titled “pml_num_layers”@pml_num_layers.setter@prevent_deleteddef pml_num_layers(value: int | None) -> NoneSet the number of Perfectly Matched Layers. Use save() to commit.
pml_thickness
Section titled “pml_thickness”@property@prevent_deleteddef pml_thickness() -> float | int | NoneGet the thickness of the PML region, or None if not set.
pml_thickness
Section titled “pml_thickness”@pml_thickness.setter@prevent_deleteddef pml_thickness(value: float | int | None) -> NoneSet the thickness of the PML region. Use save() to commit.
geometry_builder
Section titled “geometry_builder”@prevent_deleteddef geometry_builder() -> GeometryBuilderGet the geometry builder for the project. Use with GeometryPipelineVersion.V2
get_geometry
Section titled “get_geometry”@prevent_deleted@deprecated("Use geometry pipeline version V2 for new projects")def get_geometry() -> List[Geometry]Get geometry elements in the project. Currently only one geometry element per project is supported. Use with deprecated geometry pipeline version V1.
Returns:
A list of geometry elements in the project.
import_step
Section titled “import_step”@prevent_deleteddef import_step(filepath: str, name: str | None = None) -> Geometry | GeometryBuilderImport the geometry file in the given path to the project.
Arguments:
filepath- path to a file in the local systemname- Optional name for the geometry element
Returns:
The GeometryBuilder if GeometryPipelineVersion.V2, or the created geometry for deprecated GeometryPipelineVersion.V1,
import_iges
Section titled “import_iges”@prevent_deleteddef import_iges(filepath: str, name: str | None = None) -> Geometry | GeometryBuilderImport the geometry file in the given path to the project.
Arguments:
filepath- path to a file in the local systemname- Optional name for the geometry element
Returns:
The GeometryBuilder if GeometryPipelineVersion.V2, or the created geometry for deprecated GeometryPipelineVersion.V1,
import_brep
Section titled “import_brep”@prevent_deleteddef import_brep(filepath: str, name: str | None = None) -> Geometry | GeometryBuilderImport the geometry file in the given path to the project.
Arguments:
filepath- path to a file in the local systemname- Optional name for the geometry element
Returns:
The GeometryBuilder if GeometryPipelineVersion.V2, or the created geometry for deprecated GeometryPipelineVersion.V1,
import_sat
Section titled “import_sat”@prevent_deleteddef import_sat(filepath: str, name: str | None = None) -> Geometry | GeometryBuilderImport the geometry file in the given path to the project.
Arguments:
filepath- path to a file in the local systemname- Optional name for the geometry element
Returns:
The GeometryBuilder if GeometryPipelineVersion.V2, or the created geometry for deprecated GeometryPipelineVersion.V1,
import_msh
Section titled “import_msh”@prevent_deleteddef import_msh(filepath: str) -> Geometry | GeometryBuilderImport the geometry file in the given path to the project.
Arguments:
filepath- path to a file in the local system
Returns:
The GeometryBuilder if GeometryPipelineVersion.V2, or the created geometry for deprecated GeometryPipelineVersion.V1,
import_nas
Section titled “import_nas”@prevent_deleteddef import_nas(filepath: str) -> Geometry | GeometryBuilderImport the geometry file in the given path to the project.
Arguments:
filepath- path to a file in the local system
Returns:
The GeometryBuilder if GeometryPipelineVersion.V2, or the created geometry for deprecated GeometryPipelineVersion.V1,
import_gds2
Section titled “import_gds2”@prevent_deleteddef import_gds2(filepath: str, config: GDS2ImportConfig | None = None, layers: (List[CadGdsLayer]) | None = None, name: str | None = None) -> Geometry | GeometryBuilderImport the geometry file in the given path to the project.
Arguments:
filepath- path to a file in the local systemconfig- Optional configuration for the GDS import. Use only for deprecated GeometryPipelineVersion.V1.layers- Optional layers for the GDS import. Use only for GeometryPipelineVersion.V2.name- Optional name for the geometry element
Returns:
The GeometryBuilder if GeometryPipelineVersion.V2, or the created geometry for deprecated GeometryPipelineVersion.V1,
add_shared_file
Section titled “add_shared_file”@prevent_deleteddef add_shared_file(filepath: str) -> rawapi.InputFileAdd the file in the given path to the project as shared file
Arguments:
filepath- path to a file in the local system. If used in a simulation, it is available with its basename.
Returns:
A handle to the created file.
Raises:
FileExistsError- If a file with the same name already exists and is fully uploaded.
add_shared_json_file
Section titled “add_shared_json_file”@prevent_deleteddef add_shared_json_file(name: str, content: dict) -> rawapi.InputFileAdd shared file to the project with the given dictionary serialized into JSON as content.
Arguments:
name- The name for the file during the simulationcontent- The content of the file
Returns:
A handle to the created file.
Raises:
FileExistsError- If a file with the same name already exists and is fully uploaded.
get_files
Section titled “get_files”@prevent_deleteddef get_files() -> List[rawapi.InputFile]Get all files in the project.
Returns:
A list of files in the project.
get_meshes
Section titled “get_meshes”@prevent_deleteddef get_meshes() -> List[Mesh]Get all meshes in the project.
Returns:
A list of meshes in the project.
create_mesh
Section titled “create_mesh”@prevent_deleteddef create_mesh(mesh_settings: MeshSettings | None = None) -> MeshCreate a new mesh in the project.
Arguments:
mesh_settings- The settings for the mesh.
Returns:
The created mesh.
get_physics
Section titled “get_physics”@prevent_deleteddef get_physics() -> List[Physic]Get all physics in the project.
add_physics
Section titled “add_physics”@prevent_deleteddef add_physics(physic: Physic) -> PhysicAdd a physics definition to the project.
Example::
solid_mechanics_physics = project.add_physics( allsolve.Physics.SolidMechanics( target=solid_mechanics_region ) ) solid_mechanics_physics.add_interactions( [ allsolve.Interaction.SolidMechanicsClamp( name=“Clamp”, target=clamp_surface_region, ), ] )
get_simulation
Section titled “get_simulation”@prevent_deleteddef get_simulation(simulation_id: str) -> SimulationGet a simulation using the simulation ID.
Arguments:
simulation_id- The ID of the simulation to get.
Returns:
The simulation with the given ID.
get_simulations
Section titled “get_simulations”@prevent_deleteddef get_simulations() -> List[Simulation]Get all simulations in the project.
Returns:
A list of simulations in the project.
create_simulation_static
Section titled “create_simulation_static”@prevent_deleteddef create_simulation_static( name: str, description: str, max_run_time_minutes: int, solver_mode: rawapi.DistributedSolverMode = rawapi. DistributedSolverMode.DIRECT, mesh_id: str | None = None, variable_overrides_id: str | None = None, physics: list[str] | None = None, solver_tolerance: str | None = None, nonlinear_solver_tolerance: str | None = None, nonlinear_solver_max_iterations: str | None = None, numerical_jacobian: bool | None = None) -> SimulationCreate a new steady-state (static) simulation in the project.
Arguments:
name- The name of the new simulation.description- The description of the new simulation.max_run_time_minutes- The maximum run time of the simulation.solver_mode- The solver mode of the simulation.mesh_id- The ID of the mesh to use in the simulation.variable_overrides_id- The optional ID of the VariableOverrides to use.physics- List of physics IDs to simulate.solver_tolerance- The solver tolerance expression (used when solver_mode is iterative).nonlinear_solver_tolerance- The nonlinear solver tolerance expression.nonlinear_solver_max_iterations- The nonlinear solver maximum iterations expression.numerical_jacobian- Whether numerical Jacobian is enabled.
Returns:
The created simulation.
create_simulation_harmonic
Section titled “create_simulation_harmonic”@prevent_deleteddef create_simulation_harmonic( name: str, description: str, max_run_time_minutes: int, solver_mode: rawapi.DistributedSolverMode = rawapi. DistributedSolverMode.DIRECT, fundamental_frequency: str | None = None, num_fft_samples: int | None = None, mesh_id: str | None = None, variable_overrides_id: str | None = None, physics: list[str] | None = None, solver_tolerance: str | None = None, nonlinear_solver_tolerance: str | None = None, nonlinear_solver_max_iterations: str | None = None, numerical_jacobian: bool | None = None) -> SimulationCreate a new harmonic simulation in the project.
Harmonic-specific parameters: fundamental_frequency: The fundamental frequency expression. num_fft_samples: The number of FFT samples (minimum 3).
Arguments:
name- The name of the new simulation.description- The description of the new simulation.max_run_time_minutes- The maximum run time of the simulation.solver_mode- The solver mode of the simulation.mesh_id- The ID of the mesh to use in the simulation.variable_overrides_id- The optional ID of the VariableOverrides to use.physics- List of physics IDs to simulate.solver_tolerance- The solver tolerance expression (used when solver_mode is iterative).nonlinear_solver_tolerance- The nonlinear solver tolerance expression.nonlinear_solver_max_iterations- The nonlinear solver maximum iterations expression.numerical_jacobian- Whether numerical Jacobian is enabled.
Returns:
The created simulation.
create_simulation_multiharmonic
Section titled “create_simulation_multiharmonic”@prevent_deleteddef create_simulation_multiharmonic( name: str, description: str, max_run_time_minutes: int, solver_mode: rawapi.DistributedSolverMode = rawapi. DistributedSolverMode.DIRECT, fundamental_frequency: str | None = None, harmonics: list[int] | None = None, num_fft_samples: int | None = None, mesh_id: str | None = None, variable_overrides_id: str | None = None, physics: list[str] | None = None, solver_tolerance: str | None = None, nonlinear_solver_tolerance: str | None = None, nonlinear_solver_max_iterations: str | None = None, numerical_jacobian: bool | None = None) -> SimulationCreate a new multiharmonic simulation in the project.
Multiharmonic-specific parameters: fundamental_frequency: The fundamental frequency expression. harmonics: The list of harmonics. num_fft_samples: The number of FFT samples (minimum 3).
Arguments:
name- The name of the new simulation.description- The description of the new simulation.max_run_time_minutes- The maximum run time of the simulation.solver_mode- The solver mode of the simulation.mesh_id- The ID of the mesh to use in the simulation.variable_overrides_id- The optional ID of the VariableOverrides to use.physics- List of physics IDs to simulate.solver_tolerance- The solver tolerance expression (used when solver_mode is iterative).nonlinear_solver_tolerance- The nonlinear solver tolerance expression.nonlinear_solver_max_iterations- The nonlinear solver maximum iterations expression.numerical_jacobian- Whether numerical Jacobian is enabled.
Returns:
The created simulation.
create_simulation_transient
Section titled “create_simulation_transient”@prevent_deleteddef create_simulation_transient( name: str, description: str, max_run_time_minutes: int, solver_mode: rawapi.DistributedSolverMode = rawapi. DistributedSolverMode.DIRECT, transient_start_time: str | None = None, transient_end_time: str | None = None, transient_timestep_size: str | None = None, timestep_algorithm: rawapi.TimestepAlgorithm | None = None, target_frequency: str | None = None, mesh_id: str | None = None, variable_overrides_id: str | None = None, physics: list[str] | None = None, solver_tolerance: str | None = None, nonlinear_solver_tolerance: str | None = None, nonlinear_solver_max_iterations: str | None = None, numerical_jacobian: bool | None = None) -> SimulationCreate a new transient simulation in the project.
Transient-specific parameters: transient_start_time: The transient start time expression. transient_end_time: The transient end time expression. transient_timestep_size: The transient timestep size expression. timestep_algorithm: The timestep algorithm. target_frequency: The target frequency expression.
Arguments:
name- The name of the new simulation.description- The description of the new simulation.max_run_time_minutes- The maximum run time of the simulation.solver_mode- The solver mode of the simulation.mesh_id- The ID of the mesh to use in the simulation.variable_overrides_id- The optional ID of the VariableOverrides to use.physics- List of physics IDs to simulate.solver_tolerance- The solver tolerance expression (used when solver_mode is iterative).nonlinear_solver_tolerance- The nonlinear solver tolerance expression.nonlinear_solver_max_iterations- The nonlinear solver maximum iterations expression.numerical_jacobian- Whether numerical Jacobian is enabled.
Returns:
The created simulation.
create_simulation_eigenmode
Section titled “create_simulation_eigenmode”@prevent_deleteddef create_simulation_eigenmode( name: str, description: str, max_run_time_minutes: int, solver_mode: rawapi.DistributedSolverMode = rawapi. DistributedSolverMode.DIRECT, num_requested_eigenmodes: str | None = None, target_eigenfrequency: str | None = None, eigenmode_solver_tolerance: str | None = None, eigenmode_solver_max_iterations: str | None = None, mesh_id: str | None = None, variable_overrides_id: str | None = None, physics: list[str] | None = None, solver_tolerance: str | None = None) -> SimulationCreate a new eigenmode simulation in the project.
Eigenmode-specific parameters: num_requested_eigenmodes: The number of requested eigenmodes expression. target_eigenfrequency: The target eigenfrequency expression. eigenmode_solver_tolerance: The eigenmode solver tolerance expression. eigenmode_solver_max_iterations: The eigenmode solver maximum iterations expression.
Arguments:
name- The name of the new simulation.description- The description of the new simulation.max_run_time_minutes- The maximum run time of the simulation.solver_mode- The solver mode of the simulation.mesh_id- The ID of the mesh to use in the simulation.variable_overrides_id- The optional ID of the VariableOverrides to use.physics- List of physics IDs to simulate.solver_tolerance- The solver tolerance expression (used when solver_mode is iterative).
Returns:
The created simulation.
copy_simulation
Section titled “copy_simulation”@prevent_deleteddef copy_simulation(simulation_id: str) -> SimulationCreate a copy of a simulation in the project.
Arguments:
simulation_id- The ID of the simulation to copy.
Returns:
The copied simulation.
get_regions
Section titled “get_regions”@prevent_deleteddef get_regions() -> List[Region]Get all regions in the project.
Returns:
A list of regions in the project.
create_region_basic
Section titled “create_region_basic”@prevent_deleteddef create_region_basic(name: str, entity_type: rawapi.EntityType, entity_tags: List[int]) -> RegionCreate a basic region in the project.
Arguments:
name- The name of the region.entity_type- The type of the entity.entity_tags- The tags of the entity.
Returns:
The created region.
create_region_computed
Section titled “create_region_computed”@prevent_deleteddef create_region_computed(name: str, entity_type: rawapi.EntityType, operation: RegionOperation, source_region_ids: List[str]) -> ComputedRegionCreate a computed region in the project.
Arguments:
name- The name of the region.entity_type- The type of the entity.operation- The operation to perform on the source regions.source_region_ids- The IDs of the source regions.
Returns:
The created computed region.
create_region_rule
Section titled “create_region_rule”@prevent_deleteddef create_region_rule( name: str, entity_type: rawapi.EntityType, attribute_path: rawapi.AttributePath | list[tuple[str, str]] | None = None, bounding_box: rawapi.ExpressionBoundingBox | None = None, min_size: rawapi.ExpressionVector | None = None, max_size: rawapi.ExpressionVector | None = None) -> RegionCreate a region rule in the project.
Arguments:
name- The name of the region.entity_type- The type of the entity.attribute_path- The attribute path to use for the region. Can be a list of tuples (key, value).Example- [(“LayerName”, “Polysilicon”)]bounding_box- The bounding box to use for the region.min_size- The minimum size to use for the region.max_size- The maximum size to use for the region.
Returns:
The created region rule.
create_variable
Section titled “create_variable”@prevent_deleteddef create_variable(name: str, expression: str | float | int, description: str = "") -> VariableCreate a variable in the project.
Arguments:
name- The name of the variable.expression- The expression of the variable.description- The description of the variable.
Returns:
The created variable.
create_function
Section titled “create_function”@prevent_deleteddef create_function(name: str, args: List[str], expression: str, description: str = "") -> FunctionCreate a function in the project.
Arguments:
name- The name of the function.args- The arguments of the function.expression- The expression of the function.description- The description of the function.
Returns:
The created function.
create_interpolated_function
Section titled “create_interpolated_function”@prevent_deleteddef create_interpolated_function( name: str, args: List[Tuple[str, List[float]]], values: List[float], description: str = "", cubic_interpolation: bool | None = None) -> InterpolatedFunctionCreate an interpolated function in the project.
Arguments:
name- The name of the interpolated function.args- The arguments of the interpolated function.values- The values of the interpolated function.description- The description of the interpolated function.cubic_interpolation- If True, values are interpolated using a natural cubic spline. If False or None, linear interpolation is used.
Returns:
The created interpolated function.
get_variables
Section titled “get_variables”@prevent_deleteddef get_variables() -> List[Variable]Get all variables in the project.
get_functions
Section titled “get_functions”@prevent_deleteddef get_functions() -> List[Function]Get all functions in the project.
get_interpolated_functions
Section titled “get_interpolated_functions”@prevent_deleteddef get_interpolated_functions() -> List[InterpolatedFunction]Get all interpolated functions in the project.
create_variable_overrides
Section titled “create_variable_overrides”@prevent_deleteddef create_variable_overrides( name: str, overrides: List[Tuple[Variable | str, str | float | int | List[str | float | int]]], sweep_type: rawapi.SweepType | None = None) -> VariableOverridesCreate a VariableOverrides in the project. It can be used to override a value of a single or multiple variables, or to create a sweep over variables.
Arguments:
name- The name of the set of variable overrides.overrides- A list of variable overrides. The first element of the tuple is the variable to override. The variable can be a Variable object or a string with the name of the variable. The second element is the new value for the variable. The value can be a string, float, int, or list of strings, floats, or ints.sweep_type- The type of the sweep. Only valid for sweep overrides. If not provided, it will be set to SPECIFIC_VALUES.
Returns:
The created variable overrides.
get_variable_overrides
Section titled “get_variable_overrides”@prevent_deleteddef get_variable_overrides() -> List[VariableOverrides]Get all variable overrides in the project.
get_materials
Section titled “get_materials”@prevent_deleteddef get_materials() -> List[Material]Get all materials in the project.
Returns:
A list of materials in the project.
create_material
Section titled “create_material”@prevent_deleteddef create_material( name: str, description: str = "", color: str = "#535050FF", abbreviation: str | None = None, target_region: Region | None = None, coefficient_of_thermal_expansion: str | float | None = None, coefficient_of_thermal_expansion_anisotropic: List[float | str] | None = None, density: str | float | None = None, dynamic_viscosity: str | float | None = None, dynamic_viscosity_anisotropic: List[List[float | str]] | None = None, elasticity_matrix_youngs_modulus_poissons_ratio: ( MaterialProperty.ElasticityMatrixYoungsModulusPoissonsRatio | None) = None, elasticity_matrix_pressure_shear_velocity: ( MaterialProperty.ElasticityMatrixPressureShearVelocity | None) = None, elasticity_matrix: MaterialProperty.ElasticityMatrix | None = None, electric_conductivity: str | float | None = None, electric_conductivity_anisotropic: List[List[float | str]] | None = None, electric_permittivity: str | float | None = None, electric_permittivity_anisotropic: List[List[float | str]] | None = None, heat_capacity: str | float | None = None, magnetic_permeability: str | float | None = None, magnetic_permeability_anisotropic: List[List[float | str]] | None = None, mass_damping_coefficient: str | float | None = None, piezoelectric_coupling: List[List[float | str]] | None = None, prony_series: MaterialProperty.PronySeries | None = None, speed_of_sound: str | float | None = None, stiffness_damping_coefficient: str | float | None = None, thermal_conductivity: str | float | None = None, thermal_conductivity_anisotropic: List[List[float | str]] | None = None, orientation: str | Tuple[float | int, float | int, float | int] | None = None, enabled: str | None = None) -> MaterialCreate a material in the project.
Arguments:
name- The name of the material.description- Optional description of the material.color- The color of the material. Format: “#RRGGBB”abbreviation- Optional abbreviation of the material.target_region- The target Region of the material.coefficient_of_thermal_expansion- Optional coefficient of thermal expansion. Can be a float or string expression.coefficient_of_thermal_expansion_anisotropic- Optional anisotropic coefficient of thermal expansion. A list of 3 floats or strings.density- Optional density of the material. Can be a float or string expression.dynamic_viscosity- Optional dynamic viscosity. Can be a float or string expression. Mutually exclusive with dynamic_viscosity_anisotropic.dynamic_viscosity_anisotropic- Optional anisotropic dynamic viscosity. A 3x3 matrix as a list of lists of floats or strings. Mutually exclusive with dynamic_viscosity.elasticity_matrix_youngs_modulus_poissons_ratio- Optional elasticity matrix defined by Young’s modulus and Poisson’s ratio. Mutually exclusive with elasticity_matrix and elasticity_matrix_pressure_shear_velocity.elasticity_matrix_pressure_shear_velocity- Optional elasticity matrix defined by pressure and shear wave velocities. Mutually exclusive with elasticity_matrix and elasticity_matrix_youngs_modulus_poissons_ratio.elasticity_matrix- Optional elasticity matrix. A MaterialProperty.ElasticityMatrix object. Mutually exclusive with elasticity_matrix_youngs_modulus_poissons_ratio and elasticity_matrix_pressure_shear_velocity.electric_conductivity- Optional electric conductivity. Can be a float or string expression. Mutually exclusive with electric_conductivity_anisotropic.electric_conductivity_anisotropic- Optional anisotropic electric conductivity. A 3x3 matrix as a list of lists of floats or strings. Mutually exclusive with electric_conductivity.electric_permittivity- Optional electric permittivity. Can be a float or string expression. Mutually exclusive with electric_permittivity_anisotropic.electric_permittivity_anisotropic- Optional anisotropic electric permittivity. A 3x3 matrix as a list of lists of floats or strings. Mutually exclusive with electric_permittivity.heat_capacity- Optional heat capacity. Can be a float or string expression.magnetic_permeability- Optional magnetic permeability. Can be a float or string expression. Mutually exclusive with magnetic_permeability_anisotropic.magnetic_permeability_anisotropic- Optional anisotropic magnetic permeability. A 3x3 matrix as a list of lists of floats or strings. Mutually exclusive with magnetic_permeability.mass_damping_coefficient- Optional mass damping coefficient. Can be a float or string expression.piezoelectric_coupling- Optional piezoelectric coupling matrix. A 6x3 matrix as a list of lists of floats or strings.prony_series- Optional Prony series for viscoelastic material properties. A MaterialProperty.PronySeries object.speed_of_sound- Optional speed of sound. Can be a float or string expression.stiffness_damping_coefficient- Optional stiffness damping coefficient. Can be a float or string expression.thermal_conductivity- Optional thermal conductivity. Can be a float or string expression. Mutually exclusive with thermal_conductivity_anisotropic.thermal_conductivity_anisotropic- Optional anisotropic thermal conductivity. A 3x3 matrix as a list of lists of floats or strings. Mutually exclusive with thermal_conductivity.orientation- Optional orientation of the material. Can be a tuple of 3 floats or a string like “[90; 0; 0]”enabled- Optional enabled expression of the material. Can be a string expression like “eq(my_variable, 1)”project_id- The ID of the project.
Returns:
The created material.
create_material_from_library
Section titled “create_material_from_library”@prevent_deleteddef create_material_from_library(name: str, target_region: Region | None = None, enabled: str | None = None) -> MaterialCreate a material from the library by name.
Arguments:
name- The name of the library material to copy.target_region- The target Region of the material.enabled- Optional enabled expression of the material. Can be a string expression like “eq(my_variable, 1)”
Returns:
The created Material.
Raises:
ValueError- If no library material with the given name is found.
@prevent_deleteddef save() -> NoneExplictly save the changes to the cloud made by
setting properties like name, description, pml_num_layers and pml_thickness.
delete
Section titled “delete”@prevent_deleteddef delete() -> NoneDelete the project.
@prevent_deleteddef copy(with_results: bool = False, name: str | None = None, wait_for_completion: bool = True) -> SelfCopies the project and returns the copied project.
Arguments:
with_results- If True then files of the original project are copied to the new project.name- The name of the new project.wait_for_completion- If True, the copied project is returned after the copy job is completed. If False, get_copy_job() should be used to check the status of the copy job.
Returns:
The copied project.
get_copy_job
Section titled “get_copy_job”@prevent_deleteddef get_copy_job() -> Job | NoneGet the copy job for the project. The copy job exists only if the project was copied from another project with results.
Returns:
The copy job for the project.
export
Section titled “export”@prevent_deleteddef export(include_meshes: bool = True) -> dictExport project data as a dictionary.
The returned dict is compatible with import_project() and can be:
- Modified programmatically before saving
- Serialized to YAML or JSON
- Used directly with import_project(data_dict, project_to_modify=…)
Arguments:
include_meshes- Whether to include mesh definitions (default True).Note- Exported meshes are definitions only; mesh data is not included.
Returns:
Dictionary containing the project data.
Notes:
CAD file paths (STEP, IGES, etc.) and shared file paths are exported as placeholders in the format “placeholder:original_path”. When re-importing, you must provide the actual files at the specified paths.
Future versions may support optional file downloading.
Example:
project = Project.get(“my-project-id”) data = project.export() data[“name”] = “Modified Project”
Re-import to new project
Section titled “Re-import to new project”from allsolve import import_project new_project = import_project(data)
export_yaml
Section titled “export_yaml”@prevent_deleteddef export_yaml(output_path: str, include_meshes: bool = True) -> NoneExport project to a YAML file.
Arguments:
output_path- Path to write the YAML file.include_meshes- Whether to include mesh definitions (default True).
Notes:
CAD file paths are exported as placeholders. See export() docstring for details.
Example:
project = Project.get(“my-project-id”) project.export_yaml(”./my_project.yaml”)
export_json
Section titled “export_json”@prevent_deleteddef export_json(output_path: str, include_meshes: bool = True, indent: int = 2) -> NoneExport project to a JSON file.
Arguments:
output_path- Path to write the JSON file.include_meshes- Whether to include mesh definitions (default True).indent- JSON indentation level (default 2).
Notes:
CAD file paths are exported as placeholders. See export() docstring for details.
Example:
project = Project.get(“my-project-id”) project.export_json(”./my_project.json”)
allsolve.override
Section titled “allsolve.override”VariableOverrides Objects
Section titled “VariableOverrides Objects”class VariableOverrides()VariableOverrides is for managing variable overrides. It can be used to override a value of a single or multiple variables in a project, or to create a sweep over variables.
create
Section titled “create”@classmethoddef create(cls, name: str, overrides: List[Tuple[Variable | str, str | float | int | List[str | float | int]]], override_type: rawapi.SharedExpressionOverrideType = rawapi. SharedExpressionOverrideType.SWEEP, sweep_type: rawapi.SweepType | None = None, project_id: str | None = None) -> SelfCreate a new VariableOverrides.
Arguments:
name- The name of the set of variable overrides.overrides- A list of overrides of the VariableOverrides. The first element of the tuple is the variable to override. The variable can be a Variable object or a string with the name of the variable. The second element is the new value for the variable. The value can be a string, float, int, or list of strings, floats, or ints.override_type- The type of the VariableOverrides. Normal or Sweep.project_id- The ID of the project.
Returns:
The created VariableOverrides.
@classmethoddef get(cls, variable_overrides_id: str, project_id: str | None = None) -> SelfGet a VariableOverrides by its ID.
get_all
Section titled “get_all”@classmethoddef get_all(cls, project_id: str | None = None) -> List[Self]Get all VariableOverrides in a project.
@property@prevent_deleteddef id() -> strGet the ID of the VariableOverrides.
@property@prevent_deleteddef name() -> strGet the name of the VariableOverrides.
@name.setter@prevent_deleteddef name(name: str) -> NoneSet the name of the VariableOverrides.
@property@prevent_deleteddef type() -> rawapi.SharedExpressionOverrideTypeGet the type of the VariableOverrides.
sweep_type
Section titled “sweep_type”@property@prevent_deleteddef sweep_type() -> rawapi.SweepType | NoneGet the sweep type of the VariableOverrides. Only valid for sweep overrides.
sweep_type
Section titled “sweep_type”@sweep_type.setter@prevent_deleteddef sweep_type(sweep_type: rawapi.SweepType | None) -> NoneSet the sweep type of the VariableOverrides. Only valid for sweep overrides.
overrides
Section titled “overrides”@property@prevent_deleteddef overrides() -> List[Tuple[Variable, str]]Get the overrides of the VariableOverrides. The list is a copy of the overrides in the VariableOverrides. It the list is modified, use overrides setter to save the change. The list is a list of tuples, where the first element is the variable and the second is the new value for the variable.
overrides
Section titled “overrides”@overrides.setter@prevent_deleteddef overrides( overrides: List[Tuple[Variable | str, str | float | int | List[str | float | int]]]) -> NoneSet the overrides of the VariableOverrides.
delete
Section titled “delete”@prevent_deleteddef delete() -> NoneDelete the VariableOverrides.