private static Dictionary <Orbital, IVertex <Atom> > MapBondOrbitalToNeighborVertex( List <Orbital> filledOuterOrbitals, AtomWithOrbitals currentAtom, List <IVertex <Atom> > adjacentVertices) { var orbitalNeighborVertexMap = filledOuterOrbitals .Where(o => o.IsPartOfBond) .ToDictionary( o => o, o => { var bond = o.AssociatedBond; var neighborAtom = bond.Atom1.Equals(currentAtom) ? bond.Atom2 : bond.Atom1; return(adjacentVertices.Single(v => v.Object.Equals(neighborAtom))); }); return(orbitalNeighborVertexMap); }
private static IEnumerable <Point3D> GetAtomSpherePoints(AtomWithOrbitals currentAtom, IEnumerable <IVertex <Atom> > adjacentVertices) { var positionedNeighbors = adjacentVertices .Where(v => v.Object.IsPositioned || v.Object.IsPositionFixed) .ToList(); var existingPoints = positionedNeighbors .Select(v => v.Object) .Select(a => currentAtom.Position.VectorTo(a.Position)) .ToList(); var neighborAndLonePairCount = currentAtom.OuterOrbitals.Count(o => o.IsFull); var evenlyDistributedPoints = SpherePointDistributor.EvenlyDistributePointsOnSphere( 1.0, neighborAndLonePairCount - existingPoints.Count, existingPoints); return(evenlyDistributedPoints); }
public static List <Orbital> Generate(AtomWithOrbitals atom, int maximumPeriod) { var orbitals = new List <Orbital>(); for (var period = 1; period <= maximumPeriod; period++) { // s-orbital orbitals.Add(new Orbital(atom, period, OrbitalType.s)); if (period == 1) { continue; } // p-orbitals for (var i = 0; i < 3; i++) { orbitals.Add(new Orbital(atom, period, OrbitalType.p)); } if (period == 2) { continue; } // d-orbitals for (var i = 0; i < 5; i++) { orbitals.Add(new Orbital(atom, period, OrbitalType.d)); } if (period == 3) { continue; } // f-orbitals for (int i = 0; i < 7; i++) { orbitals.Add(new Orbital(atom, period, OrbitalType.f)); } //if(period == 4) // continue; } return(orbitals); }
private static IEnumerable <OrbitalBond> CreateOrbitalBonds(AtomWithOrbitals atom1, AtomWithOrbitals atom2, int bondCount) { if (!atom1.OrbitalsAvailableForBonding.Any()) { throw new ChemistryException($"Cannot bond to noble gas {atom1.Element}"); } if (!atom2.OrbitalsAvailableForBonding.Any()) { throw new ChemistryException($"Cannot bond to noble gas {atom2.Element}"); } var bonds = new List <OrbitalBond>(); for (int bondIdx = 1; bondIdx <= bondCount; bondIdx++) { var orbital1 = atom1.OrbitalsAvailableForBonding.MinimumItem(o => o.Energy.In(Unit.ElectronVolts)); var orbital2 = atom2.OrbitalsAvailableForBonding.MinimumItem(o => o.Energy.In(Unit.ElectronVolts)); var bond = new OrbitalBond(atom1, orbital1, atom2, orbital2); bonds.Add(bond); } return(bonds); }
public static UnitValue Calculate(AtomWithOrbitals atom1, Orbital orbital1, AtomWithOrbitals atom2, Orbital orbital2) { return(-5.To(Unit.ElectronVolts)); }
public static UnitValue CalculateOrbitalEnergy(AtomWithOrbitals atom, Orbital orbital) { return(-(1.0 / (OrbitalComparer.CalculateOrbitalOrder(orbital) + 1)).To(Unit.ElectronVolts)); }
public static UnitValue Calculate(AtomWithOrbitals atom1, Orbital orbital1, AtomWithOrbitals atom2, Orbital orbital2) { return(1.0 * (atom1.Radius + atom2.Radius)); }