how to transfer binary file vampire0.chk to text file ?

365 views
Skip to first unread message

Min Yi

unread,
Oct 24, 2017, 2:44:15 PM10/24/17
to Vampire Users
Dear All,
 I tried to set an initial spin configuration by myself. Since VAMPIRE only supports the set of initial uniform spin configuration for a certain material, I tried to write a vampire0.chk  file and let it read by VAMPIRE to start a new calculation.
The vampire0.chk  file  is generated by sim:save-checkpoint=continuous sim:save-checkpoint-rate=1. But I do not know the data structure of checkpoint file (vampire0.chk). My idea is that: if I can change it into text file, then I can edit it freely, and then change it back binary file.
Does anybody have some tips on transferring binary checkpoint file (vampire0.chk) to text file ?
Many thanks.
Min

Samuel Westmoreland

unread,
Oct 24, 2017, 3:17:52 PM10/24/17
to Min Yi, Vampire Users
Dear Min,

I'm not sure how the checkpoint files work, but I would guess that what you propose is quite difficult. Depending on the type of configuration you would like to set up, it may be easier to split your system up into different materials, and then set the initial spin configuration of each material. For simple structures you could do this just in your material and input files. For more complicated structures, antiferromagnets say, you could split the unit cell into two (or more) species using a unit cell file (.ucf) and then initialise each species in a different direction in your material file.

Best regards,
Sam


--
You received this message because you are subscribed to the Google Groups "Vampire Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vampire-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Richard Evans

unread,
Oct 24, 2017, 3:38:56 PM10/24/17
to Sam Westmoreland, Min Yi, Vampire Users
Dear Min, Sam,

Yes - the format of the checkpoint files is defined in this file:


However, the problem is this is not very portable and does not allow changing the number of processors between runs or even associating spins to positions. To load an existing checkpoint you can easily use

sim:load-checkpoint = restart

(to start a new calculation with the saved atomic spin configuration) or 

sim:load-checkpoint = continue

to continue an existing simulation and load in the state of the random number generator.

Cheers,

Richard

Min Yi

unread,
Oct 24, 2017, 5:03:59 PM10/24/17
to Vampire Users
Dear Richard, Sam,
Thanks very much for your suggestion. I still cannot work it out by using ucf file. I will learn how to write a checkpoint file by myself.
What I want to simulate is the domain wall. I list the atomic coordinates and exchange parameters in the ucf file (in the unit cell). For domain wall, I need a large system, e.g. 5x5x20 unit cells. Basically, when I look into the papers published by Richard, I have two ideas:
1) Ideally, I have to fix the spin at the two ends of the system and relax the system to see the domain wall. I have not figured out in VAMPIRE how to realize it. It seems that fix the spin at specific atomic position is still unavailable in VAMPIRE.
2) I remember that Richard in JEMS (Glasgow, UK) showed a poster about domain wall in Nd2Fe14B. Richard wrote in the poster 'The equilibrium domain wall spin configuration is obtained by initializing an antiparallel boundary and relaxing the system.' I do not know how to realize initializing an antiparallel boundary in Nd2FeB. Also Richard in one post pointed out that checkpoint file can be used as initial spin configuration. That is why I try to understand how to utilize checkpoint file.
3) In the paper co-authored by Richard 'Temperature-dependent exchange stiffness and domain wall width in Co', it says 'The domain wall is constrained in the system by applying antiperiodic boundary conditions'. I do not know how to realize the antiperiodic boundary conditions.
Many thanks for your kind help.
Best regards,
Min

Miftah Al-Mahdawi

unread,
Oct 25, 2017, 2:38:06 AM10/25/17
to Min Yi, Vampire Users
Dear Min,

I feel that you can do this by modifying directly the calculation program you want to use in programs folder. The only downside is you have to recompile every time you decide to change something, but compiling doesn't take time.
I think you can define the spin configuration by adding something like this (based on diagnostics.cpp) before the start of main procedure:

           //define sx,sy,sz vectors beforehand, and normalize them properly
           for(int atom=0; atom<atoms::num_atoms; atom++){
                atoms::x_spin_array[atom] = sx[atom];
                atoms::y_spin_array[atom] = sy[atom];
                atoms::z_spin_array[atom] = sz[atom];
            }

Best regards,
Miftah


To unsubscribe from this group and stop receiving emails from it, send an email to vampire-users+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages