Revision | 164f33d2c737f8c0d0cc55da4d2a0b6e81c71c10 (tree) |
---|---|
Zeit | 2011-09-28 22:02:32 |
Autor | Mikiya Fujii <mikiya.fujii@gmai...> |
Commiter | Mikiya Fujii |
Cndo2::GetGaussianOverlap is refactored.
git-svn-id: https://svn.sourceforge.jp/svnroot/molds/MolDS/trunk@146 1136aad2-a195-0410-b898-f5ea1d11b9d8
@@ -1242,8 +1242,10 @@ double Cndo2::GetGaussianOverlapSaSb(double gaussianExponentA, | ||
1242 | 1242 | double value; |
1243 | 1243 | double temp1 = 0.0; |
1244 | 1244 | double temp2 = 0.0; |
1245 | - temp1 = 2.0*pow(gaussianExponentA*gaussianExponentB, 0.5)/(gaussianExponentA+gaussianExponentB); | |
1246 | - temp2 = -1.0* gaussianExponentA*gaussianExponentB/(gaussianExponentA+gaussianExponentB); | |
1245 | + temp1 = 2.0*pow(gaussianExponentA*gaussianExponentB, 0.5) | |
1246 | + /(gaussianExponentA+gaussianExponentB); | |
1247 | + temp2 = -1.0* gaussianExponentA*gaussianExponentB | |
1248 | + /(gaussianExponentA+gaussianExponentB); | |
1247 | 1249 | value = pow(temp1, 1.5)*exp(temp2*pow(Rab, 2.0)); |
1248 | 1250 | return value; |
1249 | 1251 | } |
@@ -1258,32 +1260,32 @@ double Cndo2::GetGaussianOverlap(AtomType atomTypeA, | ||
1258 | 1260 | double gaussianExponentB, |
1259 | 1261 | double dx, double dy, double dz, double Rab){ |
1260 | 1262 | |
1261 | - double value = this->GetGaussianOverlapSaSb(gaussianExponentA, | |
1262 | - gaussianExponentB, Rab); | |
1263 | + double value = 0.0; | |
1263 | 1264 | if(valenceOrbitalA == s && valenceOrbitalB == s){ |
1265 | + value = 1.0; | |
1264 | 1266 | } |
1265 | 1267 | else if(valenceOrbitalA == s && valenceOrbitalB == px){ |
1266 | - value *= 2.0*gaussianExponentA*pow(gaussianExponentB, 0.5)*dx; | |
1268 | + value = 2.0*gaussianExponentA*pow(gaussianExponentB, 0.5)*dx; | |
1267 | 1269 | value /= (gaussianExponentA+gaussianExponentB); |
1268 | 1270 | } |
1269 | 1271 | else if(valenceOrbitalA == s && valenceOrbitalB == py){ |
1270 | - value *= 2.0*gaussianExponentA*pow(gaussianExponentB, 0.5)*dy; | |
1272 | + value = 2.0*gaussianExponentA*pow(gaussianExponentB, 0.5)*dy; | |
1271 | 1273 | value /= (gaussianExponentA+gaussianExponentB); |
1272 | 1274 | } |
1273 | 1275 | else if(valenceOrbitalA == s && valenceOrbitalB == pz){ |
1274 | - value *= 2.0*gaussianExponentA*pow(gaussianExponentB, 0.5)*dz; | |
1276 | + value = 2.0*gaussianExponentA*pow(gaussianExponentB, 0.5)*dz; | |
1275 | 1277 | value /= (gaussianExponentA+gaussianExponentB); |
1276 | 1278 | } |
1277 | 1279 | else if(valenceOrbitalA == px && valenceOrbitalB == s){ |
1278 | - value *= -2.0*pow(gaussianExponentA, 0.5)*gaussianExponentB*dx; | |
1280 | + value = -2.0*pow(gaussianExponentA, 0.5)*gaussianExponentB*dx; | |
1279 | 1281 | value /= (gaussianExponentA+gaussianExponentB); |
1280 | 1282 | } |
1281 | 1283 | else if(valenceOrbitalA == py && valenceOrbitalB == s){ |
1282 | - value *= -2.0*pow(gaussianExponentA, 0.5)*gaussianExponentB*dy; | |
1284 | + value = -2.0*pow(gaussianExponentA, 0.5)*gaussianExponentB*dy; | |
1283 | 1285 | value /= (gaussianExponentA+gaussianExponentB); |
1284 | 1286 | } |
1285 | 1287 | else if(valenceOrbitalA == pz && valenceOrbitalB == s){ |
1286 | - value *= -2.0*pow(gaussianExponentA, 0.5)*gaussianExponentB*dz; | |
1288 | + value = -2.0*pow(gaussianExponentA, 0.5)*gaussianExponentB*dz; | |
1287 | 1289 | value /= (gaussianExponentA+gaussianExponentB); |
1288 | 1290 | } |
1289 | 1291 | else if(valenceOrbitalA == px && valenceOrbitalB == px){ |
@@ -1291,22 +1293,22 @@ double Cndo2::GetGaussianOverlap(AtomType atomTypeA, | ||
1291 | 1293 | temp = -1.0*pow(dx,2.0)*gaussianExponentA*gaussianExponentB; |
1292 | 1294 | temp /= (gaussianExponentA+gaussianExponentB); |
1293 | 1295 | temp += 0.5; |
1294 | - value *= 4.0*pow(gaussianExponentA*gaussianExponentB, 0.5); | |
1296 | + value = 4.0*pow(gaussianExponentA*gaussianExponentB, 0.5); | |
1295 | 1297 | value /= (gaussianExponentA+gaussianExponentB); |
1296 | 1298 | value *= temp; |
1297 | 1299 | } |
1298 | 1300 | else if(valenceOrbitalA == px && valenceOrbitalB == py){ |
1299 | - value *= -4.0*pow(gaussianExponentA*gaussianExponentB, 1.5); | |
1301 | + value = -4.0*pow(gaussianExponentA*gaussianExponentB, 1.5); | |
1300 | 1302 | value *= pow(gaussianExponentA+gaussianExponentB, -2.0); |
1301 | 1303 | value *= dx*dy; |
1302 | 1304 | } |
1303 | 1305 | else if(valenceOrbitalA == px && valenceOrbitalB == pz){ |
1304 | - value *= -4.0*pow(gaussianExponentA*gaussianExponentB, 1.5); | |
1306 | + value = -4.0*pow(gaussianExponentA*gaussianExponentB, 1.5); | |
1305 | 1307 | value *= pow(gaussianExponentA+gaussianExponentB, -2.0); |
1306 | 1308 | value *= dx*dz; |
1307 | 1309 | } |
1308 | 1310 | else if(valenceOrbitalA == py && valenceOrbitalB == px){ |
1309 | - value *= -4.0*pow(gaussianExponentA*gaussianExponentB, 1.5); | |
1311 | + value = -4.0*pow(gaussianExponentA*gaussianExponentB, 1.5); | |
1310 | 1312 | value *= pow(gaussianExponentA+gaussianExponentB, -2.0); |
1311 | 1313 | value *= dy*dx; |
1312 | 1314 | } |
@@ -1315,22 +1317,22 @@ double Cndo2::GetGaussianOverlap(AtomType atomTypeA, | ||
1315 | 1317 | temp = -1.0*pow(dy,2.0)*gaussianExponentA*gaussianExponentB; |
1316 | 1318 | temp /= (gaussianExponentA+gaussianExponentB); |
1317 | 1319 | temp += 0.5; |
1318 | - value *= 4.0*pow(gaussianExponentA*gaussianExponentB, 0.5); | |
1320 | + value = 4.0*pow(gaussianExponentA*gaussianExponentB, 0.5); | |
1319 | 1321 | value /= (gaussianExponentA+gaussianExponentB); |
1320 | 1322 | value *= temp; |
1321 | 1323 | } |
1322 | 1324 | else if(valenceOrbitalA == py && valenceOrbitalB == pz){ |
1323 | - value *= -4.0*pow(gaussianExponentA*gaussianExponentB, 1.5); | |
1325 | + value = -4.0*pow(gaussianExponentA*gaussianExponentB, 1.5); | |
1324 | 1326 | value *= pow(gaussianExponentA+gaussianExponentB, -2.0); |
1325 | 1327 | value *= dy*dz; |
1326 | 1328 | } |
1327 | 1329 | else if(valenceOrbitalA == pz && valenceOrbitalB == px){ |
1328 | - value *= -4.0*pow(gaussianExponentA*gaussianExponentB, 1.5); | |
1330 | + value = -4.0*pow(gaussianExponentA*gaussianExponentB, 1.5); | |
1329 | 1331 | value *= pow(gaussianExponentA+gaussianExponentB, -2.0); |
1330 | 1332 | value *= dz*dx; |
1331 | 1333 | } |
1332 | 1334 | else if(valenceOrbitalA == pz && valenceOrbitalB == py){ |
1333 | - value *= -4.0*pow(gaussianExponentA*gaussianExponentB, 1.5); | |
1335 | + value = -4.0*pow(gaussianExponentA*gaussianExponentB, 1.5); | |
1334 | 1336 | value *= pow(gaussianExponentA+gaussianExponentB, -2.0); |
1335 | 1337 | value *= dz*dy; |
1336 | 1338 | } |
@@ -1339,7 +1341,7 @@ double Cndo2::GetGaussianOverlap(AtomType atomTypeA, | ||
1339 | 1341 | temp = -1.0*pow(dz,2.0)*gaussianExponentA*gaussianExponentB; |
1340 | 1342 | temp /= (gaussianExponentA+gaussianExponentB); |
1341 | 1343 | temp += 0.5; |
1342 | - value *= 4.0*pow(gaussianExponentA*gaussianExponentB, 0.5); | |
1344 | + value = 4.0*pow(gaussianExponentA*gaussianExponentB, 0.5); | |
1343 | 1345 | value /= (gaussianExponentA+gaussianExponentB); |
1344 | 1346 | value *= temp; |
1345 | 1347 | } |
@@ -1354,6 +1356,9 @@ double Cndo2::GetGaussianOverlap(AtomType atomTypeA, | ||
1354 | 1356 | ss << this->errorMessageOrbitalType << OrbitalTypeStr(valenceOrbitalB) << endl; |
1355 | 1357 | throw MolDSException(ss.str()); |
1356 | 1358 | } |
1359 | + double sasb = this->GetGaussianOverlapSaSb(gaussianExponentA, | |
1360 | + gaussianExponentB, Rab); | |
1361 | + value *= sasb; | |
1357 | 1362 | |
1358 | 1363 | return value; |
1359 | 1364 | } |
@@ -1,8 +1,8 @@ | ||
1 | 1 | // example of the input file |
2 | 2 | THEORY |
3 | - //cndo/2 | |
3 | + cndo/2 | |
4 | 4 | //indo |
5 | - zindo/s | |
5 | + //zindo/s | |
6 | 6 | //none |
7 | 7 | //principal_axes |
8 | 8 | //translate |