How to computes additional thermodynamic value

Dear lammps user,

I would like to print thermodynamic information in pair potential model. I have created compute_A in thermo.cpp. I also used compute_pair.cpp to compute the same value.

My question is: (1) that force->pair->A in thermo.cpp only gives 0,
(2) but pair->A in compute_pair.cpp shows a correct value.

Could anyone tell me how two parts point A in pair class? Or why I got a different answer than I thought in (1)?

Kinds,

Jung

Dear lammps user,

I would like to print thermodynamic information in pair potential model. I
have created compute_A in thermo.cpp. I also used compute_pair.cpp to
compute the same value.

My question is: (1) that force->pair->A in thermo.cpp only gives 0,
                       (2) but pair->A in compute_pair.cpp shows a correct
value.

Could anyone tell me how two parts point A in pair class? Or why I got a
different answer than I thought in (1)?

you are not making much sense here.
why should you need to modify thermo.cpp only to have it print data,
that is available differently, i.e. via a compute?

also, please see pair.h for the entry "double *pvector" which allows
to communicate accumulated data from pair styles to compute pair. this
is used in pair styles pair_reax_c.cpp, pair_hbond_dreiding_lj.cpp,
pair_gauss.cpp, pair_hbond_dreiding_morse.cpp, pair_airebo.cpp

so from the little what i understand of your description, you need to
allocated pvector in your custom pair style, accumulate data into it
and then access it via compute pair. any compute that outputs scalars
can be directly output via thermo_style custom.

axel.

Thank you for your kind explanation.

But I am still not clear. For example in compute_pair.cpp, it is required to have force->pair->etail if I want to add etail.

Why does etail need force->pair->etail, (not pair->tail)

Kinds,

Jung

Thank you for your kind explanation.

But I am still not clear. For example in compute_pair.cpp, it is required to
have force->pair->etail if I want to add etail.

Why does etail need force->pair->etail, (not pair->tail)

simple C++ stuff. for starters, you can look at the (simplified) class
hierarchy here: http://lammps.sandia.gov/doc/Developer.pdf

Pair is not a member of LAMMPS (or rather Pointers) but a member of
Force, which in turn is a member of LAMMPS/Pointers from which Compute
is derived and which is the parent of ComputePair.

make sense now?

axel.

Thanks again.

Then how do pair->eng_vdwl and pair->eng_coul work without force?

Kinds,

Jung

Thanks again.

Then how do pair->eng_vdwl and pair->eng_coul work without force?

"use the source, luke!"

:wink: