diff --git a/README.html b/README.html index 1e96c05e6a..18c3e0747e 100644 --- a/README.html +++ b/README.html @@ -102,7 +102,7 @@ lang="en" xml:lang="en">

1 About OpenFOAM

-

OpenFOAM is a free, open source computational fluid dynamcis (CFD) software +

OpenFOAM is a free, open source computational fluid dynamics (CFD) software package released by the OpenFOAM Foundation. It has a large user base across most areas of engineering and science, from both commercial and academic organisations. OpenFOAM has an extensive range of features to solve anything diff --git a/README.org b/README.org index c107d87870..84fd18c0cf 100644 --- a/README.org +++ b/README.org @@ -8,7 +8,7 @@ # Copyright (c) 2011 OpenFOAM Foundation. * About OpenFOAM - OpenFOAM is a free, open source computational fluid dynamcis (CFD) software + OpenFOAM is a free, open source computational fluid dynamics (CFD) software package released by the OpenFOAM Foundation. It has a large user base across most areas of engineering and science, from both commercial and academic organisations. OpenFOAM has an extensive range of features to solve anything diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/EEqns.H b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/EEqns.H index b9a47a917d..1f12fc9a12 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/EEqns.H +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/EEqns.H @@ -27,7 +27,7 @@ - (fvc::ddt(alpha1) + fvc::div(alphaPhi1))*K1 + ( - he1.name() == "e" + he1.name() == thermo1.phasePropertyName("e") ? fvc::div(alphaPhi1, p) : -dalpha1pdt )/rho1 @@ -49,7 +49,7 @@ - (fvc::ddt(alpha2) + fvc::div(alphaPhi2))*K2 + ( - he2.name() == "e" + he2.name() == thermo2.phasePropertyName("e") ? fvc::div(alphaPhi2, p) : -dalpha2pdt )/rho2 diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/UEqns.H b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/UEqns.H index ce5c622f9a..ae22926c4e 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/UEqns.H +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/UEqns.H @@ -1,3 +1,7 @@ +mrfZones.correctBoundaryVelocity(U1); +mrfZones.correctBoundaryVelocity(U2); +mrfZones.correctBoundaryVelocity(U); + fvVectorMatrix U1Eqn(U1, U1.dimensions()*dimVol/dimTime); fvVectorMatrix U2Eqn(U2, U2.dimensions()*dimVol/dimTime); diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/alphaEqn.H b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/alphaEqn.H index a20f53e014..601ff0e919 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/alphaEqn.H +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/alphaEqn.H @@ -104,6 +104,35 @@ surfaceScalarField alphaPhi2("alphaPhi" + phase2Name, phi2); { alphaPhi1 = alphaPhic1; } + + /* + // Legacy semi-implicit and potentially unbounded form + fvScalarMatrix alpha1Eqn + ( + fvm::ddt(alpha1) + + fvm::div(phic, alpha1, alphaScheme) + + fvm::div + ( + -fvc::flux(-phir, alpha2, alpharScheme), + alpha1, + alpharScheme + ) + == + fvm::Sp(Sp, alpha1) + Su + ); + + alpha1Eqn.relax(); + alpha1Eqn.solve(); + + if (nAlphaSubCycles > 1) + { + alphaPhi1 += (runTime.deltaT()/totalDeltaT)*alpha1Eqn.flux(); + } + else + { + alphaPhi1 = alpha1Eqn.flux(); + } + */ } if (g0.value() > 0.0) diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseModel/phaseModel/phaseModel.C b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseModel/phaseModel/phaseModel.C index 5dff309b57..112a302188 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseModel/phaseModel/phaseModel.C +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseModel/phaseModel/phaseModel.C @@ -26,6 +26,7 @@ License #include "phaseModel.H" #include "diameterModel.H" #include "fixedValueFvPatchFields.H" +#include "slipFvPatchFields.H" #include "surfaceInterpolate.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -118,7 +119,11 @@ Foam::phaseModel::phaseModel forAll(U_.boundaryField(), i) { - if (isA(U_.boundaryField()[i])) + if + ( + isA(U_.boundaryField()[i]) + || isA(U_.boundaryField()[i]) + ) { phiTypes[i] = fixedValueFvPatchScalarField::typeName; } diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/UEqns.H b/applications/solvers/multiphase/multiphaseEulerFoam/UEqns.H index a63ff3c85a..7584d84f27 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/UEqns.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/UEqns.H @@ -1,3 +1,5 @@ +#include "mrfZonesCorrectBCs.H" + PtrList UEqns(fluid.phases().size()); autoPtr dragCoeffs(fluid.dragCoeffs()); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/mrfZonesCorrectBCs.H b/applications/solvers/multiphase/multiphaseEulerFoam/mrfZonesCorrectBCs.H new file mode 100644 index 0000000000..d670aa4a41 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/mrfZonesCorrectBCs.H @@ -0,0 +1,6 @@ + forAllIter(PtrDictionary, fluid.phases(), iter) + { + mrfZones.correctBoundaryVelocity(iter().U()); + } + + mrfZones.correctBoundaryVelocity(U); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/phaseModel/phaseModel/phaseModel.C b/applications/solvers/multiphase/multiphaseEulerFoam/phaseModel/phaseModel/phaseModel.C index 543927e29b..f74ef12513 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/phaseModel/phaseModel/phaseModel.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/phaseModel/phaseModel/phaseModel.C @@ -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 @@ -26,6 +26,7 @@ License #include "phaseModel.H" #include "diameterModel.H" #include "fixedValueFvPatchFields.H" +#include "slipFvPatchFields.H" #include "surfaceInterpolate.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -152,7 +153,11 @@ Foam::phaseModel::phaseModel forAll(U_.boundaryField(), i) { - if (isA(U_.boundaryField()[i])) + if + ( + isA(U_.boundaryField()[i]) + || isA(U_.boundaryField()[i]) + ) { phiTypes[i] = fixedValueFvPatchScalarField::typeName; } diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseModel/phaseModel/phaseModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseModel/phaseModel/phaseModel.C index aebc7ba6cb..85ee12b316 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseModel/phaseModel/phaseModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseModel/phaseModel/phaseModel.C @@ -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 @@ -25,6 +25,7 @@ License #include "phaseModel.H" #include "fixedValueFvPatchFields.H" +#include "slipFvPatchFields.H" #include "surfaceInterpolate.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -114,7 +115,11 @@ Foam::phaseModel::phaseModel forAll(U_.boundaryField(), i) { - if (isA(U_.boundaryField()[i])) + if + ( + isA(U_.boundaryField()[i]) + || isA(U_.boundaryField()[i]) + ) { phiTypes[i] = fixedValueFvPatchScalarField::typeName; } diff --git a/applications/test/Matrix/Test-Matrix.C b/applications/test/Matrix/Test-Matrix.C index 600d0ad60f..40e79d15e9 100644 --- a/applications/test/Matrix/Test-Matrix.C +++ b/applications/test/Matrix/Test-Matrix.C @@ -23,7 +23,7 @@ License \*---------------------------------------------------------------------------*/ -#include "SquareMatrix.H" +#include "scalarMatrices.H" #include "vector.H" using namespace Foam; @@ -49,15 +49,15 @@ int main(int argc, char *argv[]) Info<< max(hmm) << endl; Info<< min(hmm) << endl; - SquareMatrix hmm2(3, 1.0); + SquareMatrix hmm2(3, 3, 1.0); hmm = hmm2; Info<< hmm << endl; - SquareMatrix hmm3(Sin); + //SquareMatrix hmm3(Sin); - Info<< hmm3 << endl; + //Info<< hmm3 << endl; SquareMatrix hmm4; @@ -70,7 +70,65 @@ int main(int argc, char *argv[]) hmm4 = hmm5; Info<< hmm5 << endl; - Info<< "End\n" << endl; + { + scalarSymmetricSquareMatrix symmMatrix(3, 3, 0); + + symmMatrix(0, 0) = 4; + symmMatrix(1, 0) = 12; + symmMatrix(1, 1) = 37; + symmMatrix(2, 0) = -16; + symmMatrix(2, 1) = -43; + symmMatrix(2, 2) = 98; + + Info<< "Symmetric Square Matrix = " << symmMatrix << endl; + + Info<< "Inverse = " << inv(symmMatrix) << endl; + Info<< "Determinant = " << det(symmMatrix) << endl; + + scalarSymmetricSquareMatrix symmMatrix2(symmMatrix); + LUDecompose(symmMatrix2); + + Info<< "Inverse = " << invDecomposed(symmMatrix2) << endl; + Info<< "Determinant = " << detDecomposed(symmMatrix2) << endl; + + scalarDiagonalMatrix rhs(3, 0); + rhs[0] = 1; + rhs[1] = 2; + rhs[2] = 3; + + LUsolve(symmMatrix, rhs); + + Info<< "Decomposition = " << symmMatrix << endl; + Info<< "Solution = " << rhs << endl; + } + + { + scalarSquareMatrix squareMatrix(3, 3, 0); + + squareMatrix[0][0] = 4; + squareMatrix[0][1] = 12; + squareMatrix[0][2] = -16; + squareMatrix[1][0] = 12; + squareMatrix[1][1] = 37; + squareMatrix[1][2] = -43; + squareMatrix[2][0] = -16; + squareMatrix[2][1] = -43; + squareMatrix[2][2] = 98; + + Info<< nl << "Square Matrix = " << squareMatrix << endl; + + scalarDiagonalMatrix rhs(3, 0); + rhs[0] = 1; + rhs[1] = 2; + rhs[2] = 3; + + LUsolve(squareMatrix, rhs); + + Info<< "Decomposition = " << squareMatrix << endl; + Info<< "Solution = " << rhs << endl; + } + + Info<< "\nEnd\n" << endl; return 0; } diff --git a/etc/config/settings.csh b/etc/config/settings.csh index be510764fd..2264c4ee03 100644 --- a/etc/config/settings.csh +++ b/etc/config/settings.csh @@ -226,7 +226,7 @@ case ThirdParty: breaksw case Gcc47: case Gcc47++0x: - set gcc_version=gcc-4.7.0 + set gcc_version=gcc-4.7.2 set gmp_version=gmp-5.0.4 set mpfr_version=mpfr-3.1.0 set mpc_version=mpc-0.9 diff --git a/etc/config/settings.sh b/etc/config/settings.sh index 12d6f4b900..5a77479b56 100644 --- a/etc/config/settings.sh +++ b/etc/config/settings.sh @@ -247,7 +247,7 @@ OpenFOAM | ThirdParty) mpc_version=mpc-0.9 ;; Gcc47 | Gcc47++0x) - gcc_version=gcc-4.7.0 + gcc_version=gcc-4.7.2 gmp_version=gmp-5.0.4 mpfr_version=mpfr-3.1.0 mpc_version=mpc-0.9 diff --git a/src/OpenFOAM/db/objectRegistry/objectRegistry.H b/src/OpenFOAM/db/objectRegistry/objectRegistry.H index 84b295c4d7..d2b4163849 100644 --- a/src/OpenFOAM/db/objectRegistry/objectRegistry.H +++ b/src/OpenFOAM/db/objectRegistry/objectRegistry.H @@ -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 @@ -159,6 +159,10 @@ public: template HashTable lookupClass(const bool strict = false) const; + //- Lookup and return all objects of the given Type + template + HashTable lookupClass(const bool strict = false); + //- Is the named Type found? template bool foundObject(const word& name) const; diff --git a/src/OpenFOAM/db/objectRegistry/objectRegistryTemplates.C b/src/OpenFOAM/db/objectRegistry/objectRegistryTemplates.C index 960605e049..483e1c2416 100644 --- a/src/OpenFOAM/db/objectRegistry/objectRegistryTemplates.C +++ b/src/OpenFOAM/db/objectRegistry/objectRegistryTemplates.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 @@ -76,6 +76,34 @@ Foam::HashTable Foam::objectRegistry::lookupClass } +template +Foam::HashTable Foam::objectRegistry::lookupClass +( + const bool strict +) +{ + HashTable objectsOfClass(size()); + + forAllIter(HashTable, *this, iter) + { + if + ( + (strict && isType(*iter())) + || (!strict && isA(*iter())) + ) + { + objectsOfClass.insert + ( + iter()->name(), + dynamic_cast(iter()) + ); + } + } + + return objectsOfClass; +} + + template bool Foam::objectRegistry::foundObject(const word& name) const { diff --git a/src/OpenFOAM/matrices/DiagonalMatrix/DiagonalMatrix.H b/src/OpenFOAM/matrices/DiagonalMatrix/DiagonalMatrix.H index 031320a457..a065b3aec3 100644 --- a/src/OpenFOAM/matrices/DiagonalMatrix/DiagonalMatrix.H +++ b/src/OpenFOAM/matrices/DiagonalMatrix/DiagonalMatrix.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 @@ -76,7 +76,7 @@ public: // Member functions - //- Invert the diaganol matrix and return itself + //- Invert the diagonal matrix and return itself DiagonalMatrix& invert(); }; diff --git a/src/OpenFOAM/matrices/Matrix/Matrix.H b/src/OpenFOAM/matrices/Matrix/Matrix.H index dd55db770c..005982d9e0 100644 --- a/src/OpenFOAM/matrices/Matrix/Matrix.H +++ b/src/OpenFOAM/matrices/Matrix/Matrix.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 @@ -221,7 +221,6 @@ template Form operator* const Matrix& ); - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/OpenFOAM/matrices/SymmetricSquareMatrix/SymmetricSquareMatrix.C b/src/OpenFOAM/matrices/SymmetricSquareMatrix/SymmetricSquareMatrix.C new file mode 100644 index 0000000000..bb6bea65c7 --- /dev/null +++ b/src/OpenFOAM/matrices/SymmetricSquareMatrix/SymmetricSquareMatrix.C @@ -0,0 +1,98 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 "SymmetricSquareMatrix.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +template +Foam::SymmetricSquareMatrix Foam::invDecomposed +( + const SymmetricSquareMatrix& matrix +) +{ + SymmetricSquareMatrix inv(matrix.n(), matrix.n(), 0.0); + + for (label i = 0; i < matrix.n(); ++i) + { + inv[i][i] = 1.0/matrix[i][i]; + + for (label j = 0; j < i; ++j) + { + scalar sum = 0.0; + + for (label k = j; k < i; k++) + { + sum -= matrix[i][k]*inv[k][j]; + } + + inv[i][j] = sum/matrix[i][i]; + } + } + + return inv.T()*inv; +} + + +template +Foam::SymmetricSquareMatrix Foam::inv +( + const SymmetricSquareMatrix& matrix +) +{ + SymmetricSquareMatrix matrixTmp(matrix); + + LUDecompose(matrixTmp); + + return invDecomposed(matrixTmp); +} + + +template +Foam::scalar Foam::detDecomposed(const SymmetricSquareMatrix& matrix) +{ + scalar diagProduct = 1.0; + + for (label i = 0; i < matrix.n(); ++i) + { + diagProduct *= matrix[i][i]; + } + + return sqr(diagProduct); +} + + +template +Foam::scalar Foam::det(const SymmetricSquareMatrix& matrix) +{ + SymmetricSquareMatrix matrixTmp = matrix; + + LUDecompose(matrixTmp); + + return detDecomposed(matrixTmp); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/matrices/SymmetricSquareMatrix/SymmetricSquareMatrix.H b/src/OpenFOAM/matrices/SymmetricSquareMatrix/SymmetricSquareMatrix.H new file mode 100644 index 0000000000..6983250078 --- /dev/null +++ b/src/OpenFOAM/matrices/SymmetricSquareMatrix/SymmetricSquareMatrix.H @@ -0,0 +1,126 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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::SymmetricSquareMatrix + +Description + A templated 2D square symmetric matrix of objects of \, where the + n x n matrix dimension is known and used for subscript bounds checking, etc. + +SourceFiles + SymmetricSquareMatrixI.H + SymmetricSquareMatrix.C + +\*---------------------------------------------------------------------------*/ + +#ifndef SymmetricSquareMatrix_H +#define SymmetricSquareMatrix_H + +#include "SquareMatrix.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class SymmetricSquareMatrix Declaration +\*---------------------------------------------------------------------------*/ + +template +class SymmetricSquareMatrix +: + public Matrix, Type> +{ + +public: + + // Constructors + + //- Null constructor. + inline SymmetricSquareMatrix(); + + //- Construct given number of rows/columns. + inline SymmetricSquareMatrix(const label n); + + //- Construct with given number of rows/columns + inline SymmetricSquareMatrix(const label m, const label n); + + //- Construct with given number of rows/columns + // and value for all elements. + inline SymmetricSquareMatrix(const label m, const label n, const Type&); + + //- Construct from Istream. + inline SymmetricSquareMatrix(Istream&); + + //- Clone + inline autoPtr > clone() const; + + + //- Return subscript-checked row of Matrix. + inline Type& operator()(const label r, const label c); + + //- Return subscript-checked row of constant Matrix. + inline const Type& operator()(const label r, const label c) const; +}; + + +// Global functions + +//- Return the LU decomposed SymmetricSquareMatrix inverse +template +SymmetricSquareMatrix invDecomposed(const SymmetricSquareMatrix&); + +//- Return the SymmetricSquareMatrix inverse +template +SymmetricSquareMatrix inv(const SymmetricSquareMatrix&); + +//- Return the LU decomposed SymmetricSquareMatrix det +template +scalar detDecomposed(const SymmetricSquareMatrix&); + +//- Return the SymmetricSquareMatrix det +template +scalar det(const SymmetricSquareMatrix&); + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +# include "SymmetricSquareMatrixI.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "SymmetricSquareMatrix.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/OpenFOAM/matrices/SymmetricSquareMatrix/SymmetricSquareMatrixI.H b/src/OpenFOAM/matrices/SymmetricSquareMatrix/SymmetricSquareMatrixI.H new file mode 100644 index 0000000000..1dee0ab9d0 --- /dev/null +++ b/src/OpenFOAM/matrices/SymmetricSquareMatrix/SymmetricSquareMatrixI.H @@ -0,0 +1,139 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 . + +\*---------------------------------------------------------------------------*/ + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +inline Foam::SymmetricSquareMatrix::SymmetricSquareMatrix() +: + Matrix, Type>() +{} + + +template +inline Foam::SymmetricSquareMatrix::SymmetricSquareMatrix(const label n) +: + Matrix, Type>(n, n) +{} + + +template +inline Foam::SymmetricSquareMatrix::SymmetricSquareMatrix +( + const label m, + const label n +) +: + Matrix, Type>(m, n) +{ + if (m != n) + { + FatalErrorIn + ( + "SymmetricSquareMatrix::SymmetricSquareMatrix" + "(const label m, const label n)" + ) << "m != n for constructing a symmetric square matrix" + << exit(FatalError); + } +} + + +template +inline Foam::SymmetricSquareMatrix::SymmetricSquareMatrix +( + const label m, + const label n, + const Type& t +) +: + Matrix, Type>(m, n, t) +{ + if (m != n) + { + FatalErrorIn + ( + "SymmetricSquareMatrix::SymmetricSquareMatrix" + "(const label m, const label n, const Type&)" + ) << "m != n for constructing a symmetric square matrix" + << exit(FatalError); + } +} + + +template +inline Foam::SymmetricSquareMatrix::SymmetricSquareMatrix(Istream& is) +: + Matrix, Type>(is) +{} + + +template +inline Foam::autoPtr > +Foam::SymmetricSquareMatrix::clone() const +{ + return autoPtr > + ( + new SymmetricSquareMatrix(*this) + ); +} + + +template +inline Type& Foam::SymmetricSquareMatrix::operator() +( + const label r, + const label c +) +{ + if (r > c) + { + return this->operator[](r)[c]; + } + else + { + return this->operator[](c)[r]; + } +} + + +template +inline const Type& Foam::SymmetricSquareMatrix::operator() +( + const label r, + const label c +) const +{ + if (r > c) + { + return this->operator[](r)[c]; + } + else + { + return this->operator[](c)[r]; + } +} + + +// ************************************************************************* // diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomeration.C b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomeration.C index 51421910c2..aacea11eaf 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomeration.C +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomeration.C @@ -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 @@ -70,7 +70,7 @@ Foam::GAMGAgglomeration::GAMGAgglomeration const dictionary& controlDict ) : - MeshObject(mesh), + MeshObject(mesh), maxLevels_(50), diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomeration.H b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomeration.H index e35cdd379f..c6ad6d2c5c 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomeration.H +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomeration.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 @@ -58,7 +58,7 @@ class lduMatrix; class GAMGAgglomeration : - public MeshObject + public MeshObject { protected: diff --git a/src/OpenFOAM/matrices/scalarMatrices/scalarMatrices.C b/src/OpenFOAM/matrices/scalarMatrices/scalarMatrices.C index 58b196da09..68a6955d71 100644 --- a/src/OpenFOAM/matrices/scalarMatrices/scalarMatrices.C +++ b/src/OpenFOAM/matrices/scalarMatrices/scalarMatrices.C @@ -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 @@ -134,6 +134,56 @@ void Foam::LUDecompose } +void Foam::LUDecompose(scalarSymmetricSquareMatrix& matrix) +{ + // Store result in upper triangular part of matrix + label size = matrix.n(); + + // Set upper triangular parts to zero. + for (label j = 0; j < size; j++) + { + for (label k = j + 1; k < size; k++) + { + matrix[j][k] = 0.0; + } + } + + for (label j = 0; j < size; j++) + { + scalar d = 0.0; + + for (label k = 0; k < j; k++) + { + scalar s = 0.0; + + for (label i = 0; i < k; i++) + { + s += matrix[i][k]*matrix[i][j]; + } + + s = (matrix[j][k] - s)/matrix[k][k]; + + matrix[k][j] = s; + matrix[j][k] = s; + + d += sqr(s); + } + + d = matrix[j][j] - d; + + if (d < 0.0) + { + FatalErrorIn("Foam::LUDecompose(scalarSymmetricSquareMatrix&)") + << "Matrix is not symmetric positive-definite. Unable to " + << "decompose." + << abort(FatalError); + } + + matrix[j][j] = sqrt(d); + } +} + + // * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * // void Foam::multiply diff --git a/src/OpenFOAM/matrices/scalarMatrices/scalarMatrices.H b/src/OpenFOAM/matrices/scalarMatrices/scalarMatrices.H index 0830b33ae6..3eecda8ebf 100644 --- a/src/OpenFOAM/matrices/scalarMatrices/scalarMatrices.H +++ b/src/OpenFOAM/matrices/scalarMatrices/scalarMatrices.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 @@ -27,6 +27,10 @@ Class Description Scalar matrices + LUDecompose for scalarSymmetricSquareMatrix implements the Cholesky + decomposition method from JAMA, a public-domain library developed at NIST, + available at http://math.nist.gov/tnt/index.html + SourceFiles scalarMatrices.C scalarMatricesTemplates.C @@ -38,6 +42,7 @@ SourceFiles #include "RectangularMatrix.H" #include "SquareMatrix.H" +#include "SymmetricSquareMatrix.H" #include "DiagonalMatrix.H" #include "scalarField.H" #include "labelList.H" @@ -49,21 +54,22 @@ namespace Foam typedef RectangularMatrix scalarRectangularMatrix; typedef SquareMatrix scalarSquareMatrix; +typedef SymmetricSquareMatrix scalarSymmetricSquareMatrix; typedef DiagonalMatrix scalarDiagonalMatrix; //- Solve the matrix using Gaussian elimination with pivoting, // returning the solution in the source template -void solve(scalarSquareMatrix& matrix, Field& source); +void solve(scalarSquareMatrix& matrix, List& source); //- Solve the matrix using Gaussian elimination with pivoting // and return the solution template void solve ( - Field& psi, + List& psi, const scalarSquareMatrix& matrix, - const Field& source + const List& source ); //- LU decompose the matrix with pivoting @@ -73,6 +79,9 @@ void LUDecompose labelList& pivotIndices ); +//- LU decompose the matrix into a lower (L) and upper (U) part. U = L.T() +void LUDecompose(scalarSymmetricSquareMatrix& matrix); + //- LU back-substitution with given source, returning the solution // in the source template @@ -80,13 +89,28 @@ void LUBacksubstitute ( const scalarSquareMatrix& luMmatrix, const labelList& pivotIndices, - Field& source + List& source +); + +//- LU back-substitution with given source, returning the solution +// in the source. Specialised for symmetric square matrices that have been +// decomposed into LU where U = L.T() as pivoting is not required +template +void LUBacksubstitute +( + const scalarSymmetricSquareMatrix& luMmatrix, + List& source ); //- Solve the matrix using LU decomposition with pivoting // returning the LU form of the matrix and the solution in the source template -void LUsolve(scalarSquareMatrix& matrix, Field& source); +void LUsolve(scalarSquareMatrix& matrix, List& source); + +//- Solve the matrix using LU decomposition returning the LU form of the matrix +// and the solution in the source, where U = L.T() +template +void LUsolve(scalarSymmetricSquareMatrix& matrix, List& source); template void multiply diff --git a/src/OpenFOAM/matrices/scalarMatrices/scalarMatricesTemplates.C b/src/OpenFOAM/matrices/scalarMatrices/scalarMatricesTemplates.C index 0489ed012d..7aaaabb695 100644 --- a/src/OpenFOAM/matrices/scalarMatrices/scalarMatricesTemplates.C +++ b/src/OpenFOAM/matrices/scalarMatrices/scalarMatricesTemplates.C @@ -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 @@ -25,6 +25,7 @@ License #include "scalarMatrices.H" #include "Swap.H" +#include "ListOps.H" // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // @@ -32,7 +33,7 @@ template void Foam::solve ( scalarSquareMatrix& tmpMatrix, - Field& sourceSol + List& sourceSol ) { label n = tmpMatrix.n(); @@ -103,9 +104,9 @@ void Foam::solve template void Foam::solve ( - Field& psi, + List& psi, const scalarSquareMatrix& matrix, - const Field& source + const List& source ) { scalarSquareMatrix tmpMatrix = matrix; @@ -119,7 +120,7 @@ void Foam::LUBacksubstitute ( const scalarSquareMatrix& luMatrix, const labelList& pivotIndices, - Field& sourceSol + List& sourceSol ) { label n = luMatrix.n(); @@ -163,11 +164,57 @@ void Foam::LUBacksubstitute } +template +void Foam::LUBacksubstitute +( + const scalarSymmetricSquareMatrix& luMatrix, + List& sourceSol +) +{ + label n = luMatrix.n(); + + label ii = 0; + + for (register label i=0; i::zero) + { + ii = i+1; + } + + sourceSol[i] = sum/luMatrixi[i]; + } + + for (register label i=n-1; i>=0; i--) + { + Type sum = sourceSol[i]; + const scalar* __restrict__ luMatrixi = luMatrix[i]; + + for (register label j=i+1; j void Foam::LUsolve ( scalarSquareMatrix& matrix, - Field& sourceSol + List& sourceSol ) { labelList pivotIndices(matrix.n()); @@ -176,6 +223,18 @@ void Foam::LUsolve } +template +void Foam::LUsolve +( + scalarSymmetricSquareMatrix& matrix, + List& sourceSol +) +{ + LUDecompose(matrix); + LUBacksubstitute(matrix, sourceSol); +} + + template void Foam::multiply ( diff --git a/src/OpenFOAM/meshes/MeshObject/MeshObject.C b/src/OpenFOAM/meshes/MeshObject/MeshObject.C index eed1d7aad8..8f25049242 100644 --- a/src/OpenFOAM/meshes/MeshObject/MeshObject.C +++ b/src/OpenFOAM/meshes/MeshObject/MeshObject.C @@ -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 @@ -28,26 +28,18 @@ License // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -template -Foam::MeshObject::MeshObject(const Mesh& mesh) +template class MeshObjectType, class Type> +Foam::MeshObject::MeshObject(const Mesh& mesh) : - regIOobject - ( - IOobject - ( - Type::typeName, - mesh.thisDb().instance(), - mesh.thisDb() - ) - ), + MeshObjectType(Type::typeName, mesh.thisDb()), mesh_(mesh) {} // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // -template -const Type& Foam::MeshObject::New +template class MeshObjectType, class Type> +const Type& Foam::MeshObject::New ( const Mesh& mesh ) @@ -67,14 +59,14 @@ const Type& Foam::MeshObject::New } else { - return store(new Type(mesh)); + return regIOobject::store(new Type(mesh)); } } -template +template class MeshObjectType, class Type> template -const Type& Foam::MeshObject::New +const Type& Foam::MeshObject::New ( const Mesh& mesh, const Data1& d @@ -95,14 +87,14 @@ const Type& Foam::MeshObject::New } else { - return store(new Type(mesh, d)); + return regIOobject::store(new Type(mesh, d)); } } -template +template class MeshObjectType, class Type> template -const Type& Foam::MeshObject::New +const Type& Foam::MeshObject::New ( const Mesh& mesh, const Data1& d1, @@ -124,14 +116,14 @@ const Type& Foam::MeshObject::New } else { - return store(new Type(mesh, d1, d2)); + return regIOobject::store(new Type(mesh, d1, d2)); } } -template +template class MeshObjectType, class Type> template -const Type& Foam::MeshObject::New +const Type& Foam::MeshObject::New ( const Mesh& mesh, const Data1& d1, @@ -154,14 +146,14 @@ const Type& Foam::MeshObject::New } else { - return store(new Type(mesh, d1, d2, d3)); + return regIOobject::store(new Type(mesh, d1, d2, d3)); } } -template +template class MeshObjectType, class Type> template -const Type& Foam::MeshObject::New +const Type& Foam::MeshObject::New ( const Mesh& mesh, const Data1& d1, @@ -185,15 +177,15 @@ const Type& Foam::MeshObject::New } else { - return store(new Type(mesh, d1, d2, d3, d4)); + return regIOobject::store(new Type(mesh, d1, d2, d3, d4)); } } // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * // -template -bool Foam::MeshObject::Delete(const Mesh& mesh) +template class MeshObjectType, class Type> +bool Foam::MeshObject::Delete(const Mesh& mesh) { if ( @@ -221,10 +213,79 @@ bool Foam::MeshObject::Delete(const Mesh& mesh) } -template -Foam::MeshObject::~MeshObject() +template class MeshObjectType, class Type> +Foam::MeshObject::~MeshObject() { - release(); + MeshObjectType::release(); +} + + +template +void Foam::meshObject::movePoints(objectRegistry& obr) +{ + HashTable*> meshObjects + ( + obr.lookupClass >() + ); + + forAllIter + ( + typename HashTable*>, + meshObjects, + iter + ) + { + if (isA >(*iter())) + { + dynamic_cast*>(iter())->movePoints(); + } + else + { + obr.checkOut(*iter()); + } + } +} + + +template +void Foam::meshObject::updateMesh(objectRegistry& obr, const mapPolyMesh& mpm) +{ + HashTable*> meshObjects + ( + obr.lookupClass >() + ); + + forAllIter + ( + typename HashTable*>, + meshObjects, + iter + ) + { + if (isA >(*iter())) + { + dynamic_cast*>(iter())->updateMesh(mpm); + } + else + { + obr.checkOut(*iter()); + } + } +} + + +template class MeshObjectType> +void Foam::meshObject::clear(objectRegistry& obr) +{ + HashTable*> meshObjects + ( + obr.lookupClass >() + ); + + forAllIter(typename HashTable*>, meshObjects, iter) + { + obr.checkOut(*iter()); + } } diff --git a/src/OpenFOAM/meshes/MeshObject/MeshObject.H b/src/OpenFOAM/meshes/MeshObject/MeshObject.H index 95cf9daf2c..8efa89f944 100644 --- a/src/OpenFOAM/meshes/MeshObject/MeshObject.H +++ b/src/OpenFOAM/meshes/MeshObject/MeshObject.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 @@ -25,9 +25,36 @@ Class Foam::MeshObject Description - Templated abstract base-class for dynamic mesh objects used to automate + Templated abstract base-class for optional mesh objects used to automate their allocation to the mesh database and the mesh-modifier event-loop. + MeshObject is templated on the type of mesh it is allocated to, the type of + the mesh object (TopologicalMeshObject, GeometricMeshObject, + MoveableMeshObject, UpdateableMeshObject) and the type of the actual object + it is created for example: + + class leastSquaresVectors + : + public MeshObject + { + . + . + . + //- Delete the least square vectors when the mesh moves + virtual bool movePoints(); + }; + + MeshObject types: + + TopologicalMeshObject: mesh object to be deleted on topology change + GeometricMeshObject: mesh object to be deleted on geometry change + MoveableMeshObject: mesh object to be updated in movePoints + UpdateableMeshObject: mesh object to be updated in updateMesh or movePoints + + Note that movePoints must be provided for MeshObjects of type + MoveableMeshObject and both movePoints and updateMesh functions must exist + provided for MeshObjects of type UpdateableMeshObject. + SourceFiles MeshObject.C @@ -37,21 +64,24 @@ SourceFiles #define MeshObject_H #include "regIOobject.H" +#include "objectRegistry.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { +// Forward declarations +class mapPolyMesh; + /*---------------------------------------------------------------------------*\ - Class MeshObject Declaration + Class MeshObject Declaration \*---------------------------------------------------------------------------*/ - -template +template class MeshObjectType, class Type> class MeshObject : - public regIOobject + public MeshObjectType { protected: @@ -124,6 +154,121 @@ public: }; +/*---------------------------------------------------------------------------*\ + Class meshObject Declaration +\*---------------------------------------------------------------------------*/ + +class meshObject +: + public regIOobject +{ +public: + + // Constructors + + meshObject(const word& typeName, const objectRegistry& obr) + : + regIOobject + ( + IOobject + ( + typeName, + obr.instance(), + obr + ) + ) + {} + + + // Static member functions + + template + static void movePoints(objectRegistry&); + + template + static void updateMesh(objectRegistry&, const mapPolyMesh&); + + template class MeshObjectType> + static void clear(objectRegistry&); +}; + + +/*---------------------------------------------------------------------------*\ + Class TopologicalMeshObject Declaration +\*---------------------------------------------------------------------------*/ + +template +class TopologicalMeshObject +: + public meshObject +{ +public: + + TopologicalMeshObject(const word& typeName, const objectRegistry& obr) + : + meshObject(typeName, obr) + {} +}; + + +/*---------------------------------------------------------------------------*\ + Class GeometricMeshObject Declaration +\*---------------------------------------------------------------------------*/ + +template +class GeometricMeshObject +: + public TopologicalMeshObject +{ +public: + + GeometricMeshObject(const word& typeName, const objectRegistry& obr) + : + TopologicalMeshObject(typeName, obr) + {} +}; + + +/*---------------------------------------------------------------------------*\ + Class MoveableMeshObject Declaration +\*---------------------------------------------------------------------------*/ + +template +class MoveableMeshObject +: + public GeometricMeshObject +{ +public: + + MoveableMeshObject(const word& typeName, const objectRegistry& obr) + : + GeometricMeshObject(typeName, obr) + {} + + virtual bool movePoints() = 0; +}; + + +/*---------------------------------------------------------------------------*\ + Class UpdateableMeshObject Declaration +\*---------------------------------------------------------------------------*/ + +template +class UpdateableMeshObject +: + public MoveableMeshObject +{ +public: + + UpdateableMeshObject(const word& typeName, const objectRegistry& obr) + : + MoveableMeshObject(typeName, obr) + {} + + virtual void updateMesh(const mapPolyMesh& mpm) = 0; +}; + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/OpenFOAM/meshes/pointMesh/pointMesh.C b/src/OpenFOAM/meshes/pointMesh/pointMesh.C index f378a5d780..de6f88d16c 100644 --- a/src/OpenFOAM/meshes/pointMesh/pointMesh.C +++ b/src/OpenFOAM/meshes/pointMesh/pointMesh.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 @@ -72,7 +72,7 @@ void Foam::pointMesh::mapFields(const mapPolyMesh& mpm) Foam::pointMesh::pointMesh(const polyMesh& pMesh) : - MeshObject(pMesh), + MeshObject(pMesh), GeoMesh(pMesh), boundary_(*this, pMesh.boundaryMesh()) { @@ -88,7 +88,7 @@ Foam::pointMesh::pointMesh(const polyMesh& pMesh) } -void Foam::pointMesh::movePoints(const pointField& newPoints) +bool Foam::pointMesh::movePoints() { if (debug) { @@ -96,7 +96,9 @@ void Foam::pointMesh::movePoints(const pointField& newPoints) << "Moving points." << endl; } - boundary_.movePoints(newPoints); + boundary_.movePoints(GeoMesh::mesh_.points()); + + return true; } diff --git a/src/OpenFOAM/meshes/pointMesh/pointMesh.H b/src/OpenFOAM/meshes/pointMesh/pointMesh.H index 25e8af9530..15dbf5bf88 100644 --- a/src/OpenFOAM/meshes/pointMesh/pointMesh.H +++ b/src/OpenFOAM/meshes/pointMesh/pointMesh.H @@ -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 @@ -48,7 +48,7 @@ namespace Foam class pointMesh : - public MeshObject, + public MeshObject, public GeoMesh { // Permanent data @@ -121,7 +121,7 @@ public: // Mesh motion //- Move points, returns volumes swept by faces in motion - void movePoints(const pointField&); + bool movePoints(); //- Update the mesh corresponding to given map void updateMesh(const mapPolyMesh& mpm); diff --git a/src/OpenFOAM/meshes/polyMesh/polyMesh.C b/src/OpenFOAM/meshes/polyMesh/polyMesh.C index 8201254e0b..9b0d11ac7a 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyMesh.C +++ b/src/OpenFOAM/meshes/polyMesh/polyMesh.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 @@ -26,30 +26,24 @@ License #include "polyMesh.H" #include "Time.H" #include "cellIOList.H" -#include "SubList.H" #include "wedgePolyPatch.H" #include "emptyPolyPatch.H" #include "globalMeshData.H" #include "processorPolyPatch.H" -#include "OSspecific.H" #include "polyMeshTetDecomposition.H" #include "indexedOctree.H" #include "treeDataCell.H" -#include "SubField.H" +#include "MeshObject.H" -#include "pointMesh.H" -#include "Istream.H" -#include "Ostream.H" -#include "simpleRegIOobject.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { -defineTypeNameAndDebug(polyMesh, 0); + defineTypeNameAndDebug(polyMesh, 0); -word polyMesh::defaultRegion = "region0"; -word polyMesh::meshSubDir = "polyMesh"; + word polyMesh::defaultRegion = "region0"; + word polyMesh::meshSubDir = "polyMesh"; } @@ -1162,21 +1156,7 @@ Foam::tmp Foam::polyMesh::movePoints geometricD_ = Vector