Skip to content
Snippets Groups Projects
Commit 309120d5 authored by andy's avatar andy
Browse files

ENH: Added null constructor to basicSourceList

parent ac8af99b
No related branches found
No related tags found
No related merge requests found
...@@ -62,6 +62,22 @@ Foam::basicSourceList::basicSourceList ...@@ -62,6 +62,22 @@ Foam::basicSourceList::basicSourceList
PtrList<basicSource>(), PtrList<basicSource>(),
mesh_(mesh), mesh_(mesh),
checkTimeIndex_(mesh_.time().startTimeIndex() + 2) 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; label count = 0;
forAllConstIter(dictionary, dict, iter) forAllConstIter(dictionary, dict, iter)
...@@ -85,15 +101,13 @@ Foam::basicSourceList::basicSourceList ...@@ -85,15 +101,13 @@ Foam::basicSourceList::basicSourceList
this->set this->set
( (
i++, i++,
basicSource::New(name, sourceDict, mesh) basicSource::New(name, sourceDict, mesh_)
); );
} }
} }
} }
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool Foam::basicSourceList::read(const dictionary& dict) bool Foam::basicSourceList::read(const dictionary& dict)
{ {
checkTimeIndex_ = mesh_.time().timeIndex() + 2; checkTimeIndex_ = mesh_.time().timeIndex() + 2;
......
...@@ -84,7 +84,10 @@ public: ...@@ -84,7 +84,10 @@ public:
// Constructors // 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); basicSourceList(const fvMesh& mesh, const dictionary& dict);
...@@ -95,6 +98,9 @@ public: ...@@ -95,6 +98,9 @@ public:
// Member Functions // Member Functions
//- Reset the source list
void reset(const dictionary& dict);
//- Correct //- Correct
template<class Type> template<class Type>
void correct(GeometricField<Type, fvPatchField, volMesh>& fld); void correct(GeometricField<Type, fvPatchField, volMesh>& fld);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment