avoid segfault when accessing fix compute data before the fix is initialized
This commit is contained in:
@ -935,6 +935,7 @@ double FixMSST::compute_vector(int n)
|
||||
|
||||
double FixMSST::compute_hugoniot()
|
||||
{
|
||||
if (!temperature) return 0.0;
|
||||
double v, e, p;
|
||||
double dhugo;
|
||||
|
||||
@ -960,6 +961,8 @@ double FixMSST::compute_hugoniot()
|
||||
|
||||
double FixMSST::compute_rayleigh()
|
||||
{
|
||||
if (!temperature) return 0.0;
|
||||
|
||||
double v, p;
|
||||
double drayleigh;
|
||||
|
||||
@ -1001,6 +1004,8 @@ double FixMSST::compute_lagrangian_position()
|
||||
|
||||
double FixMSST::compute_etotal()
|
||||
{
|
||||
if (!pe) return 0.0;
|
||||
|
||||
double epot,ekin,etot;
|
||||
epot = pe->compute_scalar();
|
||||
ekin = temperature->compute_scalar();
|
||||
|
||||
@ -244,6 +244,8 @@ void FixNPHug::compute_temp_target()
|
||||
|
||||
double FixNPHug::compute_etotal()
|
||||
{
|
||||
if (!pe) return 0.0;
|
||||
|
||||
double epot,ekin,etot;
|
||||
epot = pe->compute_scalar();
|
||||
ekin = temperature->compute_scalar();
|
||||
@ -269,6 +271,8 @@ double FixNPHug::compute_vol()
|
||||
|
||||
double FixNPHug::compute_hugoniot()
|
||||
{
|
||||
if (!temperature) return 0.0;
|
||||
|
||||
double v,e,p;
|
||||
double dhugo;
|
||||
|
||||
@ -299,6 +303,8 @@ double FixNPHug::compute_hugoniot()
|
||||
|
||||
double FixNPHug::compute_us()
|
||||
{
|
||||
if (!temperature) return 0.0;
|
||||
|
||||
double v,p;
|
||||
double eps,us;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user