Skip to content
Snippets Groups Projects
  1. Mar 23, 2022
  2. Jan 21, 2022
  3. Nov 28, 2021
    • Nicolas Essing's avatar
      Changed definition of torque (by a factor of the magnetic moment size). · ad5c240d
      Nicolas Essing authored
      The magnetic torque can be defined either as the derivative of the
      total energy with respect to the magnetic moment direction
      (T = dE/de) or as the perpendicular part of the derivative of the
      total energy with respect to the magnetic moment (T = P dE/dm).
      As de = 1/|m| P dm, the two definitions have the same directions
      and differ by the factor 1/|m|.
      
      So far, the first definition was used.
      However, we decided to switch to the second, as it is easier comparable
      to the constraint magnetic field (same units) and thus also makes it
      easier to use the torque in scripts or as an initial guess for constraint
      magnetic fields.
      
      !! Note that his commit might BREAK COMPATIBILITY with previus scripts !!
      ad5c240d
  4. Nov 16, 2021
  5. Nov 08, 2021
    • Nicolas Essing's avatar
      Information on convergence of constraint angles only over angles that really are constraint. · 3ef4db5c
      Nicolas Essing authored
      The loop calculates the difference in angles before and after they are fixed.
      This should always be zero for non-constraint moments (apart from a small deviation
      that we not fully understand right now) and converge to zero for constraint moments
      (at least approximately, with the torque-based calculation there will be some remaining
      difference). For angles constraint only with the old method however, this will converge
      to a non-zero value that is not of interest and hides the information on the constraint
      moments. Thus, after this commit, they are skipped in the calculation of what is called
      "Largest change of angle for constraint moment".
      3ef4db5c
  6. Nov 05, 2021
  7. Nov 04, 2021
    • Nicolas Essing's avatar
      Added a consistency check for the input parameters. · 76e61041
      Nicolas Essing authored
      If noncollinear magnetic fields are enabled (noncobfield=t) but
      noncollinear magnetism is not (korbit=0), the program will print
      an error message and halt.
      76e61041
    • Nicolas Essing's avatar
      Fix torque based constraints for negative moments. · a8cbb566
      Nicolas Essing authored
      The constraint magnetic field that is calculated based on the torque
      is now muliplied by the sign of the magnetic moment in the local
      frame of reference.
      The torque has to be understood as an energy related to a change in
      the direction of the local frame of reference. This can differ from
      the direction of the magnetic moment by a sign. For the constraint
      fields, the energy related to a change of the direction of the moment
      is needed, so this sign has to be put at this point.
      (This is probably somewhat confusing, I'll add a better explanation
      and probably some sketch to the documentation of these features.)
      a8cbb566
    • Nicolas Essing's avatar
    • Nicolas Essing's avatar
      Added the mean xc bfield as a scale for updating the constraint fields. · 46dc8d62
      Nicolas Essing authored
      The mean xc bfield is calculated together with the torques as a quantity
      that is needed to update the constraining fields. It is stored in the
      bfield_data type.
      The calculation is not a physically meaningfull thing as it ignores
      the underlying mesh details, but good enough for this application.
      
      This fixes the suprisingly small mixing needed for the constraint method
      based only on the moments. As pointed out by Eduardo, comparing with the
      definition in literature (e.g. Journal of Applied Physics 85, 4824 (1999)),
      there was some magnetic field missing to get the update loop to the
      right units (i.e. the right order of magnitude).
      Tested only for bcc Fe so far, this constraint mode now works well
      with a mixing factor of around 1 (0.9 is now default).
      46dc8d62
  8. Nov 03, 2021
  9. Nov 01, 2021
  10. Oct 28, 2021
    • Nicolas Essing's avatar
    • Nicolas Essing's avatar
      Output on torque. · 1a11fdbc
      Nicolas Essing authored
      If calculated, the torques are now also stored in the binary results
      file. Depending on the verbosity parameter, they are written to
      an ASCII file and an overview is written to stdout.
      1a11fdbc
    • Nicolas Essing's avatar
    • Nicolas Essing's avatar
      Small bugfix regarding torque calculation. · 8ef64b4a
      Nicolas Essing authored
      Calculating torque and magnetic moment only inside the muffin tin
      region, the point at the muffin tin radius was set to zero. This was
      not consistent with the convention on this in the rest of the code
      and introduced a (small) deviation from the desired result.
      8ef64b4a
    • Nicolas Essing's avatar
      Cleaned up input parameters for nonco bfields. · bfe8b97c
      Nicolas Essing authored
      Remove some inputs that were moved to atom-wise switches in
      nonco_angle.dat and some for functionality that was not implemented.
      
      Changed the rest to form a more consistent interface.
      Keeping a switch to turn everything off. If that switch is turned on,
      this implies calculating the torque and constraint magnetism in general.
      The fields are calculated for all atoms where that is specified in
      the nonco_angle.dat.
      It does not anymore imply external fields: There is a new switch for that.
      If that is turned on, a file with external fields must be provided.
      Introduced a verbosity parameter for bfields, select between no output,
      summary and detailed information.
      
      See comments and documentation for details.
      
      Changed output depending on the new input parameter.
      bfe8b97c
    • Nicolas Essing's avatar
      Remove unused variables from bfield_data. · 23bab175
      Nicolas Essing authored
      The external field in spherical coordinates is only used for reading
      the input file, there is no need to store it next to the same field
      in cartheisan coordinates.
      
      Also renamed external bfield from "bfield" to "bfield_ext".
      23bab175
    • Nicolas Essing's avatar
      Bugfix concerning nonco bfield data. · ee23f391
      Nicolas Essing authored
      The bfields are now always allocated, as they are passed around to
      some subroutines even if they are not used. The types are small if
      they are not initialized, so that doesn't matter.
      Actually, I never got an error from this bug, but I think this
      might depend on the compiler.
      ee23f391
  11. Oct 27, 2021
  12. Oct 26, 2021
  13. Oct 25, 2021
  14. Oct 22, 2021
    • Nicolas Essing's avatar
      Working on output for constraint magnetic fields, still preparing. · 7f46ab12
      Nicolas Essing authored
      Moved the open of the bin.results1 file to the write subroutine,
      introduced a subroutine to calculate the record length and used
      in for both reading and writing.
      7f46ab12
    • Nicolas Essing's avatar
      Cleaning up the subroutine call. · 3a30d53f
      Nicolas Essing authored
      3a30d53f
    • Nicolas Essing's avatar
      Started working on output for constraint magnetic fields. · 3621b681
      Nicolas Essing authored
      I want to incorporate this in the routines where the nonco_angle_out.dat
      is written, which is done in a somewhat complicated way. In
      ProcessKKRresults (which is called for inMasterGroup, so once per
      atom), calculateDensities is called. This subroutine calls
      writeResults1File, in which some results are written to a binary file
      at an atom-specific position.
      
      As a first step, I moved the call to this subroutine out of
      calculateDensities to ProcessKKRresults.
      
      Compiles, does not crash, and gave the same bin.results1 file in
      a simple test run I made. Together with what I read in the code
      I'm quite confident it did not change anything.
      3621b681
  15. Oct 21, 2021
    • Nicolas Essing's avatar
      Renamed angle_fixed to angle_fix_mode · 21372d11
      Nicolas Essing authored
      This is more instructive as the interger is not a simple
      switch anymore.
      21372d11
    • Nicolas Essing's avatar
      Remove fix angle modes 4 and 5. · bf93e606
      Nicolas Essing authored
      Mode 4 was supposed to fix the direction using constraint magnetic
      fields but allowing the moment to change direction as far as the
      constraint field does not fullfill this yet. While this is in principle
      possible, the current implementation was wrong, as the goal angles
      are not stored separately, so a changed moment would also change the
      goal.
      This mode could be added in the future, but as it converges slower
      than mode 2 and to the same result, there is not much reason for that.
      
      Mode 5 was supposed to fix the direction by cancelling the torque,
      but allowing the moment to move. This does not depend at all on the
      given goal directions and does thus not make any sense.
      bf93e606
    • Nicolas Essing's avatar
      In CalculationData, now only the locally treated atoms are allocated. · 4def830e
      Nicolas Essing authored
      This keeps the array of bfields consistent with other atom-wise
      quantites.
      4def830e
  16. Oct 18, 2021
    • Nicolas Essing's avatar
    • Nicolas Essing's avatar
      Implemented torque. · 3a37ec68
      Nicolas Essing authored
      The subroutine calc_torque() in bfield/torque.f90 calculates the
      magnetic torque and iterates the selfconsistency loop for the
      constraint magnetic fields, based on torque or on the fields alone.
      
      The routine is called from rhovalnew() as in KKRhost. Adapted the
      inputs and included the call. Adapted wrappers_mod, where this
      routine is called.
      
      I had to move another subroutine from NonCollinearMagnetism_mod.F90
      to the helpers module to avoid circular dependencies. Did not change
      the routine otherwise.
      
      Included the new dependencies in the Makefile.
      
      Compiles and did not crash in a short test run,
      but not completely tested.
      3a37ec68
  17. Oct 14, 2021
    • Nicolas Essing's avatar
      Fixed a bug in constraint bfield calculation related to muffin tins. · faa0629e
      Nicolas Essing authored
      The muffin tin index was taken from the old mesh, which is not correct
      and can even give errors if it is larger than the total size in the
      new mesh.
      
      Introduced a function in the Chebyshev mesh module that calculates
      the index of the muffin tin radius. Formula for this is taken from
      KKRhost.
      Used this function where before the muffin tin index of the old mesh
      was used. Added the dependency on this function to the Makefile.
      faa0629e
Loading