.. _examples: Examples ======== A simple simulation of magnetic nanoparticles is easy to set up. First you will need a position file; for a chain of MNPs this can be automatically generated:: mango_strings 1.0%1.0 5 0 0 0 0 The above command will generate an extended xyz file, `string_5r1.0%1.0.xyz`, containing 5 identical MNPs with a radius of 10nm separated by 1% of their diameter, 2nm. MNPs are aligned by default in the Z direction with their magnetisation also aligned along the same direction. The alignment can be adjusted with phi and theta (the four zeros, see `mango_strings -h`). To run a simple susceptibility simulation in a vanishingly small applied field your input file will be:: SusceptibilityCalc True Iterations 100000 Repetitions 1 NumberParticles 5 ParticleRadius 1.0 PositionFile ./string_5r1.0%1.0.xyz SkipSave 50 Boxsize 100 Using an input file with the above content, a simulation is run with:: mango -I The simulation will run one statistical repetition for 1e5 steps saving every 50th step. Values such as timestep are default values and therefore unneeded in the input file, the default values are shown in :ref:`inputfile`. To view the resulting movement the included visualiser can be used. Firstly a xyz file is needed for the visualiser. A xyz file is created by navigating to the output file in the newly created directory where the file `S_Run1_mol-5.1.hdf5` has been created. The simulation is run 1, therefore we post process our datafile with the below command to create a xyz file:: mango --suscep --logs ./ --run 1 --cfile xyz To visualise the simulation we use the created xyz file and run:: mango_vis S_Run1.0.m.xyz The video below was created using the above command appending the `-m` flag to create a video. The mesh is the size of the particles (10nm radius), the central sphere allows for the viewing of the magnetisation (blue arrows) and force (red arrows) vectors. .. video:: _static/example.mp4 :width: 600 :height: 456 :autoplay: :loop: .. _inputfile: Full Input File --------------- The default values for all variables are also shown here Downloadable here: :download:`InputFile`. .. literalinclude:: InputFile