Commit 4c753e1e authored by Henry's avatar Henry
Browse files

fvOption: Rationalize read to support re-reading

writeData is not yet completely consistent with read.
parent b8d15ba4
......@@ -190,13 +190,7 @@ public:
virtual bool isActive();
// I-O
//- Write the source header information
virtual void writeHeader(Ostream&) const;
//- Write the source footer information
virtual void writeFooter(Ostream&) const;
// IO
//- Write the source properties
virtual void writeData(Ostream&) const;
......
......@@ -27,19 +27,6 @@ License
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::fv::cellSetOption::writeHeader(Ostream& os) const
{
os << indent << name_ << nl
<< indent << token::BEGIN_BLOCK << incrIndent << nl;
}
void Foam::fv::cellSetOption::writeFooter(Ostream& os) const
{
os << decrIndent << indent << token::END_BLOCK << endl;
}
void Foam::fv::cellSetOption::writeData(Ostream& os) const
{
option::writeData(os);
......
......@@ -150,14 +150,14 @@ void Foam::fv::fixedTemperatureConstraint::setValue
void Foam::fv::fixedTemperatureConstraint::writeData(Ostream& os) const
{
os << indent << name_ << endl;
cellSetOption::writeData(os);
dict_.write(os);
}
bool Foam::fv::fixedTemperatureConstraint::read(const dictionary& dict)
{
if (option::read(dict))
if (cellSetOption::read(dict))
{
if (coeffs_.found(Tuniform_->name()))
{
......
......@@ -145,7 +145,7 @@ public:
virtual void setValue(fvMatrix<scalar>& eqn, const label fieldI);
// I-O
// IO
//- Write data
virtual void writeData(Ostream&) const;
......
......@@ -127,14 +127,14 @@ void Foam::fv::temperatureLimitsConstraint::correct(volScalarField& he)
void Foam::fv::temperatureLimitsConstraint::writeData(Ostream& os) const
{
os << indent << name_ << endl;
cellSetOption::writeData(os);
dict_.write(os);
}
bool Foam::fv::temperatureLimitsConstraint::read(const dictionary& dict)
{
if (option::read(dict))
if (cellSetOption::read(dict))
{
coeffs_.readIfPresent("Tmin", Tmin_);
coeffs_.readIfPresent("Tmax", Tmax_);
......
......@@ -36,9 +36,8 @@ Description
maximum 500;
}
SourceFiles
fvOption.C
temperatureLimitsConstraint.C
\*---------------------------------------------------------------------------*/
......@@ -119,7 +118,7 @@ public:
virtual void correct(volScalarField& he);
// I-O
// IO
//- Write data
virtual void writeData(Ostream&) const;
......
......@@ -111,7 +111,7 @@ public:
virtual void setValue(fvMatrix<Type>& eqn, const label fieldI);
// I-O
// IO
//- Write the source properties
virtual void writeData(Ostream&) const;
......
......@@ -30,7 +30,7 @@ License
template<class Type>
void Foam::fv::ExplicitSetValue<Type>::writeData(Ostream& os) const
{
os << indent << name_ << endl;
cellSetOption::writeData(os);
dict_.write(os);
}
......@@ -38,7 +38,7 @@ void Foam::fv::ExplicitSetValue<Type>::writeData(Ostream& os) const
template<class Type>
bool Foam::fv::ExplicitSetValue<Type>::read(const dictionary& dict)
{
if (option::read(dict))
if (cellSetOption::read(dict))
{
setFieldData(coeffs_.subDict("injectionRate"));
return true;
......
......@@ -414,7 +414,7 @@ public:
);
// I-O
// IO
//- Write the source header information
virtual void writeHeader(Ostream&) const;
......
......@@ -175,7 +175,7 @@ public:
void constrain(fvMatrix<Type>& eqn);
// I-O
// IO
//- Read dictionary
virtual bool read(const dictionary& dict);
......
......@@ -25,7 +25,7 @@ Class
Foam::fv::interRegionOption
Description
Base class for inter region exchange.
Base class for inter-region exchange.
\*---------------------------------------------------------------------------*/
......@@ -106,7 +106,7 @@ public:
inline const meshToMesh& meshInterp() const;
// I-O
// IO
//- Write data
virtual void writeData(Ostream&) const;
......
......@@ -160,14 +160,14 @@ void Foam::fv::actuationDiskSource::addSup
void Foam::fv::actuationDiskSource::writeData(Ostream& os) const
{
os << indent << name_ << endl;
cellSetOption::writeData(os);
dict_.write(os);
}
bool Foam::fv::actuationDiskSource::read(const dictionary& dict)
{
if (option::read(dict))
if (cellSetOption::read(dict))
{
coeffs_.readIfPresent("diskDir", diskDir_);
coeffs_.readIfPresent("Cp", Cp_);
......
......@@ -205,7 +205,7 @@ public:
);
// I-O
// IO
//- Write data
virtual void writeData(Ostream&) const;
......
......@@ -310,14 +310,14 @@ void Foam::fv::effectivenessHeatExchangerSource::addSup
void Foam::fv::effectivenessHeatExchangerSource::writeData(Ostream& os) const
{
os << indent << name_ << endl;
cellSetOption::writeData(os);
dict_.write(os);
}
bool Foam::fv::effectivenessHeatExchangerSource::read(const dictionary& dict)
{
if (option::read(dict))
if (cellSetOption::read(dict))
{
coeffs_.lookup("secondaryMassFlowRate") >> secondaryMassFlowRate_;
coeffs_.lookup("secondaryInletT") >> secondaryInletT_;
......
......@@ -276,7 +276,7 @@ public:
);
// I-O
// IO
//- Write data
virtual void writeData(Ostream&) const;
......
......@@ -125,14 +125,14 @@ void Foam::fv::explicitPorositySource::addSup
void Foam::fv::explicitPorositySource::writeData(Ostream& os) const
{
os << indent << name_ << endl;
cellSetOption::writeData(os);
dict_.write(os);
}
bool Foam::fv::explicitPorositySource::read(const dictionary& dict)
{
if (option::read(dict))
if (cellSetOption::read(dict))
{
if (coeffs_.found("UNames"))
{
......
......@@ -159,7 +159,7 @@ public:
);
// I-O
// IO
//- Write data
virtual void writeData(Ostream&) const;
......
......@@ -153,7 +153,7 @@ public:
);
// I-O
// IO
//- Write the source properties
virtual void writeData(Ostream&) const;
......
......@@ -119,12 +119,8 @@ void Foam::fv::radialActuationDiskSource::writeData(Ostream& os) const
bool Foam::fv::radialActuationDiskSource::read(const dictionary& dict)
{
if (option::read(dict))
if (actuationDiskSource::read(dict))
{
coeffs_.readIfPresent("diskDir", diskDir_);
coeffs_.readIfPresent("Cp", Cp_);
coeffs_.readIfPresent("Ct", Ct_);
coeffs_.readIfPresent("diskArea", diskArea_);
coeffs_.lookup("coeffs") >> radialCoeffs_;
return true;
}
......
......@@ -161,7 +161,7 @@ public:
);
// I-O
// IO
//- Write data
virtual void writeData(Ostream&) const;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment