class specie upadate stream IO and dictionary constructor
This commit is contained in:
parent
b912ad59b1
commit
a6b1fd6636
1 changed files with 7 additions and 3 deletions
|
|
@ -50,7 +50,8 @@ Foam::specie::specie(Istream& is)
|
|||
:
|
||||
name_(is),
|
||||
nMoles_(readScalar(is)),
|
||||
molWeight_(readScalar(is))
|
||||
molWeight_(readScalar(is)),
|
||||
nCharges_(readScalar(is))
|
||||
{
|
||||
is.check("specie::specie(Istream& is)");
|
||||
}
|
||||
|
|
@ -60,7 +61,8 @@ Foam::specie::specie(const dictionary& dict)
|
|||
:
|
||||
name_(dict.dictName()),
|
||||
nMoles_(readScalar(dict.subDict("specie").lookup("nMoles"))),
|
||||
molWeight_(readScalar(dict.subDict("specie").lookup("molWeight")))
|
||||
molWeight_(readScalar(dict.subDict("specie").lookup("molWeight"))),
|
||||
nCharges_(readScalar(dict.subDict("specie").lookup("nCharges")))
|
||||
{}
|
||||
|
||||
|
||||
|
|
@ -71,6 +73,7 @@ void Foam::specie::write(Ostream& os) const
|
|||
dictionary dict("specie");
|
||||
dict.add("nMoles", nMoles_);
|
||||
dict.add("molWeight", molWeight_);
|
||||
dict.add("nCharges", nCharges_);
|
||||
os << indent << dict.dictName() << dict;
|
||||
}
|
||||
|
||||
|
|
@ -81,7 +84,8 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const specie& st)
|
|||
{
|
||||
os << st.name_ << tab
|
||||
<< st.nMoles_ << tab
|
||||
<< st.molWeight_;
|
||||
<< st.molWeight_ << tab
|
||||
<< st.nCharges_;
|
||||
|
||||
os.check("Ostream& operator<<(Ostream& os, const specie& st)");
|
||||
return os;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue