Geant4  10.01.p01
G4MagIntegratorDriver.icc
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 //
27 // $Id: G4MagIntegratorDriver.icc 69699 2013-05-13 08:50:30Z gcosmo $
28 //
29 // --------------------------------------------------------------------
30 
31 inline
32 G4double G4MagInt_Driver::GetHmin() const
33 {
34  return fMinimumStep;
35 }
36 
37 inline
38 G4double G4MagInt_Driver::Hmin() const
39 {
40  return fMinimumStep;
41 }
42 
43 inline
44 G4double G4MagInt_Driver::GetSafety() const
45 {
46  return safety;
47 }
48 
49 inline
50 G4double G4MagInt_Driver::GetPshrnk() const
51 {
52  return pshrnk;
53 }
54 
55 inline
56 G4double G4MagInt_Driver::GetPgrow() const
57 {
58  return pgrow;
59 }
60 
61 inline
62 G4double G4MagInt_Driver::GetErrcon() const
63 {
64  return errcon;
65 }
66 
67 inline
68 void G4MagInt_Driver::SetHmin(G4double newval)
69 {
70  fMinimumStep = newval;
71 }
72 
73 inline
74 G4double G4MagInt_Driver::ComputeAndSetErrcon()
75 {
76  errcon = std::pow(max_stepping_increase/GetSafety(),1.0/GetPgrow());
77  return errcon;
78 }
79 
80 inline
81 void G4MagInt_Driver::ReSetParameters(G4double new_safety)
82 {
83  safety = new_safety;
84  pshrnk = -1.0 / pIntStepper->IntegratorOrder();
85  pgrow = -1.0 / (1.0 + pIntStepper->IntegratorOrder());
86  ComputeAndSetErrcon();
87 }
88 
89 inline
90 void G4MagInt_Driver::SetSafety(G4double val)
91 {
92  safety=val;
93  ComputeAndSetErrcon();
94 }
95 
96 inline
97 void G4MagInt_Driver::SetPgrow(G4double val)
98 {
99  pgrow=val;
100  ComputeAndSetErrcon();
101 }
102 
103 inline
104 void G4MagInt_Driver::SetErrcon(G4double val)
105 {
106  errcon=val;
107 }
108 
109 inline
110 void G4MagInt_Driver::RenewStepperAndAdjust(G4MagIntegratorStepper *pItsStepper)
111 {
112  pIntStepper = pItsStepper;
113  ReSetParameters();
114 }
115 
116 inline
117 const G4MagIntegratorStepper* G4MagInt_Driver::GetStepper() const
118 {
119  return pIntStepper;
120 }
121 
122 inline
123 G4MagIntegratorStepper* G4MagInt_Driver::GetStepper()
124 {
125  return pIntStepper;
126 }
127 
128 inline
129 G4int G4MagInt_Driver::GetMaxNoSteps() const
130 {
131  return fMaxNoSteps;
132 }
133 
134 inline
135 void G4MagInt_Driver::SetMaxNoSteps(G4int val)
136 {
137  fMaxNoSteps= val;
138 }
139 
140 inline
141 void G4MagInt_Driver::GetDerivatives(const G4FieldTrack &y_curr, // const, INput
142  G4double dydx[]) // OUTput
143 {
144  G4double tmpValArr[G4FieldTrack::ncompSVEC];
145  y_curr.DumpToArray( tmpValArr );
146  pIntStepper -> RightHandSide( tmpValArr , dydx );
147 }
148 
149 inline
150 G4double G4MagInt_Driver::GetVerboseLevel() const
151 {
152  return fVerboseLevel;
153 }
154 
155 inline
156 void G4MagInt_Driver::SetVerboseLevel(G4int newLevel)
157 {
158  fVerboseLevel= newLevel;
159 }
160 
161 inline
162 G4double G4MagInt_Driver::GetSmallestFraction() const
163 {
164  return fSmallestFraction;
165 }