From: toshinagata1964 Date: Fri, 22 Jun 2012 04:09:38 +0000 (+0000) Subject: Include periodicity flags in the 'define unit cell' dialog X-Git-Tag: v1.0.2~403 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=cb702e6de390aaa3d762a2db12984b6b54a876f4;p=molby%2FMolby.git Include periodicity flags in the 'define unit cell' dialog git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/molby/trunk@233 a2be9bc6-48de-4e38-9406-05402d4bc13c --- diff --git a/MolLib/MD/MDForce.c b/MolLib/MD/MDForce.c index 795353e..96e9754 100644 --- a/MolLib/MD/MDForce.c +++ b/MolLib/MD/MDForce.c @@ -647,7 +647,7 @@ s_make_verlet_list(MDArena *arena) VecSub(rij, apj->r, api->r); /* Calculate the cell offset for the nearest neighbor */ - if (apj->periodic_exclude == 0 && cell != NULL) { + if (ndx + ndy + ndz != 0 && apj->periodic_exclude == 0 && cell != NULL) { count = s_enum_neighbors(arena, rij, limit); } else { static Int sZeros[3] = {0, 0, 0}; diff --git a/MolLib/Ruby_bind/ruby_md.c b/MolLib/Ruby_bind/ruby_md.c index 82cc646..b28e72b 100644 --- a/MolLib/Ruby_bind/ruby_md.c +++ b/MolLib/Ruby_bind/ruby_md.c @@ -322,8 +322,8 @@ s_EnergyOutputFreqSym, s_CoordFrameSym, s_TimestepSym, s_CutoffSym, s_ElectroCutoffSym, s_PairlistDistanceSym, s_TemperatureSym, s_TransientTempSym, s_AverageTempSym, s_AndersenFreqSym, s_AndersenCouplingSym, s_RandomSeedSym, s_DielectricSym, s_GradientConvergenceSym, s_CoordinateConvergenceSym, s_UseXplorShiftSym, -s_Scale14VdwSym, s_Scale14ElectSym, s_RelocateCenterSym, s_SurfaceProbeRadiusSym, -s_SurfaceTensionSym, s_SurfacePotentialFreqSym, s_UseGraphiteSym, +s_Scale14VdwSym, s_Scale14ElectSym, s_RelocateCenterSym, +s_SurfaceProbeRadiusSym, s_SurfaceTensionSym, s_SurfacePotentialFreqSym, s_UseGraphiteSym, s_AlchemicalLambdaSym, s_AlchemicalDeltaLambdaSym, s_AlchemicalEnergySym; struct s_MDArenaAttrDef { diff --git a/MolLib/cmdtool_stubs.c b/MolLib/cmdtool_stubs.c index 4299fab..7b490bb 100644 --- a/MolLib/cmdtool_stubs.c +++ b/MolLib/cmdtool_stubs.c @@ -262,6 +262,28 @@ MolActionCallback_registerUndo(Molecule *mol, MolAction *action) { } +void +MainView_setBackgroundColor(MainView *mview, float red, float green, float blue) +{ +} + +void +MainView_getBackgroundColor(const MainView *mview, float *rgb) +{ +} + +int +MainView_insertGraphic(MainView *mview, int index, const MainViewGraphic *graphic) +{ + return 0; +} + +int +MainView_removeGraphic(MainView *mview, int index) +{ + return 0; +} + int main(int argc, const char **argv) { diff --git a/Scripts/md.rb b/Scripts/md.rb index 61baeec..68839c0 100755 --- a/Scripts/md.rb +++ b/Scripts/md.rb @@ -185,7 +185,8 @@ class Molecule bx = Vector3D[h["b0"], h["b1"], h["b2"]] cx = Vector3D[h["c0"], h["c1"], h["c2"]] ox = Vector3D[h["o0"], h["o1"], h["o2"]] - @mol.set_box(ax, bx, cx, ox) + fx = [value("aflag").to_i, value("bflag").to_i, value("cflag").to_i] + @mol.set_box(ax, bx, cx, ox, fx) return @mol end # def action(item1) @@ -197,25 +198,30 @@ class Molecule # super # end box = @mol.box - layout(4, + layout(5, item(:text, :title=>"Unit cell:"), -1, -1, -1, + item(:text, :title=>"Enable"), item(:text, :title=>"origin"), item(:textfield, :width=>140, :tag=>"o0", :value=>(box ? box[3].x.to_s : "")), item(:textfield, :width=>140, :tag=>"o1", :value=>(box ? box[3].y.to_s : "")), item(:textfield, :width=>140, :tag=>"o2", :value=>(box ? box[3].z.to_s : "")), + -1, item(:text, :title=>"a-axis"), item(:textfield, :width=>140, :tag=>"a0", :value=>(box ? box[0].x.to_s : "")), item(:textfield, :width=>140, :tag=>"a1", :value=>(box ? box[0].y.to_s : "")), item(:textfield, :width=>140, :tag=>"a2", :value=>(box ? box[0].z.to_s : "")), + item(:checkbox, :title=>"", :tag=>"aflag", :value=>(box ? box[4][0] : 0)), item(:text, :title=>"b-axis"), item(:textfield, :width=>140, :tag=>"b0", :value=>(box ? box[1].x.to_s : "")), item(:textfield, :width=>140, :tag=>"b1", :value=>(box ? box[1].y.to_s : "")), item(:textfield, :width=>140, :tag=>"b2", :value=>(box ? box[1].z.to_s : "")), + item(:checkbox, :title=>"", :tag=>"bflag", :value=>(box ? box[4][1] : 0)), item(:text, :title=>"c-axis"), item(:textfield, :width=>140, :tag=>"c0", :value=>(box ? box[2].x.to_s : "")), item(:textfield, :width=>140, :tag=>"c1", :value=>(box ? box[2].y.to_s : "")), item(:textfield, :width=>140, :tag=>"c2", :value=>(box ? box[2].z.to_s : "")), + item(:checkbox, :title=>"", :tag=>"cflag", :value=>(box ? box[4][2] : 0)), item(:button, :title=>"Set", :action=>:set_box_value), item(:text, :title=>"(Ruby expressions are allowed as the values)"), -1, -1)