#include <BLElementField.hh>
This is the interface class used by BLGlobalField to compute the field value at a given point[].
An element command that represents an element with an EM field will derive a class from this one and implement the computation for the element. The construct() function of the element command class will add the derived object into BLGlobalField. Such derived classes are typically local to the file implementing the element command.
Public Member Functions | |
BLElementField () | |
Constructor. | |
virtual | ~BLElementField () |
Destructor. | |
void | setGlobalPoint (const G4double point[4]) |
setGlobalPoint() ensures that the point is within the global bounding box of this ElementField. global coordinates. Normally called 8 times for the corners of the local bounding box, after a local->global coordinate transform. If never called, the global bounding box is infinite. BEWARE: if called only once, the bounding box is just a point. | |
bool | isInBoundingBox (const G4double point[4]) const |
isInBoundingBox() returns true if the point is within the global bounding box. global coordinates. | |
virtual void | addFieldValue (const G4double point[4], G4double field[6]) const =0 |
addFieldValue() will add the field value for this element to field[]. Implementations must be sure to verify that point[] is within the field region, and do nothing if not. point[] is in global coordinates and geant4 units; x,y,z,t. field[] is in geant4 units; Bx,By,Bz,Ex,Ey,Ez. For efficiency, the caller may (but need not) call isInBoundingBox(point), and only call this function if that returns true. | |
Protected Attributes | |
G4double | minX |
G4double | minY |
G4double | minZ |
G4double | maxX |
G4double | maxY |
G4double | maxZ |
Private Member Functions | |
BLElementField (const BLElementField &) | |
BLElementField & | operator= (const BLElementField &) |
BLElementField::BLElementField | ( | const BLElementField & | ) | [private] |
BLElementField::BLElementField | ( | ) | [inline] |
BLElementField& BLElementField::operator= | ( | const BLElementField & | ) | [private] |
void BLElementField::setGlobalPoint | ( | const G4double | point[4] | ) | [inline] |
setGlobalPoint() ensures that the point is within the global bounding box of this ElementField. global coordinates. Normally called 8 times for the corners of the local bounding box, after a local->global coordinate transform. If never called, the global bounding box is infinite. BEWARE: if called only once, the bounding box is just a point.
References LARGE, maxX, maxY, maxZ, minX, minY, and minZ.
Referenced by FieldExprPlacement::FieldExprPlacement(), FieldMapPlacement::FieldMapPlacement(), GenericBendField::GenericBendField(), GenericQuadField::GenericQuadField(), HelicalDipoleField::HelicalDipoleField(), HelicalHarmonicField::HelicalHarmonicField(), MultipoleField::MultipoleField(), PillboxField::PillboxField(), RFdeviceField::RFdeviceField(), and SolenoidField::SolenoidField().
00057 { 00058 if(minX == -LARGE || minX > point[0]) minX = point[0]; 00059 if(minY == -LARGE || minY > point[1]) minY = point[1]; 00060 if(minZ == -LARGE || minZ > point[2]) minZ = point[2]; 00061 if(maxX == LARGE || maxX < point[0]) maxX = point[0]; 00062 if(maxY == LARGE || maxY < point[1]) maxY = point[1]; 00063 if(maxZ == LARGE || maxZ < point[2]) maxZ = point[2]; 00064 }
bool BLElementField::isInBoundingBox | ( | const G4double | point[4] | ) | const [inline] |
isInBoundingBox() returns true if the point is within the global bounding box. global coordinates.
References maxX, maxY, maxZ, minX, minY, and minZ.
Referenced by BLGlobalField::GetFieldValue().
00068 { 00069 if(point[2] < minZ || point[2] > maxZ) return false; 00070 if(point[0] < minX || point[0] > maxX) return false; 00071 if(point[1] < minY || point[1] > maxY) return false; 00072 return true; 00073 }
virtual void BLElementField::addFieldValue | ( | const G4double | point[4], | |
G4double | field[6] | |||
) | const [pure virtual] |
addFieldValue() will add the field value for this element to field[]. Implementations must be sure to verify that point[] is within the field region, and do nothing if not. point[] is in global coordinates and geant4 units; x,y,z,t. field[] is in geant4 units; Bx,By,Bz,Ex,Ey,Ez. For efficiency, the caller may (but need not) call isInBoundingBox(point), and only call this function if that returns true.
Implemented in FieldExprPlacement, FieldMapPlacement, GenericBendField, GenericQuadField, HelicalDipoleField, HelicalHarmonicField, IdealSectorBendField, LiLensField, MultipoleField, PillboxField, RFdeviceField, SolenoidField, BLCMDspacecharge, and BLCMDspacechargelw.
Referenced by BLGlobalField::GetFieldValue().
G4double BLElementField::minX [protected] |
Referenced by BLElementField(), isInBoundingBox(), and setGlobalPoint().
G4double BLElementField::minY [protected] |
Referenced by BLElementField(), isInBoundingBox(), and setGlobalPoint().
G4double BLElementField::minZ [protected] |
Referenced by BLElementField(), isInBoundingBox(), and setGlobalPoint().
G4double BLElementField::maxX [protected] |
Referenced by BLElementField(), isInBoundingBox(), and setGlobalPoint().
G4double BLElementField::maxY [protected] |
Referenced by BLElementField(), isInBoundingBox(), and setGlobalPoint().
G4double BLElementField::maxZ [protected] |
Referenced by BLElementField(), isInBoundingBox(), and setGlobalPoint().