How to extract lattice temperature when using fix ttm/mod

The fix ttm/mod has two thermo output: 1) total energy of the electronic subsystem 2) Energy transfer between electronic and lattice subsystem at each time step. The electronic temperatures at each grid can also be written to a file as output. There is no option for printing lattice temperature as output.

Is there any convenient way of extracting the average lattice temperature of a cell in the ttm grid and print as an output?


All available features are mentioned in the documentation. If there is no documentation for a specific feature, it needs to be added by modifying the source code or obtained by post-processing from the available data.

Convenient? Obviously no.

I used fix chunk/atom and then chunk/temp to get the lattice cell temperatures. Now I need to edit the source term in fix ttm/mod.cpp.

It used to be like the following (line 822):

Now edited to:

I not sure if the fix would work at all. Stuck on compiling.Untill now used precompiled binaries for windows. Now have to shift to wsl (windows subsystem for linux) for compiling and running lammps. The tutorial for wsl has instruction for a basic build.

I changed the preset to most.cmake

But I also need lammps as a shared library as i need to run it from within a python script. What command should be used for that purpose? Should i just follow the tutorials for linux on wsl??

There is plenty of information about doing LAMMPS development in the LAMMPS manual. But don’t expect that to also teach you programming or system specific details or how to use the various tools. Those all have their own documentation. Also, keep in mind that tutorials by their very nature can help you to get started, but they are no substitute for understanding what you are doing. You cannot expect that there will be a tutorial that will explain all steps required for your particular needs. Also, you are not likely to find somebody here that has the time and patience to give you a personal and custom step-by-step tutorial. Once you start modifying source code, you need to be familiar with the tools and processes or you should not make those modifications and look for a different project where those are not needed.

If you are working on Windows you can either use the Windows subsystem for Linux and use Linux compilers and produce Linux executables and run those, or you can install Visual Studio and compile LAMMPS natively with the MSVC compilers from within Visual Studio.
Either should work. Since you are building with CMake, it should be straightforward to install the LAMMPS python module with “make install-python”. Details on the prerequisites for that are - again - in the LAMMPS manual.

after using the most.cmake preset with following edit (line 67 and 68, guess work)

with this when i ran a script it showed a package is missing

although it was included in the cmake preset

What to do now?

Don’t mess with things that you don’t understand. You will break stuff as you already see. Nobody will want to help you, if you have a broken LAMMPS setup. Instead, stop guessing and study the manual. It will take some time, but it is worth it.

You should probably also spend some time reading the CMake documentation.

There is a fix ttm/grid alternative and a GitHub PR #3405 which upgrades it.
It allows you to use a new dump grid command to output the Temp field to a dump file
for post processing or viz. We plan to add a dump grid/vtk version which writes
a dump file which VTK (e.g. OVITO, Paraview) can viz as a continuous 3d field, overlayed
with your atoms if desired.


1 Like