diff --git a/src/TurbulenceModels/Allwmake b/src/TurbulenceModels/Allwmake index 561610c0cefbb5761f7d569659e4f9d65021c5f7..84deb51c932692c3d145f89a2a89760fd29f2f7a 100755 --- a/src/TurbulenceModels/Allwmake +++ b/src/TurbulenceModels/Allwmake @@ -3,9 +3,9 @@ cd ${0%/*} || exit 1 # run from this directory makeType=${1:-libso} set -x -wmake libso turbulenceModels -wmake libso incompressible -wmake libso compressible +wmake $makeType turbulenceModels +wmake $makeType incompressible +wmake $makeType compressible wmakeLnInclude phaseIncompressible wmakeLnInclude phaseCompressible diff --git a/src/dynamicFvMesh/Make/files b/src/dynamicFvMesh/Make/files index 42105a9a60d3f17ca134598ab8c0264f7f22c2cc..0403ea42edff6119dd4e0982c708a6ef2a9cb901 100644 --- a/src/dynamicFvMesh/Make/files +++ b/src/dynamicFvMesh/Make/files @@ -18,5 +18,6 @@ $(solidBodyMotionFunctions)/axisRotationMotion/axisRotationMotion.C $(solidBodyMotionFunctions)/multiMotion/multiMotion.C $(solidBodyMotionFunctions)/oscillatingLinearMotion/oscillatingLinearMotion.C $(solidBodyMotionFunctions)/oscillatingRotatingMotion/oscillatingRotatingMotion.C +solidBodyMotionFvMesh/pointPatchFields/derived/solidBodyMotionDisplacement/solidBodyMotionDisplacementPointPatchVectorField.C LIB = $(FOAM_LIBBIN)/libdynamicFvMesh diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/pointPatchFields/derived/solidBodyMotionDisplacement/solidBodyMotionDisplacementPointPatchVectorField.C b/src/dynamicFvMesh/solidBodyMotionFvMesh/pointPatchFields/derived/solidBodyMotionDisplacement/solidBodyMotionDisplacementPointPatchVectorField.C new file mode 100644 index 0000000000000000000000000000000000000000..f925d3a20be74341396ea605bfc48967af8f81ce --- /dev/null +++ b/src/dynamicFvMesh/solidBodyMotionFvMesh/pointPatchFields/derived/solidBodyMotionDisplacement/solidBodyMotionDisplacementPointPatchVectorField.C @@ -0,0 +1,197 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 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 <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#include "solidBodyMotionDisplacementPointPatchVectorField.H" +#include "transformField.H" +#include "addToRunTimeSelectionTable.H" +#include "pointPatchFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * // + +solidBodyMotionDisplacementPointPatchVectorField:: +solidBodyMotionDisplacementPointPatchVectorField +( + const pointPatch& p, + const DimensionedField<vector, pointMesh>& iF +) +: + fixedValuePointPatchVectorField(p, iF), + SBMFPtr_() +{} + + +solidBodyMotionDisplacementPointPatchVectorField:: +solidBodyMotionDisplacementPointPatchVectorField +( + const pointPatch& p, + const DimensionedField<vector, pointMesh>& iF, + const dictionary& dict +) +: + fixedValuePointPatchVectorField(p, iF, dict, false), + SBMFPtr_(solidBodyMotionFunction::New(dict, this->db().time())) +{ + if (!dict.found("value")) + { + // Determine current local points and offset + fixedValuePointPatchVectorField::operator== + ( + transform(SBMFPtr_().transformation(), localPoints0()) + -localPoints0() + ); + } +} + + +solidBodyMotionDisplacementPointPatchVectorField:: +solidBodyMotionDisplacementPointPatchVectorField +( + const solidBodyMotionDisplacementPointPatchVectorField& ptf, + const pointPatch& p, + const DimensionedField<vector, pointMesh>& iF, + const pointPatchFieldMapper& mapper +) +: + fixedValuePointPatchVectorField(ptf, p, iF, mapper), + SBMFPtr_(ptf.SBMFPtr_().clone().ptr()) +{ + // For safety re-evaluate + + fixedValuePointPatchVectorField::operator== + ( + transform(SBMFPtr_().transformation(), localPoints0()) + -localPoints0() + ); +} + + +solidBodyMotionDisplacementPointPatchVectorField:: +solidBodyMotionDisplacementPointPatchVectorField +( + const solidBodyMotionDisplacementPointPatchVectorField& ptf +) +: + fixedValuePointPatchVectorField(ptf), + SBMFPtr_(ptf.SBMFPtr_().clone().ptr()) +{} + + +solidBodyMotionDisplacementPointPatchVectorField:: +solidBodyMotionDisplacementPointPatchVectorField +( + const solidBodyMotionDisplacementPointPatchVectorField& ptf, + const DimensionedField<vector, pointMesh>& iF +) +: + fixedValuePointPatchVectorField(ptf, iF), + SBMFPtr_(ptf.SBMFPtr_().clone().ptr()) +{ + // For safety re-evaluate + + fixedValuePointPatchVectorField::operator== + ( + transform(SBMFPtr_().transformation(), localPoints0()) + -localPoints0() + ); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +const pointField& +solidBodyMotionDisplacementPointPatchVectorField::localPoints0() const +{ + if (!localPoints0Ptr_.valid()) + { + pointIOField points0 + ( + IOobject + ( + "points", + this->db().time().constant(), + polyMesh::meshSubDir, + this->db(), + IOobject::MUST_READ, + IOobject::NO_WRITE, + false + ) + ); + + localPoints0Ptr_.reset(new pointField(points0, patch().meshPoints())); + } + return localPoints0Ptr_(); +} + + +void solidBodyMotionDisplacementPointPatchVectorField::updateCoeffs() +{ + if (this->updated()) + { + return; + } + + // Determine current local points and offset + fixedValuePointPatchVectorField::operator== + ( + transform(SBMFPtr_().transformation(), localPoints0()) + -localPoints0() + ); + + fixedValuePointPatchVectorField::updateCoeffs(); +} + + +void solidBodyMotionDisplacementPointPatchVectorField:: +write(Ostream& os) const +{ + // Note: write value + fixedValuePointPatchVectorField::write(os); + + os.writeKeyword(solidBodyMotionFunction::typeName) << SBMFPtr_->type() + << token::END_STATEMENT << nl; + os << indent << word(SBMFPtr_->type() + "Coeffs"); + SBMFPtr_->writeData(os); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makePointPatchTypeField +( + pointPatchVectorField, + solidBodyMotionDisplacementPointPatchVectorField +); + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/pointPatchFields/derived/solidBodyMotionDisplacement/solidBodyMotionDisplacementPointPatchVectorField.H b/src/dynamicFvMesh/solidBodyMotionFvMesh/pointPatchFields/derived/solidBodyMotionDisplacement/solidBodyMotionDisplacementPointPatchVectorField.H new file mode 100644 index 0000000000000000000000000000000000000000..c8319cd95fd75392be69d50b9d94eda3d35c637b --- /dev/null +++ b/src/dynamicFvMesh/solidBodyMotionFvMesh/pointPatchFields/derived/solidBodyMotionDisplacement/solidBodyMotionDisplacementPointPatchVectorField.H @@ -0,0 +1,169 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 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 <http://www.gnu.org/licenses/>. + +Class + Foam::solidBodyMotionDisplacementPointPatchVectorField + +Description + Enables the specification of a fixed value boundary condition using the + solid body motion functions. + +SourceFiles + solidBodyMotionDisplacementPointPatchVectorField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef solidBodyMotionDisplacementPointPatchVectorField_H +#define solidBodyMotionDisplacementPointPatchVectorField_H + +#include "solidBodyMotionFunction.H" +#include "fixedValuePointPatchFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class solidBodyMotionDisplacementPointPatchVectorField Declaration +\*---------------------------------------------------------------------------*/ + +class solidBodyMotionDisplacementPointPatchVectorField +: + public fixedValuePointPatchVectorField +{ + // Private data + + //- The motion control function + autoPtr<solidBodyMotionFunction> SBMFPtr_; + + mutable autoPtr<pointField> localPoints0Ptr_; + + +public: + + //- Runtime type information + TypeName("solidBodyMotionDisplacement"); + + + // Constructors + + //- Construct from patch and internal field + solidBodyMotionDisplacementPointPatchVectorField + ( + const pointPatch&, + const DimensionedField<vector, pointMesh>& + ); + + //- Construct from patch, internal field and dictionary + solidBodyMotionDisplacementPointPatchVectorField + ( + const pointPatch&, + const DimensionedField<vector, pointMesh>&, + const dictionary& + ); + + //- Construct by mapping given patchField<vector> onto a new patch + solidBodyMotionDisplacementPointPatchVectorField + ( + const solidBodyMotionDisplacementPointPatchVectorField&, + const pointPatch&, + const DimensionedField<vector, pointMesh>&, + const pointPatchFieldMapper& + ); + + //- Construct as copy + solidBodyMotionDisplacementPointPatchVectorField + ( + const solidBodyMotionDisplacementPointPatchVectorField& + ); + + //- Construct and return a clone + virtual autoPtr<pointPatchField<vector> > clone() const + { + return autoPtr<pointPatchField<vector> > + ( + new solidBodyMotionDisplacementPointPatchVectorField + ( + *this + ) + ); + } + + //- Construct as copy setting internal field reference + solidBodyMotionDisplacementPointPatchVectorField + ( + const solidBodyMotionDisplacementPointPatchVectorField&, + const DimensionedField<vector, pointMesh>& + ); + + + //- Construct and return a clone setting internal field reference + virtual autoPtr<pointPatchField<vector> > clone + ( + const DimensionedField<vector, pointMesh>& iF + ) const + { + return autoPtr<pointPatchField<vector> > + ( + new solidBodyMotionDisplacementPointPatchVectorField + ( + *this, + iF + ) + ); + } + + + // Member functions + + // Access + + //- Return the fluctuation scale + const solidBodyMotionFunction& motion() const + { + return SBMFPtr_(); + } + + const pointField& localPoints0() const; + + // Evaluation functions + + //- Update the coefficients associated with the patch field + virtual void updateCoeffs(); + + + //- Write + virtual void write(Ostream&) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/SDA/SDA.H b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/SDA/SDA.H index f24afc9dc666e9387ef1157c4209ee41d61665a0..67bef0f9ed56958e5b6ac87e386261fa8efdd594 100644 --- a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/SDA/SDA.H +++ b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/SDA/SDA.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -118,6 +118,19 @@ public: const Time& runTime ); + //- Construct and return a clone + virtual autoPtr<solidBodyMotionFunction> clone() const + { + return autoPtr<solidBodyMotionFunction> + ( + new SDA + ( + SBMFCoeffs_, + time_ + ) + ); + } + //- Destructor virtual ~SDA(); diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/axisRotationMotion/axisRotationMotion.H b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/axisRotationMotion/axisRotationMotion.H index bc6b67936512c83294712de2980ed106eddddc25..9f78e72d1b0cb9a8af27d05f1d0da82fbea5bba3 100644 --- a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/axisRotationMotion/axisRotationMotion.H +++ b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/axisRotationMotion/axisRotationMotion.H @@ -88,6 +88,19 @@ public: const Time& runTime ); + //- Construct and return a clone + virtual autoPtr<solidBodyMotionFunction> clone() const + { + return autoPtr<solidBodyMotionFunction> + ( + new axisRotationMotion + ( + SBMFCoeffs_, + time_ + ) + ); + } + //- Destructor virtual ~axisRotationMotion(); diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/linearMotion/linearMotion.H b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/linearMotion/linearMotion.H index cd79131d7763a334b5a32513a7afa8eacbcbcfc2..036ed957b63a48c9dbe2ff1e19a5d8786e61fc8d 100644 --- a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/linearMotion/linearMotion.H +++ b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/linearMotion/linearMotion.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -84,6 +84,19 @@ public: const Time& runTime ); + //- Construct and return a clone + virtual autoPtr<solidBodyMotionFunction> clone() const + { + return autoPtr<solidBodyMotionFunction> + ( + new linearMotion + ( + SBMFCoeffs_, + time_ + ) + ); + } + //- Destructor virtual ~linearMotion(); diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/multiMotion/multiMotion.H b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/multiMotion/multiMotion.H index 9bbf045efa99528fa05d670f0b0389d710030005..93eb8dd8e53b6a465ef44f732045d266c1601e49 100644 --- a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/multiMotion/multiMotion.H +++ b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/multiMotion/multiMotion.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -84,6 +84,19 @@ public: const Time& runTime ); + //- Construct and return a clone + virtual autoPtr<solidBodyMotionFunction> clone() const + { + return autoPtr<solidBodyMotionFunction> + ( + new multiMotion + ( + SBMFCoeffs_, + time_ + ) + ); + } + //- Destructor virtual ~multiMotion(); diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/oscillatingLinearMotion/oscillatingLinearMotion.H b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/oscillatingLinearMotion/oscillatingLinearMotion.H index a3251b80c912e7ed956be5c4e1e1508a3454346f..d080f486ef414c9027f6c40ff010e4f06320e02e 100644 --- a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/oscillatingLinearMotion/oscillatingLinearMotion.H +++ b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/oscillatingLinearMotion/oscillatingLinearMotion.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -87,6 +87,19 @@ public: const Time& runTime ); + //- Construct and return a clone + virtual autoPtr<solidBodyMotionFunction> clone() const + { + return autoPtr<solidBodyMotionFunction> + ( + new oscillatingLinearMotion + ( + SBMFCoeffs_, + time_ + ) + ); + } + //- Destructor virtual ~oscillatingLinearMotion(); diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/oscillatingRotatingMotion/oscillatingRotatingMotion.H b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/oscillatingRotatingMotion/oscillatingRotatingMotion.H index cbe10a95ecc2a186e1970855e3bdd9511902396f..60692b98f2f8bfe0cf5f7dddb141b86a8def077a 100644 --- a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/oscillatingRotatingMotion/oscillatingRotatingMotion.H +++ b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/oscillatingRotatingMotion/oscillatingRotatingMotion.H @@ -90,6 +90,19 @@ public: const Time& runTime ); + //- Construct and return a clone + virtual autoPtr<solidBodyMotionFunction> clone() const + { + return autoPtr<solidBodyMotionFunction> + ( + new oscillatingRotatingMotion + ( + SBMFCoeffs_, + time_ + ) + ); + } + //- Destructor virtual ~oscillatingRotatingMotion(); diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/rotatingMotion/rotatingMotion.H b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/rotatingMotion/rotatingMotion.H index 87ec08746fb45af2ed36ca9059a8cd2c0f423f1f..169d5d17aa8b62abcbfa0dae44e2136e331a2b04 100644 --- a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/rotatingMotion/rotatingMotion.H +++ b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/rotatingMotion/rotatingMotion.H @@ -95,6 +95,19 @@ public: const Time& runTime ); + //- Construct and return a clone + virtual autoPtr<solidBodyMotionFunction> clone() const + { + return autoPtr<solidBodyMotionFunction> + ( + new rotatingMotion + ( + SBMFCoeffs_, + time_ + ) + ); + } + //- Destructor virtual ~rotatingMotion(); diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunction.C b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunction.C index 10a3bb079965bcb6902d0922d6b08c3f52ae459d..214ac972a153284d2f3ce9cdb1788cd6b4a23c5b 100644 --- a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunction.C +++ b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunction.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -70,4 +70,10 @@ bool Foam::solidBodyMotionFunction::read(const dictionary& SBMFCoeffs) } +void Foam::solidBodyMotionFunction::writeData(Ostream& os) const +{ + os << SBMFCoeffs_; +} + + // ************************************************************************* // diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunction.H b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunction.H index 77a8920a22bef07db95b90917c2a20835f773a38..075e74629795f22b02706a8e4c985f01a1d319f3 100644 --- a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunction.H +++ b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunction.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -106,6 +106,9 @@ public: const Time& runTime ); + //- Construct and return a clone + virtual autoPtr<solidBodyMotionFunction> clone() const = 0; + // Selectors @@ -128,6 +131,9 @@ public: //- Update properties from given dictionary virtual bool read(const dictionary& SBMFCoeffs) = 0; + + //- Write in dictionary format + virtual void writeData(Ostream&) const; }; diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/tabulated6DoFMotion/tabulated6DoFMotion.H b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/tabulated6DoFMotion/tabulated6DoFMotion.H index 763d7105cfe6bc7bef35835b569f377c8fb73ce4..0a5bfc736f7dcdef46f3ed6eeee632f655317b63 100644 --- a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/tabulated6DoFMotion/tabulated6DoFMotion.H +++ b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/tabulated6DoFMotion/tabulated6DoFMotion.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -100,6 +100,19 @@ public: const Time& runTime ); + //- Construct and return a clone + virtual autoPtr<solidBodyMotionFunction> clone() const + { + return autoPtr<solidBodyMotionFunction> + ( + new tabulated6DoFMotion + ( + SBMFCoeffs_, + time_ + ) + ); + } + //- Destructor virtual ~tabulated6DoFMotion();