(function(K,L,M,H,N,m,B,n,p,r,O,P,y,Q,z,q,w,x,u,G,A,R,I,S,T,U,V,W,X,l,Y,Z,$,aa,ba,ca,da,s,ea,fa,ga,ha,ia,ja,ka,la,ma,na,oa,pa,qa,ra,sa,ta,ua,va,d,j){m("J.api");I(J.api,"MinimizerInterface");m("JM");n(["J.api.MinimizerInterface"],"JM.Minimizer","java.lang.Float java.util.Hashtable JU.AU $.BS $.Lst J.i18n.GT JM.MinAngle $.MinAtom $.MinBond $.MinTorsion $.MinimizationThread JM.FF.ForceFieldMMFF $.ForceFieldUFF JU.BSUtil $.Escape $.Logger".split(" "),function(){c$=r(function(){this.bonds=this.atoms=this.vwr=
null;this.rawBondCount=0;this.bsMinFixed=this.minPositions=this.minTorsions=this.minAngles=this.minBonds=this.minAtoms=null;this.bondCount=this.ac=0;this.partialCharges=this.atomMap=null;this.steps=50;this.crit=0.001;this.units="kJ/mol";this.pFF=null;this.ff="UFF";this.constraints=this.bsFixed=this.bsFixedDefault=this.bsAtoms=this.bsSelected=this.bsTaint=null;this.isSilent=!1;this.constraintMap=null;this.elemnoMax=0;this.$minimizationOn=!1;this.coordSaved=this.minimizationThread=null;p(this,arguments)},
JM,"Minimizer",null,J.api.MinimizerInterface);y(c$,function(){});j(c$,"setProperty",function(a,b){switch("ff        cancel    clear     constraintfixed     stop      vwr    ".indexOf(a)){case 0:this.ff.equals(b)||(this.setProperty("clear",null),this.ff=b);break;case 10:this.stopMinimization(!1);break;case 20:null!=this.minAtoms&&(this.stopMinimization(!1),this.clear());break;case 30:this.addConstraint(b);break;case 40:this.bsFixedDefault=b;break;case 50:this.stopMinimization(!0);break;case 60:this.vwr=
b}return this},"~S,~O");j(c$,"getProperty",function(a){return a.equals("log")?null==this.pFF?"":this.pFF.getLogData():null},"~S,~N");d(c$,"addConstraint",function(a){if(null!=a){var b=a[0],c=b[0];0==c?this.constraints=null:(null==this.constraints&&(this.constraints=new JU.Lst,this.constraintMap=new java.util.Hashtable),b[1]>b[c]&&(JU.AU.swapInt(b,1,c),4==c&&JU.AU.swapInt(b,2,3)),b=JU.Escape.eAI(b),c=this.constraintMap.get(b),null!=c?c[2]=a[2]:(this.constraintMap.put(b,a),this.constraints.addLast(a)))}},
"~A");d(c$,"clear",function(){this.setMinimizationOn(!1);this.bondCount=this.ac=0;this.bonds=this.atoms=null;this.rawBondCount=0;this.pFF=this.constraintMap=this.constraints=this.bsSelected=this.bsMinFixed=this.bsFixedDefault=this.bsFixed=this.bsAtoms=this.bsTaint=this.atomMap=this.coordSaved=this.partialCharges=this.minTorsions=this.minAngles=this.minBonds=this.minAtoms=null});j(c$,"minimize",function(a,b,c,e,f,g,h){this.isSilent=g||this.vwr.getBooleanProperty("minimizationSilent");this.setEnergyUnits();
2147483647==a&&(g=this.vwr.getP("minimizationSteps"),null!=g&&B(g,Integer)&&(a=g.intValue()));this.steps=a;!f&&null!=this.bsFixedDefault&&e.and(this.bsFixedDefault);0>=b&&(g=this.vwr.getP("minimizationCriterion"),null!=g&&B(g,Float)&&(b=g.floatValue()));this.crit=Math.max(b,1E-4);if(this.$minimizationOn)return!1;f=this.pFF;this.getForceField(h);if(null==this.pFF)return JU.Logger.error(J.i18n.GT.o(J.i18n.GT._("Could not get class for force field {0}"),h)),!1;JU.Logger.info("minimize: initializing "+
this.pFF.name+" (steps = "+a+" criterion = "+b+") ...");if(0>c.nextSetBit(0))return JU.Logger.error(J.i18n.GT._("No atoms selected -- nothing to do!")),!1;this.atoms=this.vwr.ms.at;this.bsAtoms=JU.BSUtil.copy(c);for(b=this.bsAtoms.nextSetBit(0);0<=b;b=this.bsAtoms.nextSetBit(b+1))0==this.atoms[b].getElementNumber()&&this.bsAtoms.clear(b);null!=e&&this.bsAtoms.or(e);this.ac=this.bsAtoms.cardinality();b=JU.BSUtil.areEqual(c,this.bsSelected);this.bsSelected=c;null!=f&&this.pFF!==f&&(b=!1);b||this.pFF.clear();
if((!b||!JU.BSUtil.areEqual(e,this.bsFixed))&&!this.setupMinimization())return this.clear(),!1;0<a&&(this.bsTaint=JU.BSUtil.copy(this.bsAtoms),JU.BSUtil.andNot(this.bsTaint,e),this.vwr.ms.setTaintedAtoms(this.bsTaint,2));null!=e&&(this.bsFixed=e);this.setAtomPositions();if(null!=this.constraints)for(b=this.constraints.size();0<=--b;){e=this.constraints.get(b);c=e[0];e=e[1];h=c[0]=Math.abs(c[0]);for(f=1;f<=h;f++){if(0>=a||!this.bsAtoms.get(c[f])){c[0]=-h;break}e[f-1]=this.atomMap[c[f]]}}this.pFF.setConstraints(this);
0>=a?this.getEnergyOnly():this.isSilent||!this.vwr.useMinimizationThread()?this.minimizeWithoutThread():this.setMinimizationOn(!0);return!0},"~N,~N,JU.BS,JU.BS,~B,~B,~S");d(c$,"setEnergyUnits",function(){this.units=this.vwr.g.energyUnits.equalsIgnoreCase("kcal")?"kcal":"kJ"});d(c$,"setupMinimization",function(){this.coordSaved=null;this.atomMap=q(this.atoms.length,0);this.minAtoms=Array(this.ac);this.elemnoMax=0;for(var a=new JU.BS,b=this.bsAtoms.nextSetBit(0),c=0;0<=b;b=this.bsAtoms.nextSetBit(b+
1),c++){var e=this.atoms[b];this.atomMap[b]=c;var f=this.atoms[b].getElementNumber();this.elemnoMax=Math.max(this.elemnoMax,f);a.set(f);this.minAtoms[c]=new JM.MinAtom(c,e,s(-1,[e.x,e.y,e.z]),this.ac);this.minAtoms[c].sType=e.getAtomName()}JU.Logger.info(J.i18n.GT.i(J.i18n.GT._("{0} atoms will be minimized."),this.ac));JU.Logger.info("minimize: getting bonds...");this.bonds=this.vwr.ms.bo;this.rawBondCount=this.vwr.ms.bondCount;this.getBonds();JU.Logger.info("minimize: getting angles...");this.getAngles();
JU.Logger.info("minimize: getting torsions...");this.getTorsions();return this.setModel(a)});d(c$,"setModel",function(a){return!this.pFF.setModel(a,this.elemnoMax)?(JU.Logger.error(J.i18n.GT.o(J.i18n.GT._("could not setup force field {0}"),this.ff)),this.ff.equals("MMFF")?(this.getForceField("UFF"),this.setModel(a)):!1):!0},"JU.BS");d(c$,"setAtomPositions",function(){for(var a=0;a<this.ac;a++)this.minAtoms[a].set();this.bsMinFixed=null;if(null!=this.bsFixed){this.bsMinFixed=new JU.BS;for(var a=this.bsAtoms.nextSetBit(0),
b=0;0<=a;a=this.bsAtoms.nextSetBit(a+1),b++)this.bsFixed.get(a)&&this.bsMinFixed.set(b)}});d(c$,"getBonds",function(){var a=new JU.Lst;this.bondCount=0;for(var b,c,e=0;e<this.rawBondCount;e++){var f=this.bonds[e];if(this.bsAtoms.get(b=f.atom1.i)&&this.bsAtoms.get(c=f.atom2.i)){if(c<b){var g=b;b=c;c=g}f=f.getCovalentOrder();switch(f){case 0:continue;case 1:case 2:case 3:break;case 515:f=5;break;default:f=1}a.addLast(new JM.MinBond(e,this.bondCount++,this.atomMap[b],this.atomMap[c],f,0,null))}}this.minBonds=
Array(this.bondCount);for(e=0;e<this.bondCount;e++)f=this.minBonds[e]=a.get(e),b=f.data[0],c=f.data[1],this.minAtoms[b].addBond(f,c),this.minAtoms[c].addBond(f,b);for(e=0;e<this.ac;e++)this.minAtoms[e].getBondedAtomIndexes()});d(c$,"getAngles",function(){for(var a=new JU.Lst,b,c,e=0;e<this.bondCount;e++){b=this.minBonds[e];var f=b.data[0],g=b.data[1];if(1<this.minAtoms[g].nBonds){b=this.minAtoms[g].getBondedAtomIndexes();for(var h=b.length;0<=--h;)if((c=b[h])>f)a.addLast(new JM.MinAngle(q(-1,[f,g,
c,e,this.minAtoms[g].getBondIndex(h)]))),this.minAtoms[f].bsVdw.clear(c)}if(1<this.minAtoms[f].nBonds){b=this.minAtoms[f].getBondedAtomIndexes();for(h=b.length;0<=--h;)if((c=b[h])<g&&c>f)a.addLast(new JM.MinAngle(q(-1,[c,f,g,this.minAtoms[f].getBondIndex(h),e]))),this.minAtoms[c].bsVdw.clear(g)}}this.minAngles=a.toArray(Array(a.size()));JU.Logger.info(this.minAngles.length+" angles")});d(c$,"getTorsions",function(){for(var a=new JU.Lst,b,c=this.minAngles.length;0<=--c;){var e=this.minAngles[c].data,
f=e[0],g=e[1],h=e[2],d;if(h>g&&1<this.minAtoms[h].nBonds){d=this.minAtoms[h].getBondedAtomIndexes();for(var v=0;v<d.length;v++)b=d[v],b!=f&&b!=g&&(a.addLast(new JM.MinTorsion(q(-1,[f,g,h,b,e[3],e[4],this.minAtoms[h].getBondIndex(v)]))),this.minAtoms[Math.min(f,b)].bs14.set(Math.max(f,b)))}if(f>g&&1!=this.minAtoms[f].nBonds){d=this.minAtoms[f].getBondedAtomIndexes();for(v=0;v<d.length;v++)b=d[v],b!=h&&b!=g&&(a.addLast(new JM.MinTorsion(q(-1,[h,g,f,b,e[4],e[3],this.minAtoms[f].getBondIndex(v)]))),this.minAtoms[Math.min(h,
b)].bs14.set(Math.max(h,b)))}}this.minTorsions=a.toArray(Array(a.size()));JU.Logger.info(this.minTorsions.length+" torsions")});d(c$,"getForceField",function(a){a.startsWith("MMFF")&&(a="MMFF");if(null==this.pFF||!a.equals(this.ff))a.equals("UFF")?this.pFF=new JM.FF.ForceFieldUFF(this):a.equals("MMFF")?this.pFF=new JM.FF.ForceFieldMMFF(this):(this.pFF=new JM.FF.ForceFieldUFF(this),a="UFF"),this.ff=a,this.vwr.setStringProperty("_minimizationForceField",a);return this.pFF},"~S");j(c$,"minimizationOn",
function(){return this.$minimizationOn});j(c$,"getThread",function(){return this.minimizationThread});d(c$,"setMinimizationOn",function(a){(this.$minimizationOn=a)?null==this.minimizationThread&&(this.minimizationThread=new JM.MinimizationThread,this.minimizationThread.setManager(this,this.vwr,null),this.minimizationThread.start()):null!=this.minimizationThread&&(this.minimizationThread=null)},"~B");d(c$,"getEnergyOnly",function(){null==this.pFF||null==this.vwr||(this.pFF.steepestDescentInitialize(this.steps,
this.crit),this.vwr.setFloatProperty("_minimizationEnergyDiff",0),this.reportEnergy(),this.vwr.setStringProperty("_minimizationStatus","calculate"),this.vwr.notifyMinimizationStatus())});d(c$,"reportEnergy",function(){this.vwr.setFloatProperty("_minimizationEnergy",this.pFF.toUserUnits(this.pFF.getEnergy()))});j(c$,"startMinimization",function(){try{JU.Logger.info("minimizer: startMinimization"),this.vwr.setIntProperty("_minimizationStep",0),this.vwr.setStringProperty("_minimizationStatus","starting"),
this.vwr.setFloatProperty("_minimizationEnergy",0),this.vwr.setFloatProperty("_minimizationEnergyDiff",0),this.vwr.notifyMinimizationStatus(),this.vwr.stm.saveCoordinates("minimize",this.bsTaint),this.pFF.steepestDescentInitialize(this.steps,this.crit),this.reportEnergy(),this.saveCoordinates()}catch(a){if(z(a,Exception))return JU.Logger.error("minimization error vwr="+this.vwr+" pFF = "+this.pFF),!1;throw a;}return this.$minimizationOn=!0});j(c$,"stepMinimization",function(){if(!this.$minimizationOn)return!1;
var a=!this.isSilent&&this.vwr.getBooleanProperty("minimizationRefresh");this.vwr.setStringProperty("_minimizationStatus","running");var b=this.pFF.steepestDescentTakeNSteps(1),c=this.pFF.getCurrentStep();this.vwr.setIntProperty("_minimizationStep",c);this.reportEnergy();this.vwr.setFloatProperty("_minimizationEnergyDiff",this.pFF.toUserUnits(this.pFF.getEnergyDiff()));this.vwr.notifyMinimizationStatus();a&&(this.updateAtomXYZ(),this.vwr.refresh(3,"minimization step "+c));return b});j(c$,"endMinimization",
function(){this.updateAtomXYZ();this.setMinimizationOn(!1);var a=this.pFF.detectExplosion();a&&this.restoreCoordinates();this.vwr.setIntProperty("_minimizationStep",this.pFF.getCurrentStep());this.reportEnergy();this.vwr.setStringProperty("_minimizationStatus",a?"failed":"done");this.vwr.notifyMinimizationStatus();this.vwr.refresh(3,"Minimizer:done"+(a?" EXPLODED":"OK"));JU.Logger.info("minimizer: endMinimization")});d(c$,"saveCoordinates",function(){null==this.coordSaved&&(this.coordSaved=s(this.ac,
3,0));for(var a=0;a<this.ac;a++)for(var b=0;3>b;b++)this.coordSaved[a][b]=this.minAtoms[a].coord[b]});d(c$,"restoreCoordinates",function(){if(null!=this.coordSaved){for(var a=0;a<this.ac;a++)for(var b=0;3>b;b++)this.minAtoms[a].coord[b]=this.coordSaved[a][b];this.updateAtomXYZ()}});d(c$,"stopMinimization",function(a){this.$minimizationOn&&(this.setMinimizationOn(!1),a?this.endMinimization():this.restoreCoordinates())},"~B");d(c$,"updateAtomXYZ",function(){if(!(0>=this.steps)){for(var a=0;a<this.ac;a++){var b=
this.minAtoms[a],c=b.atom;c.x=b.coord[0];c.y=b.coord[1];c.z=b.coord[2]}this.vwr.refreshMeasures(!1)}});d(c$,"minimizeWithoutThread",function(){if(this.startMinimization()){for(;this.stepMinimization(););this.endMinimization()}});d(c$,"report",function(a,b){this.isSilent?JU.Logger.info(a):b?this.vwr.showString(a,!1):this.vwr.scriptEcho(a)},"~S,~B");j(c$,"calculatePartialCharges",function(a,b,c,e){var f=new JM.FF.ForceFieldMMFF(this);f.setArrays(c,e,a,b,!0,!0);this.vwr.setAtomProperty(e,1087375361,
0,0,null,null,f.getAtomTypeDescriptions());this.vwr.setAtomProperty(e,1112541195,0,0,null,f.getPartialCharges(),null)},"~A,~N,~A,JU.BS")});m("JM");c$=r(function(){this.data=null;this.type=0;this.ddata=this.key=null;p(this,arguments)},JM,"MinObject");j(c$,"toString",function(){return this.type+" "+this.data[0]+","+this.data[1]+(2<this.data.length?","+this.data[2]+","+this.data[3]:"")+" "+JM.MinObject.decodeKey(this.key)});c$.getKey=d(c$,"getKey",function(a,b,c,e,f){return Integer.$valueOf(((((f<<7)+
e<<7)+c<<7)+b<<4)+a)},"~N,~N,~N,~N,~N");c$.decodeKey=d(c$,"decodeKey",function(a){if(null==a)return null;var b=a.intValue();a=b&15;var b=b>>4,c=b&127,b=b>>7,e=b&127,b=b>>7,f=b&127,b=b>>7&127;return(0>a?a+": ":"")+(10>c?"  ":" ")+c+(10>e?"  ":" ")+e+(10>f?"  ":" ")+f+(120<b?"":(10>b?"  ":" ")+b)},"Integer");m("JM");n(["JM.MinObject"],"JM.MinAngle",null,function(){c$=r(function(){this.sbType=0;this.sbKey=null;this.ka=0;this.theta0=NaN;p(this,arguments)},JM,"MinAngle",JM.MinObject);y(c$,function(a){A(this,
JM.MinAngle,[]);this.data=a},"~A")});m("JM");n(["JU.BS","$.Lst"],"JM.MinAtom",null,function(){c$=r(function(){this.index=0;this.ffAtomType=this.atom=this.sType=null;this.ffType=0;this.bonds=this.force=this.coord=this.vdwKey=null;this.partialCharge=this.hCount=this.nBonds=0;this.bondedAtoms=this.bs14=this.bsVdw=null;p(this,arguments)},JM,"MinAtom");G(c$,function(){this.coord=s(3,0);this.force=s(3,0);this.bonds=new JU.Lst;this.bsVdw=new JU.BS;this.bs14=new JU.BS});j(c$,"toString",function(){return"#"+
this.index+" "+this.sType});y(c$,function(a,b,c,e){this.index=a;this.atom=b;this.coord=c;this.bsVdw.setBits(a+1,e);this.bsVdw.clear(a);this.hCount=b.getCovalentHydrogenCount()},"~N,JM.Atom,~A,~N");d(c$,"set",function(){this.coord[0]=this.atom.x;this.coord[1]=this.atom.y;this.coord[2]=this.atom.z});d(c$,"getBondTo",function(a){this.getBondedAtomIndexes();for(var b=0;b<this.nBonds;b++)if(this.bondedAtoms[b]==a)return this.bonds.get(b);return null},"~N");d(c$,"getBondedAtomIndexes",function(){if(null==
this.bondedAtoms){this.bondedAtoms=q(this.nBonds,0);for(var a=this.nBonds;0<=--a;)this.bondedAtoms[a]=this.bonds.get(a).getOtherAtom(this.index)}return this.bondedAtoms});d(c$,"getIdentity",function(){return this.atom.getInfo()});d(c$,"addBond",function(a,b){this.bonds.addLast(a);this.nBonds++;this.bsVdw.clear(b)},"JM.MinBond,~N");d(c$,"getBondIndex",function(a){return this.bonds.get(a).index},"~N");c$.isLinear=d(c$,"isLinear",function(a){switch(a.ffType){case 4:case 53:case 61:return!0}return!1},
"JM.MinAtom")});m("JM");n(["JM.MinObject"],"JM.MinBond",null,function(){c$=r(function(){this.order=this.index=this.rawIndex=0;this.isAmide=this.isAromatic=!1;p(this,arguments)},JM,"MinBond",JM.MinObject);y(c$,function(a,b,c,e,f,g,h){A(this,JM.MinBond,[]);this.rawIndex=a;this.index=b;this.type=g;this.data=q(-1,[c,e]);this.order=f;this.key=h},"~N,~N,~N,~N,~N,~N,Integer");d(c$,"getOtherAtom",function(a){return this.data[this.data[0]==a?1:0]},"~N")});m("JM");n(["JM.MinObject"],"JM.MinTorsion",null,function(){c$=
u(JM,"MinTorsion",JM.MinObject);y(c$,function(a){A(this,JM.MinTorsion,[]);this.data=a},"~A")});m("JM");n(null,"JM.Util",["java.lang.Double","java.util.Random"],function(){c$=u(JM,"Util");c$.sub=d(c$,"sub",function(a,b,c){c.set(a[0]-b[0],a[1]-b[1],a[2]-b[2])},"~A,~A,JU.V3d");c$.putCoord=d(c$,"putCoord",function(a,b){b[0]=a.x;b[1]=a.y;b[2]=a.z},"JU.V3d,~A");c$.distance2=d(c$,"distance2",function(a,b){var c=a[0]-b[0],e=a[1]-b[1],f=a[2]-b[2];return c*c+e*e+f*f},"~A,~A");c$.distance2V=d(c$,"distance2V",
function(a,b){var c=a.x-b.x,e=a.y-b.y,f=a.z-b.z;return c*c+e*e+f*f},"JU.V3d,JU.V3d");c$.getAngleRadiansABC=d(c$,"getAngleRadiansABC",function(a,b,c){var e=JM.Util.distance2(a,b);b=JM.Util.distance2(b,c);a=JM.Util.distance2(a,c);return JM.Util.isNearZero2(e,0.001)||JM.Util.isNearZero2(b,0.001)?0:Math.acos((e+b-a)/2/Math.sqrt(e*b))},"~A,~A,~A");c$.isApprox=d(c$,"isApprox",function(a,b,c){return JM.Util.distance2V(a,b)<=c*c*Math.min(a.lengthSquared(),b.lengthSquared())},"JU.V3d,JU.V3d,~N");c$.canBeSquared=
d(c$,"canBeSquared",function(a){return 0==a?!0:1E150>(a=Math.abs(a))&&1E-150<a},"~N");c$.isNegligible=d(c$,"isNegligible",function(a,b){return JM.Util.isNegligible3(a,b,1E-11)},"~N,~N");c$.isFinite=d(c$,"isFinite",function(a){return!Double.isInfinite(a)&&!Double.isNaN(a)},"~N");c$.isNegligible3=d(c$,"isNegligible3",function(a,b,c){return Math.abs(a)<=c*Math.abs(b)},"~N,~N,~N");c$.isNear=d(c$,"isNear",function(a,b){return JM.Util.isNear3(a,b,2E-6)},"~N,~N");c$.isNear3=d(c$,"isNear3",function(a,b,c){return Math.abs(a-
b)<c},"~N,~N,~N");c$.isNearZero=d(c$,"isNearZero",function(a){return JM.Util.isNearZero2(a,2E-6)},"~N");c$.isNearZero2=d(c$,"isNearZero2",function(a,b){return Math.abs(a)<b},"~N,~N");c$.canBeNormalized=d(c$,"canBeNormalized",function(a){return 0==a.x&&0==a.y&&0==a.z?!1:JM.Util.canBeSquared(a.x)&&JM.Util.canBeSquared(a.y)&&JM.Util.canBeSquared(a.z)},"JU.V3d");c$.pointPlaneAngleRadians=d(c$,"pointPlaneAngleRadians",function(a,b,c,e,f,g,h,d){f.sub2(b,c);g.sub2(b,e);h.cross(f,g);g.add(f);f.sub2(b,a);
a=d?JM.Util.vectorAngleRadians(g,f):3.141592653589793;f=JM.Util.vectorAngleRadians(h,f);1.5707963267948966<f&&(f=3.141592653589793-f);return 1.5707963267948966+(1.5707963267948966<a?-f:f)},"JU.V3d,JU.V3d,JU.V3d,JU.V3d,JU.V3d,JU.V3d,JU.V3d,~B");c$.vectorAngleRadians=d(c$,"vectorAngleRadians",function(a,b){var c=a.length(),e=b.length();return JM.Util.isNearZero(c)||JM.Util.isNearZero(e)?0:Math.acos(a.dot(b)/(c*e))},"JU.V3d,JU.V3d");c$.getTorsionAngleRadians=d(c$,"getTorsionAngleRadians",function(a,
b,c,e,f,g,h){JM.Util.sub(b,a,f);JM.Util.sub(c,b,g);g.normalize();f.cross(f,g);JM.Util.sub(e,c,h);h.cross(g,h);a=f.dot(h);f.cross(h,f);return Math.atan2(-g.dot(f),a)},"~A,~A,~A,~A,JU.V3d,JU.V3d,JU.V3d");c$.restorativeForceAndDistance=d(c$,"restorativeForceAndDistance",function(a,b,c){c.sub2(a,b);var e=c.length();0.1>e&&(JM.Util.randomizeUnitVector(c),e=0.1);c.normalize();a.setT(c);a.scale(-1);b.setT(c);return e},"JU.V3d,JU.V3d,JU.V3d");c$.randomizeUnitVector=d(c$,"randomizeUnitVector",function(a){var b=
new java.util.Random,c;do a.set(b.nextFloat()-0.5,b.nextFloat()-0.5,b.nextFloat()-0.5),c=a.lengthSquared();while(1<c||1E-4>c);a.normalize()},"JU.V3d");c$.restorativeForceAndAngleRadians=d(c$,"restorativeForceAndAngleRadians",function(a,b,c){a.sub(b);c.sub(b);var e=a.length(),f=c.length();if(JM.Util.isNearZero(e)||JM.Util.isNearZero(f))return a.set(0,0,0),b.set(0,0,0),c.set(0,0,0),0;e=1/e;f=1/f;a.scale(e);c.scale(f);b.cross(a,c);var g=b.length();if(JM.Util.isNearZero(g))return a.set(0,0,0),b.set(0,
0,0),c.set(0,0,0),0;b.scale(1/g);g=a.dot(c);g=1<g?0:-1>g?3.141592653589793:Math.acos(g);a.cross(a,b);a.normalize();b.cross(c,b);b.normalize();a.scale(-e);b.scale(f);c.setT(b);b.add(a);b.scale(-1);return g},"JU.V3d,JU.V3d,JU.V3d");c$.restorativeForceAndOutOfPlaneAngleRadians=d(c$,"restorativeForceAndOutOfPlaneAngleRadians",function(a,b,c,e,f,g,h){a.sub2(a,b);c.sub2(c,b);e.sub2(e,b);var d=a.length(),v=c.length(),j=e.length();if(JM.Util.isNearZero(d)||JM.Util.isNearZero(v)||JM.Util.isNearZero(j))return a.set(0,
0,0),b.set(0,0,0),c.set(0,0,0),e.set(0,0,0),0;a.normalize();c.normalize();e.normalize();var l=a.dot(c),k=Math.acos(l);if(JM.Util.isNearZero(k)||JM.Util.isNearZero(Math.abs(k-3.141592653589793)))return a.set(0,0,0),b.set(0,0,0),c.set(0,0,0),e.set(0,0,0),0;k=1/Math.sin(k);f.cross(a,c);g.cross(c,e);h.cross(e,a);var q=f.dot(e)*k,m=Math.asin(q);if(1E-4>Math.cos(m)||JM.Util.isNearZero(m)||JM.Util.isNearZero(Math.abs(m-3.141592653589793)))return a.set(0,0,0),b.set(0,0,0),c.set(0,0,0),e.set(0,0,0),m;e.scaleAdd(-q/
k,e,f);e.scale(k/j);b.setT(a);a.scaleAdd(-l,c,a);a.scaleAdd(-q*k,a,g);a.scale(k/d);c.scaleAdd(-l,b,c);c.scaleAdd(-q*k,c,h);c.scale(k/v);b.setT(a);b.add(c);b.add(e);b.scale(-1);return m},"JU.V3d,JU.V3d,JU.V3d,JU.V3d,JU.V3d,JU.V3d,JU.V3d");c$.restorativeForceAndTorsionAngleRadians=d(c$,"restorativeForceAndTorsionAngleRadians",function(a,b,c,e){a.sub2(b,a);b.sub2(c,b);c.sub2(e,c);var f=a.length(),g=b.length(),h=c.length();if(JM.Util.isNearZero(f)||JM.Util.isNearZero(g)||JM.Util.isNearZero(h))return a.set(0,
0,0),b.set(0,0,0),c.set(0,0,0),e.set(0,0,0),0;var d=JM.Util.vectorAngleRadians(a,b),v=Math.sin(d),j=Math.cos(d),d=JM.Util.vectorAngleRadians(b,c),l=Math.sin(d),d=Math.cos(d);a.normalize();b.normalize();c.normalize();a.cross(a,b);e.cross(b,c);c.cross(a,e);var k=-Math.atan2(c.dot(b),a.dot(e));a.scale(1/f/v/v);e.scale(-1/h/l/l);b.setT(a);b.scale(-f/g*j-1);c.setT(e);c.scale(-h/g*d);b.sub(c);c.setT(a);c.add(b);c.add(e);c.scale(-1);return k},"JU.V3d,JU.V3d,JU.V3d,JU.V3d");w(c$,"RAD_TO_DEG",57.29577951308232,
"DEG_TO_RAD",0.017453292519943295,"max_squarable_double",1E150,"min_squarable_double",1E-150)});m("JM.FF");c$=r(function(){this.elemNo=0;this.smartsCode=this.descr=null;this.fcadj=this.formalCharge=this.hType=this.mmType=0;this.pilp=this.arom=this.sbmb=!1;this.val=this.mltb=0;p(this,arguments)},JM.FF,"AtomType");y(c$,function(a,b,c,e,f,g,h){this.elemNo=a;this.mmType=b;this.hType=c;this.formalCharge=e;this.val=f;this.descr=g;this.smartsCode=h},"~N,~N,~N,~N,~N,~S,~S");m("JM.FF");n(null,"JM.FF.ForceField",
"java.lang.Float JU.PT JM.Util JU.Logger JV.FileManager $.Viewer".split(" "),function(){c$=r(function(){this.calc=this.name=null;this.stepMax=this.currentStep=this.dE=this.e0=this.criterion=0;this.coordSaved=null;this.minBondCount=this.minAtomCount=0;this.minimizer=this.bsFixed=this.minPositions=this.minTorsions=this.minAngles=this.minBonds=this.minAtoms=null;p(this,arguments)},JM.FF,"ForceField");d(c$,"setModelFields",function(){this.minAtoms=this.minimizer.minAtoms;this.minBonds=this.minimizer.minBonds;
this.minAngles=this.minimizer.minAngles;this.minTorsions=this.minimizer.minTorsions;this.bsFixed=this.minimizer.bsMinFixed;this.minAtomCount=this.minAtoms.length;this.minBondCount=this.minBonds.length});d(c$,"setConstraints",function(a){this.bsFixed=a.bsMinFixed;this.calc.setConstraints(a.constraints);this.coordSaved=null},"JM.Minimizer");d(c$,"steepestDescentInitialize",function(a,b){this.stepMax=a;this.criterion=b/this.toUserUnits(1);this.currentStep=0;this.clearForces();this.calc.setLoggingEnabled(!0);
this.calc.setLoggingEnabled(0==a||JU.Logger.isActiveLevel(6));var c=this.name+" "+this.calc.getDebugHeader(-1)+"Jmol Minimization Version "+JV.Viewer.getJmolVersion()+"\n";this.calc.appendLogData(c);JU.Logger.info(c);this.calc.getConstraintList();this.calc.loggingEnabled&&this.calc.appendLogData(this.calc.getAtomList("S T E E P E S T   D E S C E N T"));this.dE=0;this.calc.setPreliminary(0<a);this.e0=this.energyFull(!1,!1);c=JU.PT.sprintf(" Initial "+this.name+" E = %10.3f "+this.minimizer.units+" criterion = %8.6f max steps = "+
a,"ff",l(-1,[Float.$valueOf(this.toUserUnits(this.e0)),Float.$valueOf(this.toUserUnits(b))]));this.minimizer.report(c,!1);this.calc.appendLogData(c)},"~N,~N");d(c$,"clearForces",function(){for(var a=0;a<this.minAtomCount;a++)this.minAtoms[a].force[0]=this.minAtoms[a].force[1]=this.minAtoms[a].force[2]=0});d(c$,"steepestDescentTakeNSteps",function(a){if(0==this.stepMax)return!1;for(var b=!0,c=1;c<=a;c++){this.currentStep++;this.calc.setSilent(!0);for(var e=0;e<this.minAtomCount;e++)(null==this.bsFixed||
!this.bsFixed.get(e))&&this.setForcesUsingNumericalDerivative(this.minAtoms[e],1);this.linearSearch();this.calc.setSilent(!1);this.calc.loggingEnabled&&this.calc.appendLogData(this.calc.getAtomList("S T E P    "+this.currentStep));e=this.energyFull(!1,!1);this.dE=e-this.e0;var f=JM.Util.isNear3(e,this.e0,this.criterion);if(f||0==this.currentStep%10||this.stepMax<=this.currentStep){var g=JU.PT.sprintf(this.name+" Step %-4d E = %10.6f    dE = %8.6f ","Fi",l(-1,[x(-1,[e,this.dE,this.criterion]),Integer.$valueOf(this.currentStep)]));
this.minimizer.report(g,!1);this.calc.appendLogData(g)}this.e0=e;if(f||this.stepMax<=this.currentStep)return this.calc.loggingEnabled&&this.calc.appendLogData(this.calc.getAtomList("F I N A L  G E O M E T R Y")),f&&(g=JU.PT.formatStringF("\n    "+this.name+" STEEPEST DESCENT HAS CONVERGED: E = %8.5f "+this.minimizer.units+" after "+this.currentStep+" steps","f",this.toUserUnits(e)),this.calc.appendLogData(g),this.minimizer.report(g,!0),JU.Logger.info(g)),!1;b&&2<=this.getNormalizedDE()&&(this.calc.setPreliminary(b=
!1),this.e0=this.energyFull(!1,!1))}return!0},"~N");d(c$,"getEnergies",function(a,b){if(0!=(a&1))return this.energyFull(b,!0);var c=0;0!=(a&2)&&(c+=this.energyBond(b));0!=(a&4)&&(c+=this.energyAngle(b));0!=(a&8)&&(c+=this.energyStretchBend(b));0!=(a&32)&&(c+=this.energyOOP(b));0!=(a&16)&&(c+=this.energyTorsion(b));0!=(a&64)&&(c+=this.energyVDW(b));0!=(a&128)&&(c+=this.energyES(b));return c},"~N,~B");d(c$,"setForcesUsingNumericalDerivative",function(a,b){a.force[0]=-this.getDE(a,b,0,1E-5);a.force[1]=
-this.getDE(a,b,1,1E-5);a.force[2]=-this.getDE(a,b,2,1E-5)},"JM.MinAtom,~N");d(c$,"getDE",function(a,b,c,e){a.coord[c]+=e;b=this.getEnergies(b,!1);a.coord[c]-=e;return(b-this.e0)/e},"JM.MinAtom,~N,~N,~N");d(c$,"energyFull",function(a,b){var c;a&&this.clearForces();c=this.energyBond(a)+this.energyAngle(a)+this.energyTorsion(a)+this.energyStretchBend(a)+this.energyOOP(a)+this.energyVDW(a)+this.energyES(a);!b&&this.calc.loggingEnabled&&this.calc.appendLogData(JU.PT.sprintf("\nTOTAL %s ENERGY = %8.3f %s/mol\n",
"sfs",l(-1,[this.name,Float.$valueOf(this.toUserUnits(c)),this.minimizer.units])));return c},"~B,~B");d(c$,"energyStretchBend",function(a){return this.calc.energyStretchBend(a)},"~B");d(c$,"energyBond",function(a){return this.calc.energyBond(a)},"~B");d(c$,"energyAngle",function(a){return this.calc.energyAngle(a)},"~B");d(c$,"energyTorsion",function(a){return this.calc.energyTorsion(a)},"~B");d(c$,"energyOOP",function(a){return this.calc.energyOOP(a)},"~B");d(c$,"energyVDW",function(a){return this.calc.energyVDW(a)},
"~B");d(c$,"energyES",function(a){return this.calc.energyES(a)},"~B");d(c$,"linearSearch",function(){for(var a=0.23,b=this.energyFull(!1,!0),c=0;10>c;c++){this.saveCoordinates();for(var e=0;e<this.minAtomCount;++e)if(null==this.bsFixed||!this.bsFixed.get(e)){var f=this.minAtoms[e].force,g=this.minAtoms[e].coord,h=f[0]*f[0]+f[1]*f[1]+f[2]*f[2];h>0.09/a/a&&(h=0.3/Math.sqrt(h)/a,f[0]*=h,f[1]*=h,f[2]*=h);for(h=0;3>h;++h)if(JM.Util.isFinite(f[h])){var d=f[h]*a;g[h]=0.3<d?g[h]+0.3:-0.3>d?g[h]-0.3:g[h]+
d}}e=this.energyFull(!1,!0);if(JM.Util.isNear3(e,b,0.001))break;e>b?(a*=0.1,this.restoreCoordinates()):e<b&&(b=e,a*=2.15,1<a&&(a=1))}});d(c$,"saveCoordinates",function(){null==this.coordSaved&&(this.coordSaved=s(this.minAtomCount,3,0));for(var a=0;a<this.minAtomCount;a++)for(var b=0;3>b;b++)this.coordSaved[a][b]=this.minAtoms[a].coord[b]});d(c$,"restoreCoordinates",function(){for(var a=0;a<this.minAtomCount;a++)for(var b=0;3>b;b++)this.minAtoms[a].coord[b]=this.coordSaved[a][b]});d(c$,"detectExplosion",
function(){for(var a=0;a<this.minAtomCount;a++)for(var b=this.minAtoms[a],c=0;3>c;c++)if(!JM.Util.isFinite(b.coord[c]))return!0;for(a=0;a<this.minBondCount;a++)if(b=this.minBonds[a],900<JM.Util.distance2(this.minAtoms[b.data[0]].coord,this.minAtoms[b.data[1]].coord))return!0;return!1});d(c$,"getCurrentStep",function(){return this.currentStep});d(c$,"getEnergy",function(){return this.e0});d(c$,"getAtomList",function(a){return this.calc.getAtomList(a)},"~S");d(c$,"getEnergyDiff",function(){return this.dE});
d(c$,"getLogData",function(){return this.calc.getLogData()});d(c$,"getNormalizedDE",function(){return Math.abs(this.dE/this.criterion)});d(c$,"toUserUnits",function(a){return this.toUnits(a,this.calc.getUnits())},"~N");d(c$,"toUnits",function(a,b){return b.equalsIgnoreCase(this.minimizer.units)?a:a*(this.minimizer.units.equals("kJ")?4.1868:0.23884589662749595)},"~N,~S");d(c$,"log",function(a){this.calc.appendLogData(a)},"~S");d(c$,"getBufferedReader",function(a){return JV.FileManager.getBufferedReaderForResource(this.minimizer.vwr,
this,"JM/FF/","data/"+a)},"~S");w(c$,"ENERGY",1,"EBOND",2,"EANGLE",4,"ESTRBND",8,"ETORSION",16,"EOOP",32,"EVDW",64,"EELECTROSTATIC",128,"ABI_IJ",3,"ABI_JK",4,"TBI_AB",4,"TBI_BC",5,"TBI_CD",6,"R3",0,"R4",1,"R5",2,"R56",3)});m("JM.FF");n(["JM.FF.ForceField"],"JM.FF.ForceFieldMMFF","java.lang.Float java.util.Hashtable JU.AU $.BS $.Lst $.PT JM.MinAtom $.MinObject JM.FF.AtomType $.CalculationsMMFF JU.BSUtil $.Elements $.Escape $.Logger JV.JmolAsyncException".split(" "),function(){c$=r(function(){this.useEmpiricalRules=
!0;this.typeData=this.line=this.vRings=this.rawMMFF94Charges=this.rawBondTypes=this.rawAtomTypes=null;p(this,arguments)},JM.FF,"ForceFieldMMFF",JM.FF.ForceField);G(c$,function(){this.typeData=q(4,0)});d(c$,"getAtomTypeDescriptions",function(){return JM.FF.ForceFieldMMFF.getAtomTypeDescs(this.rawAtomTypes)});d(c$,"getPartialCharges",function(){return this.rawMMFF94Charges});y(c$,function(a){A(this,JM.FF.ForceFieldMMFF,[]);this.minimizer=a;this.name="MMFF";this.getParameters()},"JM.Minimizer");j(c$,
"clear",function(){});j(c$,"setModel",function(){var a=this.minimizer;if(!this.setArrays(a.atoms,a.bsAtoms,a.bonds,a.rawBondCount,!1,!1))return!1;this.setModelFields();this.fixTypes();this.calc=new JM.FF.CalculationsMMFF(this,JM.FF.ForceFieldMMFF.ffParams,this.minAtoms,this.minBonds,this.minAngles,this.minTorsions,this.minPositions,this.minimizer.constraints);this.calc.setLoggingEnabled(!0);return this.calc.setupCalculations()},"JU.BS,~N");d(c$,"setArrays",function(a,b,c,e,f,g){var h=this.minimizer;
this.vRings=JU.AU.createArrayOfArrayList(4);this.rawAtomTypes=JM.FF.ForceFieldMMFF.setAtomTypes(a,b,h.vwr.getSmilesMatcher(),this.vRings,g);if(null==this.rawAtomTypes)return!1;this.rawBondTypes=this.setBondTypes(c,e,b);this.rawMMFF94Charges=JM.FF.ForceFieldMMFF.calculatePartialCharges(c,this.rawBondTypes,a,this.rawAtomTypes,b,f);return!0},"~A,JU.BS,~A,~N,~B,~B");d(c$,"getParameters",function(){if(null==JM.FF.ForceFieldMMFF.ffParams){this.getAtomTypes();var a=new java.util.Hashtable;JU.Logger.debugging&&
JU.Logger.debug("reading data from mmff94.par.txt");var b=null,c=null;try{for(var b=this.getBufferedReader("mmff94.par.txt"),e=0,f=0;;){for(;0>(e=(c=b.readLine()).indexOf(".PAR")););if(1>(f=JM.FF.ForceFieldMMFF.types[H("END.BCI.CHG.ANG.NDK.OND.OOP.TBN.FSB.TOR.VDW.".indexOf(c.substring(e-3,e+1))/4)]))break;this.readParams(b,f,a)}b.close()}catch(g){if(z(g,JV.JmolAsyncException))throw new JV.JmolAsyncException(g.getFileName());if(z(g,Exception))System.err.println("Exception "+g.toString()+" in getResource mmff94.par.txt line="+
c);else throw g;}finally{try{b.close()}catch(h){if(!z(h,Exception))throw h;}}JM.FF.ForceFieldMMFF.ffParams=a}});d(c$,"readParams",function(a,b,c){var e=null,f=0,g=127,h=127,d=127,v=0;switch(b){case 34:d=124;break;case 21:d=125;break;case 546:d=123;v=0;break;case 13:v=6;break;case 1:v=0;break;case 37:d=126;v=0;break;case 17:d=122,v=0}for(;!a.readLine().startsWith("*"););for(;(this.line=a.readLine()).startsWith("*"););do{switch(b){case 17:if(" "!=this.line.charAt(5))continue;break;case 34:if("4"==this.line.charAt(0))continue;
case 5:case 3:case 21:case 9:v=this.line.charCodeAt(0)-48}switch(b){case 13:case 9:d=this.ival(18,20);case 5:case 21:case 37:h=this.ival(13,15);case 546:case 3:case 34:g=this.ival(8,10);case 1:case 17:f=this.ival(3,5)}switch(b){case 546:e=s(-1,[this.dval(19,25),this.dval(13,18)]);break;case 3:e=s(-1,[this.dval(14,20),this.dval(25,31)]);break;case 5:case 21:e=s(-1,[this.dval(19,25),this.dval(28,35)]);break;case 34:e=Float.$valueOf(this.fval(10,20));break;case 13:e=s(-1,[this.dval(24,30)]);break;case 1:e=
Float.$valueOf(this.fval(5,15));break;case 37:var j=this.dval(19,25),l=this.dval(28,35),e=s(-1,[j,l]),k=JM.MinObject.getKey(v,f,g,h,d);c.put(k,e);e=s(-1,[l,j]);j=f;f=h;h=j;break;case 9:e=s(-1,[this.dval(22,28),this.dval(30,36),this.dval(38,44)]);break;case 17:e=s(-1,[this.dval(10,15),this.dval(20,25),this.dval(30,35),this.dval(40,45),this.line.charAt(46)])}k=JM.MinObject.getKey(v,f,g,h,d);c.put(k,e);JU.Logger.debugging&&JU.Logger.debug(JM.MinObject.decodeKey(k)+" "+(B(e,Float)?e:JU.Escape.eAD(e)))}while(!(this.line=
a.readLine()).startsWith("$"))},"java.io.BufferedReader,~N,java.util.Map");d(c$,"ival",function(a,b){return JU.PT.parseInt(this.line.substring(a,b).trim())},"~N,~N");d(c$,"fval",function(a,b){return JU.PT.fVal(this.line.substring(a,b).trim())},"~N,~N");d(c$,"dval",function(a,b){return JU.PT.dVal(this.line.substring(a,b).trim())},"~N,~N");d(c$,"getAtomTypes",function(){var a=new JU.Lst;try{var b=this.getBufferedReader("MMFF94-smarts.txt"),c;for(a.addLast(new JM.FF.AtomType(0,0,0,0,1,"H or NOT FOUND",
""));null!=(this.line=b.readLine());)if(!(0==this.line.length||this.line.startsWith("#"))){var e=this.ival(3,5),f=this.ival(6,8),g=this.ival(9,11),d=this.fval(12,15)/12,t=this.ival(16,18),v=this.line.substring(19,44).trim(),j=this.line.substring(45).trim();a.addLast(c=new JM.FF.AtomType(e,f,g,d,t,v,j));JM.FF.ForceFieldMMFF.setFlags(c)}b.close()}catch(l){if(z(l,JV.JmolAsyncException))throw new JV.JmolAsyncException(l.getFileName());if(z(l,Exception))System.err.println("Exception "+l.toString()+" in getResource MMFF94-smarts.txt line="+
this.line);else throw l;}JU.Logger.info(a.size()-1+" SMARTS-based atom types read");JM.FF.ForceFieldMMFF.atomTypes=a});c$.setFlags=d(c$,"setFlags",function(a){switch(a.mmType){case 32:case 35:case 72:a.fcadj=0.5;break;case 62:case 76:a.fcadj=0.25}switch(a.mmType){case 37:case 38:case 39:case 44:case 58:case 59:case 63:case 64:case 65:case 66:case 69:case 78:case 79:case 81:case 82:a.arom=!0}switch(a.mmType){case 2:case 3:case 4:case 9:case 30:case 37:case 39:case 54:case 57:case 58:case 63:case 64:case 67:case 75:case 78:case 80:case 81:a.sbmb=
!0}switch(a.mmType){case 6:case 8:case 10:case 11:case 12:case 13:case 14:case 15:case 26:case 32:case 35:case 39:case 40:case 43:case 44:case 59:case 62:case 70:case 72:case 76:a.pilp=!0}switch(a.mmType){case 10:case 32:case 35:case 39:case 41:case 44:case 55:case 56:case 58:case 59:case 69:case 72:case 81:case 82:a.mltb=1;break;case 2:case 3:case 7:case 9:case 16:case 17:case 30:case 37:case 38:case 45:case 46:case 47:case 51:case 53:case 54:case 57:case 63:case 64:case 65:case 66:case 67:case 74:case 75:case 78:case 79:case 80:a.mltb=
2;break;case 4:case 42:case 60:case 61:a.mltb=3}},"JM.FF.AtomType");c$.calculatePartialCharges=d(c$,"calculatePartialCharges",function(a,b,c,e,f,g){c=x(c.length,0);for(var d=f.nextSetBit(0);0<=d;d=f.nextSetBit(d+1))c[d]=JM.FF.ForceFieldMMFF.atomTypes.get(Math.max(0,e[d])).formalCharge;for(var t=null,d=b.length;0<=--d;){var t=a[d].atom1,j=a[d].atom2,l=f.get(t.i),q=f.get(j.i);if(l||q){var k=e[t.i],m=JM.FF.ForceFieldMMFF.atomTypes.get(Math.max(0,k)),s=0>k?-k:m.mmType,k=e[j.i],n=JM.FF.ForceFieldMMFF.atomTypes.get(Math.max(0,
k)),k=0>k?-k:n.mmType,p;try{var r=s<k?-1:1,y=JM.MinObject.getKey(b[d],1==r?k:s,1==r?s:k,127,124),w=JM.FF.ForceFieldMMFF.ffParams.get(y),u,F=JU.Logger.debugging?t+"/"+j+" mmTypes="+s+"/"+k+" formalCharges="+m.formalCharge+"/"+n.formalCharge+" bci = ":null;if(null==w){var A=JM.FF.ForceFieldMMFF.ffParams.get(JM.MinObject.getKey(0,s,127,127,127)).floatValue(),D=JM.FF.ForceFieldMMFF.ffParams.get(JM.MinObject.getKey(0,k,127,127,127)).floatValue();u=A-D;JU.Logger.debugging&&(F+=A+" - "+D+" = ")}else u=r*
w.floatValue();JU.Logger.debugging&&(F+=u,JU.Logger.debug(F));p=n.fcadj*n.formalCharge-m.fcadj*m.formalCharge+u}catch(C){if(z(C,Exception))p=NaN;else throw C;}l&&(c[t.i]+=p);q&&(c[j.i]-=p)}}if(g){a=0;for(d=c.length;0<=--d;)c[d]=Math.round(1E3*c[d])/1E3,a+=Math.abs(c[d]);0==a&&null!=t&&(c[t.i]=-0)}return c},"~A,~A,~A,~A,JU.BS,~B");c$.isBondType1=d(c$,"isBondType1",function(a,b){return a.sbmb&&b.sbmb||a.arom&&b.arom},"JM.FF.AtomType,JM.FF.AtomType");d(c$,"getBondType",function(a,b,c,e,f){return JM.FF.ForceFieldMMFF.isBondType1(b,
c)&&1==a.getCovalentOrder()&&!this.isAromaticBond(e,f)?1:0},"JM.Bond,JM.FF.AtomType,JM.FF.AtomType,~N,~N");d(c$,"isAromaticBond",function(a,b){if(null!=this.vRings[3])for(var c=this.vRings[3].size();0<=--c;){var e=this.vRings[3].get(c);if(e.get(a)&&e.get(b))return!0}return!1},"~N,~N");c$.getAtomTypeDescs=d(c$,"getAtomTypeDescs",function(a){for(var b=Array(a.length),c=a.length;0<=--c;)b[c]=String.valueOf(0>a[c]?-a[c]:JM.FF.ForceFieldMMFF.atomTypes.get(a[c]).mmType);return b},"~A");c$.setAtomTypes=
d(c$,"setAtomTypes",function(a,b,c,e,f){for(var g=new JU.Lst,d=Array(JM.FF.ForceFieldMMFF.atomTypes.size()),t=q(a.length,0),j=new JU.BS,l=new JU.BS,m=JU.BSUtil.copy(b),k=b.nextSetBit(0);0<=k;k=b.nextSetBit(k+1)){var s=a[k],n=s.bonds;if(null!=n)for(var p=n.length;0<=--p;)n[p].isCovalent()&&m.set(n[p].getOtherAtom(s).i)}for(k=m.nextSetBit(0);0<=k;k=m.nextSetBit(k+1))switch(p=a[k].getElementNumber(),p){case 1:l.set(k);break;default:j.set(p)}p=0;for(k=1;k<JM.FF.ForceFieldMMFF.atomTypes.size();k++)n=JM.FF.ForceFieldMMFF.atomTypes.get(k),
j.get(n.elemNo)&&(d[k]=n.smartsCode,p++);JU.Logger.info(p+" SMARTS matches used");try{c.getSubstructureSets(d,a,a.length,20,m,g,e)}catch(r){if(z(r,Exception))JU.Logger.error(r.toString());else throw r;}c=new JU.BS;for(p=0;p<g.size();p++)if(e=g.get(p),null!=e){e.andNot(c);for(k=e.nextSetBit(0);0<=k;k=e.nextSetBit(k+1))t[k]=p;c.or(e)}for(k=l.nextSetBit(0);0<=k;k=l.nextSetBit(k+1))n=a[k].bonds,null!=n&&(p=t[n[0].getOtherAtom(a[k]).i],0!=p&&c.set(k),t[k]=-JM.FF.ForceFieldMMFF.atomTypes.get(p).hType);
if(JU.Logger.debugging)for(k=m.nextSetBit(0);0<=k;k=m.nextSetBit(k+1))JU.Logger.debug("atom "+a[k]+"\ttype "+(0>t[k]?""+-t[k]:JM.FF.ForceFieldMMFF.atomTypes.get(t[k]).mmType+"\t"+JM.FF.ForceFieldMMFF.atomTypes.get(t[k]).smartsCode+"\t"+JM.FF.ForceFieldMMFF.atomTypes.get(t[k]).descr));return!f&&c.cardinality()!=m.cardinality()?null:t},"~A,JU.BS,J.api.SmilesMatcherInterface,~A,~B");d(c$,"setBondTypes",function(a,b,c){for(var e=q(b,0);0<=--b;){var f=a[b].atom1,g=a[b].atom2,d=c.get(f.i),t=c.get(g.i);
if(d||t)t=this.rawAtomTypes[f.i],d=JM.FF.ForceFieldMMFF.atomTypes.get(Math.max(0,t)),t=this.rawAtomTypes[g.i],t=JM.FF.ForceFieldMMFF.atomTypes.get(Math.max(0,t)),e[b]=this.getBondType(a[b],d,t,f.i,g.i)}return e},"~A,~N,JU.BS");d(c$,"fixTypes",function(){for(var a=this.minAtomCount;0<=--a;){var b=this.minAtoms[a],c=b.atom.i,e=this.rawAtomTypes[c];b.ffAtomType=JM.FF.ForceFieldMMFF.atomTypes.get(Math.max(0,e));e=0>e?-e:JM.FF.ForceFieldMMFF.atomTypes.get(e).mmType;b.ffType=e;b.vdwKey=JM.MinObject.getKey(0,
e,127,127,122);b.partialCharge=this.rawMMFF94Charges[c]}for(a=this.minBonds.length;0<=--a;)b=this.minBonds[a],b.type=this.rawBondTypes[b.rawIndex],b.key=this.getKey(b,b.type,3);for(a=this.minAngles.length;0<=--a;)b=this.minAngles[a],b.key=this.getKey(b,b.type,5),b.sbKey=this.getKey(b,b.sbType,21);for(a=this.minTorsions.length;0<=--a;)b=this.minTorsions[a],b.key=this.getKey(b,b.type,9)});d(c$,"setAngleType",function(a){a.type=this.minBonds[a.data[3]].type+this.minBonds[a.data[4]].type;this.checkRings(this.vRings[0],
a.data,3)?a.type+=0==a.type?3:4:this.checkRings(this.vRings[1],a.data,3)&&(a.type+=0==a.type?4:6);a.sbType=JM.FF.ForceFieldMMFF.sbMap[a.type];switch(a.type){case 1:case 5:case 7:a.sbType+=this.minBonds[a.data[4]].type}return a.type},"JM.MinAngle");d(c$,"setTorsionType",function(a){if(this.checkRings(this.vRings[1],a.data,4))return a.type=4;a.type=1==this.minBonds[a.data[5]].type?1:0==this.minBonds[a.data[4]].type&&0==this.minBonds[a.data[6]].type?0:2;0==a.type&&this.checkRings(this.vRings[2],a.data,
4)&&(a.type=5);return a.type},"JM.MinTorsion");d(c$,"typeOf",function(a){return this.minAtoms[a].ffType},"~N");d(c$,"checkRings",function(a,b,c){if(null!=a)for(var e=a.size();0<=--e;){var f=a.get(e);if(f.get(this.minAtoms[b[0]].atom.i)&&f.get(this.minAtoms[b[1]].atom.i)&&(3>c||f.get(this.minAtoms[b[2]].atom.i))&&(4>c||f.get(this.minAtoms[b[3]].atom.i)))return!0}return!1},"JU.Lst,~A,~N");d(c$,"getKey",function(a,b,c){var e=B(a,JM.MinObject)?a:null;a=null==e?a:e.data;var f=4;switch(c){case 3:this.fixOrder(a,
0,1);f=2;break;case 5:-1==this.fixOrder(a,0,2)&&JM.FF.ForceFieldMMFF.swap(a,3,4);b=this.setAngleType(e);f=3;break;case 21:f=3;break;case 9:switch(this.fixOrder(a,1,2)){case -1:JM.FF.ForceFieldMMFF.swap(a,0,3);JM.FF.ForceFieldMMFF.swap(a,4,6);break;case 0:-1==this.fixOrder(a,0,3)&&JM.FF.ForceFieldMMFF.swap(a,4,6)}b=this.setTorsionType(e)}for(var g=null,d=0;4>d;d++)this.typeData[d]=d<f?this.typeOf(a[d]):127;switch(c){case 21:this.typeData[3]=125;break;case 13:JM.FF.ForceFieldMMFF.sortOop(this.typeData)}g=
JM.MinObject.getKey(b,this.typeData[0],this.typeData[1],this.typeData[2],this.typeData[3]);d=JM.FF.ForceFieldMMFF.ffParams.get(g);switch(c){case 3:return!this.useEmpiricalRules?g:null!=d&&0<d[0]?g:this.applyEmpiricalRules(e,d,3);case 5:if(null!=d&&0!=d[0])return g;break;case 9:if(null==d){if(!JM.FF.ForceFieldMMFF.ffParams.containsKey(g=this.getTorsionKey(b,0,2))&&!JM.FF.ForceFieldMMFF.ffParams.containsKey(g=this.getTorsionKey(b,2,0))&&!JM.FF.ForceFieldMMFF.ffParams.containsKey(g=this.getTorsionKey(b,
2,2)))g=this.getTorsionKey(0,2,2);d=JM.FF.ForceFieldMMFF.ffParams.get(g)}return!this.useEmpiricalRules?g:null!=d?g:this.applyEmpiricalRules(e,d,9);case 21:if(null!=d)return g;b=this.getRowFor(a[0]);c=this.getRowFor(a[1]);a=this.getRowFor(a[2]);return JM.MinObject.getKey(0,b,c,a,126);case 13:if(null!=d)return g}if(!this.useEmpiricalRules&&null!=d)return g;for(var t=!1,j=!1,d=0;3>d&&!j;d++){g=0;for(j=1;g<f;g++,j<<=1)(c&j)==j&&(this.typeData[g]=JM.FF.ForceFieldMMFF.getEquivalentType(this.typeOf(a[g]),
d));switch(c){case 3:t=JM.FF.ForceFieldMMFF.fixTypeOrder(this.typeData,0,1);break;case 5:t=JM.FF.ForceFieldMMFF.fixTypeOrder(this.typeData,0,2);break;case 13:JM.FF.ForceFieldMMFF.sortOop(this.typeData)}g=JM.MinObject.getKey(b,this.typeData[0],this.typeData[1],this.typeData[2],this.typeData[3]);j=JM.FF.ForceFieldMMFF.ffParams.containsKey(g)}if(j){if(t)switch(c){case 5:JM.FF.ForceFieldMMFF.swap(a,0,2),JM.FF.ForceFieldMMFF.swap(a,3,4),this.setAngleType(e)}}else 0!=b&&5==c&&(g=Integer.$valueOf(g.intValue()^
255));if(!this.useEmpiricalRules)return g;d=JM.FF.ForceFieldMMFF.ffParams.get(g);switch(c){case 5:return null!=d&&0!=d[0]?g:this.applyEmpiricalRules(e,d,5)}return g},"~O,~N,~N");d(c$,"getTorsionKey",function(a,b,c){return JM.MinObject.getKey(a,JM.FF.ForceFieldMMFF.getEquivalentType(this.typeData[0],b),this.typeData[1],this.typeData[2],JM.FF.ForceFieldMMFF.getEquivalentType(this.typeData[3],c))},"~N,~N,~N");d(c$,"applyEmpiricalRules",function(a,b,c){var e=0,f;switch(c){case 3:e=this.minAtoms[a.data[0]];
c=this.minAtoms[a.data[1]];var d=e.atom.getElementNumber();b=c.atom.getElementNumber();d=JM.MinObject.getKey(0,Math.min(d,b),Math.max(d,b),127,123);b=JM.FF.ForceFieldMMFF.ffParams.get(d);if(null==b)return null;d=b[0];b=b[1];e=JM.FF.ForceFieldMMFF.getRuleBondLength(e,c,a.order,this.isAromaticBond(a.data[0],a.data[1]));if(0==e)return null;c=b/e;c*=c;a.ddata=s(-1,[d*c*c*c,e]);return Integer.$valueOf(-1);case 5:if(null==b||0==(d=b[1]))switch(c=this.minAtoms[a.data[1]],e=c.atom,b=e.getElementNumber(),
a.type){case 3:case 5:case 6:d=60;break;case 4:case 7:case 8:d=90;break;default:switch(d=120,e.getCovalentBondCount()){case 2:JM.MinAtom.isLinear(c)?d=180:8==b?d=105:10<b&&(d=95);break;case 3:0==c.ffAtomType.mltb&&3==c.ffAtomType.val&&(d=7==b?107:92);break;case 4:d=109.45}}e=1.75;switch(a.type){case 3:case 5:case 6:e*=0.05;break;case 4:case 7:case 8:e*=0.85}b=JM.FF.ForceFieldMMFF.getZParam(this.minAtoms[a.data[0]].atom.getElementNumber());var h=JM.FF.ForceFieldMMFF.getCParam(this.minAtoms[a.data[1]].atom.getElementNumber()),
j=JM.FF.ForceFieldMMFF.getZParam(this.minAtoms[a.data[2]].atom.getElementNumber()),l=JM.FF.ForceFieldMMFF.getR0(this.minBonds[a.data[3]]),m=JM.FF.ForceFieldMMFF.getR0(this.minBonds[a.data[4]]);c=l+m;l=(l-m)/(c*c);m=0.017453292519943295*d;m*=m;e=e*b*h*j*Math.exp(-2*l)/(c*m);a.ddata=s(-1,[e,d]);return Integer.$valueOf(-1);case 9:var q=a.data[1],k=a.data[2];c=this.minAtoms[q];f=this.minAtoms[k];if(JM.MinAtom.isLinear(c)||JM.MinAtom.isLinear(f))return null;d=this.minBonds[a.data[5]];b=c.atom.getElementNumber();
var h=f.atom.getElementNumber(),j=JM.FF.ForceFieldMMFF.getUParam(b),l=JM.FF.ForceFieldMMFF.getUParam(h),m=JM.FF.ForceFieldMMFF.getVParam(b),n=JM.FF.ForceFieldMMFF.getVParam(h),p=0,r=0,u=-1,y=-1,w=-1,x=0,z=c.ffAtomType.val,A=f.ffAtomType.val,B=c.ffAtomType.pilp,D=f.ffAtomType.pilp,C=c.ffAtomType.mltb,E=f.ffAtomType.mltb;a:for(;;){if(this.isAromaticBond(q,k)){u=B||D?0.3:0.5;e=7==z+A?3:6;break a}if(2==d.order){e=6;u=2==C&&2==E?1:0.4;break a}c=c.atom.getCovalentBondCount();f=f.atom.getCovalentBondCount();
if(4==c&&4==f){m=JM.FF.ForceFieldMMFF.getVParam(b);n=JM.FF.ForceFieldMMFF.getVParam(h);y=9;break a}if(4!=c&&(z>c||0<C)||4!=f&&(A>f||0<E))return null;z=B&&0<E;A=D&&0<C;if(1==d.order&&(0<C&&0<E||z||A)){if(B&&D)return null;e=6;if(z){u=1==E?0.5:10>=b&&10>=h?0.3:0.15;break a}if(A){u=1==C?0.5:10>=b&&10>=h?0.3:0.15;break a}if((1==C||1==E)&&(6==b||6==h)){u=0.4;break a}u=0.15;break a}switch(b<<8+h){case 2056:w=x=2;break a;case 2064:w=2;x=8;break a;case 4104:w=8;x=2;break a;case 4112:w=x=8;break a}y=c*f;break a}0<
u?p=e*u*Math.sqrt(j*l):0<y?r=Math.sqrt(m*n)/y:0!=w&&(p=-Math.sqrt(w*x));a.ddata=s(-1,[0,p,r]);return Integer.$valueOf(-1);default:return null}},"JM.MinObject,~A,~N");c$.getR0=d(c$,"getR0",function(a){return(null==a.ddata?JM.FF.ForceFieldMMFF.ffParams.get(a.key):a.ddata)[1]},"JM.MinBond");d(c$,"getRowFor",function(a){a=this.minAtoms[a].atom.getElementNumber();return 3>a?0:11>a?1:19>a?2:37>a?3:4},"~N");d(c$,"getOutOfPlaneParameter",function(a){a=JM.FF.ForceFieldMMFF.ffParams.get(this.getKey(a,6,13));
return null==a?0:a[0]},"~A");c$.sortOop=d(c$,"sortOop",function(a){JM.FF.ForceFieldMMFF.fixTypeOrder(a,0,2);JM.FF.ForceFieldMMFF.fixTypeOrder(a,0,3);JM.FF.ForceFieldMMFF.fixTypeOrder(a,2,3)},"~A");c$.fixTypeOrder=d(c$,"fixTypeOrder",function(a,b,c){return a[b]>a[c]?(JM.FF.ForceFieldMMFF.swap(a,b,c),!0):!1},"~A,~N,~N");d(c$,"fixOrder",function(a,b,c){var e=this.typeOf(a[c])-this.typeOf(a[b]);0>e&&JM.FF.ForceFieldMMFF.swap(a,b,c);return 0>e?-1:0<e?1:0},"~A,~N,~N");c$.swap=d(c$,"swap",function(a,b,c){var e=
a[b];a[b]=a[c];a[c]=e},"~A,~N,~N");c$.getEquivalentType=d(c$,"getEquivalentType",function(a,b){return 0==a?0:70==a||82<a?a:2==b?0:JM.FF.ForceFieldMMFF.equivalentTypes[(a-1<<1)+b]},"~N,~N");c$.getZParam=d(c$,"getZParam",function(a){switch(a){case 1:return 1.395;case 6:return 2.494;case 7:return 2.711;case 8:return 3.045;case 9:return 2.847;case 14:return 2.35;case 15:return 2.35;case 16:return 2.98;case 17:return 2.909;case 35:return 3.017;case 53:return 3.086}return 0},"~N");c$.getCParam=d(c$,"getCParam",
function(a){switch(a){case 5:return 0.704;case 6:return 1.016;case 7:return 1.113;case 8:return 1.337;case 14:return 0.811;case 15:return 1.068;case 16:return 1.249;case 17:return 1.078;case 33:return 0.825}return 0},"~N");c$.getUParam=d(c$,"getUParam",function(a){switch(a){case 6:case 7:case 8:return 2;case 14:case 15:case 16:return 1.25}return 0},"~N");c$.getVParam=d(c$,"getVParam",function(a){switch(a){case 6:return 2.12;case 7:return 1.5;case 8:return 0.2;case 14:return 1.22;case 15:return 2.4;
case 16:return 0.49}return 0},"~N");c$.getCovalentRadius=d(c$,"getCovalentRadius",function(a){switch(a){case 1:return 0.33;case 5:return 0.81;case 6:return 0.77;case 7:return 0.73;case 8:return 0.72;case 9:return 0.74;case 13:return 1.22;case 14:return 1.15;case 15:return 1.09;case 16:return 1.03;case 17:return 1.01;case 31:return 1.19;case 32:return 1.2;case 33:return 1.2;case 34:return 1.16;case 35:return 1.15;case 44:return 1.46;case 50:return 1.4;case 51:return 1.41;case 52:return 1.35;case 53:return 1.33;
case 81:return 1.51;case 82:return 1.53;case 83:return 1.55;default:return JU.Elements.getBondingRadius(a,0)}},"~N");c$.getRuleBondLength=d(c$,"getRuleBondLength",function(a,b,c){switch(c){case 1:case 2:case 3:break;case 5:break;default:return 0}a=a.atom.getElementNumber();b=b.atom.getElementNumber();c=JM.FF.ForceFieldMMFF.getCovalentRadius(a);var e=JM.FF.ForceFieldMMFF.getCovalentRadius(b),f=JU.Elements.getAllredRochowElectroNeg(a),d=JU.Elements.getAllredRochowElectroNeg(b);return a=c+e-(1==a||1==
b?0.05:0.085)*Math.pow(Math.abs(f-d),1.4)},"JM.MinAtom,JM.MinAtom,~N,~B");w(c$,"A4_VDW",122,"A4_BNDK",123,"A4_CHRG",124,"A4_SB",125,"A4_SBDEF",126,"KEY_SBDEF",0,"KEY_PBCI",0,"KEY_VDW",0,"KEY_BNDK",0,"KEY_OOP",6,"TYPE_PBCI",1,"TYPE_VDW",17,"TYPE_BNDK",546,"TYPE_CHRG",34,"TYPE_BOND",3,"TYPE_ANGLE",5,"TYPE_SB",21,"TYPE_SBDEF",37,"TYPE_TORSION",9,"TYPE_OOP",13,"atomTypes",null,"ffParams",null,"names","END.BCI.CHG.ANG.NDK.OND.OOP.TBN.FSB.TOR.VDW.","types",q(-1,[0,1,34,5,546,3,13,21,37,9,17]),"sbMap",q(-1,
[0,1,3,5,4,6,8,9,11]),"equivalentTypes",q(-1,[1,1,2,1,3,1,4,1,5,5,6,6,7,6,8,8,9,8,10,8,11,11,12,12,13,13,14,14,15,15,16,15,17,15,18,15,19,19,1,1,21,5,22,1,23,5,24,5,25,25,26,25,28,5,28,5,29,5,2,1,31,31,7,6,21,5,8,8,6,6,36,5,2,1,9,8,10,8,10,8,3,1,42,8,10,8,16,15,10,8,9,8,42,8,9,8,6,6,21,5,7,6,21,5,42,8,9,8,10,8,10,8,2,1,10,8,6,6,4,1,42,8,10,8,2,1,2,1,9,8,9,8,9,8,8,8,9,8,70,70,5,5,16,15,18,15,17,15,26,25,9,8,12,12,2,1,9,8,2,1,10,8,9,8]))});m("JM.FF");n(["JM.FF.ForceField","JS.T"],"JM.FF.ForceFieldUFF",
"java.util.Hashtable JU.BS $.Lst $.PT JM.FF.CalculationsUFF $.FFParam JU.Elements $.Logger JV.JmolAsyncException".split(" "),function(){c$=r(function(){this.bsAromatic=null;p(this,arguments)},JM.FF,"ForceFieldUFF",JM.FF.ForceField);y(c$,function(a){A(this,JM.FF.ForceFieldUFF,[]);this.minimizer=a;this.name="UFF"},"JM.Minimizer");j(c$,"clear",function(){this.bsAromatic=null});j(c$,"setModel",function(a,b){this.setModelFields();JU.Logger.info("minimize: setting atom types...");if(null==JM.FF.ForceFieldUFF.atomTypes&&
null==(JM.FF.ForceFieldUFF.atomTypes=this.getAtomTypes())||null==JM.FF.ForceFieldUFF.ffParams&&null==(JM.FF.ForceFieldUFF.ffParams=this.getFFParameters()))return!1;this.setAtomTypes(a,b);this.calc=new JM.FF.CalculationsUFF(this,JM.FF.ForceFieldUFF.ffParams,this.minAtoms,this.minBonds,this.minAngles,this.minTorsions,this.minPositions,this.minimizer.constraints);return this.calc.setupCalculations()},"JU.BS,~N");d(c$,"setAtomTypes",function(a,b){var c=JM.FF.ForceFieldUFF.atomTypes.size();a.clear(0);
for(var e=0;e<c;e++){var f=JM.FF.ForceFieldUFF.atomTypes.get(e),d=f[0];if(null!=d)if(d=this.getSearch(d,b,a),a.get(0))a.clear(0);else if(null==d)break;else for(var h=this.minimizer.bsAtoms.nextSetBit(0),j=0;h<this.minimizer.atoms.length&&0<=h;h=this.minimizer.bsAtoms.nextSetBit(h+1),j++)d.get(h)&&(this.minAtoms[j].sType=f[1].intern())}},"JU.BS,~N");d(c$,"getSearch",function(a,b,c){var e=null,f=a.length,e=JM.FF.ForceFieldUFF.tokenTypes[0],d=a.charCodeAt(f-2)-48,h=0;10<=d&&(d=0);var j=!1;"#"==a.charAt(1)?
h=JU.PT.parseInt(a.substring(2,f-1)):(h=a.substring(1,0<d?f-3:f-1),h.equals(h.toLowerCase())&&(h=h.toUpperCase(),j=!0),h=JU.Elements.elementNumberFromSymbol(h,!1));if(h>b)return null;if(!c.get(h))return c.set(0),null;switch(a.charAt(f-3)){case "D":e=JM.FF.ForceFieldUFF.tokenTypes[2];e[6].intValue=d;break;case "^":e=JM.FF.ForceFieldUFF.tokenTypes[4+(d-1)];break;case "+":e=JM.FF.ForceFieldUFF.tokenTypes[1];e[5].intValue=d;break;case "-":e=JM.FF.ForceFieldUFF.tokenTypes[1];e[5].intValue=-d;break;case "A":e=
JM.FF.ForceFieldUFF.tokenTypes[6]}e[2].intValue=h;b=this.minimizer.vwr.evaluateExpression(e);if(!B(b,JU.BS))return null;j&&0<=b.nextSetBit(0)&&(null==this.bsAromatic&&(this.bsAromatic=this.minimizer.vwr.evaluateExpression(JM.FF.ForceFieldUFF.tokenTypes[3])),b.and(this.bsAromatic));JU.Logger.debugging&&0<=b.nextSetBit(0)&&JU.Logger.debug(a+" minimize atoms="+b);return b},"~S,~N,JU.BS");d(c$,"getFFParameters",function(){var a,b=new java.util.Hashtable,c=null;try{for(var c=this.getBufferedReader("UFF.txt"),
e;null!=(e=c.readLine());){var f=JU.PT.getTokens(e);if(!(13>f.length)&&(JU.Logger.debugging&&JU.Logger.debug(e),e.substring(0,5).equals("param"))){a=new JM.FF.FFParam;b.put(f[1],a);a.dVal=s(11,0);a.sVal=Array(1);a.sVal[0]=f[1];a.dVal[0]=JU.PT.parseFloat(f[2]);a.dVal[1]=0.017453292519943295*JU.PT.parseFloat(f[3]);a.dVal[2]=JU.PT.parseFloat(f[4]);a.dVal[3]=JU.PT.parseFloat(f[5]);a.dVal[4]=JU.PT.parseFloat(f[6]);a.dVal[5]=JU.PT.parseFloat(f[7]);a.dVal[6]=JU.PT.parseFloat(f[8]);a.dVal[7]=JU.PT.parseFloat(f[9]);
a.dVal[8]=JU.PT.parseFloat(f[10]);a.dVal[9]=JU.PT.parseFloat(f[11]);a.dVal[10]=JU.PT.parseFloat(f[12]);a.iVal=q(1,0);var d=2<f[1].length?f[1].charAt(2):"1";switch(d){case "R":d="2";break;default:d="1";case "1":case "2":case "3":case "4":case "5":case "6":}a.iVal[0]=d.charCodeAt(0)-48}}c.close()}catch(h){if(z(h,Exception)){System.err.println("Exception "+h.toString()+" in getResource UFF.txt");try{c.close()}catch(j){if(!z(j,Exception))throw j;}return null}throw h;}JU.Logger.info(b.size()+" atom types read from UFF.txt");
return b});d(c$,"getAtomTypes",function(){var a=new JU.Lst;try{for(var b=this.getBufferedReader("UFF.txt"),c;null!=(c=b.readLine());)if(4<c.length&&c.substring(0,4).equals("atom")){var e=JU.PT.getTokens(c),f=l(-1,[e[1],e[2]]);a.addLast(f)}b.close()}catch(d){if(z(d,JV.JmolAsyncException))throw new JV.JmolAsyncException(d.getFileName());if(z(d,Exception))System.err.println("Exception "+d.toString()+" in getResource UFF.txt");else throw d;}JU.Logger.info(a.size()+" UFF parameters read");return 0<a.size()?
a:null});w(c$,"atomTypes",null,"ffParams",null,"TOKEN_ELEMENT_ONLY",0,"TOKEN_ELEMENT_CHARGED",1,"TOKEN_ELEMENT_CONNECTED",2,"TOKEN_AROMATIC",3,"TOKEN_ELEMENT_SP",4,"TOKEN_ELEMENT_ALLYLIC",6,"PT_ELEMENT",2,"PT_CHARGE",5,"PT_CONNECT",6);c$.tokenTypes=c$.prototype.tokenTypes=l(-1,[l(-1,[JS.T.tokenExpressionBegin,JS.T.n(269484436,1095763978),JS.T.i(0),JS.T.tokenExpressionEnd]),l(-1,[JS.T.tokenExpressionBegin,JS.T.n(269484436,1095763978),JS.T.i(0),JS.T.tokenAnd,JS.T.n(269484436,1632634891),JS.T.i(0),JS.T.tokenExpressionEnd]),
l(-1,[JS.T.tokenExpressionBegin,JS.T.n(269484436,1095763978),JS.T.i(0),JS.T.tokenAnd,JS.T.tokenConnected,JS.T.tokenLeftParen,JS.T.i(0),JS.T.tokenRightParen,JS.T.tokenExpressionEnd]),l(-1,[JS.T.tokenExpressionBegin,JS.T.o(1073741824,"flatring"),JS.T.tokenExpressionEnd]),l(-1,[JS.T.tokenExpressionBegin,JS.T.n(269484436,1095763978),JS.T.i(0),JS.T.tokenAnd,JS.T.tokenLeftParen,JS.T.tokenConnected,JS.T.tokenLeftParen,JS.T.i(1),JS.T.tokenComma,JS.T.o(4,"triple"),JS.T.tokenRightParen,JS.T.tokenOr,JS.T.tokenConnected,
JS.T.tokenLeftParen,JS.T.i(2),JS.T.tokenComma,JS.T.o(4,"double"),JS.T.tokenRightParen,JS.T.tokenRightParen,JS.T.tokenExpressionEnd]),l(-1,[JS.T.tokenExpressionBegin,JS.T.n(269484436,1095763978),JS.T.i(0),JS.T.tokenAnd,JS.T.o(135266310,"connected"),JS.T.tokenLeftParen,JS.T.i(1),JS.T.tokenComma,JS.T.o(4,"double"),JS.T.tokenRightParen,JS.T.tokenExpressionEnd]),l(-1,[JS.T.tokenExpressionBegin,JS.T.n(269484436,1095763978),JS.T.i(0),JS.T.tokenAnd,JS.T.tokenConnected,JS.T.tokenLeftParen,JS.T.i(3),JS.T.tokenRightParen,
JS.T.tokenAnd,JS.T.tokenConnected,JS.T.tokenLeftParen,JS.T.tokenConnected,JS.T.tokenLeftParen,JS.T.o(4,"double"),JS.T.tokenRightParen,JS.T.tokenRightParen,JS.T.tokenExpressionEnd])])});m("JM.FF");c$=r(function(){this.key=null;this.dE=0;this.d=this.c=this.b=this.a=null;this.id=this.ic=this.ib=this.ia=0;this.dData=this.iData=null;this.energy=this.theta=this.rab=this.delta=0;this.calcs=null;p(this,arguments)},JM.FF,"Calculation");d(c$,"set",function(a){this.calcs=a;return this},"JM.FF.Calculations");
d(c$,"setData",function(){},"JU.Lst,~N,~N,~N");d(c$,"getEnergy",function(){return this.energy});d(c$,"getPointers",function(a){this.dData=a[1];this.iData=a[0];switch(this.iData.length){default:this.id=this.iData[3];case 3:this.ic=this.iData[2];case 2:this.ib=this.iData[1];case 1:this.ia=this.iData[0];case 0:}},"~A");m("JM.FF");n(["JU.AU","$.SB","$.V3d"],"JM.FF.Calculations",["java.lang.Float","JU.PT","JM.Util"],function(){c$=r(function(){this.ffParams=this.calculations=this.ff=this.parC=this.parB=
this.parA=null;this.torsionCount=this.angleCount=this.bondCount=this.ac=0;this.constraints=this.minPositions=this.minTorsions=this.minAngles=this.minBonds=this.minAtoms=null;this.silent=this.gradients=this.isPreliminary=!1;this.logData=null;this.loggingEnabled=this.logging=!1;this.dd=this.dc=this.db=this.da=null;this.id=this.ic=this.ib=this.ia=0;this.v3=this.v2=this.v1=null;p(this,arguments)},JM.FF,"Calculations");G(c$,function(){this.calculations=JU.AU.createArrayOfArrayList(7);this.logData=new JU.SB;
this.da=new JU.V3d;this.db=new JU.V3d;this.dc=new JU.V3d;this.dd=new JU.V3d;this.v1=new JU.V3d;this.v2=new JU.V3d;this.v3=new JU.V3d});d(c$,"getParameter",function(a){return this.ffParams.get(a)},"~O");d(c$,"setConstraints",function(a){this.constraints=a},"JU.Lst");y(c$,function(a,b,c,e,d,g,h){this.ff=a;this.minAtoms=b;this.minBonds=c;this.minAngles=e;this.minTorsions=d;this.minPositions=g;this.ac=b.length;this.bondCount=c.length;this.angleCount=e.length;this.torsionCount=d.length;this.constraints=
h},"JM.FF.ForceField,~A,~A,~A,~A,~A,JU.Lst");d(c$,"addForce",function(a,b,c){this.minAtoms[b].force[0]+=a.x*c;this.minAtoms[b].force[1]+=a.y*c;this.minAtoms[b].force[2]+=a.z*c},"JU.V3d,~N,~N");d(c$,"setSilent",function(a){this.silent=a},"~B");d(c$,"getLogData",function(){return this.logData.toString()});d(c$,"appendLogData",function(a){this.logData.append(a).append("\n")},"~S");d(c$,"setLoggingEnabled",function(a){if(this.loggingEnabled=a)this.logData=new JU.SB},"~B");d(c$,"setPreliminary",function(a){this.isPreliminary=
a},"~B");d(c$,"pairSearch",function(a,b,c,e){for(var d=0;d<this.ac-1;d++)for(var g=this.minAtoms[d].bsVdw,h=g.nextSetBit(0);0<=h;h=g.nextSetBit(h+1))b.setData(a,d,h,0),null!=e&&e.setData(c,d,h,0)},"JU.Lst,JM.FF.Calculation,JU.Lst,JM.FF.Calculation");d(c$,"calc",function(a,b){this.logging=this.loggingEnabled&&!this.silent;this.gradients=b;var c=this.calculations[a],e,d=0;if(null==c||0==(e=c.size()))return 0;this.logging&&this.appendLogData(this.getDebugHeader(a));for(c=0;c<e;c++)d+=this.compute(a,
this.calculations[a].get(c));this.logging&&this.appendLogData(this.getDebugFooter(a,d));null!=this.constraints&&3>=a&&(d+=this.constraintEnergy(a));return d},"~N,~B");d(c$,"energyStrBnd",function(){return 0},"~B");d(c$,"energyBond",function(a){return this.calc(0,a)},"~B");d(c$,"energyAngle",function(a){return this.calc(1,a)},"~B");d(c$,"energyTorsion",function(a){return this.calc(3,a)},"~B");d(c$,"energyStretchBend",function(a){return this.calc(2,a)},"~B");d(c$,"energyOOP",function(a){return this.calc(4,
a)},"~B");d(c$,"energyVDW",function(a){return this.calc(5,a)},"~B");d(c$,"energyES",function(a){return this.calc(6,a)},"~B");d(c$,"constraintEnergy",function(a){for(var b=0,c=0,e=0,d=this.constraints.size();0<=--d;){var g=this.constraints.get(d);if(g[0][0]==a+2){c=g[1];g=g[2].doubleValue();switch(a){case 3:this.id=c[3],this.gradients&&this.dd.setA(this.minAtoms[this.id].coord);case 1:this.ic=c[2],this.gradients&&this.dc.setA(this.minAtoms[this.ic].coord);case 0:this.ib=c[1],this.ia=c[0],this.gradients&&
(this.db.setA(this.minAtoms[this.ib].coord),this.da.setA(this.minAtoms[this.ia].coord))}c=1E4;switch(a){case 3:g*=0.017453292519943295;b=this.gradients?JM.Util.restorativeForceAndTorsionAngleRadians(this.da,this.db,this.dc,this.dd):JM.Util.getTorsionAngleRadians(this.minAtoms[this.ia].coord,this.minAtoms[this.ib].coord,this.minAtoms[this.ic].coord,this.minAtoms[this.id].coord,this.v1,this.v2,this.v3);0>b&&1.5707963267948966<=g?b+=6.283185307179586:0<b&&-1.5707963267948966>=g&&(g+=6.283185307179586);
break;case 1:g*=0.017453292519943295;b=this.gradients?JM.Util.restorativeForceAndAngleRadians(this.da,this.db,this.dc):JM.Util.getAngleRadiansABC(this.minAtoms[this.ia].coord,this.minAtoms[this.ib].coord,this.minAtoms[this.ic].coord);break;case 0:b=this.gradients?JM.Util.restorativeForceAndDistance(this.da,this.db,this.dc):Math.sqrt(JM.Util.distance2(this.minAtoms[this.ia].coord,this.minAtoms[this.ib].coord))}e+=this.constrainQuadratic(b,g,c,a)}}return e},"~N");d(c$,"constrainQuadratic",function(a,
b,c,e){if(!JM.Util.isFinite(a))return 0;a-=b;if(this.gradients)switch(b=2*c*a,e){case 3:this.addForce(this.dd,this.id,b);case 1:this.addForce(this.dc,this.ic,b);case 0:this.addForce(this.db,this.ib,b),this.addForce(this.da,this.ia,b)}return c*a*a},"~N,~N,~N,~N");d(c$,"getConstraintList",function(){if(!(null==this.constraints||0==this.constraints.size())){this.appendLogData("C O N S T R A I N T S\n---------------------");for(var a=this.constraints.size();0<=--a;){var b=this.constraints.get(a),c=b[0],
e=b[1],b=b[2].doubleValue(),c=c[0]-2;switch(c){case 3:this.id=e[3];case 1:this.ic=e[2];case 0:this.ib=e[1],this.ia=e[0]}switch(c){case 0:this.appendLogData(JU.PT.sprintf("%3d %3d  %-5s %-5s  %12.6f","ssFI",l(-1,[this.minAtoms[this.ia].atom.getAtomName(),this.minAtoms[this.ib].atom.getAtomName(),x(-1,[b]),q(-1,[this.minAtoms[this.ia].atom.getAtomNumber(),this.minAtoms[this.ib].atom.getAtomNumber()])])));break;case 1:this.appendLogData(JU.PT.sprintf("%3d %3d %3d  %-5s %-5s %-5s  %12.6f","sssFI",l(-1,
[this.minAtoms[this.ia].atom.getAtomName(),this.minAtoms[this.ib].atom.getAtomName(),this.minAtoms[this.ic].atom.getAtomName(),x(-1,[b]),q(-1,[this.minAtoms[this.ia].atom.getAtomNumber(),this.minAtoms[this.ib].atom.getAtomNumber(),this.minAtoms[this.ic].atom.getAtomNumber()])])));break;case 3:this.appendLogData(JU.PT.sprintf("%3d %3d %3d %3d  %-5s %-5s %-5s %-5s  %3d %8.3f     %8.3f     %8.3f     %8.3f","ssssFI",l(-1,[this.minAtoms[this.ia].atom.getAtomName(),this.minAtoms[this.ib].atom.getAtomName(),
this.minAtoms[this.ic].atom.getAtomName(),this.minAtoms[this.id].atom.getAtomName(),x(-1,[b]),q(-1,[this.minAtoms[this.ia].atom.getAtomNumber(),this.minAtoms[this.ib].atom.getAtomNumber(),this.minAtoms[this.ic].atom.getAtomNumber(),this.minAtoms[this.id].atom.getAtomNumber()])])))}}this.appendLogData("---------------------\n")}});d(c$,"getAtomList",function(a){var b=new JU.SB;b.append("\n"+a+"\n\n ATOM    X        Y        Z    TYPE     GRADX    GRADY    GRADZ  ---------BONDED ATOMS--------\n-----------------------------------------------------------------------------------------------\n");
for(a=0;a<this.ac;a++){var c=this.minAtoms[a],e=c.getBondedAtomIndexes(),d=q(e.length+1,0);d[0]=c.atom.getAtomNumber();for(var g="   ",h=0;h<e.length;h++)g+=" %3d",d[h+1]=this.minAtoms[e[h]].atom.getAtomNumber();b.append(JU.PT.sprintf("%3d %8.3f %8.3f %8.3f  %-5s %8.3f %8.3f %8.3f"+g+"\n","sFI",l(-1,[c.sType,x(-1,[c.coord[0],c.coord[1],c.coord[2],c.force[0],c.force[1],c.force[2]]),d])))}b.append("-----------------------------------------------------------------------------------------------\n\n\n");
return b.toString()},"~S");d(c$,"getDebugHeader2",function(a){switch(a){case 0:return"\nB O N D   S T R E T C H I N G ("+this.bondCount+" bonds)\n\n  ATOMS  ATOM TYPES   BOND    BOND       IDEAL      FORCE\n  I   J   I     J     TYPE   LENGTH     LENGTH    CONSTANT      DELTA     ENERGY\n--------------------------------------------------------------------------------";case 1:return"\nA N G L E   B E N D I N G ("+this.minAngles.length+" angles)\n\n    ATOMS      ATOM TYPES        VALENCE    IDEAL        FORCE\n  I   J   K   I     J     K       ANGLE     ANGLE      CONSTANT     ENERGY\n--------------------------------------------------------------------------";
case 2:return"\nS T R E T C H   B E N D I N G ("+2*this.minAngles.length+" angles)\n\n    ATOMS      ATOM TYPES        VALENCE    IDEAL        FORCE\n  I   J   K   I     J     K       ANGLE     ANGLE      CONSTANT     ENERGY\n--------------------------------------------------------------------------";case 3:return"\nT O R S I O N A L ("+this.minTorsions.length+" torsions)\n\n      ATOMS           ATOM TYPES            n    COS          FORCE      TORSION\n  I   J   K   L   I     J     K     L          (n phi0)      CONSTANT     ANGLE        ENERGY\n---------------------------------------------------------------------------------------------";
case 4:return"\nO U T - O F - P L A N E   B E N D I N G\n\n      ATOMS           ATOM TYPES             OOP        FORCE \n  I   J   K   L   I     J     K     L       ANGLE     CONSTANT      ENERGY\n--------------------------------------------------------------------------";case 5:return"\nV A N   D E R   W A A L S  (partial list)\n\n  ATOMS  ATOM TYPES\n  I   J   I     J      Rij       kij     ENERGY\n-----------------------------------------------";case 6:return"\nE L E C T R O S T A T I C   I N T E R A C T I O N S  (partial list)\n\n  ATOMS  ATOM TYPES \n  I   J   I     J      Rij      f          Qi          Qj    ENERGY\n-------------------------------------------------------------------"}return""},
"~N");d(c$,"getDebugLine",function(a,b){return this.getDebugLineC(a,b)},"~N,JM.FF.Calculation");d(c$,"getDebugLineC",function(a,b){var c=this.ff.toUserUnits(b.energy);switch(a){case 0:return JU.PT.sprintf("%3d %3d  %-5s %-5s  %4.2f%8.3f   %8.3f     %8.3f   %8.3f   %8.3f","ssFI",l(-1,[this.minAtoms[b.ia].sType,this.minAtoms[b.ib].sType,x(-1,[0,b.rab,b.dData[1],b.dData[0],b.delta,c]),q(-1,[this.minAtoms[b.ia].atom.getAtomNumber(),this.minAtoms[b.ib].atom.getAtomNumber()])]));case 1:case 2:return JU.PT.sprintf("%3d %3d %3d  %-5s %-5s %-5s  %8.3f  %8.3f     %8.3f   %8.3f",
"sssFI",l(-1,[this.minAtoms[b.ia].sType,this.minAtoms[b.ib].sType,this.minAtoms[b.ic].sType,x(-1,[57.29577951308232*b.theta,b.dData[1],b.dData[0],c]),q(-1,[this.minAtoms[b.ia].atom.getAtomNumber(),this.minAtoms[b.ib].atom.getAtomNumber(),this.minAtoms[b.ic].atom.getAtomNumber()])]));case 3:return JU.PT.sprintf("%3d %3d %3d %3d  %-5s %-5s %-5s %-5s  %3d %8.3f     %8.3f     %8.3f     %8.3f","ssssFI",l(-1,[this.minAtoms[b.ia].sType,this.minAtoms[b.ib].sType,this.minAtoms[b.ic].sType,this.minAtoms[b.id].sType,
x(-1,[b.dData[1],b.dData[0],57.29577951308232*b.theta,c]),q(-1,[this.minAtoms[b.ia].atom.getAtomNumber(),this.minAtoms[b.ib].atom.getAtomNumber(),this.minAtoms[b.ic].atom.getAtomNumber(),this.minAtoms[b.id].atom.getAtomNumber(),b.iData[4]])]));case 4:return JU.PT.sprintf("%3d %3d %3d %3d  %-5s %-5s %-5s %-5s  %8.3f   %8.3f     %8.3f","ssssFI",l(-1,[this.minAtoms[b.ia].sType,this.minAtoms[b.ib].sType,this.minAtoms[b.ic].sType,this.minAtoms[b.id].sType,x(-1,[57.29577951308232*b.theta,b.dData[0],c]),
q(-1,[this.minAtoms[b.ia].atom.getAtomNumber(),this.minAtoms[b.ib].atom.getAtomNumber(),this.minAtoms[b.ic].atom.getAtomNumber(),this.minAtoms[b.id].atom.getAtomNumber()])]));case 5:return JU.PT.sprintf("%3d %3d  %-5s %-5s %6.3f  %8.3f  %8.3f","ssFI",l(-1,[this.minAtoms[b.iData[0]].sType,this.minAtoms[b.iData[1]].sType,x(-1,[b.rab,b.dData[0],c]),q(-1,[this.minAtoms[b.ia].atom.getAtomNumber(),this.minAtoms[b.ib].atom.getAtomNumber()])]));case 6:return JU.PT.sprintf("%3d %3d  %-5s %-5s %6.3f  %8.3f  %8.3f  %8.3f  %8.3f",
"ssFI",l(-1,[this.minAtoms[b.iData[0]].sType,this.minAtoms[b.iData[1]].sType,x(-1,[b.rab,b.dData[0],b.dData[1],b.dData[2],c]),q(-1,[this.minAtoms[b.ia].atom.getAtomNumber(),this.minAtoms[b.ib].atom.getAtomNumber()])]))}return""},"~N,JM.FF.Calculation");d(c$,"getDebugFooter",function(a,b){var c="";switch(a){case 0:c="BOND STRETCHING";break;case 1:c="ANGLE BENDING";break;case 3:c="TORSIONAL";break;case 4:c="OUT-OF-PLANE BENDING";break;case 2:c="STRETCH BENDING";break;case 5:c="VAN DER WAALS";break;
case 6:c="ELECTROSTATIC ENERGY"}return JU.PT.sprintf("\n     TOTAL %s ENERGY = %8.3f %s/mol\n","sfs",l(-1,[c,Float.$valueOf(this.ff.toUserUnits(b)),this.ff.minimizer.units]))},"~N,~N");d(c$,"setPairVariables",function(a){this.gradients?(this.setCoords(a,2),a.rab=JM.Util.restorativeForceAndDistance(this.da,this.db,this.dc)):a.rab=Math.sqrt(JM.Util.distance2(this.minAtoms[a.ia].coord,this.minAtoms[a.ib].coord));JM.Util.isNearZero2(a.rab,0.001)&&(a.rab=0.001)},"JM.FF.Calculation");d(c$,"setAngleVariables",
function(a){this.gradients?(this.setCoords(a,3),a.theta=JM.Util.restorativeForceAndAngleRadians(this.da,this.db,this.dc)):a.theta=JM.Util.getAngleRadiansABC(this.minAtoms[a.ia].coord,this.minAtoms[a.ib].coord,this.minAtoms[a.ic].coord);JM.Util.isFinite(a.theta)||(a.theta=0)},"JM.FF.Calculation");d(c$,"setOopVariables",function(a,b){this.setCoords(a,4);a.theta=this.gradients?JM.Util.restorativeForceAndOutOfPlaneAngleRadians(this.da,this.db,this.dc,this.dd,this.v1,this.v2,this.v3):JM.Util.pointPlaneAngleRadians(this.da,
this.db,this.dc,this.dd,this.v1,this.v2,this.v3,b);JM.Util.isFinite(a.theta)||(a.theta=0)},"JM.FF.Calculation,~B");d(c$,"setTorsionVariables",function(a){this.gradients?(this.setCoords(a,4),a.theta=JM.Util.restorativeForceAndTorsionAngleRadians(this.da,this.db,this.dc,this.dd),JM.Util.isFinite(a.theta)||(a.theta=1.7453292519943296E-5)):a.theta=JM.Util.getTorsionAngleRadians(this.minAtoms[a.ia].coord,this.minAtoms[a.ib].coord,this.minAtoms[a.ic].coord,this.minAtoms[a.id].coord,this.v1,this.v2,this.v3)},
"JM.FF.Calculation");d(c$,"setCoords",function(a,b){switch(b){case 4:this.da.setA(this.minAtoms[a.ia].coord);case 3:this.db.setA(this.minAtoms[a.ib].coord);case 2:this.dc.setA(this.minAtoms[a.ic].coord);case 1:this.dd.setA(this.minAtoms[a.id].coord)}},"JM.FF.Calculation,~N");d(c$,"addForces",function(a,b){switch(b){case 4:this.addForce(this.dd,a.id,a.dE);case 3:this.addForce(this.dc,a.ic,a.dE);case 2:this.addForce(this.db,a.ib,a.dE);case 1:this.addForce(this.da,a.ia,a.dE)}},"JM.FF.Calculation,~N");
d(c$,"isLinear",function(){return!1},"~N");w(c$,"RAD_TO_DEG",57.29577951308232,"DEG_TO_RAD",0.017453292519943295,"KCAL_TO_KJ",4.1868,"CALC_DISTANCE",0,"CALC_ANGLE",1,"CALC_STRETCH_BEND",2,"CALC_TORSION",3,"CALC_OOP",4,"CALC_VDW",5,"CALC_ES",6,"CALC_MAX",7,"PI_OVER_2",1.5707963267948966,"TWO_PI",6.283185307179586)});m("JM.FF");n(["JM.FF.Calculations"],"JM.FF.CalculationsMMFF","JU.Lst $.PT JM.MinAtom $.MinObject JM.FF.MMFFAngleCalc $.MMFFDistanceCalc $.MMFFESCalc $.MMFFOOPCalc $.MMFFSBCalc $.MMFFTorsionCalc $.MMFFVDWCalc".split(" "),
function(){c$=r(function(){this.mmff=this.sbCalc=this.esCalc=this.vdwCalc=this.oopCalc=this.torsionCalc=this.angleCalc=this.bondCalc=null;p(this,arguments)},JM.FF,"CalculationsMMFF",JM.FF.Calculations);y(c$,function(a,b,c,e,d,g,h,j){A(this,JM.FF.CalculationsMMFF,[a,c,e,d,g,h,j]);this.mmff=a;this.ffParams=b;this.bondCalc=(new JM.FF.MMFFDistanceCalc).set(this);this.angleCalc=(new JM.FF.MMFFAngleCalc).set(this);this.sbCalc=(new JM.FF.MMFFSBCalc).set(this);this.torsionCalc=(new JM.FF.MMFFTorsionCalc).set(this);
this.oopCalc=(new JM.FF.MMFFOOPCalc).set(this);this.vdwCalc=(new JM.FF.MMFFVDWCalc).set(this);this.esCalc=(new JM.FF.MMFFESCalc).set(this)},"JM.FF.ForceField,java.util.Map,~A,~A,~A,~A,~A,JU.Lst");j(c$,"getUnits",function(){return"kcal"});j(c$,"setupCalculations",function(){var a,b=(new JM.FF.MMFFDistanceCalc).set(this);a=this.calculations[0]=new JU.Lst;for(var c=0;c<this.bondCount;c++)b.setData(a,this.minBonds[c]);a=this.calculations[1]=new JU.Lst;b=(new JM.FF.MMFFAngleCalc).set(this);for(c=0;c<this.angleCount;c++)b.setData(a,
this.minAngles[c]);a=this.calculations[2]=new JU.Lst;b=(new JM.FF.MMFFSBCalc).set(this);for(c=0;c<this.angleCount;c++)b.setData(a,this.minAngles[c]);a=this.calculations[3]=new JU.Lst;b=(new JM.FF.MMFFTorsionCalc).set(this);for(c=0;c<this.torsionCount;c++)b.setData(a,this.minTorsions[c]);a=this.calculations[4]=new JU.Lst;b=(new JM.FF.MMFFOOPCalc).set(this);for(c=0;c<this.ac;c++)JM.FF.CalculationsMMFF.isInvertible(this.minAtoms[c])&&b.setData(a,c);this.pairSearch(this.calculations[5]=new JU.Lst,(new JM.FF.MMFFVDWCalc).set(this),
this.calculations[6]=new JU.Lst,(new JM.FF.MMFFESCalc).set(this));return!0});j(c$,"isLinear",function(a){return JM.MinAtom.isLinear(this.minAtoms[a])},"~N");c$.isInvertible=d(c$,"isInvertible",function(a){switch(a.ffType){default:return!1;case 2:case 3:case 10:case 30:case 37:case 39:case 40:case 41:case 45:case 49:case 54:case 55:case 56:case 57:case 58:case 63:case 64:case 67:case 69:case 78:case 80:case 81:return!0}},"JM.MinAtom");j(c$,"compute",function(a,b){switch(a){case 0:return this.bondCalc.compute(b);
case 1:return this.angleCalc.compute(b);case 2:return this.sbCalc.compute(b);case 3:return this.torsionCalc.compute(b);case 4:return this.oopCalc.compute(b);case 5:return this.vdwCalc.compute(b);case 6:return this.esCalc.compute(b)}return 0},"~N,~A");j(c$,"getParameterObj",function(a){return null==a.key||null!=a.ddata?a.ddata:this.ffParams.get(a.key)},"JM.MinObject");j(c$,"getDebugHeader",function(a){switch(a){case -1:return"MMFF94 Force Field -- T. A. Halgren, J. Comp. Chem. 5 & 6 490-519ff (1996).\n";
case 3:return"\nT O R S I O N A L ("+this.minTorsions.length+" torsions)\n\n      ATOMS           ATOM TYPES          TORSION\n  I   J   K   L   I     J     K     L      ANGLE       V1       V2       V3     ENERGY\n--------------------------------------------------------------------------------------\n";default:return this.getDebugHeader2(a)}},"~N");j(c$,"getDebugLine",function(a,b){var c=this.ff.toUserUnits(b.energy);switch(a){case 1:case 2:return JU.PT.sprintf("%11s  %-5s %-5s %-5s  %8.3f  %8.3f     %8.3f   %8.3f",
"ssssFI",l(-1,[JM.MinObject.decodeKey(b.key),this.minAtoms[b.ia].sType,this.minAtoms[b.ib].sType,this.minAtoms[b.ic].sType,x(-1,[57.29577951308232*b.theta,b.dData[1],b.dData[0],c]),q(-1,[this.minAtoms[b.ia].atom.getAtomNumber(),this.minAtoms[b.ib].atom.getAtomNumber(),this.minAtoms[b.ic].atom.getAtomNumber()])]));case 3:return JU.PT.sprintf("%15s  %-5s %-5s %-5s %-5s  %8.3f %8.3f %8.3f %8.3f %8.3f","sssssF",l(-1,[JM.MinObject.decodeKey(b.key),this.minAtoms[b.ia].sType,this.minAtoms[b.ib].sType,this.minAtoms[b.ic].sType,
this.minAtoms[b.id].sType,x(-1,[57.29577951308232*b.theta,b.dData[0],b.dData[1],b.dData[2],c])]));default:return this.getDebugLineC(a,b)}},"~N,JM.FF.Calculation");w(c$,"FPAR",143.9325,"DA_D","D","DA_DA",133)});m("JM.FF");n(["JM.FF.Calculations"],"JM.FF.CalculationsUFF","JU.Lst JM.FF.UFFAngleCalc $.UFFDistanceCalc $.UFFOOPCalc $.UFFTorsionCalc $.UFFVDWCalc".split(" "),function(){c$=r(function(){this.vdwCalc=this.oopCalc=this.torsionCalc=this.angleCalc=this.bondCalc=null;p(this,arguments)},JM.FF,"CalculationsUFF",
JM.FF.Calculations);y(c$,function(a,b,c,e,d,g,h,j){A(this,JM.FF.CalculationsUFF,[a,c,e,d,g,h,j]);this.ffParams=b;this.bondCalc=(new JM.FF.UFFDistanceCalc).set(this);this.angleCalc=(new JM.FF.UFFAngleCalc).set(this);this.torsionCalc=(new JM.FF.UFFTorsionCalc).set(this);this.oopCalc=(new JM.FF.UFFOOPCalc).set(this);this.vdwCalc=(new JM.FF.UFFVDWCalc).set(this)},"JM.FF.ForceField,java.util.Map,~A,~A,~A,~A,~A,JU.Lst");j(c$,"getUnits",function(){return"kJ"});j(c$,"setupCalculations",function(){var a,b=
(new JM.FF.UFFDistanceCalc).set(this);a=this.calculations[0]=new JU.Lst;for(var c=0;c<this.bondCount;c++){var e=this.minBonds[c],d=e.order;e.isAromatic&&(d=1.5);e.isAmide&&(d=1.41);b.setData(a,e.data[0],e.data[1],d)}a=this.calculations[1]=new JU.Lst;b=(new JM.FF.UFFAngleCalc).set(this);for(c=this.minAngles.length;0<=--c;)b.setData(a,this.minAngles[c].data);a=this.calculations[3]=new JU.Lst;b=(new JM.FF.UFFTorsionCalc).set(this);for(c=this.minTorsions.length;0<=--c;)b.setData(a,this.minTorsions[c].data);
a=this.calculations[4]=new JU.Lst;for(var b=(new JM.FF.UFFOOPCalc).set(this),g,c=0;c<this.ac;c++)e=this.minAtoms[c],3==e.nBonds&&JM.FF.CalculationsUFF.isInvertible(g=e.atom.getElementNumber())&&b.setData(a,c,g,0);this.pairSearch(this.calculations[5]=new JU.Lst,(new JM.FF.UFFVDWCalc).set(this),null,null);return!0});c$.isInvertible=d(c$,"isInvertible",function(a){switch(a){case 6:case 7:case 8:case 15:case 33:case 51:case 83:return!0;default:return!1}},"~N");c$.calculateR0=d(c$,"calculateR0",function(a,
b,c,e,d){d=-0.1332*(a+b)*Math.log(d);var g=Math.sqrt(c)-Math.sqrt(e);return a+b+d-a*b*g*g/(c*a+e*b)},"~N,~N,~N,~N,~N");j(c$,"compute",function(a,b){switch(a){case 0:return this.bondCalc.compute(b);case 1:return this.angleCalc.compute(b);case 3:return this.torsionCalc.compute(b);case 4:return this.oopCalc.compute(b);case 5:return this.vdwCalc.compute(b)}return 0},"~N,~A");j(c$,"getDebugHeader",function(a){switch(a){case -1:return"Universal Force Field -- Rappe, A. K., et. al.; J. Am. Chem. Soc. (1992) 114(25) p. 10024-10035\n";
default:return this.getDebugHeader2(a)}},"~N");j(c$,"getParameterObj",function(){return null},"JM.MinObject");w(c$,"KCAL332",1390.2842991599998,"KCAL644",2696.8016159999997,"KCAL6",25.1208,"KCAL22",92.1096,"KCAL44",184.2192,"PAR_R",0,"PAR_THETA",1,"PAR_X",2,"PAR_D",3,"PAR_ZETA",4,"PAR_Z",5,"PAR_V",6,"PAR_U",7,"PAR_XI",8,"PAR_HARD",9,"PAR_RADIUS",10)});m("JM.FF");n(["JM.FF.Calculation"],"JM.FF.MMFFAngleCalc",null,function(){c$=u(JM.FF,"MMFFAngleCalc",JM.FF.Calculation);d(c$,"setData",function(a,b){var c=
this.calcs.getParameterObj(b);null!=c&&a.addLast(l(-1,[b.data,c,b.key]))},"JU.Lst,JM.MinAngle");j(c$,"compute",function(a){this.key=a[2];this.getPointers(a);a=this.dData[0];var b=this.dData[1];this.calcs.setAngleVariables(this);var c=57.29577951308232*this.theta-b;180==b?(this.energy=143.9325*a*(1+Math.cos(this.theta)),this.calcs.gradients&&(this.dE=-143.9325*a*Math.sin(this.theta))):(this.energy=0.021922*a*Math.pow(c,2)*(1+-0.006981317007977318*c),this.calcs.gradients&&(this.dE=0.021922*a*c*(2+-0.020943951023931956*
c)));this.calcs.gradients&&this.calcs.addForces(this,3);this.calcs.logging&&this.calcs.appendLogData(this.calcs.getDebugLine(1,this));return this.energy},"~A");w(c$,"CB",-0.006981317007977318)});m("JM.FF");n(["JM.FF.Calculation"],"JM.FF.MMFFDistanceCalc",null,function(){c$=r(function(){this.delta2=this.kb=this.r0=0;p(this,arguments)},JM.FF,"MMFFDistanceCalc",JM.FF.Calculation);d(c$,"setData",function(a,b){this.ia=b.data[0];this.ib=b.data[1];var c=this.calcs.getParameterObj(b);null!=c&&a.addLast(l(-1,
[q(-1,[this.ia,this.ib]),c]))},"JU.Lst,JM.MinBond");j(c$,"compute",function(a){this.getPointers(a);this.kb=this.dData[0];this.r0=this.dData[1];this.calcs.setPairVariables(this);this.delta=this.rab-this.r0;this.delta2=this.delta*this.delta;this.energy=71.96625*this.kb*this.delta2*(1+-2*this.delta+2.3333333333333335*this.delta2);this.calcs.gradients&&(this.dE=71.96625*this.kb*this.delta*(2+-6*this.delta+9.333333333333334*this.delta2),this.calcs.addForces(this,2));this.calcs.logging&&this.calcs.appendLogData(this.calcs.getDebugLine(0,
this));return this.energy},"~A");w(c$,"FSTRETCH",71.96625,"CS",-2,"CS2",2.3333333333333335)});m("JM.FF");n(["JM.FF.Calculation"],"JM.FF.MMFFESCalc",null,function(){c$=u(JM.FF,"MMFFESCalc",JM.FF.Calculation);j(c$,"setData",function(a,b,c){0==this.calcs.minAtoms[b].partialCharge||0==this.calcs.minAtoms[c].partialCharge||a.addLast(l(-1,[q(-1,[b,c]),s(-1,[this.calcs.minAtoms[b].partialCharge,this.calcs.minAtoms[c].partialCharge,this.calcs.minAtoms[b].bs14.get(c)?249.0537:332.0716])]))},"JU.Lst,~N,~N,~N");
j(c$,"compute",function(a){this.getPointers(a);a=this.dData[0]*this.dData[1]*this.dData[2];this.calcs.setPairVariables(this);var b=this.rab+0.05;this.energy=a/b;this.calcs.gradients&&(this.dE=-this.energy/b,this.calcs.addForces(this,2));this.calcs.logging&&20<Math.abs(this.energy)&&this.calcs.appendLogData(this.calcs.getDebugLine(6,this));return this.energy},"~A");w(c$,"BUFF",0.05)});m("JM.FF");n(["JM.FF.Calculation"],"JM.FF.MMFFOOPCalc",null,function(){c$=r(function(){this.list=null;p(this,arguments)},
JM.FF,"MMFFOOPCalc",JM.FF.Calculation);G(c$,function(){this.list=q(4,0)});d(c$,"setData",function(a,b){if(3==this.calcs.minAtoms[b].nBonds){var c=this.calcs.minAtoms[b].getBondedAtomIndexes();this.list[0]=c[2];this.list[1]=b;this.list[2]=c[1];this.list[3]=c[0];var e=this.calcs.mmff.getOutOfPlaneParameter(this.list);0!=e&&(e=s(-1,[e]),a.addLast(l(-1,[q(-1,[c[0],b,c[1],c[2]]),e])),a.addLast(l(-1,[q(-1,[c[1],b,c[2],c[0]]),e])),a.addLast(l(-1,[q(-1,[c[2],b,c[0],c[1]]),e])))}},"JU.Lst,~N");j(c$,"compute",
function(a){this.getPointers(a);this.calcs.setOopVariables(this,!1);a=this.dData[0];this.energy=71.96568080495746*a*this.theta*this.theta;this.calcs.gradients&&(this.dE=2.5120761569715815*a*this.theta,this.calcs.addForces(this,4));this.calcs.logging&&this.calcs.appendLogData(this.calcs.getDebugLine(4,this));return this.energy},"~A");w(c$,"FOOPD",2.5120761569715815,"FOOP",71.96568080495746)});m("JM.FF");n(["JM.FF.Calculation"],"JM.FF.MMFFSBCalc",null,function(){c$=u(JM.FF,"MMFFSBCalc",JM.FF.Calculation);
d(c$,"setData",function(a,b){if(!this.calcs.isLinear(b.data[1])){var c=this.calcs.getParameter(b.sbKey),e=this.calcs.getParameterObj(b),d=this.calcs.getParameter(this.calcs.minBonds[b.data[3]]),g=this.calcs.getParameter(this.calcs.minBonds[b.data[4]]);null==c||(null==e||null==d||null==g)||(e=e[1],g=g[1],a.addLast(l(-1,[b.data,s(-1,[c[0],e,d[1]]),b.sbKey])),a.addLast(l(-1,[q(-1,[b.data[2],b.data[1],b.data[0]]),s(-1,[c[1],e,g]),b.sbKey])))}},"JU.Lst,JM.MinAngle");j(c$,"compute",function(a){this.key=
a[2];this.getPointers(a);a=2.5121*this.dData[0];var b=this.dData[1],c=this.dData[2];this.calcs.setPairVariables(this);this.calcs.setAngleVariables(this);c=this.rab-c;this.delta=57.29577951308232*this.theta-b;this.energy=a*c*this.delta;this.calcs.logging&&this.calcs.appendLogData(this.calcs.getDebugLine(2,this));this.calcs.gradients&&(this.dE=a*c,this.calcs.addForces(this,3),this.calcs.setPairVariables(this),this.dE=a*this.delta,this.calcs.addForces(this,2));return this.energy},"~A")});m("JM.FF");
n(["JM.FF.Calculation"],"JM.FF.MMFFTorsionCalc",null,function(){c$=u(JM.FF,"MMFFTorsionCalc",JM.FF.Calculation);d(c$,"setData",function(a,b){if(!this.calcs.isLinear(b.data[1])&&!this.calcs.isLinear(b.data[2])){var c=this.calcs.getParameterObj(b);null!=c&&a.addLast(l(-1,[b.data,c,b.key]))}},"JU.Lst,JM.MinTorsion");j(c$,"compute",function(a){this.key=a[2];this.getPointers(a);a=this.dData[0];var b=this.dData[1],c=this.dData[2];this.calcs.setTorsionVariables(this);var e=Math.cos(this.theta),d=e*e;this.energy=
0.5*(a*(1+e)+b*(2-2*d)+c*(1+e*(4*d-3)));if(this.calcs.gradients){var g=Math.sin(this.theta);this.dE=0.5*(-a*g+4*b*g*e+3*c*g*(1-4*d));this.calcs.addForces(this,4)}this.calcs.logging&&this.calcs.appendLogData(this.calcs.getDebugLine(3,this));return this.energy},"~A")});m("JM.FF");n(["JM.FF.Calculation"],"JM.FF.MMFFVDWCalc",null,function(){c$=u(JM.FF,"MMFFVDWCalc",JM.FF.Calculation);j(c$,"setData",function(a,b,c){this.a=this.calcs.minAtoms[b];this.b=this.calcs.minAtoms[c];var e=this.calcs.getParameter(this.a.vdwKey),
d=this.calcs.getParameter(this.b.vdwKey);if(!(null==e||null==d)){var g=e[0],h=e[1],j=e[2],m=e[3],e=H(e[4]),p=d[0],n=d[1],k=d[2],r=d[3],d=H(d[4]),j=j*Math.pow(g,0.25),u=k*Math.pow(p,0.25),k=(j-u)/(j+u),j=0.5*(j+u);68!=e&&68!=d&&(j*=1+0.2*(1-Math.exp(-12*k*k)));g=181.16*m*r*g*p/(Math.sqrt(g/h)+Math.sqrt(p/n))*Math.pow(j,-6);133==e+d&&(j*=0.8,g*=0.5);a.addLast(l(-1,[q(-1,[b,c]),s(-1,[j,g])]))}},"JU.Lst,~N,~N,~N");j(c$,"compute",function(a){this.getPointers(a);this.calcs.setPairVariables(this);a=this.dData[0];
var b=this.dData[1],c=this.rab/a,e=1.07/(c+0.07),d=1.12/(Math.pow(c,7)+0.12);this.energy=b*Math.pow(e,7)*(d-2);this.calcs.gradients&&(this.dE=-7*b*Math.pow(e,7)/a*(e/1.07*(d-2)+d*d*Math.pow(c,6)),this.calcs.addForces(this,2));this.calcs.logging&&0.1<Math.abs(this.energy)&&this.calcs.appendLogData(this.calcs.getDebugLine(5,this));return this.energy},"~A")});m("JM.FF");n(["JM.FF.Calculation"],"JM.FF.UFFAngleCalc",["JM.FF.CalculationsUFF"],function(){c$=u(JM.FF,"UFFAngleCalc",JM.FF.Calculation);d(c$,
"setData",function(a,b){this.a=this.calcs.minAtoms[this.ia=b[0]];this.b=this.calcs.minAtoms[this.ib=b[1]];this.c=this.calcs.minAtoms[this.ic=b[2]];var c="H_"===this.a.sType&&"H_"===this.c.sType?10:1;this.calcs.parA=this.calcs.getParameter(this.a.sType);this.calcs.parB=this.calcs.getParameter(this.b.sType);this.calcs.parC=this.calcs.getParameter(this.c.sType);var e=this.calcs.parB.iVal[0],d=this.calcs.parA.dVal[5],g=this.calcs.parC.dVal[5],h=this.calcs.parB.dVal[1],j=Math.cos(h),m=Math.sin(h),p,n;
switch(e){case 1:case 2:case 4:case 6:m=p=n=0;break;default:n=1/(4*m*m),p=-4*n*j,m=n*(2*j*j+1)}var k=this.a.getBondTo(this.ib),r=k.order;k.isAromatic&&(r=1.5);k.isAmide&&(r=1.41);this.rab=JM.FF.CalculationsUFF.calculateR0(this.calcs.parA.dVal[0],this.calcs.parB.dVal[0],this.calcs.parA.dVal[8],this.calcs.parB.dVal[8],r);k=this.c.getBondTo(this.ib);r=k.order;k.isAromatic&&(r=1.5);k.isAmide&&(r=1.41);k=JM.FF.CalculationsUFF.calculateR0(this.calcs.parB.dVal[0],this.calcs.parC.dVal[0],this.calcs.parB.dVal[8],
this.calcs.parC.dVal[8],r);r=Math.sqrt(this.rab*this.rab+k*k-2*this.rab*k*j);d=2696.8016159999997*(d*g/Math.pow(r,5))*(3*this.rab*k*(1-j*j)-r*r*j);a.addLast(l(-1,[q(-1,[this.ia,this.ib,this.ic,e]),s(-1,[d,57.29577951308232*h,m-n,p,2*n,c*d])]))},"JU.Lst,~A");j(c$,"compute",function(a){this.getPointers(a);a=this.iData[3];var b=this.calcs.isPreliminary?this.dData[5]:this.dData[0],c=this.dData[2],e=this.dData[3],d=this.dData[4];this.calcs.setAngleVariables(this);if((4==a||6==a)&&(2.35619<this.theta||
0.785398>this.theta))a=1;var g=Math.cos(this.theta),h=Math.sin(this.theta);switch(a){case 0:case 1:this.energy=b*(1+g)*(1+g)/4;break;case 2:this.energy=b*(1+4*g*(1+g))/9;break;case 4:case 6:this.energy=b*g*g;break;default:this.energy=b*(c+e*g+d*g*g)}if(this.calcs.gradients){switch(a){case 0:case 1:this.dE=-0.5*b*h*(1+g);break;case 2:this.dE=-4*h*b*(1-2*g)/9;break;case 4:case 6:this.dE=-b*h*g;break;default:this.dE=-b*(e*h-2*d*g*h)}this.calcs.addForces(this,3)}this.calcs.logging&&this.calcs.appendLogData(this.calcs.getDebugLine(1,
this));return this.energy},"~A")});m("JM.FF");n(["JM.FF.Calculation"],"JM.FF.UFFDistanceCalc",["JM.FF.CalculationsUFF"],function(){c$=r(function(){this.kb=this.r0=0;p(this,arguments)},JM.FF,"UFFDistanceCalc",JM.FF.Calculation);j(c$,"setData",function(a,b,c,e){this.calcs.parA=this.calcs.getParameter(this.calcs.minAtoms[b].sType);this.calcs.parB=this.calcs.getParameter(this.calcs.minAtoms[c].sType);this.r0=JM.FF.CalculationsUFF.calculateR0(this.calcs.parA.dVal[0],this.calcs.parB.dVal[0],this.calcs.parA.dVal[8],
this.calcs.parB.dVal[8],e);this.kb=1390.2842991599998*this.calcs.parA.dVal[5]*this.calcs.parB.dVal[5]/(this.r0*this.r0*this.r0);a.addLast(l(-1,[q(-1,[b,c]),s(-1,[this.r0,this.kb,e])]))},"JU.Lst,~N,~N,~N");j(c$,"compute",function(a){this.getPointers(a);this.r0=this.dData[0];this.kb=this.dData[1];this.calcs.setPairVariables(this);this.delta=this.rab-this.r0;this.energy=this.kb*this.delta*this.delta;this.calcs.gradients&&(this.dE=2*this.kb*this.delta,this.calcs.addForces(this,2));this.calcs.logging&&
this.calcs.appendLogData(this.calcs.getDebugLine(0,this));return this.energy},"~A")});m("JM.FF");n(["JM.FF.Calculation"],"JM.FF.UFFOOPCalc",null,function(){c$=u(JM.FF,"UFFOOPCalc",JM.FF.Calculation);j(c$,"setData",function(a,b,c){this.b=this.calcs.minAtoms[b];var e=this.b.getBondedAtomIndexes();this.a=this.calcs.minAtoms[this.ia=e[0]];this.c=this.calcs.minAtoms[this.ic=e[1]];this.d=this.calcs.minAtoms[this.id=e[2]];var d=1,g=-1,h=0,e=25.1208;switch(c){case 6:if("C_2"===this.b.sType&&1<this.b.hCount||
"C_2+"===this.b.sType||"O_2"===this.a.sType||"O_2"===this.c.sType||"O_2"===this.d.sType){e+=184.2192;break}break;case 7:case 8:break;default:e=92.1096;d=0.017453292519943295;switch(c){case 15:d*=84.4339;break;case 33:d*=86.9735;break;case 51:d*=87.7047;break;case 83:d*=90}c=Math.cos(d);d=c*c;g=-2*c;h=1}e/=3;a.addLast(l(-1,[q(-1,[this.ia,b,this.ic,this.id]),s(-1,[e,d,g,h,10*e])]));a.addLast(l(-1,[q(-1,[this.ic,b,this.id,this.ia]),s(-1,[e,d,g,h,10*e])]));a.addLast(l(-1,[q(-1,[this.id,b,this.ia,this.ic]),
s(-1,[e,d,g,h,10*e])]))},"JU.Lst,~N,~N,~N");j(c$,"compute",function(a){this.getPointers(a);a=this.calcs.isPreliminary?this.dData[4]:this.dData[0];var b=this.dData[1],c=this.dData[2],d=this.dData[3];this.calcs.setOopVariables(this,!0);var f=Math.cos(this.theta);this.energy=a*(b+c*f+d*f*f);this.calcs.gradients&&(this.dE=a*(c*Math.sin(this.theta)+2*d*Math.sin(this.theta)*f),this.calcs.addForces(this,4));this.calcs.logging&&this.calcs.appendLogData(this.calcs.getDebugLine(4,this));return this.energy},
"~A")});m("JM.FF");n(["JM.FF.Calculation"],"JM.FF.UFFTorsionCalc",["JM.Util"],function(){c$=u(JM.FF,"UFFTorsionCalc",JM.FF.Calculation);d(c$,"setData",function(a,b){var c=-1,d=0,f=0;this.a=this.calcs.minAtoms[this.ia=b[0]];this.b=this.calcs.minAtoms[this.ib=b[1]];this.c=this.calcs.minAtoms[this.ic=b[2]];this.d=this.calcs.minAtoms[this.id=b[3]];var g=this.c.getBondTo(this.ib),h=g.order;g.isAromatic&&(h=1.5);g.isAmide&&(h=1.41);this.calcs.parB=this.calcs.getParameter(this.b.sType);this.calcs.parC=this.calcs.getParameter(this.c.sType);
switch(this.calcs.parB.iVal[0]*this.calcs.parC.iVal[0]){case 9:d=3;f=this.calcs.parB.dVal[6];g=this.calcs.parC.dVal[6];h=0;switch(this.b.atom.getElementNumber()){case 8:h=2;break;case 16:case 34:case 52:case 84:h=6.8}if(0!=h)switch(this.c.atom.getElementNumber()){case 8:f=h;d=g=2;break;case 16:case 34:case 52:case 84:f=h,g=6.8,d=2}f=2.0934*Math.sqrt(f*g);break;case 4:c=1;d=2;f=2.0934*5*Math.sqrt(this.calcs.parB.dVal[7]*this.calcs.parC.dVal[7])*(1+4.18*Math.log(h));break;case 6:c=1;d=6;f=3==this.calcs.parC.iVal[0];
switch((f?this.c:this.b).atom.getElementNumber()){case 8:case 16:case 34:case 52:case 84:switch((f?this.b:this.c).atom.getElementNumber()){case 8:case 16:case 34:case 52:case 84:break;default:d=2,c=-1}}f=2.0934}JM.Util.isNearZero(f)||a.addLast(l(-1,[q(-1,[this.ia,this.ib,this.ic,this.id,d]),s(-1,[f,c])]))},"JU.Lst,~A");j(c$,"compute",function(a){this.getPointers(a);a=this.iData[4];var b=this.dData[0],c=this.dData[1];this.calcs.setTorsionVariables(this);this.energy=b*(1-c*Math.cos(this.theta*a));this.calcs.gradients&&
(this.dE=b*a*c*Math.sin(a*this.theta),this.calcs.addForces(this,4));this.calcs.logging&&this.calcs.appendLogData(this.calcs.getDebugLine(3,this));return this.energy},"~A")});m("JM.FF");n(["JM.FF.Calculation"],"JM.FF.UFFVDWCalc",null,function(){c$=u(JM.FF,"UFFVDWCalc",JM.FF.Calculation);j(c$,"setData",function(a,b,c){this.a=this.calcs.minAtoms[b];this.b=this.calcs.minAtoms[c];var d=this.calcs.getParameter(this.a.sType),f=this.calcs.getParameter(this.b.sType),g=d.dVal[2],h=d.dVal[3];(null==f||null==
f.dVal)&&System.out.println("OHOH");d=f.dVal[2];f=4.1868*Math.sqrt(h*f.dVal[3]);g=Math.sqrt(g*d);a.addLast(l(-1,[q(-1,[b,c]),s(-1,[g,f])]))},"JU.Lst,~N,~N,~N");j(c$,"compute",function(a){this.getPointers(a);a=this.dData[0];var b=this.dData[1];this.calcs.setPairVariables(this);var c=a/this.rab,d=c*c*c,d=d*d;this.energy=b*d*(d-2);this.calcs.gradients&&(this.dE=12*b*(1-d)*d*c/a,this.calcs.addForces(this,2));this.calcs.logging&&this.calcs.appendLogData(this.calcs.getDebugLine(5,this));return this.energy},
"~A")});m("JM.FF");c$=r(function(){this.sVal=this.dVal=this.iVal=null;p(this,arguments)},JM.FF,"FFParam");m("JM");n(["J.thread.JmolThread"],"JM.MinimizationThread",["JU.Logger"],function(){c$=r(function(){this.minimizer=null;p(this,arguments)},JM,"MinimizationThread",J.thread.JmolThread);y(c$,function(){A(this,JM.MinimizationThread,[])});j(c$,"setManager",function(a,b){this.minimizer=a;this.setViewer(b,"MinimizationThread");return 0},"~O,JV.Viewer,~O");j(c$,"run1",function(a){for(;;)switch(a){case -1:this.lastRepaintTime=
this.startTime;this.haveReference=!0;if(!this.minimizer.startMinimization())return;this.vwr.startHoverWatcher(!1);a=0;break;case 0:if(!this.minimizer.minimizationOn()||this.checkInterrupted(this.minimizer.getThread())){a=-2;break}this.currentTime=System.currentTimeMillis();if(!this.runSleep(33-(this.currentTime-this.lastRepaintTime),1))return;a=1;break;case 1:this.lastRepaintTime=this.currentTime=System.currentTimeMillis();a=this.minimizer.stepMinimization()?0:-2;break;case -2:this.minimizer.endMinimization();
this.vwr.startHoverWatcher(!0);return}},"~N");j(c$,"oops",function(a){this.minimizer.minimizationOn()&&JU.Logger.error(a.toString())},"Exception")})})(Clazz,Clazz.newLongArray,Clazz.doubleToByte,Clazz.doubleToInt,Clazz.doubleToLong,Clazz.declarePackage,Clazz.instanceOf,Clazz.load,Clazz.instantialize,Clazz.decorateAsClass,Clazz.floatToInt,Clazz.floatToLong,Clazz.makeConstructor,Clazz.defineEnumConstant,Clazz.exceptionOf,Clazz.newIntArray,Clazz.defineStatics,Clazz.newFloatArray,Clazz.declareType,Clazz.prepareFields,
Clazz.superConstructor,Clazz.newByteArray,Clazz.declareInterface,Clazz.p0p,Clazz.pu$h,Clazz.newShortArray,Clazz.innerTypeInstance,Clazz.isClassDefined,Clazz.prepareCallback,Clazz.newArray,Clazz.castNullAs,Clazz.floatToShort,Clazz.superCall,Clazz.decorateAsType,Clazz.newBooleanArray,Clazz.newCharArray,Clazz.implementOf,Clazz.newDoubleArray,Clazz.overrideConstructor,Clazz.clone,Clazz.doubleToShort,Clazz.getInheritedLevel,Clazz.getParamsType,Clazz.isAF,Clazz.isAI,Clazz.isAS,Clazz.isASS,Clazz.isAP,Clazz.isAFloat,
Clazz.isAII,Clazz.isAFF,Clazz.isAFFF,Clazz.tryToSearchAndExecute,Clazz.getStackTrace,Clazz.inheritArgs,Clazz.alert,Clazz.defineMethod,Clazz.overrideMethod,Clazz.declareAnonymous,Clazz.cloneFinals);
