Using lineforce or planeforce fixes with a dynamic group

Dear all,

I want to limit the movements of a dynamic group to a specific direction. To do so, I was thinking of using, either, “lineforce” or “planeforce” fixes; however, none of these fixes allow the use of dynamic group.
What should I change to make these fixes compatible?
Any detailed help would be appreciated.

Soheil

​generally, fixes are not enabled for dynamic groups unless they have been
reviewed for being compatible. i have just reviewed both of these fixes and
determined that they are compatible with dynamic groups. it will be enabled
in the next LAMMPS patch.

for compatible fixes, the change to allow dynamic groups is to set the
dynamic_group_allow variable to 1 in the constructor. like in the diff
below​.

axel.

diff --git a/src/fix_lineforce.cpp b/src/fix_lineforce.cpp
index f82ed95..1e78bf3 100644
--- a/src/fix_lineforce.cpp
+++ b/src/fix_lineforce.cpp
@@ -29,6 +29,8 @@ using namespace FixConst;
FixLineForce::FixLineForce(LAMMPS *lmp, int narg, char **arg) :
   Fix(lmp, narg, arg)
{
+ dynamic_group_allow = 1;

Thanks a lot, Axel.

Dear all,

I want to limit the movements of a dynamic group to a specific direction. To do so, I was thinking of using, either, “lineforce” or “planeforce” fixes; however, none of these fixes allow the use of dynamic group.
What should I change to make these fixes compatible?

​generally, fixes are not enabled for dynamic groups unless they have been reviewed for being compatible. i have just reviewed both of these fixes and determined that they are compatible with dynamic groups. it will be enabled in the next LAMMPS patch.

for compatible fixes, the change to allow dynamic groups is to set the dynamic_group_allow variable to 1 in the constructor. like in the diff below​.

axel.

diff --git a/src/fix_lineforce.cpp b/src/fix_lineforce.cpp
index f82ed95…1e78bf3 100644
— a/src/fix_lineforce.cpp
+++ b/src/fix_lineforce.cpp
@@ -29,6 +29,8 @@ using namespace FixConst;
FixLineForce::FixLineForce(LAMMPS *lmp, int narg, char **arg) :
Fix(lmp, narg, arg)
{

  • dynamic_group_allow = 1;