PRISM
 v0.0.0
Loading...
Searching...
No Matches
SubSpecies.h
1//* This file is a part of PRISM: Plasma Reaction Input SysteM,
2//* A library for parcing chemical reaction networks for plasma chemistry
3//* https://github.com/NCSU-ComPS-Group/prism
4//*
5//* Licensed under MIT, please see LICENSE for details
6//* https://opensource.org/license/mit
7//*
8//* Copyright 2024, North Carolina State University
9//* ALL RIGHTS RESERVED
10//*
11#pragma once
12
13#include <string>
14
15#include "SpeciesBase.h"
16
17class SpeciesFactory;
18
19namespace prism
20{
25class SubSpecies : public SpeciesBase
26{
27public:
32 SubSpecies(const std::string & name);
33
35 bool operator==(const SubSpecies & other) const;
37 bool operator!=(const SubSpecies & other) const;
38
40 const std::string & base() const { return _base; }
42 const std::string & modifier() const { return _modifier; }
44 unsigned int subscript() const { return _subscript; }
45
46 virtual std::string to_string() const override;
47
48 friend std::string to_string(const prism::SubSpecies & s);
49 friend std::string to_string(prism::SubSpecies & s);
50 friend std::ostream & operator<<(std::ostream & os, prism::SubSpecies & s);
51 friend std::ostream & operator<<(std::ostream & os, const prism::SubSpecies & s);
52
53private:
55 const std::string _base;
57 std::string _modifier;
59 const unsigned int _subscript;
61 std::string setBase();
66 std::string setModifier();
70 unsigned int setSubscript();
75 void setMass() override;
79 void setCharge() override;
81 void setLatexName() override;
82
83 virtual void setNeutralGroundState() override;
84};
85} // namespace RXN
86template <>
87struct std::hash<prism::SubSpecies>
88{
93 size_t operator()(const prism::SubSpecies & obj) const;
94};
const std::string & name() const
Getter method for the name of species.
Definition SpeciesBase.h:33
SpeciesBase(const std::string &name)
Definition SpeciesBase.C:21
The parts with a Species can be brokenup into Eg Speices: NH3, SubSpecies: [N, H3].
Definition SubSpecies.h:26
bool operator==(const SubSpecies &other) const
Comparison operator checks if the sub species have the same member variables.
Definition SubSpecies.C:308
SubSpecies(const std::string &name)
Creates a simple SubSpecies object.
Definition SubSpecies.C:24
unsigned int subscript() const
getter method for the subscript on the subspecies
Definition SubSpecies.h:44
bool operator!=(const SubSpecies &other) const
Comparison for checking whether or not the two are not equal.
Definition SubSpecies.C:336
const std::string & modifier() const
getter method for the modifier std::string
Definition SubSpecies.h:42
const std::string & base() const
getter method for the elemental base of the species
Definition SubSpecies.h:40
size_t operator()(const prism::SubSpecies &obj) const
Custom override for the hash method Hash is only based on the name std::string.