Sim4Life

573 Topics 1.8k Posts

Subcategories


  • Installing Sim4Life and configuring licenses

    28 Topics
    99 Posts

    Hello
    I installed Sim4Life on a server with 1TB hard drive, 256 GB of RAM and an Nvidia Tesla T4 card. On this server there are other programs such as Matlab and MySQL.

    Now the question is about the following error that I get related to the "counters" when opening and loading the model of the virtual family of "Duke" as I understand it is because it is not taking all the performance resources to execute when the model is loaded .

    I would like to know if anyone knows how to fix this problem or if these "counters" should be enabled, where could this be done?

  • Working with CAD models

    53 Topics
    182 Posts

    The first method might not be working if your spline doesn't have a parametrization. If you click on the spline in the Model tree and don't see a list of points in the Controller window, then the information is no longer available and you'll have to stick to the second method.

  • Working with models from the Virtual Population

    45 Topics
    206 Posts

    Hi Bryn,

    I would like to ask a question regarding posing. My aim is to detect the variation in bone position from the skin in different poses (hypothesis being: as the soft tissues deform, the bone wont always be at the same position wrt the skin). I currently have 8 antennas placed around the skin which are supposed to mimic wearable antennas and I would like to move these antennas along with the pose.

    But if I link these antennas to the bone using "link-parent tool", the bone is always at the same location wrt to the bone irrespective of the pose. But I cannot link the antennas wrt to the skin as the antennas dont move with the pose.

    How can I do this? I would like the antennas which are placed around the skin to similar to the skin rather than the bone? Based on the first video in this chain, triangular meshes can be posed similar to the body. If I convert the antennas to meshes and then pose it, will I be getting the same issue i.e the bone is always at the same location wrt to the antennas?

    Thanks

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

    216 Topics
    636 Posts

    For others having this issue, when using the MQS solver, the E-field is calculated only in the lossy domain, whereas the H-field is calculated everywhere. So the E-field and its derived values will be NaN in regions with no conductivity.

  • Postprocessing results

    91 Topics
    253 Posts

    If you want to visualize the RMS value for a field, you will need to perform scaling manually.

    Select the desired field in the sensor outputs, then go to Field Data Tools > Field Scaling.

    Scale the field by 1/sqrt(2) by entering 0.7071 as the Scale Factor.

    Then you can visualize the slice as you normally would.

  • Scripting interface for Sim4Life

    113 Topics
    314 Posts

    short answer: you can run most of the Python API without opening the Sim4Life user interface.

    you have different options

    you can call Sim4Life.exe --run your_script.py you can write scripts and run them using the python.exe in the Sim4Life installation you can create a virtual environment with the Sim4Life packages, e.g. "C:\Program Files\Sim4Life_6.2.2.6592\Python\python.exe" -m venv .venv --system-site-packages and then use the python from this venv to run your script

    The first option opens Sim4Life, runs the script, and closes Sim4Life again. It probably is the easiest option to work robustly.

    The latter two options run without the UI and by default without an application. In most cases, you will need an application though (e.g. the Application initializes the active model, which is needed for modeling). For Python scripting without the UI you can create a console application. We do this e.g., to run Python tests without opening the UI (which is slower). To create a console application you can usually call:

    import XCore XCore.GetOrCreateConsoleApp() # now you can do some stuff import s4l_v1 as s4l sphere = s4l.model.CreateSolidSphere(s4l.model.Vec3(0.0), 1.0)
  • Running Sim4Life over a network

    3 Topics
    5 Posts

    I eventually configured Sim4Life on a Cloup GPU workstation (paperspace.com). 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?
  • Grid Convergence

    Unsolved
    2
    0 Votes
    2 Posts
    87 Views

    To perform such a study, define your region or quantity of interest, then parametrize it. After a quantity has been parametrized, you can run multiple simulations using the built in Sweeper feature or using the Sim4Life Python API.

    There is an example in the Sim4Life manual titled 'Parametrized Patch Antenna' that shows how to use the Sweeper feature.

    If using the Python API, the easiest way would be to create a baseline simulation by hand, then right-click on the simulation name and select To Python. Then you would find the quantity of interest in the auto-generated script and assign it to a variable instead of the hardcoded value. Using a simple loop in Python, you can create multiple simulation that have identical setup except for parameters of interest.

    In your example, multiple simulations would be run with identical setup except for the grid resolution within a region of interest (e.g., a wire block surrounding a region of interest is placed in a manual grid settings folder, then Maximum Step is changed from 0.3 to 1.0 mm).

    Then in Analysis you extract a quantity of interest and compare how this value changes as a function of grid resolution.

    If the change in the value is small as you increase resolution, you can proceed in future simulations with a coarser resolution to save on run time. The exact convergence of the value needed depends on your application.

  • This topic is deleted!

    1
    0 Votes
    1 Posts
    2 Views
    No one has replied
  • My S4L file isn't opening after it crashed

    3
    0 Votes
    3 Posts
    137 Views

    @bryn Thank you Bryn.
    Managed to find a version that wasn't corrupted!
    Hope you have a nice day 🙂

  • 3D Surface model to Voxel and export

    2
    0 Votes
    2 Posts
    178 Views

    Are you using Sim4Life lite (web version)? I recorded my screen while I voxeled Duke V2.0 and exported the voxels.
    There seems to be a glitch in the Reload button when I try to see the data that was saved in the Study: as a workaround the Reload button in the DATA tab works. I voxeled at 15mm, so the skin is not completely closed, but if you choose something like 5-10mm it should be enough to resolve thin layers (like the skin):

    BTW. if you are using a desktop version of Sim4Life, the workflow is similar, except that the software uses native Windows file dialogs to save/load files.

    Youtube Video

  • This topic is deleted!

    1
    0 Votes
    1 Posts
    29 Views
    No one has replied
  • This topic is deleted!

    1
    0 Votes
    1 Posts
    10 Views
    No one has replied
  • 0 Votes
    4 Posts
    426 Views

    Assuming 'sim' is the acoustic simulation you're interested in and that 'elements' is a list of the elements (gotten from entities = model.AllEntities()) and that 'amp' and 'phase' are numpy arrays with the amplitude, phase values you're interested in assigning:

    # Print current simulation name print(sim.Name) # Remove all sources before adding them to_del = [] for s in sim.AllSettings: if isinstance(s,acoustic.SourceSettings): to_del.append(s) for d in to_del: sim.Remove(d) # Add sources with correct element and parameters for source_idx in np.arange(len(elements)): source_settings = acoustic.SourceSettings() source_settings.Amplitude = amp[source_idx] source_settings.Phase = phases[source_idx] sim.Add(source_settings, rings[source_idx]) print(rings[source_idx].Name, amp[source_idx], phases[source_idx])

    Sorry I'm not providing a full example. Easiest way to do that would be to manually create the whole simulation without the sources (just make all sources as materials), then right click on simulation and select 'To Python...' and then add the lines above to your code

    You could do something like this to get the elements as a list:

    src_ents = [] entities = model.AllEntities() for e in entities: if 'Element' in e.Name: src_ents.append(e)

    Careful, I have no idea how the elements will be sorted in that case but you could use a fixed size numerical suffix and then sort them.

  • File .Smash error

    2
    0 Votes
    2 Posts
    271 Views

    Hallo,
    There should be, in the same folder where the smash project is, a file named as the smash file, but starting with a ".", like ".Name_of_the_File.smash.xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx".
    Try to drag that file directly into Sim4Life and save it with a different name. From there you should be able to go on with the models/simulations/analysis settings already saved.

  • Cannot read document verion

    3
    0 Votes
    3 Posts
    264 Views

    I have two versions installed (6.2.2 and 7.00) and I tried opening the file with both. I have now deleted the smash file that wasn't working and started over, but if it happens again, I will try the import option- thanks!

  • Bone identification using RF signals

    1
    0 Votes
    1 Posts
    179 Views
    No one has replied
  • 0 Votes
    3 Posts
    356 Views

    If you don't have a full version, i think (untested) you can still recover the model by importing the smash file in the modeling tab.

  • 'Point Sensor Tool' is not available

    7
    0 Votes
    7 Posts
    468 Views

    Sorry, don't have S4L with neuron available at the moment, but I looked at the tutorial and it seems to have changed. When you create the sensor settings can you try to drag and drop the axon to the sensor setting and then chose the section name? (That was the old way of doing it)

    Still, you should be able to run the simulation without a point sensor.. Sorry can't help more

  • 0 Votes
    5 Posts
    372 Views

    I am using Sim4Life 6.2.1.4972.
    It happened once when I've had put a high "maximum number of samples" in the time domain (200 I think) with the acoustic head tutorial that I changed a bit, by putting 2 transducers instead of 1.
    Another time it was weird because it happened with a SEFT targeting a square of skin, which was rather simple but it did crash again. My simulation was probably wrong in a way, but it didn't throw and error and just stopped.

    But now that I am applying @gbgbha advices, it is fine 🙂 and thanks for the tip ! I'll try for the file that I lost

  • Why does TRP exceed input power(Antenna)?

    2
    0 Votes
    2 Posts
    301 Views

    The TRP is computed in a different way than the input power. Both ways are mathematically correct and would both be "exact" if there were no numerical errors. In any FDTD simulation, however, there are spatial (finite grid) or temporal (finite time step) discretization error.
    What you are seeing in this half-wave dipole example, is that those discretization errors are larger than the precision you would require to distinguish TRP from input power (because the radiation efficiency is very high in this case, there is almost no difference between TRP and input power).

    To solve this "problem", either you accept that the simulation results are accurate enough for your needs (the warning is a simple consistency check) or you increase the precision of the simulation. You can do so by increasing the grid resolution, the overall convergence level and the resolution of the far-field sensor. This will be computationally expensive, though.

    To help you understand, you could try to add some lossy media in your (coarse) simulation (e.g. place the dipole next to a phantom or any other dielectric). The simulation will not be more precise, but the numerical errors will be less "obvious" because they will be dwarfed by the losses occurring in the dielectric. The TRP will be lower than the input power and the warning will not be triggered.

    I hope this helps.

  • 0 Votes
    1 Posts
    196 Views
    No one has replied
  • S4L is unable to read and load my project

    18
    0 Votes
    18 Posts
    1k Views

    THank you very much for the hints.

  • 0 Votes
    5 Posts
    775 Views

    That works! If it's for a 2D plot, you can always right click and export the data to an excel or csv file and then work with that if you'd prefer

  • Optimal performance

    3
    0 Votes
    3 Posts
    364 Views

    The full version has the same performance as the Light version: it can just deal with bigger problems.
    Note that the low-frequency solvers are not GPU-accelerated, so if you are using that the GPU is anyway not used. If you are using the FDTD solver instead, it is accelerated by the GPU but its performance might be severely affected by the frequency of your simulation (the lower the frequency, the more iteration the FDTD method has to do in order to reach convergence). If you are in a regime where the quasi-static approximations hold, I would strongly advise you to use the LF solvers.

  • Editing the excitation signal

    2
    0 Votes
    2 Posts
    325 Views

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

  • Invalid Bounding Box Error

    2
    0 Votes
    2 Posts
    322 Views

    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.