- Timestamp:
- Apr 22, 2008, 11:48:46 AM (17 years ago)
- Children:
- 473c2b
- Parents:
- f91abc
- Location:
- pcp/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
pcp/src/perturbed.c
rf91abc r519b83 1274 1274 sawtooth(Lat,X[index[0]],index[0]) * TempPsiR [i0] 1275 1275 -sawtooth(Lat,X[index[2]],index[2]) * TempPsi2R[i0]; 1276 // ShiftGaugeOrigin(P,X [index[0]],index[0]) * TempPsiR [i0]1277 // -ShiftGaugeOrigin(P,X [index[2]],index[2]) * TempPsi2R[i0];1276 // ShiftGaugeOrigin(P,X,index[0]) * TempPsiR [i0] 1277 // -ShiftGaugeOrigin(P,X,index[2]) * TempPsi2R[i0]; 1278 1278 // PsiCR[iS] = (x[index[0]] - Wcentre[index[0]]) * TempPsiR [i0] - (x[index[2]] - Wcentre[index[2]]) * TempPsi2R[i0]; 1279 1279 } … … 1403 1403 // Psi2CR[iS] = sawtooth(Lat,X[cross(index_pxr,3)],cross(index_pxr,3)) * TempPsiR[i0]; 1404 1404 MinImageConv(Lat,x,Wcentre,X); 1405 PsiCR[iS] = ShiftGaugeOrigin(P,X [cross(index_pxr,1)],cross(index_pxr,1)) * TempPsiR[i0];1406 Psi2CR[iS] = ShiftGaugeOrigin(P,X [cross(index_pxr,3)],cross(index_pxr,3)) * TempPsiR[i0];1405 PsiCR[iS] = ShiftGaugeOrigin(P,X,cross(index_pxr,1)) * TempPsiR[i0]; 1406 Psi2CR[iS] = ShiftGaugeOrigin(P,X,cross(index_pxr,3)) * TempPsiR[i0]; 1407 1407 } 1408 1408 … … 1641 1641 * the core region inadequately/only moderately well approximated by a plane-wave-pseudo-potential-method. 1642 1642 * \param *P Problem at hand, containing Lattice and Ions 1643 * \param r parameter r1643 * \param r coordinate vector 1644 1644 * \param index index of the basis vector 1645 1645 * \return \f$d(r)\f$ 1646 1646 * \note Continuous Set of Damped Gauge Transformations according to Keith and Bader 1647 1647 */ 1648 inline double ShiftGaugeOrigin(struct Problem *P, double r , const int index)1648 inline double ShiftGaugeOrigin(struct Problem *P, double r[NDIM], const int index) 1649 1649 { 1650 1650 struct Ions *I = &P->Ion; 1651 1651 struct Lattice *Lat = &P->Lat; 1652 double x , tmp;1653 int is,ia ;1652 double x[NDIM], tmp; 1653 int is,ia, i; 1654 1654 1655 1655 // loop over all ions to calculate the sum 1656 x = r; 1656 for(i=0;i<NDIM;i++) 1657 x[i] = r[i]; 1657 1658 for (is=0; is < I->Max_Types; is++) 1658 for (ia=0; ia < I->I[is].Max_IonsOfType; ia++) { 1659 tmp = (r - I->I[is].R[NDIM*ia]); 1660 x -= tmp*exp(- I->I[is].alpha[ia] * tpow(tmp,4)); 1661 } 1662 1663 return(sawtooth(Lat,x,index)); // still use sawtooth due to the numerical instability around the border region of the cell 1659 for (ia=0; ia < I->I[is].Max_IonsOfType; ia++) 1660 for(i=0;i<NDIM;i++) { 1661 tmp = (r[i] - I->I[is].R[NDIM*ia]); 1662 x[i] -= tmp*exp(- I->I[is].alpha[ia] * tpow(tmp,4)); 1663 } 1664 1665 return(sawtooth(Lat,x[index],index)); // still use sawtooth due to the numerical instability around the border region of the cell 1664 1666 } 1665 1667 … … 2243 2245 for (i=0;i<NDIM;i++) // build gauge-translated r_bar evaluation point 2244 2246 r_bar[i] = sawtooth(Lat,X,i); 2245 // ShiftGaugeOrigin(P, truedist(Lat, x[i], Psi->AddData[k].WannierCentre[i], i),i);2247 // ShiftGaugeOrigin(P,X,i); 2246 2248 //truedist(Lat, x[i], Psi->AddData[k].WannierCentre[i], i); 2247 2249 factor += Psi1R[i0] * (r_bar[cross_lookup_1[0]] * Psi1R[i0]); … … 2264 2266 for (i=0;i<NDIM;i++) // build gauge-translated r_bar evaluation point 2265 2267 r_bar[i] = sawtooth(Lat,X[i],i); 2266 // ShiftGaugeOrigin(P,X [i],i);2268 // ShiftGaugeOrigin(P,X,i); 2267 2269 //X[i]; 2268 2270 Current = Psip0R[i0] * (r_bar[cross_lookup_1[0]] * Psi1R[i0]); -
pcp/src/perturbed.h
rf91abc r519b83 42 42 void PlotVectorPlane(struct Problem *P, int B_Index, int n_orth); 43 43 void ReadSrcPerturbedPsis(struct Problem *P, enum PsiTypeTag type); 44 inline double ShiftGaugeOrigin(struct Problem *P, double r , const int index);44 inline double ShiftGaugeOrigin(struct Problem *P, double r[NDIM], const int index); 45 45 inline double sawtooth(struct Lattice *Lat, const double L, const int index); 46 46 inline void MinImageConv(struct Lattice *Lat, const double R[NDIM], const double r[NDIM], double *result);
Note:
See TracChangeset
for help on using the changeset viewer.