// Use this for initialization void Awake() { nonbonding = new NonBonding(); vdws = new List <VdW> (); stretches = new List <Stretch> (); bends = new List <Bend> (); torsions = new List <Torsion> (); improperTorsions = new List <ImproperTorsion> (); dielectricConstant = 1f; }
public void UpdateParameters(Parameters other, bool replace = false) { if (replace) { this.nonbonding = other.nonbonding; } for (int otherIndex = 0; otherIndex < other.vdws.Count; otherIndex++) { int thisIndex = IndexVdW(other.vdws [otherIndex]); if (thisIndex == -1) { this.vdws.Add(other.vdws [otherIndex].Copy()); } else if (replace) { this.vdws [thisIndex] = other.vdws [otherIndex].Copy(); } } for (int otherIndex = 0; otherIndex < other.stretches.Count; otherIndex++) { int thisIndex = IndexStretch(other.stretches [otherIndex]); if (thisIndex == -1) { this.stretches.Add(other.stretches [otherIndex].Copy()); } else if (replace) { this.stretches [thisIndex] = other.stretches [otherIndex].Copy(); } } for (int otherIndex = 0; otherIndex < other.bends.Count; otherIndex++) { int thisIndex = IndexBend(other.bends [otherIndex]); if (thisIndex == -1) { this.bends.Add(other.bends [otherIndex].Copy()); } else if (replace) { this.bends [thisIndex] = other.bends [otherIndex].Copy(); } } for (int otherIndex = 0; otherIndex < other.torsions.Count; otherIndex++) { int thisIndex = IndexTorsion(other.torsions [otherIndex]); if (thisIndex == -1) { Debug.Log("New Torsion: " + other.torsions [otherIndex].ToString()); this.torsions.Add(other.torsions [otherIndex].Copy()); } else if (replace) { Debug.Log("Replaced Torsion: " + other.torsions [otherIndex].ToString()); this.torsions [thisIndex] = other.torsions [otherIndex].Copy(); } } for (int otherIndex = 0; otherIndex < other.improperTorsions.Count; otherIndex++) { int thisIndex = IndexImproperTorsion(other.improperTorsions [otherIndex]); if (thisIndex == -1) { this.improperTorsions.Add(other.improperTorsions [otherIndex].Copy()); } else if (replace) { this.improperTorsions [thisIndex] = other.improperTorsions [otherIndex].Copy(); } } }
public void SetNonBonding(int vType = 3, int cType = 1, int vCutoff = 0, int cCutoff = 0, float vScale1 = 0f, float vScale2 = 0f, float vScale3 = 0.5f, float cScale1 = 0f, float cScale2 = 0f, float cScale3 = -1.2f) { this.nonbonding = new NonBonding(vType, cType, vCutoff, cCutoff, vScale1, vScale2, vScale3, cScale1, cScale2, cScale3); }