Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/Geant4/G4ModifiedMidpoint.hh was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // ********************************************************************
0002 // * License and Disclaimer                                           *
0003 // *                                                                  *
0004 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0005 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0006 // * conditions of the Geant4 Software License,  included in the file *
0007 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0008 // * include a list of copyright holders.                             *
0009 // *                                                                  *
0010 // * Neither the authors of this software system, nor their employing *
0011 // * institutes,nor the agencies providing financial support for this *
0012 // * work  make  any representation or  warranty, express or implied, *
0013 // * regarding  this  software system or assume any liability for its *
0014 // * use.  Please see the license in the file  LICENSE  and URL above *
0015 // * for the full disclaimer and the limitation of liability.         *
0016 // *                                                                  *
0017 // * This  code  implementation is the result of  the  scientific and *
0018 // * technical work of the GEANT4 collaboration.                      *
0019 // * By using,  copying,  modifying or  distributing the software (or *
0020 // * any work based  on the software)  you  agree  to acknowledge its *
0021 // * use  in  resulting  scientific  publications,  and indicate your *
0022 // * acceptance of all terms of the Geant4 Software license.          *
0023 // ********************************************************************
0024 //
0025 // G4ModifiedMidpoint
0026 //
0027 // Class description:
0028 //
0029 // Modified midpoint method implementation, based on Boost odeint
0030 
0031 // Author: Dmitry Sorokin, Google Summer of Code 2016
0032 // Supervision: John Apostolakis, CERN
0033 // --------------------------------------------------------------------
0034 #ifndef G4MODIFIED_MIDPOINT_HH
0035 #define G4MODIFIED_MIDPOINT_HH
0036 
0037 #include "G4Types.hh"
0038 #include "G4EquationOfMotion.hh"
0039 #include "G4FieldTrack.hh"
0040 
0041 class G4ModifiedMidpoint
0042 {
0043   public:
0044 
0045     G4ModifiedMidpoint( G4EquationOfMotion* equation,
0046                         G4int nvar = 6, G4int steps = 2 );
0047    ~G4ModifiedMidpoint() = default;
0048 
0049     void DoStep( const G4double yIn[], const G4double dydxIn[],
0050                  G4double yOut[], G4double hstep) const;
0051 
0052     void DoStep( const G4double yIn[], const G4double dydxIn[],
0053                  G4double yOut[], G4double hstep, G4double yMid[],
0054                  G4double derivs[][G4FieldTrack::ncompSVEC]) const;
0055 
0056     inline void SetSteps(G4int steps);
0057     inline G4int GetSteps() const;
0058 
0059     inline void SetEquationOfMotion(G4EquationOfMotion* equation);
0060     inline G4EquationOfMotion* GetEquationOfMotion();
0061 
0062     inline G4int GetNumberOfVariables() const;
0063 
0064   private:
0065 
0066     void copy(G4double dst[], const G4double src[]) const;
0067 
0068   private:
0069 
0070     G4EquationOfMotion* fEquation = nullptr;
0071     G4int fnvar = 0;
0072     G4int fsteps = 0;
0073 };
0074 
0075 #include "G4ModifiedMidpoint.icc"
0076 
0077 #endif