ENH: Added null constructor to basicSourceList

This commit is contained in:
andy
2012-09-25 18:20:15 +01:00
parent ac8af99bb7
commit 309120d5b6
2 changed files with 24 additions and 4 deletions

View File

@ -62,6 +62,22 @@ Foam::basicSourceList::basicSourceList
PtrList<basicSource>(),
mesh_(mesh),
checkTimeIndex_(mesh_.time().startTimeIndex() + 2)
{
reset(dict);
}
Foam::basicSourceList::basicSourceList(const fvMesh& mesh)
:
PtrList<basicSource>(),
mesh_(mesh),
checkTimeIndex_(mesh_.time().startTimeIndex() + 2)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::basicSourceList::reset(const dictionary& dict)
{
label count = 0;
forAllConstIter(dictionary, dict, iter)
@ -85,15 +101,13 @@ Foam::basicSourceList::basicSourceList
this->set
(
i++,
basicSource::New(name, sourceDict, mesh)
basicSource::New(name, sourceDict, mesh_)
);
}
}
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool Foam::basicSourceList::read(const dictionary& dict)
{
checkTimeIndex_ = mesh_.time().timeIndex() + 2;

View File

@ -84,7 +84,10 @@ public:
// Constructors
//- Construct from components with list of field names
//- Construct null
basicSourceList(const fvMesh& mesh);
//- Construct from mesh and dictionary
basicSourceList(const fvMesh& mesh, const dictionary& dict);
@ -95,6 +98,9 @@ public:
// Member Functions
//- Reset the source list
void reset(const dictionary& dict);
//- Correct
template<class Type>
void correct(GeometricField<Type, fvPatchField, volMesh>& fld);