Skip to content

Commit

Permalink
updated log output
Browse files Browse the repository at this point in the history
 - added “number of beads” for each molecule
 - moved molecular weight log output to individual polymer sections
  • Loading branch information
jostasche committed Sep 26, 2016
1 parent eeb45c0 commit 492aaff
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
8 changes: 8 additions & 0 deletions Polymer.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,8 @@ def write_gromacs(self,mypath="."):
d=[] #dihedrals topology
imp=[] #impropers topology

polymass=[]

index=1 #atom counter
for j in xrange(0,len(self.poly),1):

Expand Down Expand Up @@ -529,6 +531,7 @@ def write_gromacs(self,mypath="."):
charge=self.ff.nonbonded[atomtype][2]

at.append([index,atomtype,j+1,data_list[i][2],data_list[i][1],index,charge,mass])
polymass.append(float(mass))

index+=1
if index>99999:
Expand Down Expand Up @@ -609,6 +612,11 @@ def write_gromacs(self,mypath="."):

f_out.close()

# print infos about polymer
self.logger.info(">> number of beads : %s", len(self.p))
self.logger.info(">> molecular weight : %s g/mol", sum(polymass))


return

#generate and return list for clash avoidance scan
Expand Down
8 changes: 1 addition & 7 deletions System.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,16 +168,10 @@ def create_system(self,mypath="."):
contmols.append([name,cnt])


# print molecular weights
# print weight concentration
masspoly=[]
for x in xrange(0,len(self.polymers),1):
masspoly.append(self.polymers[x].get_mass_2())

self.logger.info("\n> molecular weights:")
for x in xrange(0,len(contmols),1):
self.logger.info(">> %s: %s g/mol"%(contmols[x][0],masspoly[x]))

# print weight concentration
weighted=[]
for x in xrange(0,len(masspoly),1):
weighted.append(float(masspoly[x])*float(contmols[x][1]))
Expand Down

0 comments on commit 492aaff

Please sign in to comment.