[lammps-users] Problem using "fix heat"

Hi Axel,

Yes, the problem first appeared on an Itanium-based Altix. But it does not seem to be limited
to this particular architecture.

I've run the code (without any optimization) on a Core-i7 as well on a Xeon processor. The problem repeats itself on these
systems, although the error message is slightly different. On the Core-i7 it simply gives a segmentation fault.

Maurice

Hi Axel,

hi maurice,

Yes, the problem first appeared on an Itanium-based Altix. But it does
not seem to be limited
to this particular architecture.

ok.

I've run the code (without any optimization) on a Core-i7 as well on a
Xeon processor. The problem repeats itself on these
systems, although the error message is slightly different. On the
Core-i7 it simply gives a segmentation fault.

thanks for the confirmation. this is indeed a genuine problem.
i just wanted to make sure that we're not embarking on a wild
goose chase. i've seen this so many times on itaniums, it is
useful to check.

i've taken your input and generated a stack trace with it and
i think i have found the reason for the crash.

please try this change to the source and recompile.
it looks like everybody else is using fix heat
in combination with the region keyword.

cheers,
    axel.

diff --git a/src/fix_heat.cpp b/src/fix_heat.cpp
index 19f7aea..c4a4693 100644
--- a/src/fix_heat.cpp
+++ b/src/fix_heat.cpp
@@ -89,7 +89,7 @@ void FixHeat::end_of_step()
   Region *region = NULL;
   if (iregion >= 0) region = domain->regions[iregion];
   
- if (region < 0) {
+ if (iregion < 0) {
     heat = heat_input*nevery*update->dt*force->ftm2v;
     ke = group->ke(igroup)*force->ftm2v;
     group->vcm(igroup,masstotal,vcm);

Thanks,

That did the trick.

Cheers,

Maurice

I'll post a patch for this.

Thanks,
Steve