Changeset 6df7db


Ignore:
Timestamp:
May 30, 2008, 9:06:35 AM (17 years ago)
Author:
Frederik Heber <heber@…>
Children:
9e831e
Parents:
08e223
Message:

StructOpts and Perturbation can now be combined, parsed src densities may be used with a different CommonWannier value (ChangeWannierCentres() is now externally callable)

StructOpt 1 with MaxOuterStep something and DoPerturbation 1 will now perform a structure optimization and subsequently the perturbation on the optimized structure. For this to work we needed a new enumerator ParseSrcDensities, which discerns between reading only occupied and all src densities. Thus, after the optimization is done, we read the written src densities and then immediately step on to to the perturbation minimisation.
This also allows for later perturbation with different CommonWannier values without re-minimisaition of occupied src densities.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pcp/src/run.c

    r08e223 r6df7db  
    721721  struct Lattice *Lat = &P->Lat;
    722722  struct Psis *Psi = &Lat->Psi;
     723  struct Ions *I = &P->Ion;
    723724  //struct FileData *F = &P->Files;
    724725//  int i;
     
    745746  ResetBrent(P,Psi);
    746747  *Stop = 0;
    747   if (P->Call.ReadSrcFiles != DoNotParse) {
     748  if ((P->Call.ReadSrcFiles != DoNotParse) && (!I->StructOpt)) {
    748749    if (!ReadSrcPsiDensity(P,Occupied,1, R->LevSNo)) {  // if file for level exists and desired, read from file
    749750      P->Call.ReadSrcFiles = DoNotParse; // -r was bogus, remove it, have to start anew
     
    776777    EnergyOutput(P,0);
    777778  }
    778   if ((P->Call.ReadSrcFiles != DoReadAllSrcDensities) && (P->Call.ReadSrcFiles != DoReadOccupiedSrcDensities)) {  // otherwise minimise oneself
     779  if ((I->StructOpt) || ((P->Call.ReadSrcFiles != DoReadAllSrcDensities) && (P->Call.ReadSrcFiles != DoReadOccupiedSrcDensities))) {  // otherwise minimise oneself
    779780    if(P->Call.out[LeaderOut]) fprintf(stderr,"(%i)Beginning minimisation of type %s ...\n", P->Par.me, R->MinimisationName[Occupied]);
    780781    while (*Stop != 1) {  // loop testing condition over all Psis
     
    10861087      MinimiseOccupied(P, &Stop, &SuperStop);
    10871088      if (!I->StructOpt) {
    1088         if (((P->Call.ReadSrcFiles != DoReadAllSrcDensities) || (P->Call.ReadSrcFiles != DoReadOccupiedSrcDensities)) || (!ParseWannierFile(P))) { // only localize and store if they have just been minimised (hence don't come solely from file), otherwise read stored values from file (if possible)
     1089        if (((P->Call.ReadSrcFiles != DoReadAllSrcDensities) && (P->Call.ReadSrcFiles != DoReadOccupiedSrcDensities)) || (!ParseWannierFile(P))) { // only localize and store if they have just been minimised (hence don't come solely from file), otherwise read stored values from file (if possible)
    10891090          SpeedMeasure(P, WannierTime, StartTimeDo);
    10901091          ComputeMLWF(P);   // localization of orbitals
    10911092          SpeedMeasure(P, WannierTime, StopTimeDo);
    1092           OutputVisSrcFiles(P, Occupied); // rewrite now localized orbitals
    10931093    //      if (!TestReadnWriteSrcDensity(P,Occupied))
    10941094    //        Error(SomeError,"TestReadnWriteSrcDensity failed!");
    10951095        }
    1096      
     1096        // join Wannier orbital to groups with common centres under certain conditions
     1097        //debug (P,"Changing Wannier Centres according to CommonWannier");
     1098        ChangeWannierCentres(P);
     1099        OutputVisSrcFiles(P, Occupied); // rewrite now localized orbitals
     1100       
     1101
    10971102//      // plot psi cuts
    10981103//      for (i=0; i < Psi->MaxPsiOfType; i++)  // go through all wave functions (here without the extra ones for each process)
Note: See TracChangeset for help on using the changeset viewer.