Commit aaf5e87c authored by Steve Plimpton's avatar Steve Plimpton Committed by GitHub
Browse files

Merge pull request #703 from akohlmey/custom-rigid-body-generation

Allow rigid body generation from custom properties
parents 2d0f5e27 83c7d3a1
Loading
Loading
Loading
Loading
+28 −6
Original line number Diff line number Diff line
@@ -26,6 +26,9 @@ style = {rigid} or {rigid/nve} or {rigid/nvt} or {rigid/npt} or {rigid/nph} or {
bodystyle = {single} or {molecule} or {group} :l
  {single} args = none
  {molecule} args = none
  {custom} args = {i_propname} or {v_varname}
    i_propname = an integer property defined via fix property/atom
    v_varname  = an atom-style or atomfile-style variable 
  {group} args = N groupID1 groupID2 ...
    N = # of groups
    groupID1, groupID2, ... = list of N group IDs :pre
@@ -81,6 +84,16 @@ fix 1 particles rigid/npt molecule temp 1.0 1.0 5.0 x 0.5 0.5 1.0 z 0.5 0.5 1.0
fix 1 water rigid/nph molecule iso 0.5 0.5 1.0
fix 1 particles rigid/npt/small molecule temp 1.0 1.0 1.0 iso 0.5 0.5 1.0 :pre

variable bodyid atom 1.0*gmask(clump1)+2.0*gmask(clump2)+3.0*gmask(clump3)
fix 1 clump rigid custom v_bodyid :pre

variable bodyid atomfile bodies.txt
fix 1 clump rigid custom v_bodyid :pre

fix 0 all property/atom i_bodyid
read_restart data.rigid fix 0 NULL Bodies
fix 1 clump rigid/small custom i_bodyid :pre
	
[Description:]

Treat one or more sets of atoms as independent rigid bodies.  This
@@ -100,7 +113,7 @@ of a biomolecule such as a protein.

Example of small rigid bodies are patchy nanoparticles, such as those
modeled in "this paper"_#Zhang1 by Sharon Glotzer's group, clumps of
granular particles, lipid molecules consiting of one or more point
granular particles, lipid molecules consisting of one or more point
dipoles connected to other spheroids or ellipsoids, irregular
particles built from line segments (2d) or triangles (3d), and
coarse-grain models of nano or colloidal particles consisting of a
@@ -203,11 +216,11 @@ most one rigid body. Which atoms are in which bodies can be defined
via several options.

NOTE: With the {rigid/small} styles, which require that {bodystyle} be
specified as {molecule}, you can define a system that has no rigid
bodies initially.  This is useful when you are using the {mol} keyword
in conjunction with another fix that is adding rigid bodies on-the-fly
as molecules, such as "fix deposit"_fix_deposit.html or "fix
pour"_fix_pour.html.
specified as {molecule} or {custom}, you can define a system that has
no rigid bodies initially.  This is useful when you are using the {mol}
keyword in conjunction with another fix that is adding rigid bodies
on-the-fly as molecules, such as "fix deposit"_fix_deposit.html or
"fix pour"_fix_pour.html.

For bodystyle {single} the entire fix group of atoms is treated as one
rigid body.  This option is only allowed for the {rigid} styles.
@@ -222,6 +235,15 @@ molecule ID = 0) surrounding rigid bodies, this may not be what you
want.  Thus you should be careful to use a fix group that only
includes atoms you want to be part of rigid bodies.

Bodystyle {custom} is similar to bodystyle {molecule}, however some
custom properties are used to group atoms into rigid bodies. The
special case for molecule/body ID = 0 is not available. Possible
custom properties are an integer property associated with atoms through
"fix property/atom"_fix_property_atom.html or an atom style variable
or an atomfile style variable. For the latter two, the variable value
will be rounded to an integer and then rigid bodies defined from
those values.

For bodystyle {group}, each of the listed groups is treated as a
separate rigid body.  Only atoms that are also in the fix group are
included in each rigid body.  This option is only allowed for the
+83 −0
Original line number Diff line number Diff line
81
1 1
2 1
3 1
4 1
5 1
6 1
7 1
8 1
9 1
10 2
11 2
12 2
13 2
14 2
15 2
16 2
17 2
18 2
19 3
20 3
21 3
22 3
23 3
24 3
25 3
26 3
27 3
28 4
29 4
30 4
31 4
32 4
33 4
34 4
35 4
36 4
37 5
38 5
39 5
40 5
41 5
42 5
43 5
44 5
45 5
46 6
47 6
48 6
49 6
50 6
51 6
52 6
53 6
54 6
55 7
56 7
57 7
58 7
59 7
60 7
61 7
62 7
63 7
64 8
65 8
66 8
67 8
68 8
69 8
70 8
71 8
72 8
73 9
74 9
75 9
76 9
77 9
78 9
79 9
80 9
81 9
+185 −0
Original line number Diff line number Diff line
# LAMMPS data file for rigid bodies

81	atoms		
1	atom types	

-12 12 xlo xhi
-12 12 ylo yhi
-12 12 zlo zhi

Masses			

1 1		

Pair Coeffs			

1 1 1		

Atoms				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23 3
24 3
25 3
26 3
27 3
28 4
29 4
30 4
31 4
32 4
33 4
34 4
35 4
36 4
37 5
38 5
39 5
40 5
41 5
42 5
43 5
44 5
45 5
46 6
47 6
48 6
49 6
50 6
51 6
52 6
53 6
54 6
55 7
56 7
57 7
58 7
59 7
60 7
61 7
62 7
63 7
64 8
65 8
66 8
67 8
68 8
69 8
70 8
71 8
72 8
73 9
74 9
75 9
76 9
77 9
78 9
79 9
80 9
81 9
+83 −0
Original line number Diff line number Diff line
# Simple rigid body system

