Bicameral Engine
GPU-resident engine for a magic-research open-world game
Loading...
Searching...
No Matches
reaction_table.cpp File Reference
#include "sim/reaction_table.h"
#include <algorithm>
#include <bit>
#include <format>
#include <map>
Include dependency graph for reaction_table.cpp:

Go to the source code of this file.

Classes

struct  bicameral::sim::anonymous_namespace{reaction_table.cpp}::TermsResult

Namespaces

namespace  bicameral
namespace  bicameral::sim
namespace  bicameral::sim::anonymous_namespace{reaction_table.cpp}

Typedefs

using bicameral::sim::anonymous_namespace{reaction_table.cpp}::NameIndex = std::map<std::string, uint32_t, std::less<>>

Functions

uint64_t bicameral::sim::anonymous_namespace{reaction_table.cpp}::HashName (std::string_view name)
ReactionTableDefinition bicameral::sim::anonymous_namespace{reaction_table.cpp}::CanonicalOrder (const ReactionTableDefinition &definition)
std::expected< NameIndex, std::string > bicameral::sim::anonymous_namespace{reaction_table.cpp}::IndexElements (const ReactionTableDefinition &definition, BakedReactionTable &baked)
int64_t bicameral::sim::anonymous_namespace{reaction_table.cpp}::ZeroKelvinEnthalpy (const SpeciesDefinition &species)
std::expected< void, std::string > bicameral::sim::anonymous_namespace{reaction_table.cpp}::BakeSpecies (const SpeciesDefinition &definition, const NameIndex &elements, const ReactionTableDefinition &table, BakedReactionTable &baked)
std::expected< NameIndex, std::string > bicameral::sim::anonymous_namespace{reaction_table.cpp}::BakeAllSpecies (const ReactionTableDefinition &definition, const NameIndex &elements, BakedReactionTable &baked)
std::expected< TermsResult, std::string > bicameral::sim::anonymous_namespace{reaction_table.cpp}::CopyTerms (const RuleDefinition &rule, std::span< const RuleTerm > terms, const NameIndex &species, std::span< uint32_t > ids, std::span< uint32_t > coefficients)
std::expected< void, std::string > bicameral::sim::anonymous_namespace{reaction_table.cpp}::CheckElementBalance (const RuleDefinition &definition, const RxRule &rule, const BakedReactionTable &baked)
int64_t bicameral::sim::anonymous_namespace{reaction_table.cpp}::ReactionEnthalpy (const RxRule &rule, const BakedReactionTable &baked)
std::expected< RxRule, std::string > bicameral::sim::anonymous_namespace{reaction_table.cpp}::BakeRule (const RuleDefinition &definition, const NameIndex &species, const BakedReactionTable &baked)
std::optional< std::string > bicameral::sim::anonymous_namespace{reaction_table.cpp}::CheckDeclaredEnthalpy (const RuleDefinition &rule, const ReactionTableDefinition &definition, const NameIndex &species)
std::expected< uint64_t, std::string > bicameral::sim::anonymous_namespace{reaction_table.cpp}::BakeRate (const RuleDefinition &definition, int64_t lnConstantPart, uint32_t kelvin)
std::expected< void, std::string > bicameral::sim::anonymous_namespace{reaction_table.cpp}::BakeRates (const RuleDefinition &definition, const RxRule &rule, BakedReactionTable &baked)
void bicameral::sim::anonymous_namespace{reaction_table.cpp}::BuildRuleIndex (BakedReactionTable &baked)
std::expected< BakedReactionTable, std::string > bicameral::sim::BakeReactionTable (const ReactionTableDefinition &definition)
template<typename Cell>
Cell bicameral::sim::anonymous_namespace{reaction_table.cpp}::FillReactionCell (const BakedReactionTable &table, Cell cell, std::span< const SpeciesAmount > amounts, int32_t temperatureMilliKelvin)
template<typename Cell>
std::vector< uint64_t > bicameral::sim::anonymous_namespace{reaction_table.cpp}::CountCellElements (const BakedReactionTable &table, const Cell &cell)
template<typename Cell>
uint64_t bicameral::sim::anonymous_namespace{reaction_table.cpp}::HashCell (const Cell &cell)
RxCell bicameral::sim::MakeReactionCell (const BakedReactionTable &table, std::span< const SpeciesAmount > amounts, int32_t temperatureMilliKelvin)
RxWideCell bicameral::sim::MakeWideReactionCell (const BakedReactionTable &table, std::span< const SpeciesAmount > amounts, int32_t temperatureMilliKelvin)
std::vector< uint64_t > bicameral::sim::CountElements (const BakedReactionTable &table, const RxCell &cell)
std::vector< uint64_t > bicameral::sim::CountElements (const BakedReactionTable &table, const RxWideCell &cell)
uint64_t bicameral::sim::HashReactionCell (const RxCell &cell)
uint64_t bicameral::sim::HashReactionCell (const RxWideCell &cell)
RxLoneCell bicameral::sim::AdvanceLoneReactionCell (const BakedReactionTable &table, const RxLoneCell &lone, uint64_t worldSeed, uint64_t tickBegin, uint32_t tickCount, uint64_t cellId)
RxWaitStep bicameral::sim::StepReactionCellWait (const BakedReactionTable &table, const RxCell &cell, uint64_t worldSeed, uint64_t tick, uint64_t changedTick, uint64_t cellId)
RxWideWaitStep bicameral::sim::StepReactionCellWait (const BakedReactionTable &table, const RxWideCell &cell, uint64_t worldSeed, uint64_t tick, uint64_t changedTick, uint64_t cellId)

Variables

constexpr uint64_t bicameral::sim::anonymous_namespace{reaction_table.cpp}::GAS_CONSTANT_NANOJOULES = 8314462618
constexpr uint64_t bicameral::sim::anonymous_namespace{reaction_table.cpp}::NANOJOULES_PER_JOULE = 1000000000
constexpr uint64_t bicameral::sim::anonymous_namespace{reaction_table.cpp}::MICROJOULES_PER_JOULE = 1000000
constexpr int64_t bicameral::sim::anonymous_namespace{reaction_table.cpp}::STANDARD_TEMPERATURE_MILLIKELVIN = 298150
constexpr int32_t bicameral::sim::anonymous_namespace{reaction_table.cpp}::RATE_EXPONENT_MIN = -4096
constexpr int32_t bicameral::sim::anonymous_namespace{reaction_table.cpp}::RATE_EXPONENT_MAX = 4096
constexpr int64_t bicameral::sim::anonymous_namespace{reaction_table.cpp}::CELL_VOLUME_LOG2 = -3
constexpr uint64_t bicameral::sim::anonymous_namespace{reaction_table.cpp}::FNV_OFFSET = 0xcbf29ce484222325ULL
constexpr uint64_t bicameral::sim::anonymous_namespace{reaction_table.cpp}::FNV_PRIME = 0x100000001b3ULL
constexpr int64_t bicameral::sim::anonymous_namespace{reaction_table.cpp}::DECLARED_ENTHALPY_TOLERANCE_JOULES = 1000