Error related to the new version

About anything related to MARS.

Error related to the new version

Postby sherzerg » Mon Jun 06, 2016 8:11 pm

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]
Attachments
mtLdpmGiliNV.cpp
(43.61 KiB) Downloaded 1158 times
NewVerMyPrism100.mrs
(1004.48 KiB) Downloaded 1136 times
YGrun.mrs
(4.99 KiB) Downloaded 1181 times
sherzerg
 
Posts: 4
Joined: Thu Jun 02, 2016 1:18 pm

Re: Error related to the new version

Postby zhouxinwei » Mon Jun 06, 2016 9:00 pm

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.
zhouxinwei
 
Posts: 208
Joined: Thu Jul 09, 2015 7:12 pm

Re: Error related to the new version

Postby zhouxinwei » Tue Jun 07, 2016 6:05 am

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.
zhouxinwei
 
Posts: 208
Joined: Thu Jul 09, 2015 7:12 pm

Re: Error related to the new version

Postby sherzerg » Tue Jun 07, 2016 11:48 am

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?
Attachments
linkFaceXX.cpp
(12.13 KiB) Downloaded 1130 times
user.cpp
(1 KiB) Downloaded 1189 times
ldpmX.cpp
(3.68 KiB) Downloaded 1119 times
sherzerg
 
Posts: 4
Joined: Thu Jun 02, 2016 1:18 pm

Re: Error related to the new version

Postby zhouxinwei » Tue Jun 07, 2016 2:23 pm

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.
zhouxinwei
 
Posts: 208
Joined: Thu Jul 09, 2015 7:12 pm

Re: Error related to the new version

Postby sherzerg » Sun Jun 26, 2016 8:23 am

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
Attachments
mtLdpmGiliNV.cpp
(36.86 KiB) Downloaded 1106 times
Screen Shot 2016-06-26 at 9.13.21 AM.png
Screen Shot 2016-06-26 at 9.13.21 AM.png (264.82 KiB) Viewed 14192 times
sherzerg
 
Posts: 4
Joined: Thu Jun 02, 2016 1:18 pm

Re: Error related to the new version

Postby zhouxinwei » Tue Jul 05, 2016 2:46 am

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.
zhouxinwei
 
Posts: 208
Joined: Thu Jul 09, 2015 7:12 pm


Return to Other

Who is online

Users browsing this forum: No registered users and 1 guest

cron