Changeset 3052 for branches/mcstas-1.x
- Timestamp:
- 04/08/11 15:12:44 (14 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
branches/mcstas-1.x/lib/optics/Pol_simpleBfield.comp
r1673 r3052 145 145 Coords localG = rot_apply(ROT_A_CURRENT_COMP, coords_set(0,-GRAVITY,0)); 146 146 147 if(!mcMagnetPrecession) 148 mcMagnetPrecession = &SimpleNumMagnetPrecession; 149 147 150 if(mcMagnet==0) { 148 151 … … 154 157 parPtr[4] = yh; 155 158 parPtr[5] = length; 156 MAGNET_ON;159 //MAGNET_ON; 157 160 } else { 158 MAGNET_OFF;161 //MAGNET_OFF; 159 162 } 160 163 … … 181 184 MAGNET_ON; 182 185 mcMagneticField = fieldFunction; 183 mcMagnetPrecession = &SimpleNumMagnetPrecession;184 186 mcMagnetData = parPtr; 185 186 187 rot_copy(mcMagnetRot, ROT_A_CURRENT_COMP); 187 188 mcMagnetPos = coords_scale(POS_A_CURRENT_COMP, 1.0); 188 189 // i=0: Bx parameter190 // i=1: By parameter191 // i=2: Bz parameter192 // i=3: Magnet width193 // i=4: Magnet height194 // i=5: Magnet length195 196 189 } else { 197 190 … … 201 194 MAGNET_OFF; 202 195 mcMagneticField = NULL; 203 mcMagnetPrecession = NULL;204 196 mcMagnetData = NULL; 205 197 // Here, we ought to clean up mcMagnet(Rot,Pos) 206 198 } 207 208 // printf("Exit z: %f, mcmagnet: %d\n", z, mcmagnet); 209 210 %} 211 212 /* This section is executed when the simulation ends (C code). Other */ 213 /* optional sections are : SAVE */ 199 %} 200 214 201 FINALLY 215 202 %{
