~siesta-pseudos-bases/siesta/trunk-psml

« back to all changes in this revision

Viewing changes to Src/m_ts_sparse.F90

  • Committer: Alberto Garcia
  • Date: 2019-09-02 14:09:43 UTC
  • mfrom: (427.6.323 trunk)
  • Revision ID: albertog@icmab.es-20190902140943-mzmbe1jacgefpgxw
Sync to trunk-776 (notably nc/soc wavefunction support)


Show diffs side-by-side

added added

removed removed

Lines of Context:
507
507
          jct = orb_type(jo)
508
508
          if ( jct == TYP_BUFFER ) cycle
509
509
 
510
 
          if ( ict > 0 ) then
511
 
             ! In order to allow to have the update sparsity pattern
512
 
             ! as a subset, we require that the Hamiltonian also
513
 
             ! has the electrode interconnects
514
 
             UseBulk = Elecs(ict)%Bulk
515
 
          else if ( jct > 0 ) then
516
 
             UseBulk = Elecs(jct)%Bulk
517
 
          else
518
 
             ! we are definitely not in an electrode
519
 
             ! hence, this will *most* likely get updated
520
 
             UseBulk = .false.
521
 
          end if
 
510
          UseBulk = .false.
 
511
          ! Specify bulk according to electrode
 
512
          ! In order to allow to have the update sparsity pattern
 
513
          ! as a subset, we require that the Hamiltonian also
 
514
          ! has the electrode interconnects
 
515
          if ( ict > TYP_DEVICE ) UseBulk = Elecs(ict)%Bulk
 
516
          if ( jct > TYP_DEVICE ) UseBulk = UseBulk .or. Elecs(jct)%Bulk
522
517
 
523
518
          if ( UseBulk ) then
524
519
             ! here we create the Hamiltonian matrix on these criterias:
532
527
             
533
528
             ! If not bulk we only want to save the Hamiltonian elements
534
529
             ! for the same electrode, otherwise everything is needed
535
 
             if ( ict > 0 .and. jct > 0 ) then
 
530
             if ( ict > TYP_DEVICE .and. jct > TYP_DEVICE ) then
536
531
                l_HS(ind) = ict == jct
537
532
             else
538
533
                l_HS(ind) = .true.
661
656
          !   DM_update == 1 (cross-terms)
662
657
          !   DM_update == 2 (all)
663
658
 
664
 
          if ( ict > 0 ) then
 
659
          if ( ict > TYP_DEVICE ) then
665
660
             ! Assign that the density matrix, should not be updated
666
661
             DM_bulk = Elecs(ict)%DM_update < 2
667
662
             ! If DM_cross is different from 0, the entire
668
663
             ! electrode region is updated
669
664
             DM_cross = Elecs(ict)%DM_update /= 0
670
 
          else if ( jct > 0 ) then
 
665
          else if ( jct > TYP_DEVICE ) then
671
666
             DM_bulk = Elecs(jct)%DM_update < 2
672
667
             DM_cross = Elecs(jct)%DM_update /= 0
673
668
          else
678
673
 
679
674
          ! We check whether it is electrode-connections. 
680
675
          ! If, so, they are not used in transiesta:
681
 
          if      ( ict > 0 .and. jct > 0 ) then
 
676
          if      ( ict > TYP_DEVICE .and. jct > TYP_DEVICE ) then
682
677
 
683
678
             ! Remove connections between electrodes
684
679
             ! but maintain same electrode updates if not bulk dm