McStas logo McStas - A neutron ray-trace simulation package ILL; PSI; ESS Niels Bohr Institute DTU Physics NEXMAP

McStas

About McStas
 Conditions of use
 Authors/Contacts
 Project funding
 Screenshots

Download
 Components
 Linux Install (deb/rpm)
 Mac OS X Install
 Unix Install (src code)
 Windows Install
 Other Downloads (share)

Mailing list

Search web/mailinglist

Documentation
 McStas manual
 FAQ
 Known problems
 Publications
 C Compilers
 Other
 Tools
 Tutorial

Workshops/conferences

Developments

Links

Report bugs

Git

McStas Ubuntu live-dvd


McStas: Pol_simpleBfield Component

[ Identification | Description | Input parameters | Output parameters | Links ]

The Pol_simpleBfield Component

Magnetic field component.

Identification

  • Author: Erik B Knudsen, Peter Christiansen and Peter Willendrup
  • Origin: RISOE
  • Date: July 2011
  • Version: 4382

Description


Region with a definable magnetic field.

The component is nestable. This means that it requires a

// START MAGNETIC FIELD
COMPONENT msf =
Pol_simpleBfield(xwidth=0.08, yheight=0.08, zdepth=0.2, Bx=0, By=-0.678332e-4, Bz=0)
     AT (0, 0, 0) RELATIVE armMSF

// HERE CAN BE OTHER COMPONENTS INSIDE THE MAGNETIC FIELD

// STOP MAGNETIC FIELD
COMPONENT msf_stop = Pol_simpleBfield_stop(magnet_comp_stop=msf)
     AT (0, 0, 0) RELATIVE armMSF

In between the two component instances the propagation routine
PROP_DT also handles spin propagation.
The current algorithm used for spin propagation is:
SimpleNumMagnetPrecession
in pol-lib.

Example: Pol_simpleBfield(xwidth=0.1, yheight=0.1, zdepth=0.2, Bx=0, By=1, Bz=0)
         Pol_simpleBfield(xwidth=0.1, yheight=0.1, zdepth=0.2,
           filename="bfield.dat", fieldFunction=table_magnetic_field)

The magetic field may be given as any definable c-function with a specific footprint:
  int func(double x, double y, double z, double t, double *bx, double *by, double *bz, void *data)
where the magnetic field at coordinates (x,y,z, t) is returned in the variables 
pointed to by bx,by, and bz. Additional parameters to be handed to the function
should be handed to the function using the pointer data.

Functions supplied by the system are:
1. const_magnetic_field: Constant field (Bx,By,Bz) within the region
2. rot_magnetic_field: Field is initially (0,By,0) but after a length of zdepth 
     has rotated to (By,0,0)
3. majorana_magnetic_field: Field is initially (Bx,By,0) liearly transforms to 
     (-Bx,By,0) after zdepth where By<

Input parameters

Parameters in boldface are required; the others are optional.
Name Unit Description Default
fieldFunction pointer Function describing the magnetic field. const_magnetic_field
xwidth m Width of opening.  
yheight m Height of opening.  
zdepth m Length of field.  
Bx T Parameter used for x composant of field.  
By T Parameter used for y composant of field.  
Bz T Parameter used for z composant of field.  
filename "bfield.dat"

Output parameters

Name Unit Description Default
magnet  
parPtr pointer Pointer to component magnet parameters  

Links


[ Identification | Description | Input parameters | Output parameters | Links ]

Generated automatically by McDoc, Peter Willendrup <peter.willendrup@risoe.dk> / Fri Mar 17 20:40:06 2017


Last Modified: Friday, 17-Mar-2017 21:40:06 CET
Search website mailinglist archive GitHub repos