Public Member Functions | |
FieldMapPlacement (BLFieldMap *_map, G4RotationMatrix *rot, G4ThreeVector &pos, G4double &_current, G4double &_gradient, G4double _timeOffset) | |
void | addFieldValue (const G4double point[4], G4double field[6]) const |
Private Attributes | |
BLCoordinateTransform | global2local |
G4RotationMatrix | rotation |
G4double * | current |
G4double * | gradient |
G4double | timeOffset |
BLFieldMap * | map |
FieldMapPlacement::FieldMapPlacement | ( | BLFieldMap * | _map, | |
G4RotationMatrix * | rot, | |||
G4ThreeVector & | pos, | |||
G4double & | _current, | |||
G4double & | _gradient, | |||
G4double | _timeOffset | |||
) |
References current, BLFieldMap::getBoundingPoint(), BLCoordinateTransform::getGlobal(), BLCoordinateTransform::getRotation(), global2local, gradient, BLCoordinateTransform::isRotated(), map, rotation, BLElementField::setGlobalPoint(), and timeOffset.
00210 : global2local(rot,pos), rotation() 00211 { 00212 map = _map; 00213 current = &_current; 00214 gradient = &_gradient; 00215 timeOffset = _timeOffset; 00216 00217 if(global2local.isRotated()) { 00218 rotation = global2local.getRotation(); 00219 rotation.invert(); 00220 } 00221 00222 // set global bounding box 00223 G4double local[4], global[4]; 00224 local[3] = 0.0; 00225 for(int i=0; i<8; ++i) { 00226 map->getBoundingPoint(i,local); 00227 global2local.getGlobal(local,global); 00228 setGlobalPoint(global); 00229 } 00230 }
void FieldMapPlacement::addFieldValue | ( | const G4double | point[4], | |
G4double | field[6] | |||
) | const [virtual] |
Implements BLElementField.
References B, current, E, BLFieldMap::getFieldValue(), BLCoordinateTransform::getLocal(), global2local, gradient, BLFieldMap::hasB(), BLFieldMap::hasE(), map, rotation, and timeOffset.
00234 { 00235 G4double local[4], thisField[6]; 00236 00237 global2local.getLocal(local,point); 00238 00239 local[3] -= timeOffset; // KBB 25aug10 - shift time back by timeOffset 00240 00241 map->getFieldValue(local,thisField,*current,*gradient); 00242 00243 if(map->hasB()) { 00244 G4ThreeVector B(thisField[0],thisField[1],thisField[2]); 00245 B = rotation * B; 00246 field[0] += B[0]; 00247 field[1] += B[1]; 00248 field[2] += B[2]; 00249 } 00250 00251 if(map->hasE()) { 00252 G4ThreeVector E(thisField[3],thisField[4],thisField[5]); 00253 E = rotation * E; 00254 field[3] += E[0]; 00255 field[4] += E[1]; 00256 field[5] += E[2]; 00257 } 00258 }
Referenced by addFieldValue(), and FieldMapPlacement().
G4RotationMatrix FieldMapPlacement::rotation [private] |
Referenced by addFieldValue(), and FieldMapPlacement().
G4double* FieldMapPlacement::current [private] |
Referenced by addFieldValue(), and FieldMapPlacement().
G4double* FieldMapPlacement::gradient [private] |
Referenced by addFieldValue(), and FieldMapPlacement().
G4double FieldMapPlacement::timeOffset [private] |
Referenced by addFieldValue(), and FieldMapPlacement().
BLFieldMap* FieldMapPlacement::map [private] |
Referenced by addFieldValue(), and FieldMapPlacement().