diff --git a/examples/01_cut_a_sphere/README b/examples/01_cut_a_sphere/README new file mode 100644 index 0000000..addef0f --- /dev/null +++ b/examples/01_cut_a_sphere/README @@ -0,0 +1,6 @@ +Generate a sphere from the pdb file + +run: +python /home/tao/Nutstore/code/simupy/tools/build/sphere.py + +The details can be set in "inp" file diff --git a/examples/01_cut_a_sphere/inp b/examples/01_cut_a_sphere/inp new file mode 100644 index 0000000..a5e487d --- /dev/null +++ b/examples/01_cut_a_sphere/inp @@ -0,0 +1,7 @@ +[SPHERE] +pdbfile = ca12.pdb ; input pdb file +center = 23.978 23.978 23.978 ; center of the sphere, usually we use the center of the box +radius = 12.8 ; radius of the sphere (in A) +atoms = Ca Al O ; Atom names in the pdb file +natoms = 12 14 33 ; Desired ratio +outfile = caalo_128.pdb ; Output pdb file diff --git a/lib/mytype.py b/lib/mytype.py index 2d2ff78..01218cd 100644 --- a/lib/mytype.py +++ b/lib/mytype.py @@ -178,6 +178,14 @@ def assignEleTypes(self,): match = pattern.match(b) if match: i.element= match.group(1) + + def assignAtomTypes2(self,): + """ assign atomtypes according to the element types + specially designed for lammps data file + """ + self.assignEleTypes() + for i in self.atoms: + i.name = i.element def assignAtomTypes(self,): """ assign atomtypes according to the element types diff --git a/lib/utilities.py b/lib/utilities.py index c11d99a..450fbcd 100644 --- a/lib/utilities.py +++ b/lib/utilities.py @@ -103,8 +103,6 @@ def get_angle(a1, a2, a3): theta = np.arccos(cost)/np.pi * 180.0 return theta -def cut_circle(): - pass if __name__ == "__main__": a = [3.4199999522999995 , 0.0000000000000000 , 0.0000000000000000]