From 6fb77f4e05910e0a6682df3f0bbc72af8776988d Mon Sep 17 00:00:00 2001 From: Cezary Czaplewski Date: Mon, 28 Aug 2017 00:17:01 +0200 Subject: [PATCH] ntwx for remd (trajcache) --- django_simple/todo/forms.py | 2 ++ django_simple/todo/jobfiles.py | 10 +++++----- django_simple/todo/templates/details.html | 8 ++++++++ django_simple/todo/views.py | 2 ++ files/matplotlib_hist.py | 4 ++-- 5 files changed, 19 insertions(+), 7 deletions(-) diff --git a/django_simple/todo/forms.py b/django_simple/todo/forms.py index 987887b..beff582 100644 --- a/django_simple/todo/forms.py +++ b/django_simple/todo/forms.py @@ -237,6 +237,8 @@ class TaskForm_remd_a(forms.Form): help_text='number of replicas') remd_nstex = forms.IntegerField(label='NSTEX',initial=1000, help_text='exchange and write trajectory every nstex steps') + md_ntwx = forms.IntegerField(label='NTWX',initial=1000, + help_text='write trajectory every ntwx steps') remd_cluter_temp = forms.FloatField(label='TEMPER', help_text='temperature for cluster analysis',initial=280) # remd_traj1file = forms.BooleanField(required=False,label='single trajectory file',initial='true') diff --git a/django_simple/todo/jobfiles.py b/django_simple/todo/jobfiles.py index ce0cf44..c3484fa 100644 --- a/django_simple/todo/jobfiles.py +++ b/django_simple/todo/jobfiles.py @@ -126,7 +126,7 @@ CUTOFF=7.00000 WCORR4=0.00000 type_line = 'reset_vel='+ str(instance.remd_nstex)\ +' nstep='+str(instance.md_nstep)\ +' ntwe='+str(instance.md_ntwe)\ - +' ntwx='+str(instance.remd_nstex)\ + +' ntwx='+str(instance.md_ntwx)\ +' dt='+str(instance.md_dt) if instance.md_lang == 'langevin': type_line = type_line + ' lang=1 ' @@ -142,7 +142,7 @@ CUTOFF=7.00000 WCORR4=0.00000 type_line2 = 'nrep='+str(instance.remd_nrep) \ +' nstex='+str(instance.remd_nstex) \ +' tlist mlist sync nsyn='+str(instance.remd_nstex)\ - +' traj1file rest1file ' + +' traj1file rest1file TRAJCACHE=200' if instance.md_start == 'pdbstart': type_line = type_line + ' preminim cart' @@ -270,10 +270,10 @@ CUTOFF=7.00000 WCORR4=0.00000 # write wham & cluster input with open(instance.jobdirname+'/file_wham.inp','w') as f: - if instance.md_nstep/instance.remd_nstex*nreplicas<=8000: + if instance.md_nstep/instance.md_ntwx*nreplicas<=8000: isampl=1 else: - isampl=int(instance.md_nstep/instance.remd_nstex*nreplicas/8000) + isampl=int(instance.md_nstep/instance.md_ntwx*nreplicas/8000) if instance.md_pdbref: f.write('SEED='+str(instance.md_seed)+' isampl='+str(isampl)+ @@ -295,7 +295,7 @@ CUTOFF=7.00000 WCORR4=0.00000 for element in tmp1: f.write('nr=1 temp='+element+' fi=0.0 0.0 0.0 0.0 0.0\n') f.write('kh= 0.0 Q0=0.0\n') - rec=instance.md_nstep/instance.remd_nstex + rec=instance.md_nstep/instance.md_ntwx f.write('nfile_cx=1 rec_start='+str(rec/10) +' rec_end='+str(rec)+' totraj='+str(nreplicas)+'\n') f.write('file_MD000\n') diff --git a/django_simple/todo/templates/details.html b/django_simple/todo/templates/details.html index b640281..6a7f396 100644 --- a/django_simple/todo/templates/details.html +++ b/django_simple/todo/templates/details.html @@ -175,10 +175,18 @@ Created {{ task.created_date }}
{{ task.md_nstep}}
  • +
    ntwe
    +
    {{ task.md_ntwe}}
    +
  • +
  • nstex
    {{ task.remd_nstex}}
  • +
    ntwx
    +
    {{ task.md_ntwx}}
    +
  • +
  • dt
    {{ task.md_dt}}
  • diff --git a/django_simple/todo/views.py b/django_simple/todo/views.py index 6f3a75e..2ec8735 100644 --- a/django_simple/todo/views.py +++ b/django_simple/todo/views.py @@ -250,6 +250,7 @@ def add_remd(request,task_id): task.md_start=form.cleaned_data["md_start"] task.myfile1=form.cleaned_data["file1"] task.md_pdbref=form.cleaned_data["md_pdbref"] + task.md_ntwx=task.remd_nstex task.md_seq="" if task.md_start == "pdbstart" or task.md_pdbref: @@ -313,6 +314,7 @@ def add_remd_a(request,task_id): task.md_scal_fric=form.cleaned_data["md_scal_fric"] task.remd_nrep=form.cleaned_data["remd_nrep"] task.remd_nstex=form.cleaned_data["remd_nstex"] + task.md_ntwx=form.cleaned_data["md_ntwx"] # task.remd_traj1file=form.cleaned_data["remd_traj1file"] # task.remd_rest1file=form.cleaned_data["remd_rest1file"] diff --git a/files/matplotlib_hist.py b/files/matplotlib_hist.py index 36b55aa..6bf943f 100755 --- a/files/matplotlib_hist.py +++ b/files/matplotlib_hist.py @@ -92,7 +92,7 @@ if ncolumns==14: yt=rms[r==i] xt=(s+r*max(s))[r==i] tt=x[r==i] - plt.scatter(xt,yt,c=tt,edgecolors='face',s=0.1,cmap=cm.rainbow) + plt.scatter(xt,yt,c=tt,edgecolors='face',s=0.1,cmap=cm.rainbow,vmin=Tremd[0],vmax=Tremd[-1]) plt.xlim(0,max(s)+max(s)*max(r)) plt.savefig('remd_step_rms.png') @@ -102,7 +102,7 @@ x,y,rms= np.loadtxt('file_wham.thermal',usecols=(0,6,4),unpack=True) plt.clf() plt.xlabel('bath temperature [K]') plt.ylabel('heat capacity') -plt.xlim(Tremd[1]-10, Tremd[-1]+10) +plt.xlim(Tremd[0], Tremd[-1]) plt.plot(x,y,'-',color=c) plt.savefig('remd_cv.png') -- 1.7.9.5