Problem with Triangle region command

Dear steve and all,

I am trying to create the triangular geometrical void in the input file. I saw your reply on this thread

https://sourceforge.net/p/lammps/mailman/message/18939890/

copied the region_triangle.cpp and region_triangle.h in src folder and re-compiled the lammps but still i am getting the error message saying “ERROR: Unrecognized region style ‘triangle’ (…/domain.cpp:1759)”

LAMMPS (7 Aug 2019)

------------------------ INITIALIZATION ----------------------------

units metal
dimension 3
boundary p p p
atom_style atomic
variable latparam equal 4.05

----------------------- ATOM DEFINITION ----------------------------

lattice fcc {latparam} lattice fcc 4.05 Lattice spacing in x,y,z = 4.05 4.05 4.05 region whole block 0 10 0 10 0 10 create_box 1 whole Created orthogonal box = (0 0 0) to (40.5 40.5 40.5) 1 by 1 by 1 MPI processor grid lattice fcc {latparam} orient x 1 0 0 orient y 0 1 0 orient z 0 0 1
lattice fcc 4.05 orient x 1 0 0 orient y 0 1 0 orient z 0 0 1
Lattice spacing in x,y,z = 4.05 4.05 4.05
create_atoms 1 region whole
Created 4000 atoms
create_atoms CPU = 0.000463009 secs
mass 1 27
dump 1 all custom 10 dump.void id type x y z

region void4 triangle 4.5 4.5 6.5 8.5 8.5 4.5
ERROR: Unrecognized region style ‘triangle’ (…/domain.cpp:1759)
Last command: region void4 triangle 4.5 4.5 6.5 8.5 8.5 4.5

Could you please tell me where i am going wrong?

Thank you,
-Javeed

please note, that you are referring to an e-mail and source files from more than 10 years ago.
that said, the class in those files is very simple and nothing much has changed in the region classes since then, so they still should compile.
however, you need to make certain, that those files are actually compiled and linked into the executable.
for the old build system running “make” with the same “machine” argument as before should suffice.
when using the new CMake based build system, you need to re-run cmake in the build folder (like this: cmake .) so that the new files are registered and then run make.
if the newly compiled executable contains the new code and be seen from running LAMMPS with the -h flag, which should print lists of all included (optional) styles.

also, you need to make certain, that you actually are using the new executable and not the previously compiled (and installed?) one.
most of these are things that cannot be inferred from what you are reporting, so nobody can tell what went wrong. it is most likely, that it is a mistake on your side.

axel.