units		lj
atom_style	atomic
atom_modify  map array

pair_style	lj/cut 2.5

read_data	data.rigid

velocity 	all create 100.0 4928459


# unconnected bodies

group		clump1 id <> 1 9
group		clump2 id <> 10 18
group		clump3 id <> 19 27
group		clump4 id <> 28 36
group		clump5 id <> 37 45
group		clump6 id <> 46 54
group		clump7 id <> 55 63
group		clump8 id <> 64 72
group		clump9 id <> 73 81

variable bodies atomfile bodies.txt
fix 1 all rigid custom v_bodies

# 1 chain of connected bodies

#group		clump1 id <> 1 9
#group		clump2 id <> 9 18
#group		clump3 id <> 18 27
#group		clump4 id <> 27 36
#group		clump5 id <> 36 45
#group		clump6 id <> 45 54
#group		clump7 id <> 54 63
#group		clump8 id <> 63 72
#group		clump9 id <> 72 81

#fix 1 all poems group clump1 clump2 clump3 clump4 clump5 &
#	  	      clump6 clump7 clump8 clump9

# 2 chains of connected bodies

#group		clump1 id <> 1 9
#group		clump2 id <> 9 18
#group		clump3 id <> 18 27
#group		clump4 id <> 27 36
#group		clump5 id <> 37 45
#group		clump6 id <> 45 54
#group		clump7 id <> 54 63
#group		clump8 id <> 63 72
#group		clump9 id <> 72 81

#fix 1 all poems group clump1 clump2 clump3 clump4
#fix 2 all poems group clump5 clump6 clump7 clump8 clump9

neigh_modify	exclude group clump1 clump1
neigh_modify	exclude group clump2 clump2
neigh_modify	exclude group clump3 clump3
neigh_modify	exclude group clump4 clump4
neigh_modify	exclude group clump5 clump5
neigh_modify	exclude group clump6 clump6
neigh_modify	exclude group clump7 clump7
neigh_modify	exclude group clump8 clump8
neigh_modify	exclude group clump9 clump9

thermo		100

#dump		1 all atom 50 dump.rigid

#dump		2 all image 100 image.*.jpg type type &
#		axes yes 0.8 0.02 view 60 -30
#dump_modify	2 pad 5

#dump		3 all movie 100 movie.mpg type type &
#		axes yes 0.8 0.02 view 60 -30
#dump_modify	3 pad 5

timestep 	0.0001
thermo		50
run		10000
+83 −0
Original line number Diff line number Diff line
# Simple rigid body system

units		lj
atom_style	atomic
atom_modify  map array

pair_style	lj/cut 2.5

read_data	data.rigid

velocity 	all create 100.0 4928459


# unconnected bodies

group		clump1 id <> 1 9
group		clump2 id <> 10 18
group		clump3 id <> 19 27
group		clump4 id <> 28 36
group		clump5 id <> 37 45
group		clump6 id <> 46 54
group		clump7 id <> 55 63
group		clump8 id <> 64 72
group		clump9 id <> 73 81

variable bodies atom 1.0*gmask(clump1)+2.0*gmask(clump2)+3.0*gmask(clump3)+4.0*gmask(clump4)+5.0*gmask(clump5)+6.0*gmask(clump6)+7.0*gmask(clump7)+8.0*gmask(clump8)+9.0*gmask(clump9)
fix 1 all rigid custom v_bodies

# 1 chain of connected bodies

#group		clump1 id <> 1 9
#group		clump2 id <> 9 18
#group		clump3 id <> 18 27
#group		clump4 id <> 27 36
#group		clump5 id <> 36 45
#group		clump6 id <> 45 54
#group		clump7 id <> 54 63
#group		clump8 id <> 63 72
#group		clump9 id <> 72 81

#fix 1 all poems group clump1 clump2 clump3 clump4 clump5 &
#	  	      clump6 clump7 clump8 clump9

# 2 chains of connected bodies

#group		clump1 id <> 1 9
#group		clump2 id <> 9 18
#group		clump3 id <> 18 27
#group		clump4 id <> 27 36
#group		clump5 id <> 37 45
#group		clump6 id <> 45 54
#group		clump7 id <> 54 63
#group		clump8 id <> 63 72
#group		clump9 id <> 72 81

#fix 1 all poems group clump1 clump2 clump3 clump4
#fix 2 all poems group clump5 clump6 clump7 clump8 clump9

neigh_modify	exclude group clump1 clump1
neigh_modify	exclude group clump2 clump2
neigh_modify	exclude group clump3 clump3
neigh_modify	exclude group clump4 clump4
neigh_modify	exclude group clump5 clump5
neigh_modify	exclude group clump6 clump6
neigh_modify	exclude group clump7 clump7
neigh_modify	exclude group clump8 clump8
neigh_modify	exclude group clump9 clump9

thermo		100

#dump		1 all atom 50 dump.rigid

#dump		2 all image 100 image.*.jpg type type &
#		axes yes 0.8 0.02 view 60 -30
#dump_modify	2 pad 5

#dump		3 all movie 100 movie.mpg type type &
#		axes yes 0.8 0.02 view 60 -30
#dump_modify	3 pad 5

timestep 	0.0001
thermo		50
run		10000
Loading