gibbonCode / GIBBON

The Geometry and Image-Based Bioengineering add-On for MATLAB
http://gibboncode.org/
GNU Affero General Public License v3.0
189 stars 60 forks source link

testGibbon - error results in termination #11

Closed siboles closed 6 years ago

siboles commented 6 years ago

@Kevin-Mattheus-Moerman openjournals/joss-reviews#506 The first encountered error when running: testGibbon('demo', 'test'); Terminates the rest of the testing. Ideally, these errors would be trapped and recorded, but testing could continue.

Specifically, this occurs with:

testGibbon -> Test file:14 of 58 DEMO_FEBio_block_biaxial_loading_stiffness_analysis.m

Yielding the trace:

Error using - Matrix dimensions must agree.

Error in patchDetach (line 12) FX=((FX-FX_mean)*shrinkFactor)+FX_mean;

Error in ind2patch (line 59) [F,V]=patchDetach(F,V,1);

Error in viewFourthOrderTensor (line 133) [Fp,Vp,Cp]=ind2patch(logicEntry,CM,'sk');

Error in DEMO_FEBio_block_biaxial_loading_stiffness_analysis (line 286) viewFourthOrderTensor(c); %Visualize tensor C

Error in run (line 96) evalin('caller', [script ';']);

Error in testGibbon (line 71) run(mFileNow);

Kevin-Mattheus-Moerman commented 6 years ago

I cannot reproduce this error. What FEBio version do you use?

Can you run the demo on its own? (i.e. without using testGibbon) DEMO_FEBio_block_biaxial_loading_stiffness_analysis

Can you check if this file is being created and if you have delete/write permission in that region, you can type this in the command window to see where the file is: fullfile(savePath,FEB_struct.run_output_names{3}) That file should be the FEBio log file containing the stiffness tensor entries. I wonder if it is empty or if it does not contain the right amount of entries for some reason.

Just before the error (line 285 ish) could you check the size of c by typing size(c)

If you update GIBBON you'll see that I've made two changes to check something. 1) I switched to external running mode (line 241): FEBioRunStruct.runMode='external';%'internal'; This is just to check if for some reason Arch linux does not like the "internal" mode. I noticed this demo was using internal mode.

2) I increased the maximum log file checking time (line 244): FEBioRunStruct.maxLogCheckTime=10; %Max log file checking time This should not be the error but just in case.

Terminates the rest of the testing. Ideally, these errors would be trapped and recorded, but testing could continue.

I agree that would be nice. I'll consider that/think about how to do that. For now the user can read the message displayed which says "Test file: 14 of 58" failed. The user can then start from this file by setting startInd (start index) to 14.

startInd=14; %The start index approveOpt=0; %Wait to approve every time, yes=1, no=0 testGibbon('demo','test',approveOpt,startInd);

siboles commented 6 years ago

I am using FEBio 2.5.2.8980. I pulled your changes and reinstalled (not sure if that is necessary or not.) The error still occurs.

The stiffness tensor was being saved in ../GIBBON/data/temp/tempModel_stiffness_out.txt.

The file is not empty, and size(c) was 3x3x3x3. I had a colleague install and run this on a Windows machine and the test passed. He is currently running the rest of the DEMOs. I will post the results of those as a separate issue if there are any errors.

siboles commented 6 years ago

My issues all seem to stem from this ind2patch function. Had the same problem with meshing demos.

Error using - Matrix dimensions must agree.

Error in patchDetach (line 12) FX=((FX-FX_mean)*shrinkFactor)+FX_mean;

Error in ind2patch (line 59) [F,V]=patchDetach(F,V,1);

Error in DEMO_MixedTetHexMeshing_torus (line 70) [Fm,Vm,Cm]=ind2patch(L_plot,double(M),'sk');

Error in run (line 96) evalin('caller', [script ';']);

Error in testGibbon (line 71) run(mFileNow);

siboles commented 6 years ago

I don't think this issue should impede the acceptance for JOSS, since it is OS specific. I will close this, and recommend opening a new issue without linking to the review.

Kevin-Mattheus-Moerman commented 6 years ago

Handling of errors in testGibbon has been improved. It now catches the error and gives you the file index so you can resume from that point

Kevin-Mattheus-Moerman commented 6 years ago

@siboles have you tried testGibbon('help', 'test');? Do all of those run? Have you tried HELP_im2patch and HELP_ind2patch. I suspect that size(FX_mean) does not match size(FX) for you in patchDetach. Can you report on those sizes? I wonder if you need a transpose somewhere...