Geant4 Cross Reference |
1 // ******************************************************************** 2 // * License and Disclaimer * 3 // * * 4 // * The Geant4 software is copyright of the Copyright Holders of * 5 // * the Geant4 Collaboration. It is provided under the terms and * 6 // * conditions of the Geant4 Software License, included in the file * 7 // * LICENSE and available at http://cern.ch/geant4/license . These * 8 // * include a list of copyright holders. * 9 // * * 10 // * Neither the authors of this software system, nor their employing * 11 // * institutes,nor the agencies providing financial support for this * 12 // * work make any representation or warranty, express or implied, * 13 // * regarding this software system or assume any liability for its * 14 // * use. Please see the license in the file LICENSE and URL above * 15 // * for the full disclaimer and the limitation of liability. * 16 // * * 17 // * This code implementation is the result of the scientific and * 18 // * technical work of the GEANT4 collaboration. * 19 // * By using, copying, modifying or distributing the software (or * 20 // * any work based on the software) you agree to acknowledge its * 21 // * use in resulting scientific publications, and indicate your * 22 // * acceptance of all terms of the Geant4 Software license. * 23 // ******************************************************************** 24 // 25 // G4RK547FEq1 26 // 27 // Class description: 28 // 29 // An implementation of the 7 stage embedded Runge-Kutta 4,5 pair (RK547FEq1) 30 // from the paper: 31 // D. J. Higham and G. Hall, 32 // "Embedded Runge-Kutta formulae with stable equilibrium states", 33 // J. Comput. Appl. Math., vol. 29, no. 1, pp. 25-33, 1990. 34 35 // Author: Dmitry Sorokin, Google Summer of Code 2017 36 // Supervision: John Apostolakis, CERN 37 // -------------------------------------------------------------------- 38 #ifndef G4RK547FEQ1_HH 39 #define G4RK547FEQ1_HH 40 41 #include "G4MagIntegratorStepper.hh" 42 #include "G4FieldTrack.hh" 43 44 class G4RK547FEq1 : public G4MagIntegratorStepper 45 { 46 public: 47 48 G4RK547FEq1(G4EquationOfMotion* EqRhs, G4int integrationVariables = 6); 49 50 G4RK547FEq1(const G4RK547FEq1&) = delete; 51 G4RK547FEq1& operator= (const G4RK547FEq1&) = delete; 52 53 void Stepper( const G4double yInput[], 54 const G4double dydx[], 55 G4double hstep, 56 G4double yOutput[], 57 G4double yError[] ) override; 58 59 void Stepper( const G4double yInput[], 60 const G4double dydx[], 61 G4double hstep, 62 G4double yOutput[], 63 G4double yError[], 64 G4double dydxOutput[] ); 65 66 G4double DistChord() const override; 67 G4int IntegratorOrder() const override { return 4; } 68 69 private: 70 71 void makeStep( const G4double yInput[], 72 const G4double dydx[], 73 const G4double hstep, 74 G4double yOutput[], 75 G4double* dydxOutput = nullptr, 76 G4double* yError = nullptr) const; 77 78 private: 79 80 G4double fyIn[G4FieldTrack::ncompSVEC], 81 fdydx[G4FieldTrack::ncompSVEC], 82 fyOut[G4FieldTrack::ncompSVEC], 83 fdydxOut[G4FieldTrack::ncompSVEC]; 84 85 G4double fhstep = -1.0; 86 }; 87 88 #endif 89