Page 1 of 1

Error related to the new version

PostPosted: Mon Jun 06, 2016 8:11 pm
by sherzerg
Dear team

A code that had been written for a new material model, previously worked in the old version.
The codes has been modified to the new version and also the input files has been updated.
I got an error, I don't understand why, the code was only modified for the new version?
Is there a problem in the input file? Do I need to do some debugging? If I should do debugging, do I need special files for that? are there guidelines for how to do debugging?

This is the error message I get:

mdl> c
Solve: from time 0 to 0.0500003
A 'nan' (not a number) value was found
Possible operations that can cause 'nan':
acos(x) where x > 1. or x < -1.
log(x) where x <= 0.
sqrt(x) where x < 0.
pow(x,y) where x<0 and y is not an integer
Error at node 1906
Code: Select all
[code][/code]

Re: Error related to the new version

PostPosted: Mon Jun 06, 2016 9:00 pm
by zhouxinwei
I compiled your source code with MARS library version 2016.2.02, the simulation passed 50 steps without problem and kept running.

Please clean up the temporary files (e.g. remove the build folder, *.o files, if any), rebuild MARS and try again.


Update 1: I was running the debug version, the OpenMP version does give the problem. This usually indicates there is some issue in the source code, and I am looking into it.

Re: Error related to the new version

PostPosted: Tue Jun 07, 2016 6:05 am
by zhouxinwei
I looked into the source code, and in mtLdpmGiliNV.cpp I found:

Code: Select all
    // Elastic Moduli
    real EN, ET, ED, alphas;
    int NOS = prm->getNumberOfSteps(); 
    if ( NOS <= 2 ) {
        alphas = alpha;
        EN = E0;
        ET = alphas * EN;
        ED = alphaD * EN;
    } else {
        EN = stv[26];
        ET = alphas * EN;
        alphas = ET/EN;
        ED = alphaD * EN;
        Eu = DensRatio * EN;
        Kc = EN * KcRatio;
        Hs = Hr * EN;   
    }      
   
    real sqalpha = sqrt(alphas);


In the else branch, alphas is not initialized, when sqalpha is calculated by sqrt(alphas), you could end up doing square root of a negative value, which gives the error message you saw. This is an error which needs fix.

I think this error didn't show up in the old version (maybe you were doing a debug run in the old version), but is caught in the new version doing a OpenMP run.

The latest files I worked on are in GitLab MARS-UD-300, please use them instead.

Re: Error related to the new version

PostPosted: Tue Jun 07, 2016 11:48 am
by sherzerg
thank you very much for your answer.
I have files that were not uploaded (because there was not enough a space)
Maybe they also have a problem?

Re: Error related to the new version

PostPosted: Tue Jun 07, 2016 2:23 pm
by zhouxinwei
You didn't provide the source code for the new material model, which should fix the error I pointed out.

What do you mean by there is not enough space? Please elaborate.

Let's use the files in GitLab so we don't need to fix the same files repeatedly, GitLab makes it much easier for collaboration.

When use GitLab, you need to first get my files, modify them and put them back into GitLab.

Re: Error related to the new version

PostPosted: Sun Jun 26, 2016 8:23 am
by sherzerg
Dear Team

I wrote this post and I uploaded these files also in GitLab (ES3 / MARS-UD-300 ยท Issues) (I was not sure where you prefer the messige so I uploaded the files in both sites)
Following your guidance of solving the error message (In the forum):
I initialized alpha and still got the error message:
Please find attached the updated scrip, in addison I printed the output and got the following result 0.000A.
(a print screen of the code and the error message is also attached)

I will greatly appreciate your answer

Gili

Re: Error related to the new version

PostPosted: Tue Jul 05, 2016 2:46 am
by zhouxinwei
In the print out, alpha is zero, it seems that it should be a non-zero. Also, in mtLdpmGiliNV.cpp, stv[26] is not updated after the material model is called, this could be something you want to look into.

Please walk through the material model and make sure the code implementation is what you intended.