thelfer/tfel

[material-properties] Add support for bounds and physical bounds on the output of material laws

iramiere opened this issue · 6 comments

Hello,

We would need to check that the calculation of the Poisson coefficient \nu given by an empirical law (based on experimental data), does not go beyond the physical domain: \nu must remain < 0.5

Is there an @PhysicalBounds-type Mfront command for output variables?
In view of the very empirical law depending on many parameters, limiting the input parameters is not enough to guarantee that \nu does not leave the mechanically acceptable domain (and this is practically the case).

Thank you for your help or advice,
Best regards,
Isabelle

@iramiere What version do you plan to use ? Are you using the Cast3M interface or the pleiades interface (or both ?)

@thelfer I have to catch the Mfront version.
But for sure, I use the pleiades interface, and it would be nice to have it for the Cast3M interface for single tests.

After check, we are currently on tfel 3.4.3, but we are going to jump to tfel 4.1

Best regards,
Isabelle

One simple way is to check your mechanical properties in your behavior law and specify "converged = false ;" another way is to check your value at the end of your MaterialLaw

if(nu>0.5){
std::cout<<"Poisson coeficient is not valid"<<std::endl ;
return nan("Poisson coeficient is not valid");
}

I add a std::cout to easily write the c++ exception but I am sure there is a better code to do.

return nan("Poisson coeficient is not valid");

This works for the Cast3M interface, but other interfaces have different conventions about error handling.

@iramiere This is quite a pain to implement because every interface has its own way of reporting errors. I'll try to support this ASAP in the Cast3M interface and back-port it to rliv-4.2.

I could then make a 4.2.1 release if required by PLEIADES.

Note: thanks to Issue #514 you could do:

if((nu<0) && (nu>0.5)){
  throw(std::range_error("invalid value for the Poisson' ratio"));
}

This is more a hack than anything else and it is better to avoid exceptions that are incompatible with HPC environments.