Conjugate Gradient Solver (CGS) issue while computing head model with FEM method

Dear brainstormers,

As I am starting out using the software, I tried to compute a head model in the DUNEuro framework, using a FEM method. However, after a while the script stopped running and the following message appeared:

SolverAbort [apply:/home/juan/bst-duneuro/src/dune-istl/dune/istl/solvers.hh:342]: CGSolver: initial defect=nan is infinite or NaN

After visually inspecting the head model, I didn't find and anomaly, and the software seem to work smoothle for the other subjects, so I suspect this could be due to an error while processing. After searching the forum(s) I didn't find anyone else that reported this issue. So, do you have any hint on what could be malfunctioning? Thanks in advance for your replies!

Hi @umbertonencha

Can you give more details about the model that gives you this error?
Is there anything different from the other subjects?

How did you get the mesh?

Can you share a figure with the cortex (source position) and one with the channel position?

Thank ou for your quick response!

We obtain the model computing as it follows:
Subject >compute head model>MRI volume>DUNEuro FEM
then we choose 6 layers for the FEM computation as displayed here

There doesn't seem to be anything different from the other subjects when visually checking the MRI data nor the channel position.
We obtained the mesh with simnibs (12 layers).

Thank you again for your help!

As for the head model, here there is an images you are asking for:

Hi @umbertonencha

I'm not sure that this is the correct approach to it.
When you "uncheck" the layer on this panel, the tissues are removed from the computation.

I'll recommend merging the surface first, as explained in this tuto:

https://neuroimage.usc.edu/brainstorm/Tutorials/FemMedianNerveCharm?highlight=(fem)#Merge_tissues

If you used this method in the previous subjects, I recommend recomputing these models by following the tutorials.

Thank you for your help! Unfortunately, after trying merging the layers as in the tutorial and obtaining a merged SimNibs mesh with 5 layers, the same error appears. I also tried to remesh it using iso2mesh (both versions) and by forcing the source space inside the gray layer. Here there is a screenshot of what I obtain right before launching the computation:
image

This is the error that I get when I try to remesh with any version of Iso2mesh and for any resolution I choose between 0.01 and 0.0001:


Thank you in advance for your help!

This error is at the level of the mesh generation.

Can you share the mesh file that you obtain from the Charm process?

Those are all the new errors due to the latest version of the SimNibs 4 Charm process.
I may recommend using the Headreco if you can get it. ( from SimNibs 3)

Thank you very much for the rapid response! Unfortunately, after consulting my colleagues, I won't be able to share any MRI file data on here, for apparently they have a strict confidentiality policy.
But anyway, we finally used for this subject the default head model to create the FEM head model.

Thank you very much for your help! If I have some time I will use the Headreco you advised me to and I'll get back to you about that.

Thanks for the reply. Sounds good.

If you are still having the issue, you can send it in private,
and I need just the mesh (not the MRI), + the location of the dipoles and the sensors and the conductivity values you are using.