File indexing completed on 2025-01-18 09:58:08
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027 #ifndef G4DNAGillespieDirectMethod_hh
0028 #define G4DNAGillespieDirectMethod_hh 1
0029 #include "globals.hh"
0030 #include "G4DNAMesh.hh"
0031 #include "G4Track.hh"
0032 #include "G4Molecule.hh"
0033 #include "G4MolecularConfiguration.hh"
0034 #include "G4MoleculeTable.hh"
0035 #include "G4ITTrackHolder.hh"
0036 #include "G4DNAEventSet.hh"
0037 class G4DNAMolecularReactionData;
0038 class G4DNAScavengerMaterial;
0039 class G4MolecularConfiguration;
0040 class G4ChemEquilibrium;
0041 class G4DNAGillespieDirectMethod
0042 {
0043 public:
0044 G4DNAGillespieDirectMethod();
0045 ~G4DNAGillespieDirectMethod();
0046 using MolType = const G4MolecularConfiguration*;
0047 using Index = G4VDNAMesh::Index;
0048 using Voxel = G4DNAMesh::Voxel;
0049 using JumpingData = std::pair<MolType, Index>;
0050 using ReactionData = const G4DNAMolecularReactionData;
0051 using EventIt = G4DNAEventSet::EventSet::iterator;
0052
0053 G4double PropensityFunction(const Voxel& voxel, ReactionData* data);
0054 G4double PropensityFunction(const Voxel& voxel, MolType moleType);
0055 inline void SetVoxelMesh(G4DNAMesh& mesh) { fpMesh = &mesh; }
0056 void SetTimeStep(const G4double& stepTime);
0057 void Initialize();
0058 void CreateEvent(const Index& index);
0059 void CreateEvents();
0060 void SetEventSet(G4DNAEventSet*);
0061 inline void SetVerbose(const G4int& verbose)
0062 {
0063 fVerbose = verbose;
0064 }
0065 G4bool SetEquilibrium(const G4DNAMolecularReactionData* pReaction);
0066 void ResetEquilibrium();
0067
0068
0069 private:
0070 G4double Reaction(const Voxel& voxel);
0071 G4double DiffusiveJumping(const Voxel& voxel);
0072 G4double ComputeNumberInNode(const Voxel& voxel, MolType type);
0073 G4double VolumeOfNode(const Voxel& voxel);
0074 G4DNAMolecularReactionTable* fMolecularReactions;
0075 G4DNAMesh* fpMesh = nullptr;
0076 G4double fTimeStep = DBL_MAX;
0077 G4DNAEventSet* fpEventSet = nullptr;
0078 G4double fVerbose = 0;
0079 std::map<G4double , ReactionData*> fReactionDataMap;
0080 std::map<G4double , JumpingData> fJumpingDataMap;
0081 G4bool FindScavenging(const Voxel& voxel, MolType, G4double&);
0082 G4DNAScavengerMaterial* fpScavengerMaterial = nullptr;
0083 std::map<G4int,std::unique_ptr<G4ChemEquilibrium>> fEquilibriumProcesses;
0084 G4bool IsEquilibrium(const G4int& reactionType) const;
0085
0086 };
0087 #endif