Fix ouputs

I have modified the existing fix langevin implementation to include a stadium type thermostat, where the langevin coefficient varies with distance to a predefined boundary.

I would to validate the implementation by letting the fix give an output of the langevin coefficients, so that i can visualize them in a dump file or plot as a function of distance. Looking at the other fixes, i am little bit confused on how to do this.

Any help is much appreciated.

Best regards

By Lang coeff do you mean a per-atom quantity?

I assume yes, since you mention a dump file.

A fix cannot produce both global (scalar,vector) and

per-atom values. However, if you implemented

this as an option to the current fix langevin, you

can turn off the global output and turn-on per-atom

output when your option is invoked. Look for

another fix that sets peratom_flag = 1 and you

will see how to setup the output. It can either

be a single quantiy per atom or multiple values

per atom.

E.g. grep peratom_flag fix*cpp

Also, if you wrote a derived fix, fix langevin/stadium,

deriving from fix langevin, then you could just make

it always do peratom output and no global output.

If you want to release this in main LAMMPS, the

derived fix is what we would want (fix langevin is

already complicated enough).



Thanks for the response. I wanted to do a derived fix, but as it stands now for testing purposes I have made some simple modifications to fix_langevin.h and fix_langevin.cpp. Since fix langevin does not output any global quantities, i set the peratom flag for the langevin coefficients and they seem to output fine to a dump file. I think the stadium fix works and i am working on creating a derived fix.

The other question i obviously have is restarts, using this fix. Since these langevin coefficients are decided at the initiation of the fix, I would like to save them to a restart file a of and use them in the event of a restart.

Is there a template for this. The one that came the closest is fix_move, that stores the original coordinates in the restart file.

Any other advise on restarts will also be much appreciated.

Are these coeffs unique to each atom and something
you cannot re-create at a later time? If not, you could
just recreate them once when the fix is re-instantiated
at the beginning of each restart.

If yes, then it seems you need to do 2 things. One
is to carry them along with each atom during a simulation
as atoms move to new processors. The 2nd is to
write them to a restart file and read them back in
for a new simulation. Fix move does both for the
initial (time=0) position of each atom. It does
this by defining several methods and using FixSTORE.
So you can copy code from there to do what you