PRISM
 v0.0.0
Loading...
Searching...
No Matches
SpeciesBase.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#include <string>
13#include <iostream>
14
15namespace prism
16{
21{
22public:
26 SpeciesBase(const std::string & name);
27 virtual ~SpeciesBase() {}
29 bool operator==(const SpeciesBase & other) const;
31 bool operator!=(const SpeciesBase & other) const;
33 const std::string & name() const { return _name; }
38 double mass() const { return _mass; }
43 double molarMass() const { return _molar_mass; }
45 int chargeNumber() const { return _charge_num; }
47 double charge() const { return _charge; }
49 const std::string & latexRepresentation() const { return _latex_name; }
54 const std::string & neutralGroundState() const { return _neutral_ground_state; }
55 virtual std::string to_string() const;
56
57protected:
59 std::string _name;
61 double _mass;
65 double _charge;
69 std::string _latex_name;
78 std::string checkName(const std::string & name);
82 virtual void setMass() = 0;
86 virtual void setCharge() = 0;
88 virtual void setLatexName() = 0;
89 virtual void setNeutralGroundState() = 0;
90};
91}
92
93template <>
94struct std::hash<prism::SpeciesBase>
95{
100 size_t operator()(const prism::SpeciesBase & obj) const;
101};
Base class for species and subspecies.
Definition SpeciesBase.h:21
int chargeNumber() const
Getter method for the charge number of the species.
Definition SpeciesBase.h:45
int _charge_num
The level of charge ex: Ar-4 this is -4.
Definition SpeciesBase.h:67
std::string checkName(const std::string &name)
Method checks to make sure that the name is not an empty std::string also checks to make sure e and E...
Definition SpeciesBase.C:24
std::string _neutral_ground_state
the neutral ground state for a species ex: Ar2* -> Ar2
Definition SpeciesBase.h:72
double _molar_mass
the molar mass of the species
Definition SpeciesBase.h:63
const std::string & latexRepresentation() const
Getter method for the latex name of the species.
Definition SpeciesBase.h:49
bool operator!=(const SpeciesBase &other) const
Comparison for checking whether or not the two are not equal.
Definition SpeciesBase.C:51
const std::string & name() const
Getter method for the name of species.
Definition SpeciesBase.h:33
virtual void setMass()=0
Method for setting the mass of the species.
virtual void setCharge()=0
Method for the setting the charge number of the species.
SpeciesBase(const std::string &name)
Definition SpeciesBase.C:21
double molarMass() const
Getter method for the molar mass of the species molar mass is in g / mol.
Definition SpeciesBase.h:43
bool operator==(const SpeciesBase &other) const
Comparison operator checks if the two base species have the same name.
Definition SpeciesBase.C:45
double _charge
the charge of the spcies in coulomb
Definition SpeciesBase.h:65
std::string _name
The full std::string of the species base.
Definition SpeciesBase.h:59
virtual void setLatexName()=0
methods for setting the latex name of each species
const std::string & neutralGroundState() const
Gets the ground neutral state of the subspecies Ex: H3* -> H3.
Definition SpeciesBase.h:54
double charge() const
Getter method for the charge of the species.
Definition SpeciesBase.h:47
double _mass
The mass of an individual instance of the species.
Definition SpeciesBase.h:61
double mass() const
Getter method for the mass of the species mass of the species is in kg.
Definition SpeciesBase.h:38
std::string _latex_name
The name of the spcies formatted for printing in a latex_table.
Definition SpeciesBase.h:69
size_t operator()(const prism::SpeciesBase &obj) const
Custom hash function based only on the name of the species.