/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License This file is part of OpenFOAM. OpenFOAM is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. OpenFOAM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenFOAM. If not, see . \*---------------------------------------------------------------------------*/ #include "Particle.H" #include "dictionary.H" #include "scalarList.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // const dataType Foam::Particle::staticData(); // * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::Particle::Particle(const dictionary& dict) : name_(dict["name"]), W_(readScalar(dict["W"])), z_(readScalar(dict["z"])) { label geometry (dict.lookupOrDefault("geometry", 0)); const entry* entryPtr = dict.lookupEntryPtr("tranlib", false, true); if (entryPtr) { scalarList tranlib(entryPtr->stream()); geometry = tranlib[0]; } switch(geometry) { case 0: geometry_ = Geometry::ATOM; break; case 1: geometry_ = Geometry::LINEAR; break; case 2: geometry_ = Geometry::NONLINEAR; break; default: FatalErrorInFunction << "Illegal molecule geometry type. 0, 1 and 2 are allowed." << abort(FatalError); } } // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // Foam::Particle::~Particle() {} // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * * // void Foam::Particle::operator=(const Particle& rhs) { // Check for assignment to self if (this == &rhs) { FatalErrorInFunction << "Attempted assignment to self" << abort(FatalError); } } // * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * * // Foam::Ostream& Foam::operator<<(Ostream& os, const Particle& st) { os << st.name_ << tab << st.W_ << tab << st.z_ << tab << st.geometry_; os.check("Ostream& operator<<(Ostream& os, const specie& st)"); return os; } // ************************************************************************* //