Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4MagErrorStepper.hh
Go to the documentation of this file.
1//
2// ********************************************************************
3// * License and Disclaimer *
4// * *
5// * The Geant4 software is copyright of the Copyright Holders of *
6// * the Geant4 Collaboration. It is provided under the terms and *
7// * conditions of the Geant4 Software License, included in the file *
8// * LICENSE and available at http://cern.ch/geant4/license . These *
9// * include a list of copyright holders. *
10// * *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work make any representation or warranty, express or implied, *
14// * regarding this software system or assume any liability for its *
15// * use. Please see the license in the file LICENSE and URL above *
16// * for the full disclaimer and the limitation of liability. *
17// * *
18// * This code implementation is the result of the scientific and *
19// * technical work of the GEANT4 collaboration. *
20// * By using, copying, modifying or distributing the software (or *
21// * any work based on the software) you agree to acknowledge its *
22// * use in resulting scientific publications, and indicate your *
23// * acceptance of all terms of the Geant4 Software license. *
24// ********************************************************************
25//
26// G4MagErrorStepper
27//
28// Class description:
29//
30// Abstract base class for integrator of particle's equation of motion,
31// used in tracking in space dependent magnetic field.
32
33// Author: W.Wander (MIT), 09.12.1997
34// --------------------------------------------------------------------
35#ifndef G4MAGERRORSTEPPER_HH
36#define G4MAGERRORSTEPPER_HH
37
38#include "G4Types.hh"
40#include "G4Mag_EqRhs.hh"
41#include "G4ThreeVector.hh"
42
43/**
44 * @brief G4MagErrorStepper is an abstract base class for integrator of
45 * particle's equation of motion, used in tracking in space dependent
46 * magnetic field.
47 */
48
50{
51 public:
52
53 /**
54 * Constructor for G4MagErrorStepper.
55 * @param[in] EqRhs Pointer to the provided equation of motion.
56 * @param[in] numberOfVariables The number of integration variables.
57 * @param[in] numberOfVariables The number of state variables.
58 */
60 G4int numberOfVariables,
61 G4int numStateVariables = 12);
62
63 /**
64 * Destructor.
65 */
66 ~G4MagErrorStepper() override;
67
68 /**
69 * Copy constructor and assignment operator not allowed.
70 */
73
74 /**
75 * The stepper for the Runge Kutta integration.
76 * The stepsize is fixed, with the step size given by 'h'.
77 * Integrates ODE starting values y[0 to 6].
78 * Outputs yout[] and its estimated error yerr[].
79 * @param[in] y Starting values array of integration variables.
80 * @param[in] dydx Derivatives array.
81 * @param[in] h The given step size.
82 * @param[out] yout Integration output.
83 * @param[out] yerr The estimated error.
84 */
85 void Stepper( const G4double y[],
86 const G4double dydx[],
87 G4double h,
88 G4double yout[],
89 G4double yerr[] ) override;
90
91 /**
92 * Same as Stepper() function above, but should perform a 'dump' step
93 * without error calculation. To be implemented in concrete derived classes.
94 */
95 virtual void DumbStepper( const G4double y[],
96 const G4double dydx[],
97 G4double h,
98 G4double yout[] ) = 0;
99
100 /**
101 * Estimates the maximum distance of curved solution and chord.
102 */
103 G4double DistChord() const override;
104
105 private:
106
107 /** Data stored in order to find the chord. */
108 G4ThreeVector fInitialPoint, fMidPoint, fFinalPoint;
109
110 /** Arrays used only for temporary storage; they are allocated at the
111 class level only for efficiency, so that calls to new and delete are
112 not made in Stepper(). */
113 G4double *yInitial, *yMiddle, *dydxMid, *yOneStep;
114};
115
116#include "G4MagErrorStepper.icc"
117
118#endif
CLHEP::Hep3Vector G4ThreeVector
double G4double
Definition G4Types.hh:83
int G4int
Definition G4Types.hh:85
G4EquationOfMotion is the abstract base class for the right hand size of the equation of motion of a ...
G4double DistChord() const override
void Stepper(const G4double y[], const G4double dydx[], G4double h, G4double yout[], G4double yerr[]) override
virtual void DumbStepper(const G4double y[], const G4double dydx[], G4double h, G4double yout[])=0
G4MagErrorStepper(G4EquationOfMotion *EqRhs, G4int numberOfVariables, G4int numStateVariables=12)
G4MagErrorStepper(const G4MagErrorStepper &)=delete
G4MagErrorStepper & operator=(const G4MagErrorStepper &)=delete
~G4MagErrorStepper() override
G4MagIntegratorStepper(G4EquationOfMotion *Equation, G4int numIntegrationVariables, G4int numStateVariables=12, G4bool isFSAL=false)