From: henry Date: Fri, 20 Nov 2009 10:29:14 +0000 (+0000) Subject: Corrected test applications. X-Git-Url: https://repo.or.cz/w/OpenFOAM-1.6.x.git/commitdiff_plain/c57dfab5403c3eafe5123d11dde5765991b95655 Corrected test applications. --- diff --git a/applications/test/CompactListList/CompactListListTest.C b/applications/test/CompactListList/CompactListListTest.C index 136b5f45..9407f611 100644 --- a/applications/test/CompactListList/CompactListListTest.C +++ b/applications/test/CompactListList/CompactListListTest.C @@ -62,7 +62,7 @@ int main(int argc, char *argv[]) Info<< "cll2(2, 3) = " << cll2(2, 3) << nl << endl; - Info<< "cll2 as List > " << List >(cll2) << endl; + Info<< "cll2 as List > " << cll2() << endl; cll2.setSize(3); diff --git a/applications/test/DimensionedField/DimensionedFieldTest.C b/applications/test/DimensionedField/DimensionedFieldTest.C deleted file mode 100644 index bc1f875d..00000000 --- a/applications/test/DimensionedField/DimensionedFieldTest.C +++ /dev/null @@ -1,133 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. - \\/ 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 2 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, write to the Free Software Foundation, - Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -\*---------------------------------------------------------------------------*/ - -#include "argList.H" -#include "Time.H" -#include "DimensionedFields.H" -#include "DimensionedSphericalTensorField.H" -#include "vector.H" -#include "tensor.H" -#include "GeoMesh.H" - -using namespace Foam; - -namespace Foam -{ - -class vMesh -{ - -public: - - vMesh() - {} - - label size() const - { - return 10; - } -}; - -}; - -template<> -const word Foam::DimensionedField >::typeName -( - "dimenionedScalarField" -); - -template<> -const word Foam::DimensionedField >::typeName -( - "dimenionedVectorField" -); - -template<> -const word Foam::DimensionedField >::typeName -( - "dimenionedTensorField" -); - -template<> -const word Foam::DimensionedField >::typeName -( - "dimenionedSphericalTensorField" -); - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -// Main program: - -int main(int argc, char *argv[]) -{ - -# include "setRootCase.H" -# include "createTime.H" - - vMesh vm; - - DimensionedField > dsf - ( - IOobject - ( - "dsf", - runTime.timeName(), - runTime, - IOobject::MUST_READ, - IOobject::NO_WRITE - ), - vm - ); - - Info<< dsf << endl; - dsf += dsf; - dsf -= dimensionedScalar("5", dsf.dimensions(), 5.0); - Info<< dsf << endl; - - Info<< sqr(dsf + dsf) - sqr(dsf + dsf) << endl; - - DimensionedField > dvf - ( - IOobject - ( - "dvf", - runTime.timeName(), - runTime, - IOobject::MUST_READ, - IOobject::NO_WRITE - ), - vm - ); - - Info<< (dvf ^ (dvf ^ dvf)) << endl; - - Info << "End\n" << endl; - - return 0; -} - - -// ************************************************************************* // diff --git a/applications/test/DimensionedField/Make/files b/applications/test/DimensionedField/Make/files deleted file mode 100644 index 02c47901..00000000 --- a/applications/test/DimensionedField/Make/files +++ /dev/null @@ -1,3 +0,0 @@ -DimensionedFieldTest.C - -EXE = $(FOAM_USER_APPBIN)/DimensionedFieldTest diff --git a/applications/test/DimensionedField/Make/options b/applications/test/DimensionedField/Make/options deleted file mode 100644 index 6a9e9810..00000000 --- a/applications/test/DimensionedField/Make/options +++ /dev/null @@ -1,2 +0,0 @@ -/* EXE_INC = -I$(LIB_SRC)/cfdTools/include */ -/* EXE_LIBS = -lfiniteVolume */ diff --git a/applications/test/Matrix/MatrixTest.C b/applications/test/Matrix/MatrixTest.C index 24bcc682..5576291f 100644 --- a/applications/test/Matrix/MatrixTest.C +++ b/applications/test/Matrix/MatrixTest.C @@ -24,7 +24,7 @@ License \*---------------------------------------------------------------------------*/ -#include "Matrix.H" +#include "SquareMatrix.H" #include "vector.H" using namespace Foam; @@ -34,7 +34,7 @@ using namespace Foam; int main(int argc, char *argv[]) { - Matrix hmm(3, 3); + SquareMatrix hmm(3); hmm[0][0] = -3.0; hmm[0][1] = 10.0; @@ -46,27 +46,27 @@ int main(int argc, char *argv[]) hmm[2][1] = 6.0; hmm[2][2] = 1.0; - Info<< hmm << endl << hmm - 2.0*(-hmm) << endl; + //Info<< hmm << endl << hmm - 2.0*(-hmm) << endl; Info<< max(hmm) << endl; Info<< min(hmm) << endl; - Matrix hmm2(3, 3, 1.0); + SquareMatrix hmm2(3, 1.0); hmm = hmm2; Info<< hmm << endl; - Matrix hmm3(Sin); + SquareMatrix hmm3(Sin); Info<< hmm3 << endl; - Matrix hmm4; + SquareMatrix hmm4; hmm4 = hmm2; Info<< hmm4 << endl; - Matrix hmm5; + SquareMatrix hmm5; hmm4 = hmm5; Info<< hmm5 << endl; diff --git a/applications/test/ODETest/ODETest.C b/applications/test/ODETest/ODETest.C index dfc7a663..2d8cecfa 100644 --- a/applications/test/ODETest/ODETest.C +++ b/applications/test/ODETest/ODETest.C @@ -69,7 +69,7 @@ public: const scalar x, const scalarField& y, scalarField& dfdx, - Matrix& dfdy + scalarSquareMatrix& dfdy ) const { dfdx[0] = 0.0; diff --git a/applications/test/parallel/parallelTest.C b/applications/test/parallel/parallelTest.C index bf8440ec..dfc9c976 100644 --- a/applications/test/parallel/parallelTest.C +++ b/applications/test/parallel/parallelTest.C @@ -60,13 +60,13 @@ int main(int argc, char *argv[]) { Perr<< "slave sending to master " << Pstream::masterNo() << endl; - OPstream toMaster(Pstream::masterNo()); + OPstream toMaster(Pstream::scheduled, Pstream::masterNo()); toMaster << data; } - Perr<< "slave receiving from master " + Perr<< "slave receiving from master " << Pstream::masterNo() << endl; - IPstream fromMaster(Pstream::masterNo()); + IPstream fromMaster(Pstream::scheduled, Pstream::masterNo()); fromMaster >> data; Perr<< data << endl; @@ -81,7 +81,7 @@ int main(int argc, char *argv[]) ) { Perr << "master receiving from slave " << slave << endl; - IPstream fromSlave(slave); + IPstream fromSlave(Pstream::scheduled, slave); fromSlave >> data; Perr<< data << endl; @@ -95,7 +95,7 @@ int main(int argc, char *argv[]) ) { Perr << "master sending to slave " << slave << endl; - OPstream toSlave(slave); + OPstream toSlave(Pstream::scheduled, slave); toSlave << data; } } diff --git a/applications/test/slicedField/slicedFieldTest.C b/applications/test/slicedField/slicedFieldTest.C index a82b4ac7..dd8da252 100644 --- a/applications/test/slicedField/slicedFieldTest.C +++ b/applications/test/slicedField/slicedFieldTest.C @@ -23,7 +23,7 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Application - volField + slicedFieldTest Description @@ -32,16 +32,16 @@ Description #include "fvCFD.H" #include "SlicedGeometricField.H" #include "slicedFvPatchFields.H" +#include "slicedSurfaceFields.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // int main(int argc, char *argv[]) { + #include "setRootCase.H" -# include "setRootCase.H" - -# include "createTime.H" -# include "createMesh.H" + #include "createTime.H" + #include "createMesh.H" Info<< "Reading field p\n" << endl; volScalarField p @@ -91,7 +91,7 @@ int main(int argc, char *argv[]) Info<< C << endl; Info<< (C & U) << endl; - SlicedGeometricField + SlicedGeometricField Sf ( IOobject @@ -105,7 +105,7 @@ int main(int argc, char *argv[]) mesh.faceAreas() ); - Info<< Sf << endl; + //Info<< Sf << endl; return 0; } diff --git a/applications/test/volField/volFieldTest.C b/applications/test/volField/volFieldTest.C index 3b7dafef..f910c225 100644 --- a/applications/test/volField/volFieldTest.C +++ b/applications/test/volField/volFieldTest.C @@ -34,11 +34,10 @@ Application int main(int argc, char *argv[]) { + #include "setRootCase.H" -# include "setRootCase.H" - -# include "createTime.H" -# include "createMesh.H" + #include "createTime.H" + #include "createMesh.H" Info<< "Reading field p\n" << endl; volScalarField p @@ -70,12 +69,9 @@ int main(int argc, char *argv[]) mesh ); -# include "createPhi.H" - - //Info<< transform(dimensionedTensor("I", dimless, 0.1*I), U) << endl; - + #include "createPhi.H" - GeometricField st + GeometricField st ( IOobject ( @@ -86,8 +82,8 @@ int main(int argc, char *argv[]) IOobject::NO_WRITE ), mesh, - dimensioned("st", dimless, sphericalTensor::I), - zeroGradientFvPatchSphericalTensorField::typeName + dimensioned("st", dimless, symmTensor::one), + zeroGradientFvPatchSymmTensorField::typeName ); //Info<< fvc::div(st) << endl; diff --git a/src/OpenFOAM/containers/HashTables/HashSet/HashSet.C b/src/OpenFOAM/containers/HashTables/HashSet/HashSet.C index d63921f9..4701c802 100644 --- a/src/OpenFOAM/containers/HashTables/HashSet/HashSet.C +++ b/src/OpenFOAM/containers/HashTables/HashSet/HashSet.C @@ -105,7 +105,7 @@ template void Foam::HashSet::operator&=(const HashSet& rhs) { // Remove elements not also found in rhs - for (iterator iter = this->cbegin(); iter != this->cend(); ++iter) + for (iterator iter = this->begin(); iter != this->end(); ++iter) { if (!rhs.found(iter.key())) { @@ -145,8 +145,6 @@ void Foam::HashSet::operator-=(const HashSet& rhs) } -// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * // - /* * * * * * * * * * * * * * * * Global operators * * * * * * * * * * * * * */ template diff --git a/src/OpenFOAM/matrices/Matrix/Matrix.C b/src/OpenFOAM/matrices/Matrix/Matrix.C index 7f91a5f3..0062d897 100644 --- a/src/OpenFOAM/matrices/Matrix/Matrix.C +++ b/src/OpenFOAM/matrices/Matrix/Matrix.C @@ -235,12 +235,12 @@ void Foam::Matrix::operator=(const Matrix& a) template const Type& Foam::max(const Matrix& a) { - label nm = a.n_*a.m_; + label nm = a.n()*a.m(); if (nm) { label curMaxI = 0; - const Type* v = a.v_[0]; + const Type* v = a[0]; for (register label i=1; i& a) template const Type& Foam::min(const Matrix& a) { - label nm = a.n_*a.m_; + label nm = a.n()*a.m(); if (nm) { label curMinI = 0; - const Type* v = a.v_[0]; + const Type* v = a[0]; for (register label i=1; i& a) template Form Foam::operator-(const Matrix& a) { - Form na(a.n_, a.m_); + Form na(a.n(), a.m()); - if (a.n_ && a.m_) + if (a.n() && a.m()) { - Type* nav = na.v_[0]; - const Type* av = a.v_[0]; + Type* nav = na[0]; + const Type* av = a[0]; - label nm = a.n_*a.m_; + label nm = a.n()*a.m(); for (register label i=0; i& a) template Form Foam::operator+(const Matrix& a, const Matrix& b) { - if (a.n_ != b.n_) + if (a.n() != b.n()) { FatalErrorIn ( "Matrix::operator+(const Matrix&, const Matrix&)" ) << "attempted add matrices with different number of rows: " - << a.n_ << ", " << b.n_ + << a.n() << ", " << b.n() << abort(FatalError); } - if (a.m_ != b.m_) + if (a.m() != b.m()) { FatalErrorIn ( "Matrix::operator+(const Matrix&, const Matrix&)" ) << "attempted add matrices with different number of columns: " - << a.m_ << ", " << b.m_ + << a.m() << ", " << b.m() << abort(FatalError); } - Form ab(a.n_, a.m_); + Form ab(a.n(), a.m()); - Type* abv = ab.v_[0]; - const Type* av = a.v_[0]; - const Type* bv = b.v_[0]; + Type* abv = ab[0]; + const Type* av = a[0]; + const Type* bv = b[0]; - label nm = a.n_*a.m_; + label nm = a.n()*a.m(); for (register label i=0; i& a, const Matrix& b) template Form Foam::operator-(const Matrix& a, const Matrix& b) { - if (a.n_ != b.n_) + if (a.n() != b.n()) { FatalErrorIn ( "Matrix::operator-(const Matrix&, const Matrix&)" ) << "attempted add matrices with different number of rows: " - << a.n_ << ", " << b.n_ + << a.n() << ", " << b.n() << abort(FatalError); } - if (a.m_ != b.m_) + if (a.m() != b.m()) { FatalErrorIn ( "Matrix::operator-(const Matrix&, const Matrix&)" ) << "attempted add matrices with different number of columns: " - << a.m_ << ", " << b.m_ + << a.m() << ", " << b.m() << abort(FatalError); } - Form ab(a.n_, a.m_); + Form ab(a.n(), a.m()); - Type* abv = ab.v_[0]; - const Type* av = a.v_[0]; - const Type* bv = b.v_[0]; + Type* abv = ab[0]; + const Type* av = a[0]; + const Type* bv = b[0]; - label nm = a.n_*a.m_; + label nm = a.n()*a.m(); for (register label i=0; i& a, const Matrix& b) template Form Foam::operator*(const scalar s, const Matrix& a) { - Form sa(a.n_, a.m_); + Form sa(a.n(), a.m()); - if (a.n_ && a.m_) + if (a.n() && a.m()) { - Type* sav = sa.v_[0]; - const Type* av = a.v_[0]; + Type* sav = sa[0]; + const Type* av = a[0]; - label nm = a.n_*a.m_; + label nm = a.n()*a.m(); for (register label i=0; i