589 Topics 1.8k Posts


  • Installing Sim4Life and configuring licenses

    29 Topics
    104 Posts

    These error messages can be safely ignored, but I will pass them along to see if such overzealous and misleading error messages can be suppressed in the future.

  • Working with CAD models

    56 Topics
    187 Posts

    Hi all, I noticed that even with the same parameters my unstructured mesh seems to be changing slightly each time it's generated. Could you shed more light on whether there is randomness in the generation of faceted and octree meshes, and if there is, how to fix the random seed to ensure reproducibility, please?

  • Working with models from the Virtual Population

    46 Topics
    209 Posts

    Thank you for the detailed answer!

  • FDTD, Low-Frequency, Neuron, Mode-Matching, Flow, Acoustics, etc...

    219 Topics
    655 Posts

    It looks like this is a bug. Until it is fixed, you can still add line sensors to LF simulations using the API.

    Here is a quick example that adds an entity named 'Lines 1' as a voltage sensor:

    # -*- coding: utf-8 -*- import numpy import s4l_v1.document as document import s4l_v1.materials.database as database import s4l_v1.model as model import s4l_v1.simulation.emlf as emlf import s4l_v1.units as units from s4l_v1 import ReleaseVersion from s4l_v1 import Unit # Define the version to use for default values ReleaseVersion.set_active(ReleaseVersion.version8_0) # Creating the simulation simulation = emlf.ElectroQsOhmicSimulation() # Mapping the components and entities component__plane_x = simulation.AllComponents["Plane X+"] component__plane_x_1 = simulation.AllComponents["Plane X-"] component__background = simulation.AllComponents["Background"] component__plane_y = simulation.AllComponents["Plane Y+"] component__plane_y_1 = simulation.AllComponents["Plane Y-"] component__plane_z = simulation.AllComponents["Plane Z+"] component__plane_z_1 = simulation.AllComponents["Plane Z-"] component__overall_field = simulation.AllComponents["Overall Field"] entity__line = model.AllEntities()["Lines 1"] # Adding a new VoltageSensorSettings voltage_sensor_settings = emlf.VoltageSensorSettings() components = [entity__line] simulation.Add(voltage_sensor_settings, components) # Editing AutomaticGridSettings "Automatic automatic_grid_settings = [x for x in simulation.AllSettings if isinstance(x, emlf.AutomaticGridSettings) and x.Name == "Automatic"][0] components = [entity__line] simulation.Add(automatic_grid_settings, components) # Editing AutomaticVoxelerSettings "Automatic Voxeler Settings automatic_voxeler_settings = [x for x in simulation.AllSettings if isinstance(x, emlf.AutomaticVoxelerSettings) and x.Name == "Automatic Voxeler Settings"][0] components = [entity__line] simulation.Add(automatic_voxeler_settings, components) # Update the materials with the new frequency parameters simulation.UpdateAllMaterials() # Update the grid with the new parameters simulation.UpdateGrid() # Add the simulation to the UI document.AllSimulations.Add( simulation )
  • Postprocessing results

    96 Topics
    268 Posts

    Dear Arjama,

    Thanks a lot for your reply and for your very detailed example. The problem I was referring to is in the line where you add TIMAM to the mask.
    If I run:
    inputs = [TIMAM]
    field_masking_filter = analysis.core.FieldMaskingFilter(inputs=inputs)

    where TIMAM = modulation_envelope(e_field_1, e_field_2, dir_vector=None)

    I get the error:
    field_masking_filter = analysis.core.FieldMaskingFilter(inputs=[TImax])
    File "C:\Program Files\Sim4Life_8.0.0.15165\Python\lib\site-packages\s4l_v1_api\", line 231, in init
    File "C:\Program Files\Sim4Life_8.0.0.15165\Python\lib\site-packages\s4l_v1_api\", line 647, in Connect
    raise Exception("Can't connect ports")
    Exception: Can't connect ports

    So I think my problem is the creation of TIMAM. I Imagine it is not the TI envelope, but rather the TI Envelope inside some data structure that can be connected to the masking filter?

    Thanks again!

  • Scripting interface for Sim4Life

    114 Topics
    318 Posts

    You could also delete all of the model entities by filtering by type. Visible geometry objects have type 'body', so you could do:

    import s4l_v1.model as model entities_to_delete = [e for e in model.AllEntities() if e.Type == 'body'] for e in entities_to_delete: e.Delete()
  • Running Sim4Life over a network

    3 Topics
    5 Posts

    I eventually configured Sim4Life on a Cloup GPU workstation ( The workstation has an Intel Xeon E5-2630 v3 processor, 16 virtual cores, 90 GB of RAM, and two NVIDIA Ampere A6000 GPUs, each with 48 GB of GPU memory. For Exablate Neuro transducers (220 and 670 kHz) simulations, the workstation improved simulation speed from about 200 Mcell/s with an 8-core OpenMP configuration, to about 12000 Mcells/s with two GPUs.

    The workstation allows simulations (1449x1149x816 grid, 200 periods, 670 kHz, 0.22 mm max step for 10 points per wavelength) in about 40 minutes with Fourier-domain sensor recordings and about 4 hours with Time-domain sensor recordings. Time-domain simulations seem only compatible with a single GPU, while Fourier-domain sensor simulations can use both GPUs. Also, the Fourier domain field sensor recordings create simulations that look unstable (or less accurate) compared to the time-domain field sensor recordings, with all other factors equal. Only the time-domain simulations have readily matched previous studies, but the simulation time is still too long.

    Can the time-domain sensor acoustic simulation be run on multiple GPUs? Also, most of the time for Fourier-domain simulations is spent "allocating memory for the voxel array." Is there a way to configure the GPU to preallocate memory or another way to reduce the amount of time to distribute the array memory?
  • Editing the excitation signal

    0 Votes
    2 Posts

    I think your signal was fine, but your settings for the Field Sensor need to be changed.

  • Invalid Bounding Box Error

    0 Votes
    2 Posts

    2kHz will probably not be feasible in most propagating media, because the wavelength will simply be too large compared to the grid resolution your geometry requires (leading to unreasonably large time steps).
    You might want to check for e.g. what your grid look like, especially the padding at the boundaries of your computational domain.

  • This topic is deleted!

    0 Votes
    1 Posts
    No one has replied
  • CEM43 / Arrhenius Thermal Damage

    0 Votes
    1 Posts
    No one has replied
  • how to model a bent wire with a fixed length?

    1 Votes
    10 Posts

    Thanks for the code.

    Actually I need to model some wires with the fixed length, with one part in the brain in different spots and the remaining out of the brain, It takes a long time to model each one and I'm looking for a way to make them in a shorter time.


  • grid resolution of wire and insulation

    0 Votes
    3 Posts

    Thanks for your reply.