修訂 | 16450a543591bf6e69a0c15e20d4168fa947d957 (tree) |
---|---|
時間 | 2011-10-08 16:52:18 |
作者 | Mikiya Fujii <mikiya.fujii@gmai...> |
Commiter | Mikiya Fujii |
Zindo/S-HF analytic force is implemented with out GTO expansion. #26483
git-svn-id: https://svn.sourceforge.jp/svnroot/molds/MolDS/trunk@198 1136aad2-a195-0410-b898-f5ea1d11b9d8
@@ -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 |
@@ -30,7 +30,7 @@ SCF_END | ||
30 | 30 | //CIS_END |
31 | 31 | |
32 | 32 | MD |
33 | - total_steps 10 | |
33 | + total_steps 100 | |
34 | 34 | electronic_state 2 |
35 | 35 | dt 0.05 |
36 | 36 | MD_END |
@@ -1444,6 +1444,77 @@ void ZindoS::CalcForce(int electronicStateIndex){ | ||
1444 | 1444 | Atom* atomA = (*molecule->GetAtomVect())[a]; |
1445 | 1445 | int firstAOIndexA = atomA->GetFirstAOIndex(); |
1446 | 1446 | int numberAOsA = atomA->GetValence().size(); |
1447 | + double coreRepulsion[CartesianType_end] = {0.0,0.0,0.0}; | |
1448 | + double electronicForce1[CartesianType_end] = {0.0,0.0,0.0}; | |
1449 | + double electronicForce2[CartesianType_end] = {0.0,0.0,0.0}; | |
1450 | + double electronicForce3[CartesianType_end] = {0.0,0.0,0.0}; | |
1451 | + double*** overlapDer = MallocerFreer::GetInstance()->MallocDoubleMatrix3d | |
1452 | + (OrbitalType_end, OrbitalType_end, CartesianType_end); | |
1453 | + for(int b=0; b<this->molecule->GetAtomVect()->size(); b++){ | |
1454 | + if(a != b){ | |
1455 | + Atom* atomB = (*molecule->GetAtomVect())[b]; | |
1456 | + int firstAOIndexB = atomB->GetFirstAOIndex(); | |
1457 | + int numberAOsB = atomB->GetValence().size(); | |
1458 | + | |
1459 | + // calc. first derivative of overlap. | |
1460 | + this->CalcDiatomicOverlapFirstDerivative(overlapDer, atomA, atomB); | |
1461 | + | |
1462 | + for(int i=0; i<CartesianType_end; i++){ | |
1463 | + coreRepulsion[i] += this->GetDiatomCoreRepulsionFirstDerivative | |
1464 | + (a, b, (CartesianType)i); | |
1465 | + electronicForce1[i] += ( atomA->GetCoreCharge()*atomicElectronPopulation[b] | |
1466 | + +atomB->GetCoreCharge()*atomicElectronPopulation[a]) | |
1467 | + *this->GetNishimotoMatagaTwoEleIntFirstDerivative | |
1468 | + (atomA, s, atomB, s, (CartesianType)i); | |
1469 | + } | |
1470 | + | |
1471 | + for(int mu=firstAOIndexA; mu<firstAOIndexA+numberAOsA; mu++){ | |
1472 | + OrbitalType orbitalMu = atomA->GetValence()[mu-firstAOIndexA]; | |
1473 | + for(int nu=firstAOIndexB; nu<firstAOIndexB+numberAOsB; nu++){ | |
1474 | + OrbitalType orbitalNu = atomB->GetValence()[nu-firstAOIndexB]; | |
1475 | + double bondParameter = 0.5*(atomA->GetBondingParameter( | |
1476 | + this->theory, orbitalMu) | |
1477 | + +atomB->GetBondingParameter( | |
1478 | + this->theory, orbitalNu)); | |
1479 | + for(int i=0; i<CartesianType_end; i++){ | |
1480 | + electronicForce2[i] += 2.0*this->orbitalElectronPopulation[mu][nu] | |
1481 | + *bondParameter | |
1482 | + *overlapDer[mu-firstAOIndexA][nu-firstAOIndexB][i]; | |
1483 | + electronicForce3[i] += (this->orbitalElectronPopulation[mu][mu] | |
1484 | + *this->orbitalElectronPopulation[nu][nu] | |
1485 | + -0.5*pow(this->orbitalElectronPopulation[mu][nu],2.0)) | |
1486 | + *this->GetNishimotoMatagaTwoEleIntFirstDerivative | |
1487 | + (atomA, orbitalMu, atomB, orbitalNu, | |
1488 | + (CartesianType)i); | |
1489 | + } | |
1490 | + } | |
1491 | + } | |
1492 | + | |
1493 | + for(int i=0; i<CartesianType_end; i++){ | |
1494 | + this->matrixForce[a][i] = -1.0*(coreRepulsion[i] | |
1495 | + - electronicForce1[i] | |
1496 | + + electronicForce2[i] | |
1497 | + + electronicForce3[i]); | |
1498 | + } | |
1499 | + | |
1500 | + } | |
1501 | + } | |
1502 | + if(overlapDer != NULL){ | |
1503 | + MallocerFreer::GetInstance()->FreeDoubleMatrix3d(&overlapDer, | |
1504 | + OrbitalType_end, | |
1505 | + OrbitalType_end); | |
1506 | + } | |
1507 | + } | |
1508 | + | |
1509 | + | |
1510 | + /* | |
1511 | + // Calculate force. First derivative of overlap integral is | |
1512 | + // calculated with GTO expansion technique. | |
1513 | + //#pragma omp parallel for schedule(auto) | |
1514 | + for(int a=0; a<this->molecule->GetAtomVect()->size(); a++){ | |
1515 | + Atom* atomA = (*molecule->GetAtomVect())[a]; | |
1516 | + int firstAOIndexA = atomA->GetFirstAOIndex(); | |
1517 | + int numberAOsA = atomA->GetValence().size(); | |
1447 | 1518 | for(int i=0; i<CartesianType_end; i++){ |
1448 | 1519 | |
1449 | 1520 | double coreRepulsion = 0.0; |
@@ -1498,9 +1569,11 @@ void ZindoS::CalcForce(int electronicStateIndex){ | ||
1498 | 1569 | + electronicForce3); |
1499 | 1570 | } |
1500 | 1571 | } |
1572 | + */ | |
1501 | 1573 | |
1502 | - /* | |
1574 | + /* | |
1503 | 1575 | // checking of calculated force |
1576 | + cout << "chek the force\n"; | |
1504 | 1577 | double checkSumForce[3] = {0.0, 0.0, 0.0}; |
1505 | 1578 | for(int a=0; a<this->molecule->GetAtomVect()->size(); a++){ |
1506 | 1579 | for(int i=0; i<CartesianType_end; i++){ |
@@ -1514,7 +1587,6 @@ void ZindoS::CalcForce(int electronicStateIndex){ | ||
1514 | 1587 | cout << "force: " << i << " " << checkSumForce[i] << endl; |
1515 | 1588 | } |
1516 | 1589 | */ |
1517 | - | |
1518 | 1590 | } |
1519 | 1591 | |
1520 | 1592 | } |