Skip to main content

DG & GA solver

You may pass advanced solver settings to the simulation settings object. Currently, we only support this approach for the GA solver.

GaSolverSettings

PropertyTypeDescriptionExample value
number_of_raysintOptional. Number of rays to use in the raytracing part of the simulation. Defaults to 5000.
ism_orderintOptional. Image source method order to use. Defaults to 2.
air_absorptionboolOptional. Toggles the inclusion of air absorption in the solver. Defaults to true.
ism_ray_countintOptional. How many rays are used in the image source pre-visibility check, accepted range is between 1,000 and 5,000,000. Defaults to 500,000.
write_out_ism_raypathsboolOptional. Save the ray paths and the pressure-per-reflection from the ISM calculation. Note: this may cause the result set to become very large. Defaults to false.

Example

The following example demonstrates how to set custom GaSolverSettings, pass them to the Simulation Settings object, and include them in the simulation definition.

# define the GA settings
ga_settings = treble.GaSolverSettings(ism_order=20, air_absorption=True, number_of_rays=750000,ism_ray_count=100000)
# add them to the simulation settings
sim_settings = treble.SimulationSettings(ga_settings=ga_settings, ambisonics_order=16)
#include the simulation settings in the simulation definition
sim_def = treble.SimulationDefinition(
name=f"hybrid_{model.name}",
simulation_type=treble.SimulationType.hybrid,
model=model,
crossover_frequency=4000,
receiver_list=sim_receivers,
source_list=sim_sources,
material_assignment=[material_assignments[model.name][layer] for layer in model.layer_names],
ir_length=0.5,
simulation_settings=sim_settings,
gpu_allocation_strategy=treble.GpuAllocationStrategy.utilization_optimized
)