Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4QSSubstepStruct.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// Structs used by G4QSStepper.
27
28// Author: Mattias Portnoy (Univ. Buenos Aires), 2024
29// --------------------------------------------------------------------
30#ifndef G4QSS_SUBSTEPSTRUCT_HH
31#define G4QSS_SUBSTEPSTRUCT_HH
32
33#include "G4FieldTrack.hh"
35#include "G4qss_misc.hh"
36
37#include <map>
38#include <cmath>
39
40constexpr G4int MAX_QSS_ORDER=3;
42
44
45/**
46 * @brief Structs used by G4QSStepper.
47 */
48
49struct Substep
50{
56 G4double t{0.0};
57 // simple id method so that substeps can have different orders in same step
58 G4int extrapolation_method =0; // To be overwritten in run (expect: 1,2 or 3)
59 G4double b_field[3] = {0.0, 0.0, 0.0 };
60
61 inline Substep();
62};
63
64// --------------------------------------------------------------------------------
65
67{
69 Substep* _substeps = nullptr;
71
74
75 /** Mimics the functionality of GNU method reallocarray. */
76 void* safe_reallocarray(void* ptr, size_t numMembers, size_t size);
77
78 inline void resize();
79
81
82 inline void save_substep(Substep* substep);
83
84 inline void reset();
85
86};
87
88#include "G4QSSubstepStruct.icc"
89
90#endif
G4double QSStateVector[6]
constexpr G4int NUMBER_OF_VARIABLES_QSS
constexpr G4int MAX_QSS_ORDER
double G4double
Definition G4Types.hh:83
int G4int
Definition G4Types.hh:85
Structs used by G4QSStepper.
G4int extrapolation_method
QSStateVector sync_t
QSStateVector state_tq
QSStateVector state_x[MAX_QSS_ORDER+1]
QSStateVector state_q[MAX_QSS_ORDER]
QSStateVector state_tx
G4double b_field[3]
Substep * _substeps
void reset()
void * safe_reallocarray(void *ptr, size_t numMembers, size_t size)
G4int current_substep_index
void resize()
Substep * create_substep()
void save_substep(Substep *substep)