#include <ComputeBonds.h>
|
|
Definition at line 23 of file ComputeBonds.h. 00023 { size = 2 };
|
|
|
Definition at line 49 of file ComputeBonds.h. 00049 { bondEnergyIndex, TENSOR(virialIndex), reductionDataSize };
|
|
|
Definition at line 50 of file ComputeBonds.h. 00050 { reductionChecksumLabel = REDUCTION_BOND_CHECKSUM };
|
|
|
Copyright (c) 1995, 1996, 1997, 1998, 1999, 2000 by The Board of Trustees of the University of Illinois. All rights reserved. Definition at line 12 of file ComputeBonds.inl. 00012 { ; }
|
|
||||||||||||||||
|
Definition at line 14 of file ComputeBonds.inl. References atomID, TupleSignature::offset, TupleSignature::tupleParamType, and value. 00014 {
00015 atomID[0] = atom0;
00016 atomID[1] = atom0 + sig->offset[0];
00017 value = &v[sig->tupleParamType];
00018 }
|
|
||||||||||||
|
Definition at line 20 of file ComputeBonds.inl. References bond::atom1, bond::atom2, atomID, Bond, bond::bond_type, and value. 00021 {
00022 atomID[0] = a->atom1;
00023 atomID[1] = a->atom2;
00024 value = &v[a->bond_type];
00025 }
|
|
||||||||||||
|
Definition at line 27 of file ComputeBonds.inl. References atomID, and AtomID. 00028 {
00029 if (atom0 > atom1) { // Swap end atoms so lowest is first!
00030 AtomID tmp = atom1; atom1 = atom0; atom0 = tmp;
00031 }
00032 atomID[0] = atom0;
00033 atomID[1] = atom1;
00034 }
|
|
|
Definition at line 57 of file ComputeBonds.h. 00057 {};
|
|
||||||||||||
|
Definition at line 65 of file ComputeBonds.C. References BigReal, DebugM, Lattice::delta(), TuplePatchElem::f, Force, BondValue::k, Patch::lattice, Vector::length(), Vector::length2(), localIndex, TuplePatchElem::p, p, CompAtom::partition, CompAtom::position, pp_clamp(), pp_reduction(), pressureProfileMin, pressureProfileSlabs, pressureProfileThickness, Real, value, TuplePatchElem::x, Vector::x, BondValue::x0, Vector::y, and Vector::z. 00067 {
00068 DebugM(1, "::computeForce() localIndex = " << localIndex[0] << " "
00069 << localIndex[1] << std::endl);
00070
00071 BigReal r; // Distance between atoms
00072 BigReal scal; // force scaling
00073 BigReal diff; // difference between theta and theta0
00074 BigReal energy; // energy from the bond
00075
00076 //DebugM(3, "::computeForce() -- starting with bond type " << bondType << std::endl);
00077
00078 // get the bond information
00079 Real k = value->k * scale;
00080 Real x0 = value->x0;
00081
00082 // compute vectors between atoms and their distances
00083 const Lattice & lattice = p[0]->p->lattice;
00084 const Vector r12 = lattice.delta(p[0]->x[localIndex[0]].position,
00085 p[1]->x[localIndex[1]].position);
00086
00087 if (0. == x0) { // for Drude bonds
00088 scal = -2.0*k;
00089 energy = k * r12.length2();
00090 }
00091 else {
00092 r = r12.length();
00093
00094 // Compare it to the rest bond
00095 diff = r - x0;
00096
00097 // Add the energy from this bond to the total energy
00098 energy = k*diff*diff;
00099
00100 // Determine the magnitude of the force
00101 diff *= -2.0*k;
00102
00103 // Scale the force vector accordingly
00104 scal = (diff/r);
00105 }
00106 const Force f12 = scal * r12;
00107
00108
00109 // Now add the forces to each force vector
00110 p[0]->f[localIndex[0]] += f12;
00111 p[1]->f[localIndex[1]] -= f12;
00112
00113 DebugM(3, "::computeForce() -- ending with delta energy " << energy << std::endl);
00114 reduction[bondEnergyIndex] += energy;
00115 reduction[virialIndex_XX] += f12.x * r12.x;
00116 reduction[virialIndex_XY] += f12.x * r12.y;
00117 reduction[virialIndex_XZ] += f12.x * r12.z;
00118 reduction[virialIndex_YX] += f12.y * r12.x;
00119 reduction[virialIndex_YY] += f12.y * r12.y;
00120 reduction[virialIndex_YZ] += f12.y * r12.z;
00121 reduction[virialIndex_ZX] += f12.z * r12.x;
00122 reduction[virialIndex_ZY] += f12.z * r12.y;
00123 reduction[virialIndex_ZZ] += f12.z * r12.z;
00124
00125 if (pressureProfileData) {
00126 BigReal z1 = p[0]->x[localIndex[0]].position.z;
00127 BigReal z2 = p[1]->x[localIndex[1]].position.z;
00128 int n1 = (int)floor((z1-pressureProfileMin)/pressureProfileThickness);
00129 int n2 = (int)floor((z2-pressureProfileMin)/pressureProfileThickness);
00130 pp_clamp(n1, pressureProfileSlabs);
00131 pp_clamp(n2, pressureProfileSlabs);
00132 int p1 = p[0]->x[localIndex[0]].partition;
00133 int p2 = p[1]->x[localIndex[1]].partition;
00134 int pn = pressureProfileAtomTypes;
00135 pp_reduction(pressureProfileSlabs,
00136 n1, n2,
00137 p1, p2, pn,
00138 f12.x * r12.x, f12.y * r12.y, f12.z * r12.z,
00139 pressureProfileData);
00140 }
00141 }
|
|
||||||||||||||||||||
|
Definition at line 50 of file ComputeBonds.C. References Bond, int32, and NAMD_die(). 00051 {
00052 #ifdef MEM_OPT_VERSION
00053 NAMD_die("Should not be called in BondElem::getMoleculePointers in memory optimized version!");
00054 #else
00055 *count = mol->numBonds;
00056 *byatom = mol->bondsByAtom;
00057 *structarray = mol->bonds;
00058 #endif
00059 }
|
|
||||||||||||
|
Definition at line 61 of file ComputeBonds.C. References Parameters::bond_array. 00061 {
00062 *v = p->bond_array;
00063 }
|
|
||||||||||||||||
|
Definition at line 33 of file ComputeBonds.h. References AtomSignature::bondCnt, and AtomSignature::bondSigs.
|
|
|
Definition at line 44 of file ComputeBonds.h.
|
|
||||||||||||||||
|
|
|
|
Definition at line 41 of file ComputeBonds.inl. References atomID. 00042 {
00043 return (atomID[0] < a.atomID[0] ||
00044 (atomID[0] == a.atomID[0] &&
00045 (atomID[1] < a.atomID[1]) ));
00046 }
|
|
|
Definition at line 36 of file ComputeBonds.inl. References atomID.
|
|
||||||||||||
|
Definition at line 143 of file ComputeBonds.C. References ADD_TENSOR, SubmitReduction::item(), REDUCTION_BOND_ENERGY, REDUCTION_VIRIAL_NORMAL, and virialIndex. 00144 {
00145 reduction->item(REDUCTION_BOND_ENERGY) += data[bondEnergyIndex];
00146 ADD_TENSOR(reduction,REDUCTION_VIRIAL_NORMAL,data,virialIndex);
00147 }
|
|
|
Definition at line 24 of file ComputeBonds.h. Referenced by BondElem(), operator<(), and operator==(). |
|
|
Definition at line 25 of file ComputeBonds.h. Referenced by computeForce(). |
|
|
Definition at line 26 of file ComputeBonds.h. Referenced by computeForce(). |
|
|
Definition at line 45 of file ComputeBonds.C. |
|
|
Definition at line 47 of file ComputeBonds.C. Referenced by computeForce(). |
|
|
Copyright (c) 1995, 1996, 1997, 1998, 1999, 2000 by The Board of Trustees of the University of Illinois. All rights reserved. Definition at line 44 of file ComputeBonds.C. Referenced by computeForce(). |
|
|
Definition at line 46 of file ComputeBonds.C. Referenced by computeForce(). |
|
|
Definition at line 27 of file ComputeBonds.h. |
|
|
Definition at line 47 of file ComputeBonds.h. Referenced by BondElem(), and computeForce(). |
1.3.9.1