File FormulaGenerator.h¶
This header file contains functions that convert structure data into chemical formulas.
- Copyright
This code is licensed under the 3-clause BSD license.
Copyright ETH Zurich, Laboratory for Physical Chemistry, Reiher Group.
See LICENSE.txt for details.
-
namespace
Scine
This header file contains functions that allow for common notation for common things that can be done at a different degree of derivatives.
This header contains alias definitions defining which classes to use for the different degrees of derivatives.
-
namespace
Utils
Functions
-
std::string
generateChemicalFormula
(const ElementTypeCollection &elements, const std::string &numberPrefix = "", const std::string &numberPostfix = "")¶ This function returns the elemental composition of a compound based on its ElementTypeCollection.
The convention is the Hill Order System. It starts with C, then H, then all the other elements in alphabetical order. Returns “(empty)” if elements is empty.
- Return
std::string The final string.
- Parameters
elements
: The collection of elements to be transcribed.numberPrefix
: Characters to put before each number for rich text formats (Latex etc).numberPostfix
: Characters to put after each number for rich text formats (Latex etc).
-
std::string
singleElementPartOfFormula
(std::string symbol, int numberOccurrences, const std::string &numberPrefix, const std::string &numberPostfix)¶ This function transcribes a single element into a string.
- Return
std::string The final string.
- Parameters
symbol
: The element symbolnumberOccurrences
: The number of times the element is present in a given structure.numberPrefix
: Characters to put before each number for rich text formats (Latex etc).numberPostfix
: Characters to put after each number for rich text formats (Latex etc).
-
std::string
-
namespace