Wall/reflect/stochastic

Hello Sir,

When i use the fix style ‘wall/reflect/stochastic’ in LAMMPS after installing the EXTRA-FIX package, the command is working good. BUT when i try to use the same command in the FORTRAN using lammps as a library, i got the error.

ERROR: Unrecognized fix style ‘wall/reflect/stochastic’ is part of the EXTRA-FIX package which is not enabled in this LAMMPS binary. (src/modify.cpp:917)
Last command: fix ywalls flow wall/reflect/stochastic maxwell 345533 ylo EDGE ${temp_hot} 0.0 0.0 0.0 0.421

I can not understand, why i am having this error after installing the said package. On the other hand, it is working in the pure LAMMPS.

Thank you
Adnan

Most likely the library that you are linking to is not the one that was used when creating the LAMMPS executable.

With which commands exactly did you build either of the two executables.

I used these two commands to create the executable file:

mpif90 -c Fourier_Hybrid.f90 -fopenmp
mpif90 LAMMPS.o Fourier_Hybrid.o liblammps.a -lmpi_cxx -lstdc++ -lm -ldl -fopenmp

This doesn’t say how you built LAMMPS.
Was it in the same folder?

I am sorry, I used this command to built:

cmake -D BUILD_MPI=yes -D BUILD_OMP=yes -D LAMMPS_MACHINE=yes cmake …/cmake -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_Fortran_COMPILER=gfortran -D PKG_OPENMP=yes -D BUILD_OMP=yes -D PKG_EXTRA-FIX=on …/cmake

Yes, i build in the same src/builld folder. One possibility may be to try to install again in new folder with EXTRA-FIX package and remove the previous version/folder.

When you do this, you should be using liblammps_yes.a and the LAMMPS executable would be called lmp_yes.

You can easily check if the library file has been updated as needed with:

nm liblammps.a | c++filt | grep FixWallReflectStochastic

Which should output something like this:

0000000001c8c360 t LAMMPS_NS::Fix* style_creator<LAMMPS_NS::Fix, LAMMPS_NS::FixWallReflectStochastic>(LAMMPS_NS::LAMMPS*, int, char**)
0000000001cadcca t LAMMPS_NS::Fix* style_creator<LAMMPS_NS::Fix, LAMMPS_NS::FixWallReflectStochastic>(LAMMPS_NS::LAMMPS*, int, char**) [clone .cold]
00000000021608c0 T LAMMPS_NS::FixWallReflectStochastic::wall_particle(int, int, double)
0000000002160f80 T LAMMPS_NS::FixWallReflectStochastic::FixWallReflectStochastic(LAMMPS_NS::LAMMPS*, int, char**)
0000000002160f80 T LAMMPS_NS::FixWallReflectStochastic::FixWallReflectStochastic(LAMMPS_NS::LAMMPS*, int, char**)
00000000021623ba t LAMMPS_NS::FixWallReflectStochastic::FixWallReflectStochastic(LAMMPS_NS::LAMMPS*, int, char**) [clone .cold]
0000000002160890 T LAMMPS_NS::FixWallReflectStochastic::~FixWallReflectStochastic()
00000000021623a4 t LAMMPS_NS::FixWallReflectStochastic::~FixWallReflectStochastic() [clone .cold]
0000000002160850 T LAMMPS_NS::FixWallReflectStochastic::~FixWallReflectStochastic()
0000000002160850 T LAMMPS_NS::FixWallReflectStochastic::~FixWallReflectStochastic()
0000000002162394 t LAMMPS_NS::FixWallReflectStochastic::~FixWallReflectStochastic() [clone .cold]
00000000052d1308 V typeinfo for LAMMPS_NS::FixWallReflectStochastic
0000000001357bc0 V typeinfo name for LAMMPS_NS::FixWallReflectStochastic
00000000052d1320 V vtable for LAMMPS_NS::FixWallReflectStochastic

I use this -D LAMMPS_MPI=yes in one machine and it created liblammps_mpi.a, there also having this error.

There is no LAMMPS_MPI CMake variable or define.

I used this command and nothing happens. It seems that i need to build again the lammps and repeat the procedures.

Alright sir. I may have made a mistake. I will re-install. Thank you so much.

When you do that, please make certain that you document every step of what you do so that you can provide exact information to reproduce it.

This can be done with a custom CMake preset/cache file or using a shell script that first deletes the build folder and then recreates it from scratch.

Alright Sir. I will follow these instructions

Thank you
Adnan

Problem was resolved. Thank you so much for your help.

I searched in my Build Folder and found the files that you mention “liblammps_yes.a” and i complied with this library and now the code is running good.

Best regards
Adnan