MCPcopy Create free account
hub / github.com/ElectroZybr/LatticeLab / findAtomTypeBySymbol

Function findAtomTypeBySymbol

Lattice/Scripting/ScriptAPI.cpp:29–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27}
28
29std::optional<AtomData::Type> findAtomTypeBySymbol(std::string_view speciesName) {
30 const std::string atomSymbol = normalizeAtomSymbol(std::string(speciesName));
31 for (size_t i = 0; i < static_cast<size_t>(AtomData::Type::COUNT); ++i) {
32 const AtomData::Type type = static_cast<AtomData::Type>(i);
33 if (AtomData::symbol(type) == atomSymbol) {
34 return type;
35 }
36 }
37 return std::nullopt;
38}
39
40} // namespace
41

Callers 2

spawnMethod · 0.70
lj_minMethod · 0.70

Calls 1

normalizeAtomSymbolFunction · 0.70

Tested by

no test coverage detected