diff --git a/src/lagrangian/intermediate/submodels/CloudSubModelBase.C b/src/lagrangian/intermediate/submodels/CloudSubModelBase.C
new file mode 100644
index 0000000000..83098ec87c
--- /dev/null
+++ b/src/lagrangian/intermediate/submodels/CloudSubModelBase.C
@@ -0,0 +1,136 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration |
+ \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
+ \\/ M anipulation |
+-------------------------------------------------------------------------------
+License
+ This file is part of OpenFOAM.
+
+ OpenFOAM is free software: you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with OpenFOAM. If not, see .
+
+\*---------------------------------------------------------------------------*/
+
+#include "CloudSubModelBase.H"
+
+// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
+
+template
+Foam::CloudSubModelBase::CloudSubModelBase(CloudType& owner)
+:
+ subModelBase(owner.outputProperties()),
+ owner_(owner)
+{}
+
+
+template
+Foam::CloudSubModelBase::CloudSubModelBase
+(
+ CloudType& owner,
+ const dictionary& dict,
+ const word& baseName,
+ const word& modelType,
+ const word& dictExt
+)
+:
+ subModelBase
+ (
+ owner.outputProperties(),
+ dict,
+ baseName,
+ modelType,
+ dictExt
+ ),
+ owner_(owner)
+{}
+
+
+template
+Foam::CloudSubModelBase::CloudSubModelBase
+(
+ const word& modelName,
+ CloudType& owner,
+ const dictionary& dict,
+ const word& baseName,
+ const word& modelType
+)
+:
+ subModelBase
+ (
+ modelName,
+ owner.outputProperties(),
+ dict,
+ baseName,
+ modelType
+ ),
+ owner_(owner)
+{}
+
+
+template
+Foam::CloudSubModelBase::CloudSubModelBase
+(
+ const CloudSubModelBase& smb
+)
+:
+ subModelBase(smb),
+ owner_(smb.owner_)
+{}
+
+
+// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
+
+template
+Foam::CloudSubModelBase::~CloudSubModelBase()
+{}
+
+
+// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
+
+template
+const CloudType& Foam::CloudSubModelBase::owner() const
+{
+ return owner_;
+}
+
+
+template
+CloudType& Foam::CloudSubModelBase::owner()
+{
+ return owner_;
+}
+
+
+template
+bool Foam::CloudSubModelBase::outputTime() const
+{
+ return
+ active()
+ && owner_.solution().transient()
+ && owner_.db().time().outputTime();
+}
+
+
+template
+void Foam::CloudSubModelBase::write(Ostream& os) const
+{
+ os.writeKeyword("owner") << owner_.name() << token::END_STATEMENT
+ << nl;
+
+ subModelBase::write(os);
+}
+
+
+// ************************************************************************* //
diff --git a/src/lagrangian/intermediate/submodels/CloudSubModelBase.H b/src/lagrangian/intermediate/submodels/CloudSubModelBase.H
new file mode 100644
index 0000000000..443612e018
--- /dev/null
+++ b/src/lagrangian/intermediate/submodels/CloudSubModelBase.H
@@ -0,0 +1,138 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration |
+ \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
+ \\/ M anipulation |
+-------------------------------------------------------------------------------
+License
+ This file is part of OpenFOAM.
+
+ OpenFOAM is free software: you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with OpenFOAM. If not, see .
+
+Class
+ Foam::CloudSubModelBase
+
+Description
+ Base class for cloud sub-models
+
+SourceFiles
+ CloudSubModelBase.C
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef CloudSubModelBase_H
+#define CloudSubModelBase_H
+
+#include "subModelBase.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+/*---------------------------------------------------------------------------*\
+ Class CloudSubModelBase Declaration
+\*---------------------------------------------------------------------------*/
+
+template
+class CloudSubModelBase
+:
+ public subModelBase
+{
+protected:
+
+ // Protected Data
+
+ //- Reference to the cloud
+ CloudType& owner_;
+
+
+public:
+
+ // Constructors
+
+ //- Construct null from owner cloud
+ CloudSubModelBase(CloudType& owner);
+
+ //- Construct from owner cloud without name
+ CloudSubModelBase
+ (
+ CloudType& owner,
+ const dictionary& dict,
+ const word& baseName,
+ const word& modelType,
+ const word& dictExt = "Coeffs"
+ );
+
+ //- Construct from owner cloud with name
+ CloudSubModelBase
+ (
+ const word& modelName,
+ CloudType& owner,
+ const dictionary& dict,
+ const word& baseName,
+ const word& modelType
+ );
+
+ //- Construct as copy
+ CloudSubModelBase(const CloudSubModelBase& smb);
+
+
+ //- Destructor
+ virtual ~CloudSubModelBase();
+
+ //- Type of cloud this model was instantiated for
+ typedef CloudType cloudType;
+
+
+ // Member Functions
+
+ // Access
+
+ //- Return const access to the owner cloud
+ const CloudType& owner() const;
+
+ //- Flag to indicate when to write a property
+ virtual bool outputTime() const;
+
+
+ // Edit
+
+ //- Return non-const access to the owner cloud for manipulation
+ CloudType& owner();
+
+
+ // I-O
+
+ //- Write
+ virtual void write(Ostream& os) const;
+};
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#ifdef NoRepository
+# include "CloudSubModelBase.C"
+#endif
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/lagrangian/intermediate/submodels/SubModelBase.C b/src/lagrangian/intermediate/submodels/SubModelBase.C
deleted file mode 100644
index 2df1f5207c..0000000000
--- a/src/lagrangian/intermediate/submodels/SubModelBase.C
+++ /dev/null
@@ -1,394 +0,0 @@
-/*---------------------------------------------------------------------------*\
- ========= |
- \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
- \\ / O peration |
- \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
- \\/ M anipulation |
--------------------------------------------------------------------------------
-License
- This file is part of OpenFOAM.
-
- OpenFOAM is free software: you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- for more details.
-
- You should have received a copy of the GNU General Public License
- along with OpenFOAM. If not, see .
-
-\*---------------------------------------------------------------------------*/
-
-#include "SubModelBase.H"
-
-// * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * * //
-
-template
-bool Foam::SubModelBase::SubModelBase::inLine() const
-{
- return (modelName_ != word::null);
-}
-
-
-// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
-
-template
-Foam::SubModelBase::SubModelBase(CloudType& owner)
-:
- owner_(owner),
- dict_(dictionary::null),
- baseName_(word::null),
- modelType_(word::null),
- modelName_(word::null),
- coeffDict_(dictionary::null)
-{}
-
-
-template
-Foam::SubModelBase::SubModelBase
-(
- CloudType& owner,
- const dictionary& dict,
- const word& baseName,
- const word& modelType,
- const word& dictExt
-)
-:
- owner_(owner),
- dict_(dict),
- baseName_(baseName),
- modelType_(modelType),
- modelName_(word::null),
- coeffDict_(dict.subDict(modelType + dictExt))
-{}
-
-
-template
-Foam::SubModelBase::SubModelBase
-(
- const word& modelName,
- CloudType& owner,
- const dictionary& dict,
- const word& baseName,
- const word& modelType
-)
-:
- owner_(owner),
- dict_(dict),
- baseName_(baseName),
- modelType_(modelType),
- modelName_(modelName),
- coeffDict_(dict)
-{}
-
-
-template
-Foam::SubModelBase::SubModelBase(const SubModelBase& smb)
-:
- owner_(smb.owner_),
- dict_(smb.dict_),
- baseName_(smb.baseName_),
- modelType_(smb.modelType_),
- modelName_(smb.modelName_),
- coeffDict_(smb.coeffDict_)
-{}
-
-
-// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
-
-template
-Foam::SubModelBase::~SubModelBase()
-{}
-
-
-// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
-
-template
-const CloudType& Foam::SubModelBase::owner() const
-{
- return owner_;
-}
-
-
-template
-const Foam::dictionary& Foam::SubModelBase::dict() const
-{
- return dict_;
-}
-
-
-template
-const Foam::word& Foam::SubModelBase::modelType() const
-{
- return modelType_;
-}
-
-
-template
-const Foam::word& Foam::SubModelBase::baseName() const
-{
- return baseName_;
-}
-
-
-template
-const Foam::word& Foam::SubModelBase::modelName() const
-{
- return modelName_;
-}
-
-
-template
-const Foam::dictionary& Foam::SubModelBase::coeffDict() const
-{
- return coeffDict_;
-}
-
-
-template
-bool Foam::SubModelBase::defaultCoeffs(const bool printMsg) const
-{
- bool def = coeffDict_.lookupOrDefault("defaultCoeffs", false);
- if (printMsg && def)
- {
- Info<< incrIndent;
- Info<< indent << "Employing default coefficients" << endl;
- Info<< decrIndent;
- }
-
- return def;
-}
-
-
-template
-CloudType& Foam::SubModelBase::owner()
-{
- return owner_;
-}
-
-
-template
-bool Foam::SubModelBase::active() const
-{
- return true;
-}
-
-
-template
-void Foam::SubModelBase::cacheFields(const bool)
-{
- // do nothing
-}
-
-
-template
-bool Foam::SubModelBase::outputTime() const
-{
- return
- active()
- && owner_.solution().transient()
- && owner_.db().time().outputTime();
-}
-
-
-template
-template
-Type Foam::SubModelBase::getBaseProperty
-(
- const word& entryName,
- const Type& defaultValue
-) const
-{
- Type result = defaultValue;
-
- const dictionary& properties = this->owner().outputProperties();
-
- if (properties.found(baseName_))
- {
- const dictionary& baseDict = properties.subDict(baseName_);
- baseDict.readIfPresent(entryName, result);
- }
-
- return result;
-}
-
-
-template
-template
-void Foam::SubModelBase::getBaseProperty
-(
- const word& entryName,
- Type& value
-) const
-{
- const dictionary& properties = this->owner().outputProperties();
-
- if (properties.found(baseName_))
- {
- const dictionary& baseDict = properties.subDict(baseName_);
- baseDict.readIfPresent(entryName, value);
- }
-}
-
-
-template
-template
-void Foam::SubModelBase::setBaseProperty
-(
- const word& entryName,
- const Type& value
-)
-{
- dictionary& properties = this->owner().outputProperties();
-
- if (properties.found(baseName_))
- {
- dictionary& baseDict = properties.subDict(baseName_);
- baseDict.add(entryName, value, true);
- }
- else
- {
- properties.add(baseName_, dictionary());
- properties.subDict(baseName_).add(entryName, value);
- }
-}
-
-
-template
-template
-Type Foam::SubModelBase::getModelProperty
-(
- const word& entryName,
- const Type& defaultValue
-) const
-{
- Type result = defaultValue;
-
- const dictionary& properties = this->owner().outputProperties();
-
- if (properties.found(baseName_))
- {
- const dictionary& baseDict = properties.subDict(baseName_);
-
- if (inLine() && baseDict.found(modelName_))
- {
- baseDict.subDict(modelName_).readIfPresent(entryName, result);
- }
- else if (baseDict.found(modelType_))
- {
- baseDict.subDict(modelType_).readIfPresent(entryName, result);
- }
- }
-
- return result;
-}
-
-
-template
-template
-void Foam::SubModelBase::getModelProperty
-(
- const word& entryName,
- Type& value
-) const
-{
- const dictionary& properties = this->owner().outputProperties();
-
- if (properties.found(baseName_))
- {
- const dictionary& baseDict = properties.subDict(baseName_);
-
- if (inLine() && baseDict.found(modelName_))
- {
- baseDict.subDict(modelName_).readIfPresent(entryName, value);
- }
- else if (baseDict.found(modelType_))
- {
- baseDict.subDict(modelType_).readIfPresent(entryName, value);
- }
- }
-}
-
-
-template
-template
-void Foam::SubModelBase::setModelProperty
-(
- const word& entryName,
- const Type& value
-)
-{
- dictionary& properties = this->owner().outputProperties();
-
- if (properties.found(baseName_))
- {
- dictionary& baseDict = properties.subDict(baseName_);
-
- if (inLine())
- {
- if (baseDict.found(modelName_))
- {
- baseDict.subDict(modelName_).add(entryName, value, true);
- }
- else
- {
- baseDict.add(modelName_, dictionary());
- baseDict.subDict(modelName_).add(entryName, value, true);
- }
- }
- else
- {
- if (baseDict.found(modelType_))
- {
- baseDict.subDict(modelType_).add(entryName, value, true);
- }
- else
- {
- baseDict.add(modelType_, dictionary());
- baseDict.subDict(modelType_).add(entryName, value, true);
- }
- }
- }
- else
- {
- properties.add(baseName_, dictionary());
-
- if (inLine())
- {
- properties.subDict(baseName_).add(modelName_, dictionary());
- properties.subDict(baseName_).subDict(modelName_).add
- (
- entryName,
- value
- );
- }
- else
- {
- properties.subDict(baseName_).add(modelType_, dictionary());
- properties.subDict(baseName_).subDict(modelType_).add
- (
- entryName,
- value
- );
- }
- }
-}
-
-
-template
-void Foam::SubModelBase::write(Ostream& os) const
-{
- os.writeKeyword("owner") << owner_.name() << token::END_STATEMENT
- << nl;
-
- // not writing complete cloud dictionary, only coeffs
-// os << dict_;
- os << coeffDict_;
-}
-
-
-// ************************************************************************* //
diff --git a/src/lagrangian/intermediate/submodels/SubModelBase.H b/src/lagrangian/intermediate/submodels/SubModelBase.H
deleted file mode 100644
index 608cee614e..0000000000
--- a/src/lagrangian/intermediate/submodels/SubModelBase.H
+++ /dev/null
@@ -1,225 +0,0 @@
-/*---------------------------------------------------------------------------*\
- ========= |
- \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
- \\ / O peration |
- \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
- \\/ M anipulation |
--------------------------------------------------------------------------------
-License
- This file is part of OpenFOAM.
-
- OpenFOAM is free software: you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- for more details.
-
- You should have received a copy of the GNU General Public License
- along with OpenFOAM. If not, see .
-
-Class
- Foam::SubModelBase
-
-Description
- Base class for cloud sub-models
-
-SourceFiles
- SubModelBase.C
-
-\*---------------------------------------------------------------------------*/
-
-#ifndef SubModelBase_H
-#define SubModelBase_H
-
-#include "dictionary.H"
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-namespace Foam
-{
-
-// Forward declaration of classes
-template
-class SubModelBase;
-
-/*---------------------------------------------------------------------------*\
- Class SubModelBase Declaration
-\*---------------------------------------------------------------------------*/
-
-template
-class SubModelBase
-{
-protected:
-
- // Protected Data
-
- //- Reference to the cloud
- CloudType& owner_;
-
- //- Reference to the cloud dictionary
- const dictionary dict_;
-
- //- Name of the sub-model base class
- const word baseName_;
-
- //- Type of the sub-model
- const word modelType_;
-
- //- Name of the sub-model
- const word modelName_;
-
- //- Coefficients dictionary
- const dictionary coeffDict_;
-
-
- // Protected Member Functions
-
- //- Flag to indicate whether data is/was read in-line
- bool inLine() const;
-
-
-public:
-
- // Constructors
-
- //- Construct null from owner cloud
- SubModelBase(CloudType& owner);
-
- //- Construct from owner cloud, dictionary, and model type name
- SubModelBase
- (
- CloudType& owner,
- const dictionary& dict,
- const word& baseName,
- const word& modelType,
- const word& dictExt = "Coeffs"
- );
-
- //- Construct from owner cloud, dictionary, and model type name
- SubModelBase
- (
- const word& modelName,
- CloudType& owner,
- const dictionary& dict,
- const word& baseName,
- const word& modelType
- );
-
- //- Construct as copy
- SubModelBase(const SubModelBase& smb);
-
-
- //- Destructor
- virtual ~SubModelBase();
-
- //- Type of cloud this model was instantiated for
- typedef CloudType cloudType;
-
-
- // Member Functions
-
- // Access
-
- //- Return const access to the owner cloud
- const CloudType& owner() const;
-
- //- Return const access to the cloud dictionary
- const dictionary& dict() const;
-
- //- Return const access to the sub-model type
- const word& modelType() const;
-
- //- Return const access to the base name of the sub-model
- const word& baseName() const;
-
- //- Return const access to the name of the sub-model
- const word& modelName() const;
-
- //- Return const access to the coefficients dictionary
- const dictionary& coeffDict() const;
-
- //- Return const access to the properties dictionary
- const IOdictionary& properties() const;
-
- //- Returns true if defaultCoeffs is true and outputs on printMsg
- bool defaultCoeffs(const bool printMsg) const;
-
- //- Return the model 'active' status - default active = true
- virtual bool active() const;
-
- //- Cache dependant sub-model fields
- virtual void cacheFields(const bool store);
-
- //- Flag to indicate when to write a property
- bool outputTime() const;
-
-
- // Edit
-
- //- Return non-const access to the owner cloud for manipulation
- CloudType& owner();
-
- // Base properties
-
- //- Retrieve generic property from the base model
- template
- Type getBaseProperty
- (
- const word& entryName,
- const Type& defaultValue = pTraits::zero
- ) const;
-
- //- Retrieve generic property from the base model
- template
- void getBaseProperty(const word& entryName, Type& value) const;
-
- //- Add generic property to the base model
- template
- void setBaseProperty(const word& entryName, const Type& value);
-
-
- // Model properties
-
- //- Retrieve generic property from the sub-model
- template
- Type getModelProperty
- (
- const word& entryName,
- const Type& defaultValue = pTraits::zero
- ) const;
-
- //- Retrieve generic property from the sub-model
- template
- void getModelProperty(const word& entryName, Type& value) const;
-
- //- Add generic property to the sub-model
- template
- void setModelProperty(const word& entryName, const Type& value);
-
-
- // I-O
-
- //- Write
- virtual void write(Ostream& os) const;
-};
-
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-} // End namespace Foam
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-#ifdef NoRepository
-# include "SubModelBase.C"
-#endif
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-#endif
-
-// ************************************************************************* //