RuntimeError: Failed to create voxels. No valid grid configuration available.
-
Modifying the jupyter tutorial for the pTxCoil emfdtd, where I have basically just replaced the model with my own, I am incapable of voxeling:
The modelling checks out fine. It plots everything and it looks sane. In the Simulation section, the usual stuff shows up,
Can anyone discuss why voxeling sometimes fail...
This is a summary of the many lines error output:
Error : Unable to retrieve information from model analyzer for entity id ffa14448-e74a-4fb1-add7-d970a1b4afeb
Error : Unable to analyze components: Grid driver task(s) failed.
Error : Failed to update grid after processing all components.
Error : Unable to compute grid.
...
Traceback (most recent call last):
File "...johndoe.py", line 713, in <module>
main()
File "..johndoe.py", line 709, in main
RunTutorial(project_path)
File "..johndoe.py", line 681, in RunTutorial
sim.CreateVoxels(smash_path)
File "C:\Program Files\Sim4Life_8.2.0.16876\Python\Lib\site-packages\s4l_v1\simulation_emfdtd_impl.py", line 1005, in CreateVoxels
self.raw.CreateVoxels()
RuntimeError: Failed to create voxels. No valid grid configuration available.def RunTutorial(smash_path): document.New() CreateModel() sim = CreateSimulation(use_graphcard=False) document.AllSimulations.Add(sim) sim.UpdateGrid() sim.CreateVoxels(smash_path) # Note, keep this flag to true even if no further processing is being done # ask PC or MaG sim.RunSimulation(True) # True = wait until simulation has finished def main(data_path=None, project_dir=None): """ data_path = path to a folder that contains data for this simulation (e.g. model files) project_dir = path to a folder where this project and its results will be saved """ import os import sys print("Python ", sys.version) print("Running in ", os.getcwd(), "@", os.environ["COMPUTERNAME"]) if project_dir is None: project_dir = os.path.expanduser( os.path.join("~", "Documents", "s4l_python_tutorials") ) if not os.path.exists(project_dir): os.makedirs(project_dir) fname = os.path.splitext(os.path.basename(_CFILE))[0] + ".smash" project_path = os.path.join(project_dir, fname) RunTutorial(project_path) if __name__ == "__main__": main()
-
Not sure what is wrong, but I would look for the model entity with the Id "ffa14448-e74a-4fb1-add7-d970a1b4afeb", i.e.,
import XCore import XCoreModeling as xcm all_entities = xcm.GetActiveModel().GetEntities() all_entities = xcm.CollectEntities(all_entities) for entity in all_entities: if entity.Id = XCore.Uuid("ffa14448-e74a-4fb1-add7-d970a1b4afeb"): print(f"Entity {entity.Name}: valid={entity.Valid}, type={type(entity)}")
For some reason the gridder cannot process it. "Valid==False" means it was deleted from the model, but you still have an (invalid) handle.
-
Not sure what is wrong, but I would look for the model entity with the Id "ffa14448-e74a-4fb1-add7-d970a1b4afeb", i.e.,
import XCore import XCoreModeling as xcm all_entities = xcm.GetActiveModel().GetEntities() all_entities = xcm.CollectEntities(all_entities) for entity in all_entities: if entity.Id = XCore.Uuid("ffa14448-e74a-4fb1-add7-d970a1b4afeb"): print(f"Entity {entity.Name}: valid={entity.Valid}, type={type(entity)}")
For some reason the gridder cannot process it. "Valid==False" means it was deleted from the model, but you still have an (invalid) handle.
@bryn
Thank for the advice bryn. It turned out my phantom was passed on as an entitygroup and not a solid with a volume. When extracting it, the voxeling completed for that and the rest of the parts... It currently runs, but I will try your suggestion when it is done. -
So my problem was solved for the simple phantom a sphere. It can be voxeled. I am having a discussion with chatgpt about how to load Duke into the simulation section because currently it wont be voxeled. Is there a simple few lines of code that loads Duke and all the default tissue electrical properties or is it necessary to assign each tissue type in a loop or via thousands lines of code (as I have seen elsewhere)....