Lattice Microbes 2.5
This is for whole cell modeling
Loading...
Searching...
No Matches
NextSubvolumeSolver.h
Go to the documentation of this file.
1/*
2 * University of Illinois Open Source License
3 * Copyright 2011-2018 Luthey-Schulten Group,
4 * All rights reserved.
5 *
6 * Developed by: Luthey-Schulten Group
7 * University of Illinois at Urbana-Champaign
8 * http://www.scs.uiuc.edu/~schulten
9 *
10 * Permission is hereby granted, free of charge, to any person obtaining a copy of
11 * this software and associated documentation files (the Software), to deal with
12 * the Software without restriction, including without limitation the rights to
13 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
14 * of the Software, and to permit persons to whom the Software is furnished to
15 * do so, subject to the following conditions:
16 *
17 * - Redistributions of source code must retain the above copyright notice,
18 * this list of conditions and the following disclaimers.
19 *
20 * - Redistributions in binary form must reproduce the above copyright notice,
21 * this list of conditions and the following disclaimers in the documentation
22 * and/or other materials provided with the distribution.
23 *
24 * - Neither the names of the Luthey-Schulten Group, University of Illinois at
25 * Urbana-Champaign, nor the names of its contributors may be used to endorse or
26 * promote products derived from this Software without specific prior written
27 * permission.
28 *
29 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
30 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
31 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
32 * THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
33 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
34 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
35 * OTHER DEALINGS WITH THE SOFTWARE.
36 *
37 * Author(s): Elijah Roberts
38 */
39
40#ifndef LM_RDME_NEXTSUBVOLUMESOLVER_H_
41#define LM_RDME_NEXTSUBVOLUMESOLVER_H_
42
43#include "rdme/Lattice.h"
44#include "rdme/RDMESolver.h"
46
49
50
51namespace lm {
52
53namespace io {
54class Lattice;
55class SpeciesCounts;
56}
57namespace rdme {
58
59class ByteLattice;
60
62{
63public:
66 virtual ~NextSubvolumeSolver();
67 virtual bool needsReactionModel() {return true;}
68 virtual bool needsDiffusionModel() {return true;}
69 virtual void buildDiffusionModel(const uint numberSiteTypesA, const double * DFA, const uint * RLA, lattice_size_t latticeXSize, lattice_size_t latticeYSize, lattice_size_t latticeZSize, site_size_t particlesPerSite, unsigned int bytes_per_particle, si_dist_t latticeSpacing, const uint8_t * latticeData, const uint8_t * latticeSitesData, bool rowMajorData=true);
70 virtual void generateTrajectory();
71
72protected:
74 virtual void destroyModel();
75 virtual void destroyDiffusionModel();
77 virtual void writeLatticeData(double time, ByteLattice * lattice, lm::io::Lattice * latticeDataSet);
78 virtual void recordSpeciesCounts(double time, lm::io::SpeciesCounts * speciesCountsDataSet);
79 virtual void writeSpeciesCounts(lm::io::SpeciesCounts * speciesCountsDataSet);
80 virtual int updateAllSubvolumePropensities(si_time_t time, int rngNext, double * expRngValues);
81 virtual int updateSubvolumePropensity(si_time_t time, lattice_size_t s, int rngNext, double * expRngValues);
83 virtual int performSubvolumeReaction(si_time_t time, lattice_size_t s, int rngNext, double * uniRngValues, bool * affectedNeighbor, lattice_size_t * neighborSubvolume);
85
86
87 virtual void updateSpeciesCountsForSubvolume(lattice_size_t subvolume);
89 void addParticles(lattice_size_t subvolume, particle_t particle, uint count);
90
91protected:
97};
98
99}
100}
101
102#endif
uint32_t site_size_t
Definition ByteLatticeExtended.h:23
uint32_t particle_t
Definition ByteLatticeExtended.h:19
uint32_t lattice_size_t
Definition Lattice.h:55
double si_dist_t
Definition Types.h:63
unsigned int uint
Definition Types.h:52
double si_time_t
Definition Types.h:64
Distributions
Types of random number generators that are allowed.
Definition RandomGenerator.h:56
uint numberReactions
Definition CMESolver.h:273
RandomGenerator::Distributions neededDists
Definition CMESolver.h:264
A Lattice that is based on packed bytes of memory, i.e. one byte per lattice site to hold particles.
Definition ByteLattice.h:53
virtual void updateCurrentSubvolumeSpeciesCounts(uint r)
Definition NextSubvolumeSolver.cpp:553
ReactionQueue * reactionQueue
Definition NextSubvolumeSolver.h:95
virtual void writeLatticeData(double time, ByteLattice *lattice, lm::io::Lattice *latticeDataSet)
Definition NextSubvolumeSolver.cpp:338
double latticeSpacingSquared
Definition NextSubvolumeSolver.h:94
NextSubvolumeSolver()
Definition NextSubvolumeSolver.cpp:61
virtual int updateSubvolumePropensity(si_time_t time, lattice_size_t s, int rngNext, double *expRngValues)
Definition NextSubvolumeSolver.cpp:402
virtual void allocateModel(uint numberSpecies, uint numberReactions)
Definition NextSubvolumeSolver.cpp:74
virtual void generateTrajectory()
Actually run the simulation.
Definition NextSubvolumeSolver.cpp:123
virtual void updateSpeciesCountsForSubvolume(lattice_size_t subvolume)
Definition NextSubvolumeSolver.cpp:459
virtual void writeSpeciesCounts(lm::io::SpeciesCounts *speciesCountsDataSet)
Definition NextSubvolumeSolver.cpp:362
virtual bool needsDiffusionModel()
Tells whether the solver needs a reaction model.
Definition NextSubvolumeSolver.h:68
virtual ~NextSubvolumeSolver()
Definition NextSubvolumeSolver.cpp:70
virtual double calculateSubvolumePropensity(si_time_t time, lattice_size_t s)
Definition NextSubvolumeSolver.cpp:421
double * reactionPropensities
Definition NextSubvolumeSolver.h:93
uint * currentSubvolumeSpeciesCounts
Definition NextSubvolumeSolver.h:96
lattice_size_t numberSubvolumes
Definition NextSubvolumeSolver.h:92
virtual void buildDiffusionModel(const uint numberSiteTypesA, const double *DFA, const uint *RLA, lattice_size_t latticeXSize, lattice_size_t latticeYSize, lattice_size_t latticeZSize, site_size_t particlesPerSite, unsigned int bytes_per_particle, si_dist_t latticeSpacing, const uint8_t *latticeData, const uint8_t *latticeSitesData, bool rowMajorData=true)
Definition NextSubvolumeSolver.cpp:88
virtual bool needsReactionModel()
Tells whether the solver needs a reaction model.
Definition NextSubvolumeSolver.h:67
virtual int performSubvolumeReaction(si_time_t time, lattice_size_t s, int rngNext, double *uniRngValues, bool *affectedNeighbor, lattice_size_t *neighborSubvolume)
Definition NextSubvolumeSolver.cpp:478
virtual void checkSpeciesCountsAgainstLattice()
Definition NextSubvolumeSolver.cpp:328
virtual int updateAllSubvolumePropensities(si_time_t time, int rngNext, double *expRngValues)
Definition NextSubvolumeSolver.cpp:378
virtual void destroyDiffusionModel()
Definition NextSubvolumeSolver.cpp:113
virtual void recordSpeciesCounts(double time, lm::io::SpeciesCounts *speciesCountsDataSet)
Definition NextSubvolumeSolver.cpp:355
virtual void destroyModel()
Definition NextSubvolumeSolver.cpp:82
void addParticles(lattice_size_t subvolume, particle_t particle, uint count)
Definition NextSubvolumeSolver.cpp:561
void updateSubvolumeWithSpeciesCounts(lattice_size_t subvolume)
Definition NextSubvolumeSolver.cpp:471
Definition RDMESolver.h:55
Lattice * lattice
Definition RDMESolver.h:73
RDMESolver(RandomGenerator::Distributions neededDists)
Definition RDMESolver.cpp:58
A queue that contains information on reaction events.
Definition ReactionQueue.h:51
uint numberSpecies
Definition lm_setp.cpp:72
Definition LatticeBuilder.h:56
Definition LatticeBuilder.h:60
Definition Capsule.cpp:46