|
Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
|
G4Field is the abstract class for any kind of field. It allows any kind of field (vector, scalar, tensor and any set of them) to be defined by implementing the inquiry function interface. A field must co-work with a corresponding Equation of Motion, to enable the integration of a particle's position, momentum and, optionally, spin. For this a field and its equation of motion must follow the same convention for the order of field components. More...
#include <G4Field.hh>
Public Member Functions | |
| G4Field (G4bool gravityOn=false) | |
| virtual | ~G4Field ()=default |
| G4Field (const G4Field &p)=default | |
| G4Field & | operator= (const G4Field &p) |
| virtual void | GetFieldValue (const G4double Point[4], G4double *fieldArr) const =0 |
| virtual G4bool | DoesFieldChangeEnergy () const =0 |
| virtual G4FieldType | GetFieldType () const |
| G4bool | IsGravityActive () const |
| void | SetGravityActive (G4bool OnOffFlag) |
| virtual G4Field * | Clone () const |
Static Public Attributes | |
| static constexpr G4int | MAX_NUMBER_OF_COMPONENTS = 24 |
G4Field is the abstract class for any kind of field. It allows any kind of field (vector, scalar, tensor and any set of them) to be defined by implementing the inquiry function interface. A field must co-work with a corresponding Equation of Motion, to enable the integration of a particle's position, momentum and, optionally, spin. For this a field and its equation of motion must follow the same convention for the order of field components.
Definition at line 66 of file G4Field.hh.
| G4Field::G4Field | ( | G4bool | gravityOn = false | ) |
Constructor for G4Field.
| [in] | gravityOn | Flag to indicate if gravity is enabled or not. |
Definition at line 33 of file G4Field.cc.
Referenced by G4CachedMagneticField::Clone(), G4DELPHIMagField::Clone(), Clone(), G4KM_DummyField::Clone(), G4LineCurrentMagField::Clone(), G4QuadrupoleMagField::Clone(), G4SextupoleMagField::Clone(), G4UniformElectricField::Clone(), G4UniformGravityField::Clone(), G4UniformMagField::Clone(), G4ElectroMagneticField::G4ElectroMagneticField(), G4Field(), G4MagneticField::G4MagneticField(), G4MagneticField::G4MagneticField(), G4UniformGravityField::G4UniformGravityField(), G4UniformGravityField::G4UniformGravityField(), G4UniformGravityField::G4UniformGravityField(), operator=(), G4DELPHIMagField::~G4DELPHIMagField(), G4LineCurrentMagField::~G4LineCurrentMagField(), G4QuadrupoleMagField::~G4QuadrupoleMagField(), G4SextupoleMagField::~G4SextupoleMagField(), G4UniformElectricField::~G4UniformElectricField(), and G4UniformMagField::~G4UniformMagField().
|
virtualdefault |
Default virtual Destructor.
|
default |
Copy constructor and assignment operator.
|
virtual |
Interface method to implement cloning, needed by multi-threading. Here issuing a fatal exception, as expecting this to be implemented concretely in derived classes.
Reimplemented in G4CachedMagneticField, G4DELPHIMagField, G4HarmonicPolMagField, G4KM_DummyField, G4LineCurrentMagField, G4QuadrupoleMagField, G4SextupoleMagField, G4TCachedMagneticField< T_Field >, G4TQuadrupoleMagField, G4TUniformMagneticField, G4UniformElectricField, G4UniformGravityField, and G4UniformMagField.
Definition at line 45 of file G4Field.cc.
Referenced by G4FieldManager::Clone().
|
pure virtual |
Each type/class of field should respond the field does change energy. For example:
Implemented in G4ElectricField, G4ElectroMagneticField, G4MagneticField, and G4UniformGravityField.
Referenced by G4FieldManager::G4FieldManager().
|
inlinevirtual |
Returns the field type-ID, "kUserFieldType". This should be overriden in derived classes.
Reimplemented in G4ElectroMagneticField, G4MagneticField, and G4UniformGravityField.
Definition at line 115 of file G4Field.hh.
|
pure virtual |
Given the position time vector 'Point', returns the value of the field in the array 'fieldArr'. Notes: 1) The 'Point' vector has the following structure: Point[0] is x ( position, in Geant4 units ) Point[1] is y Point[2] is z Point[3] is t ( time, in Geant4 units ) 2) The convention for the components of the field array 'fieldArr' are determined by the type of field.
| [in] | Point | The position time vector. |
| [out] | fieldArr | The field array in output. |
Implemented in G4CachedMagneticField, G4ElectricField, G4ElectroMagneticField, G4MagneticField, G4TCachedMagneticField< T_Field >, G4TUniformMagneticField, G4UniformElectricField, G4UniformGravityField, and G4UniformMagField.
Referenced by G4ErrorSurfaceTrajState::BuildErrorMatrix(), G4ErrorFreeTrajState::G4ErrorFreeTrajState(), G4ElectricFieldModel::GetFieldAtLocation(), G4MagneticFieldModel::GetFieldAtLocation(), G4SynchrotronRadiation::GetMeanFreePath(), G4SynchrotronRadiationInMat::GetMeanFreePath(), G4SynchrotronRadiationInMat::GetPhotonEnergy(), G4SynchrotronRadiation::PostStepDoIt(), G4SynchrotronRadiationInMat::PostStepDoIt(), G4ErrorMagFieldLimitProcess::PostStepGetPhysicalInteractionLength(), and G4ErrorFreeTrajState::PropagateError().
|
inline |
Replies if the field includes gravity.
Definition at line 121 of file G4Field.hh.
Referenced by G4CoupledTransportation::AlongStepGetPhysicalInteractionLength(), and G4RepleteEofM::G4RepleteEofM().
Definition at line 38 of file G4Field.cc.
Referenced by G4ElectroMagneticField::operator=(), G4MagneticField::operator=(), and G4UniformGravityField::operator=().
|
inline |
Sets the gravity flag.
Definition at line 127 of file G4Field.hh.
|
staticconstexpr |
Definition at line 138 of file G4Field.hh.