mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-12-28 03:37:59 +00:00
ENH: Added I/O for ExplicitSource
This commit is contained in:
@ -59,7 +59,7 @@ Foam::ExplicitSetValue<Type>::ExplicitSetValue
|
||||
basicSource(name, modelType, dict, mesh),
|
||||
fieldData_()
|
||||
{
|
||||
setFieldData(coeffs_.subDict("fieldData"));
|
||||
read(dict);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -96,6 +96,12 @@ void Foam::ExplicitSource<Type>::setFieldData(const dictionary& dict)
|
||||
dict.lookup(iter().keyword()) >> fieldData_[i].second();
|
||||
i++;
|
||||
}
|
||||
|
||||
// Set volume normalisation
|
||||
if (volumeMode_ == vmAbsolute)
|
||||
{
|
||||
VDash_ = V_;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -106,22 +112,16 @@ Foam::ExplicitSource<Type>::ExplicitSource
|
||||
(
|
||||
const word& name,
|
||||
const word& modelType,
|
||||
const dictionary& coeffs,
|
||||
const dictionary& dict,
|
||||
const fvMesh& mesh
|
||||
)
|
||||
:
|
||||
basicSource(name, modelType, coeffs, mesh),
|
||||
volumeMode_(wordToVolumeModeType(coeffs_.lookup("volumeMode"))),
|
||||
basicSource(name, modelType, dict, mesh),
|
||||
volumeMode_(vmAbsolute),
|
||||
VDash_(1.0),
|
||||
fieldData_()
|
||||
{
|
||||
setFieldData(coeffs_.subDict("fieldData"));
|
||||
|
||||
// Set volume normalisation
|
||||
if (volumeMode_ == vmAbsolute)
|
||||
{
|
||||
VDash_ = V_;
|
||||
}
|
||||
read(dict);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -30,22 +30,25 @@ License
|
||||
template<class Type>
|
||||
void Foam::ExplicitSource<Type>::writeData(Ostream& os) const
|
||||
{
|
||||
notImplemented
|
||||
(
|
||||
"void Foam::ExplicitSource<Type>::read(Ostream&) const"
|
||||
);
|
||||
os << indent << name_ << endl;
|
||||
dict_.write(os);
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
bool Foam::ExplicitSource<Type>::read(const dictionary& dict)
|
||||
{
|
||||
notImplemented
|
||||
(
|
||||
"bool Foam::ExplicitSource<Type>::read(const dictionary&)"
|
||||
);
|
||||
if (basicSource::read(dict))
|
||||
{
|
||||
setFieldData(coeffs_.subDict("fieldData"));
|
||||
volumeMode_ = wordToVolumeModeType(coeffs_.lookup("volumeMode"));
|
||||
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user