sampsapursiainen / zeffiro_interface

Interface for using finite elements in inverse problems with complex domains
GNU General Public License v3.0
24 stars 15 forks source link

Create FEM mesh error #199

Open mshavliuk opened 1 year ago

mshavliuk commented 1 year ago

Description

Cannot compute the FEM mesh for the multicompartment_head_project with some specific resolutions.

Steps to reproduce

  1. Import the scripts/scripts_for_importing/multicompartment_head_project/import_segmentation.zef
  2. Go to the mesh tool
  3. Set Mesh Resolution to 10
  4. See the error
Error using zef_point_in_compartment (line 128)
Arrays have incompatible sizes for this operation.

Error in zef_mesh_labeling_step (line 31)
I_1 = zef_point_in_compartment(zef,reuna_p{i_labeling},reuna_t_aux,nodes(I_2,:),[compartment_counter n_compartments]);

Error in zef_create_fem_mesh (line 148)
zef_mesh_labeling_step;

Error in zef_create_finite_element_mesh (line 11)
zef = zef_create_fem_mesh(zef);

Related documentation

Error using matlab.ui.control.internal.controller.ComponentController/executeUserCallback (line 427)
Error while evaluating Button PrivateButtonPushedFcn.

This never happens for some other resolutions, for example 3mm. Also, on the screenshot it can be seen, that the error occurred during "Labeling of compartment 8/35", so some of them were processed successfully.

Expected behavior

The FEM Mesh generation is completed without errors.

Screenshots

Screenshot 2023-05-07 at 9 45 15

Context

Name Value
Version 2241fddd zef_nse_sigma: fix indentations with Matlab's smart indent tool
OS e.g. MacOS
Shell N/A
mshavliuk commented 1 year ago

While exploring this error, I also got another one a few times, although I'm not fully sure what was the exact sequence of actions to cause it. It might be that it's caused by an incorrectly generated mesh and be a direct consequence of an error described above, but I'm not totally sure. @GitFernandoGalaz could you take a look?

Unrecognized function or variable 'I_global'.

Error in zef_surface_mesh (line 159)
    tetra_ind_global = I_global(tetra_ind);

Error in zef_mesh_labeling_step (line 127)
[~,~,~,~,I_2] = zef_surface_mesh(label_ind,[],I_1);

Error in zef_create_fem_mesh (line 210)
zef_mesh_labeling_step;

Error in zef_create_finite_element_mesh (line 11)
zef = zef_create_fem_mesh(zef);

Error using matlab.ui.control.internal.controller.ComponentController/executeUserCallback (line 427)
Error while evaluating Button PrivateButtonPushedFcn.