/* * DO NOT MANUALLY UPDATE THIS FILE. * If needed: make cpp_headers * * fortran2c.py - automatic conversion * cmemfl.inc -> cmemfl.h */ #ifndef __CMEMFL__ #define __CMEMFL__ #include "types.h" #ifdef __cplusplus extern "C" { #endif // //=== Cmemfl ===========================================================* // //----------------------------------------------------------------------* // * // Partial (all additions wrt the original one) * // Copyright (C) 2003-2019: CERN & INFN * // All Rights Reserved. * // * // CoMmon for ElectroMagnetic FieLds: * // * // Created on 16 January 1992 by Alfredo Ferrari in substitution of * // the old Magpar in order to include electric fields and crystal * // channeling * // * // Description of variables: * // Bifuni = strength of a possibly uniform magnetic field (Tesla)* // Umgfld = x-axis unit vector component of a possibly uniform * // magnetic field * // Vmgfld = y-axis unit vector component of a possibly uniform * // magnetic field * // Wmgfld = z-axis unit vector component of a possibly uniform * // magnetic field * // Elfuni = strength of a possibly uniform electric field (kV/cm)* // Uelfld = x-axis unit vector component of a possibly uniform * // electric field * // Velfld = y-axis unit vector component of a possibly uniform * // electric field * // Welfld = z-axis unit vector component of a possibly uniform * // electric field * // Bifcur = current strength of the magnetic field (Tesla) * // Umgcur = x-axis unit vector component of the current * // magnetic field * // Vmgcur = y-axis unit vector component of the current * // magnetic field * // Wmgcur = z-axis unit vector component of the current * // magnetic field * // Elfcur = strength of the current electric field (kV/cm) * // Uelcur = x-axis unit vector component of the current * // electric field * // Velcur = y-axis unit vector component of the current * // electric field * // Welcur = z-axis unit vector component of the current * // electric field * // Delfld = maximum tolerable error of the boundary iteration * // both for electric/magnetic transport (cm) * // Anglmg = biggest angle that particle is allowed to travel * // in the magnetic field (deg) * // Dstpmg = guarantees that step is not forced to be too small. * // (if suggested angle is too big, magnetic only) * // Rkrfra = max. fraction of a 2 pi angle allowed for a single * // Runge-Kutta step in magnetic field * // Dmgfrk = maximum step length with magnetic field if Runge- * // -Kutta integration is selected, used only in zones of* // zero local field * // Delfrk = maximum step length with electric field for Runge- * // -Kutta integration * // Denelf = energy gained or lost in the electric field * // Densra = energy lost by synchrotron radiation emission * // Fpbmax = factor by which to multiply Pmax in dp/dx tabulation.* // Lfmgel = flag for first time initialization * // Lrkuti = flag for selecting Runge-Kutta integration for an * // inhomogeneous magnetic field and no electric field * // Runge-Kutta is always selected if an electric field * // is present. * // Direct constant radius tracking is always selected * // only if an homogeneous magnetic field is present * // Lmgmap = flag for inhomogeneous magnetic field * // Lelmap = flag for inhomogeneous electric field * // Lmgfon(j,k) = flag for magnetic field presence for the j_th region * // for prompt (=1) or radioactive decay (=2) particles * // Lelfon(j,k) = flag for electric field presence for the j_th region * // for prompt (=1) or radioactive decay (=2) particles * // Icryon(j,k) = flag for crystal and channeling for the j_th region * // for prompt (=1) or radioactive decay (=2) particles * // If > 0 it is the index of the crystal corresponding * // to that region * //----------------------------------------------------------------------* // * extern struct { double bifuni; double elfuni; double bifcur; double elfcur; double umgfld; double vmgfld; double wmgfld; double umgcur; double vmgcur; double wmgcur; double uelfld; double velfld; double welfld; double uelcur; double velcur; double welcur; double delfld; double anglmg; double dstpmg; double rkrfra; double dmgfrk; double delfrk; double del000; double onmcth; double anglrk; double onmcrk; double dminmn; double denelf; double densra; double fpbmax; logical lfmgel; logical lrkuti; logical lmgfld; logical lelfld; logical lmgmap; logical lelmap; logical lrkutt; logical lmgfon[2][MXXRGN]; logical lelfon[2][MXXRGN]; int icryon[2][MXXRGN]; } cmemfl_; //----------------------------------------------------------------------* // * // CoMmon for user defined MaGnetic FieLds: * // * // Description of variables: * // Mxflds = Maximum number of created fields allowed * // Mxrgns = Maximum number of magnatic field regions * // Nfldmg = Number of magnetic field types created * // Cnammg = Name of the magnetic field * // Itypmg = field main type * // Ixsmmg = input symmetry for X axis. If not than zero * // on entry apply symmetry and on exit select * // the appropriate field component: * // 1=Bx, 2=By, 3=Bz, 4=-Bx, 5=-By, 6=-Bz * // Iysmmg = input symmetry for Y axis. If not than zero * // Izsmmg = input symmetry for Z axis. If not than zero * // R2comg = maximum radius^2 of core field * // Xcormg = X origin of core field * // Ycormg = Y origin of core field * // Cosmg = Cosine of azimuth angle of field (wrt to +Y) * // Sinmg = Sine of azimuth angle of field (wrt to +Y) * // Rbndmg = bend radius of dipolar fields * // Sagtmg = sagitta (valid in case of a non-zero bend radius) * // Uuumg = U direction of constnat field * // Vvvmg = V direction of constnat field * // Wwwmg = W direction of constnat field * // Nxmg = X Number of nodes in grid * // Nymg = Y Number of nodes in grid * // Nzmg = Z Number of nodes in grid * // Ixptmg = X index pointer in blank common * // Iyptmg = Y index pointer in blank common * // Izptmg = Z index pointer in blank common * // Inptmg = number of nodes set with DATA for consistency * // checking it should be equal to Nxmg*Nymg*Nzmg * // * // Iregmg = index of field type on region * // Krttmg = rotation type there to be applied * // 0=region, 1=lattice-prototype, 2=lattice-replica * // Irotmg = rotation matrix for the field * // * // FIXME BNV what counting should I use for the user? * // Field Types numbering??? * // Constant 1 * // Dipolar 2 * // Quad 4 * // Sex 6 * // Octu 8 * // Deca 10 * // Int-RZ 100 * // Int-2D 200 * // Int-2D+Analytic 202..210 * // Int-3D 300 * // Int-3D+Analytic 302..310 * //----------------------------------------------------------------------* // const int NMGCONST = 1; const int NMGDIPOLE = 2; const int NMGQUAD = 4; const int NMGSEX = 6; const int NMGOCTU = 8; const int NMGDECA = 10; const int NMGINTRZ = 100; const int NMGINT2D = 200; const int NMGINT3D = 300; // FIXME WARNING reorder elements for correct padding const int MXFLDS = 128; // Region field properties // counters extern struct { char cnammg[MXFLDS][10]; int itypmg[MXFLDS]; double r2comg[MXFLDS]; double xcormg[MXFLDS]; double ycormg[MXFLDS]; double rbndmg[MXFLDS]; double sagtmg[MXFLDS]; double sinmg[MXFLDS]; double cosmg[MXFLDS]; double uuumg[MXFLDS]; double vvvmg[MXFLDS]; double wwwmg[MXFLDS]; int ixsmmg[MXFLDS]; int iysmmg[MXFLDS]; int izsmmg[MXFLDS]; int nxmg[MXFLDS]; int nymg[MXFLDS]; int nzmg[MXFLDS]; double xminmg[MXFLDS]; double yminmg[MXFLDS]; double zminmg[MXFLDS]; double xmaxmg[MXFLDS]; double ymaxmg[MXFLDS]; double zmaxmg[MXFLDS]; double xstpmg[MXFLDS]; double ystpmg[MXFLDS]; double zstpmg[MXFLDS]; int ixptmg[MXFLDS]; int iyptmg[MXFLDS]; int izptmg[MXFLDS]; int inptmg[MXFLDS]; int iregmg[MXXRGN]; int krttmg[MXXRGN]; double fregmg[MXXRGN]; int irotmg[MXXRGN]; int nfldmg; } cmgfld_; #ifdef __cplusplus } #endif #endif