]> Pileus Git - ~andy/sunrise/commitdiff
sci-libs/openfoam-kernel: Update patches for the OpenFOAM Kernel.
authorOliver Borm (oli) <oli.borm@web.de>
Thu, 31 Jan 2008 20:47:15 +0000 (20:47 +0000)
committerOliver Borm (oli) <oli.borm@web.de>
Thu, 31 Jan 2008 20:47:15 +0000 (20:47 +0000)
svn path=/sunrise/; revision=5579

sci-libs/openfoam-kernel/ChangeLog
sci-libs/openfoam-kernel/Manifest
sci-libs/openfoam-kernel/files/openfoam-kernel-1.4.1_p20080131.patch [new file with mode: 0644]
sci-libs/openfoam-kernel/files/openfoam-kernel-compile-1.4.1_p20080131.patch [new file with mode: 0644]
sci-libs/openfoam-kernel/openfoam-kernel-1.4.1_p20080131.ebuild [new file with mode: 0644]

index 6be6eec9961be2d27084babe048487fe645e6bff..aa48885f01e03a41f3e7255ff97de1d81ccbd112 100644 (file)
@@ -2,6 +2,12 @@
 # Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2
 # $Header: $
 
+  31 Jan 2008; Oliver Borm (boroli) <oli.borm@web.de>
+  +files/openfoam-kernel-compile-1.4.1_p20080131.patch,
+  +files/openfoam-kernel-1.4.1_p20080131.patch,
+  +openfoam-kernel-1.4.1_p20080131.ebuild:
+  Update patches for the OpenFOAM Kernel.
+
   29 Jan 2008; Oliver Borm (boroli) <oli.borm@web.de>
   +files/openfoam-kernel-1.4.1_p20080118.patch,
   +files/openfoam-kernel-compile-1.4.1_p20080118.patch, +metadata.xml,
index dd493d6bec91c4f804f9eb2dc6d22caf2480245e..e5fc3115c4a1632435c475809d1c9e9d1bb9b9d0 100644 (file)
@@ -1,6 +1,9 @@
 AUX openfoam-kernel-1.4.1_p20080118.patch 25846 RMD160 39bf0338915def0c0b4dd62df5c5c6502e384e24 SHA1 2832ed700eb45e72979dcb7d5982e734f683c95d SHA256 65005fd20a6a24cf1970aac03d160bf129e8cf8a5060b7e92b07c1e34c982fbd
+AUX openfoam-kernel-1.4.1_p20080131.patch 26920 RMD160 f198c807d805950b9b2a78e1876b62557c314b77 SHA1 7423df21a364639f576c0611e342dd0845cc097d SHA256 3461e9776f836d7701f746b1ade56f1fb6c5377650024df539883b65792bf448
 AUX openfoam-kernel-compile-1.4.1_p20080118.patch 6143 RMD160 ab03b9d55ee2d6eb3515fe2430e42f2204177bb9 SHA1 8301b591701f2bf6cb182f1cd415d0348e46d98b SHA256 999098d347d417ff88724ea30c6a18b7cc3a8bbecfcb23b5cfdcbe17afdb58c4
+AUX openfoam-kernel-compile-1.4.1_p20080131.patch 6143 RMD160 ab03b9d55ee2d6eb3515fe2430e42f2204177bb9 SHA1 8301b591701f2bf6cb182f1cd415d0348e46d98b SHA256 999098d347d417ff88724ea30c6a18b7cc3a8bbecfcb23b5cfdcbe17afdb58c4
 DIST OpenFOAM-1.4.1.General.gtgz 148526808 RMD160 e25d8bdfa63f15eeeb7b9f1cef09cc26fb7bef74 SHA1 56bbbf5b33c49d08cda35088a65b24d7dc59014f SHA256 c765b36639b42c737bc9ba1ac13c0f66efe20ee4a9f71a6ef987e86ebd50da28
 EBUILD openfoam-kernel-1.4.1_p20080118.ebuild 2031 RMD160 0d76094a1f94e40ba86311d964d1821263de0cda SHA1 5454250f73407c132350a9f16146b96937a4eca8 SHA256 c60fc45c3a54fd1dad694e6fd327492d522dfd0fc4cee9e76e7e1fdbc5ff16aa
-MISC ChangeLog 392 RMD160 fa22673c9108c38bb5460be6b8751df9d9000c49 SHA1 d5eddce2cba70a199ceb260c28fef3e06cb12a55 SHA256 2323a8516cbc243039c90e6c5d1d780682c2e6659311429606709980473d00e2
+EBUILD openfoam-kernel-1.4.1_p20080131.ebuild 2031 RMD160 0d76094a1f94e40ba86311d964d1821263de0cda SHA1 5454250f73407c132350a9f16146b96937a4eca8 SHA256 c60fc45c3a54fd1dad694e6fd327492d522dfd0fc4cee9e76e7e1fdbc5ff16aa
+MISC ChangeLog 636 RMD160 5a507af9dacae6dd2108508e899b3d284b96b1a1 SHA1 7e9a1cc080a34493686481683185bce95b01e807 SHA256 e39b3a7206a4c9c6e76c5aaa72e955e1f82ae2d34400a14b655e3741e1142c83
 MISC metadata.xml 170 RMD160 645927a396fdc21cdeb089fe42c5397332420ea6 SHA1 ac7f48a14fec325926f9ce1be8fbf1f311b4f2e4 SHA256 d797a2ec6f9dc516c9f9c1a758ee87ad3e8c43101b5dc76c2f872d5bd4639b42
diff --git a/sci-libs/openfoam-kernel/files/openfoam-kernel-1.4.1_p20080131.patch b/sci-libs/openfoam-kernel/files/openfoam-kernel-1.4.1_p20080131.patch
new file mode 100644 (file)
index 0000000..3464059
--- /dev/null
@@ -0,0 +1,851 @@
+Index: LESmodels/compressible/SpalartAllmaras/SpalartAllmaras.C
+===================================================================
+--- src/LESmodels/compressible/SpalartAllmaras/SpalartAllmaras.C       (Revision 30)
++++ src/LESmodels/compressible/SpalartAllmaras/SpalartAllmaras.C       (Revision 439)
+@@ -44,29 +44,38 @@
+ // * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * * //
+ tmp<volScalarField> SpalartAllmaras::fv1() const
+ {
+     volScalarField chi3 = pow(nuTilda_/(mu()/rho()), 3);
+-
+     return chi3/(chi3 + pow(Cv1_, 3));
+ }
+ tmp<volScalarField> SpalartAllmaras::fv2() const
+ {
+     volScalarField chi = nuTilda_/(mu()/rho());
+     return scalar(1) - chi/(scalar(1) + chi*fv1());
+ }
+ tmp<volScalarField> SpalartAllmaras::fw(const volScalarField& Stilda) const
+ {
+-    volScalarField r = nuTilda_/(Stilda*sqr(kappa_*dTilda_));
++    volScalarField r = min
++    (
++        nuTilda_
++       /(
++           max(Stilda, dimensionedScalar("SMALL", Stilda.dimensions(), SMALL))
++          *sqr(kappa_*dTilda_)
++        ),
++        scalar(10.0)
++    );
++    r.boundaryField() == 0.0;
++
+     volScalarField g = r + Cw2_*(pow(r, 6) - r);
+     return g*pow((1.0 + pow(Cw3_, 6))/(pow(g, 6) + pow(Cw3_, 6)), 1.0/6.0);
+ }
+ // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
+
+Index: dynamicMesh/meshCut/meshModifiers/multiDirRefinement/multiDirRefinement.C
+===================================================================
+--- src/dynamicMesh/meshCut/meshModifiers/multiDirRefinement/multiDirRefinement.C      (Revision 30)
++++ src/dynamicMesh/meshCut/meshModifiers/multiDirRefinement/multiDirRefinement.C      (Revision 439)
+@@ -343,16 +343,16 @@
+             }
+         }
+     }
+     hexRefiner.setRefinement(consistentCells, meshMod);
+-    // Use inflation
+-    autoPtr<mapPolyMesh> morphMapPtr = meshMod.changeMesh(mesh, true, true);
++    // Change mesh, no inflation
++    autoPtr<mapPolyMesh> morphMapPtr = meshMod.changeMesh(mesh, false, true);
+     const mapPolyMesh& morphMap = morphMapPtr();
+     if (morphMap.hasMotionPoints())
+     {
+         mesh.movePoints(morphMap.preMotionPoints());
+     }
+@@ -365,47 +365,31 @@
+     {
+         Pout<< "multiDirRefinement : updated mesh at time "
+             << mesh.time().timeName() << endl;
+     }
+     hexRefiner.updateMesh(morphMap);
+-    // Take over split pattern from hex refiner. (should be empty at this
+-    // point)
+-
+-    // From old cell label to index
+-    Map<label> consistentSet(2*consistentCells.size());
+-
+-    forAll(consistentCells, i)
+-    {
+-        consistentSet.insert(consistentCells[i], i);
+-    }
+-
+     // Collect all cells originating from same old cell (original + 7 extra)
+-    addedCells_.setSize(consistentCells.size());
+-    forAll(addedCells_, i)
++    forAll(consistentCells, i)
+     {
+-        addedCells_[i].setSize(8);
++        addedCells_[consistentCells[i]].setSize(8);
+     }
+-    labelList nAddedCells(consistentCells.size(), 0);
++    labelList nAddedCells(addedCells_.size(), 0);
+     const labelList& cellMap = morphMap.cellMap();
+     forAll(cellMap, cellI)
+     {
+         label oldCellI = cellMap[cellI];
+-        Map<label>::const_iterator iter = consistentSet.find(oldCellI);
+-
+-        if (iter != consistentSet.end())
++        if (addedCells_[oldCellI].size() > 0)
+         {
+-            label index = iter();
+-
+-            addedCells_[nAddedCells[index]++] = cellI;
++            addedCells_[oldCellI][nAddedCells[oldCellI]++] = cellI;
+         }
+     }
+ }
+ void Foam::multiDirRefinement::refineAllDirs
+ (
+
+Index: OpenFOAM/db/error/error.H
+===================================================================
+--- src/OpenFOAM/db/error/error.H      (Revision 30)
++++ src/OpenFOAM/db/error/error.H      (Revision 439)
+@@ -80,14 +80,17 @@
+         //- Construct from title string
+         error(const string& title);
+         //- Construct from dictionary
+         error(const dictionary& errDict);
++        //- Construct as copy
++        error(const error& err);
++
+     // Destructor
+         ~error();
+     // Member functions
+Index: OpenFOAM/db/error/error.C
+===================================================================
+--- src/OpenFOAM/db/error/error.C      (Revision 30)
++++ src/OpenFOAM/db/error/error.C      (Revision 439)
+@@ -76,14 +76,28 @@
+                "cannot open error stream"
+             << endl;
+         ::exit(1);
+     }
+ }
++error::error(const error& err)
++:
++    messageStream(err),
++    functionName_(err.functionName_),
++    sourceFileName_(err.sourceFileName_),
++    sourceFileLineNumber_(err.sourceFileLineNumber_),
++    abort_(err.abort_),
++    throwExceptions_(err.throwExceptions_),
++    messageStreamPtr_(new OStringStream(*err.messageStreamPtr_))
++{
++    //*messageStreamPtr_ << err.message();
++}
++
++
+ error::~error()
+ {
+     delete messageStreamPtr_;
+ }
+ OSstream& error::operator()
+@@ -251,14 +265,15 @@
+     return os;
+ }
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+ // Global error definitions
+-error FatalError ("--> FOAM FATAL ERROR : ");
++error FatalError("--> FOAM FATAL ERROR : ");
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+ } // End namespace Foam
+ // ************************************************************************* //
++
+Index: OpenFOAM/db/dictionary/dictionary.C
+===================================================================
+--- src/OpenFOAM/db/dictionary/dictionary.C    (Revision 30)
++++ src/OpenFOAM/db/dictionary/dictionary.C    (Revision 439)
+@@ -119,14 +119,20 @@
+     }
+     else
+     {
+         return -1;
+     }
+ }
++// Clear the Dictionary
++void Foam::dictionary::clear()
++{
++    IDLList<entry>::clear();
++    hashedEntries_.clear();
++}
+ // Find and return entry
+ bool Foam::dictionary::found(const word& keyword) const
+ {
+     return hashedEntries_.found(keyword);
+ }
+Index: OpenFOAM/db/dictionary/dictionary.H
+===================================================================
+--- src/OpenFOAM/db/dictionary/dictionary.H    (Revision 30)
++++ src/OpenFOAM/db/dictionary/dictionary.H    (Revision 439)
+@@ -126,14 +126,16 @@
+         //- Return line number of first token in dictionary
+         label startLineNumber() const;
+         //- Return line number of last token in dictionary
+         label endLineNumber() const;
++        //- Clear the dictionary
++        void clear();
+         // Search and lookup
+             //- Search dictionary for given keyword
+             bool found(const word& keyword) const;
+             //- Find and return an entry data stream
+Index: OpenFOAM/db/IOstreams/StringStreams/OStringStream.H
+===================================================================
+--- src/OpenFOAM/db/IOstreams/StringStreams/OStringStream.H    (Revision 30)
++++ src/OpenFOAM/db/IOstreams/StringStreams/OStringStream.H    (Revision 439)
+@@ -63,21 +63,41 @@
+         (
+             streamFormat format=ASCII,
+             versionNumber version=currentVersion
+         )
+         :
+             OSstream
+             (
+-                *(new std::ostringstream()),
++               *(new std::ostringstream()),
+                 "OStringStream.sinkFile",
+                 format,
+                 version
+             )
+         {}
++        //- Construct as copy
++        OStringStream(const OStringStream& oss)
++        :
++            OSstream
++            (
++               *(
++                    new std::ostringstream
++                    (
++                        dynamic_cast<const std::ostringstream&>
++                        (
++                            oss.stream()
++                        ).str()
++                    )
++                ),
++                oss.name(),
++                oss.format(),
++                oss.version()
++            )
++        {}
++
+     // Destructor
+         ~OStringStream()
+         {
+             delete &dynamic_cast<std::ostringstream&>(stream());
+         }
+Index: OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchFieldFunctions.H
+===================================================================
+--- src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchFieldFunctions.H    (Revision 30)
++++ src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchFieldFunctions.H    (Revision 439)
+@@ -214,32 +214,28 @@
+ #undef BINARY_TYPE_OPERATOR_FT
+ #define PRODUCT_OPERATOR(product, op, opFunc)                                 \
+                                                                               \
+ template                                                                      \
+ <                                                                             \
+-    template<class> class PatchField,                                         \
+-    class pointPatch,                                                         \
+     class Type1,                                                              \
+     class Type2                                                               \
+ >                                                                             \
+ inline void opFunc                                                            \
+ (                                                                             \
+     pointPatchField                                                           \
+     <typename product<Type1, Type2>::type>& f,                                \
+     const pointPatchField<Type1>& f1,                                         \
+     const pointPatchField<Type2>& f2                                          \
+ )                                                                             \
+ {}                                                                            \
+                                                                               \
+ template                                                                      \
+ <                                                                             \
+-    template<class> class PatchField,                                         \
+-    class pointPatch,                                                         \
+     class Type,                                                               \
+     class Form,                                                               \
+     class Cmpt,                                                               \
+     int nCmpt                                                                 \
+ >                                                                             \
+ inline void opFunc                                                            \
+ (                                                                             \
+@@ -248,16 +244,14 @@
+     const pointPatchField<Type>& f1,                                          \
+     const VectorSpace<Form,Cmpt,nCmpt>& vs                                    \
+ )                                                                             \
+ {}                                                                            \
+                                                                               \
+ template                                                                      \
+ <                                                                             \
+-    template<class> class PatchField,                                         \
+-    class pointPatch,                                                         \
+     class Form,                                                               \
+     class Cmpt,                                                               \
+     int nCmpt,                                                                \
+     class Type                                                                \
+ >                                                                             \
+ inline void opFunc                                                            \
+ (                                                                             \
+@@ -272,112 +266,99 @@
+ PRODUCT_OPERATOR(crossProduct, ^, cross)
+ PRODUCT_OPERATOR(innerProduct, &, dot)
+ PRODUCT_OPERATOR(scalarProduct, &&, dotdot)
+ #undef PRODUCT_OPERATOR
+-template<template<class> class PatchField, class pointPatch>
+-void hdual
++inline void hdual
+ (
+     pointPatchField<vector>&,
+     const pointPatchField<tensor>&
+ )
+ {}
+-template<template<class> class PatchField, class pointPatch>
+-void hdual
++inline void hdual
+ (
+     pointPatchField<tensor>&,
+     const pointPatchField<vector>&
+ )
+ {}
+-template<template<class> class PatchField, class pointPatch>
+-void diag
++inline void diag
+ (
+     pointPatchField<vector>&,
+     const pointPatchField<tensor>&
+ )
+ {}
+-template<template<class> class PatchField, class pointPatch>
+-void tr
++inline void tr
+ (
+     pointPatchField<scalar>&,
+     const pointPatchField<tensor>&
+ )
+ {}
+-template<template<class> class PatchField, class pointPatch>
+-void dev
++inline void dev
+ (
+     pointPatchField<tensor>&,
+     const pointPatchField<tensor>&
+ )
+ {}
+-template<template<class> class PatchField, class pointPatch>
+-void dev2
++inline void dev2
+ (
+     pointPatchField<tensor>&,
+     const pointPatchField<tensor>&
+ )
+ {}
+-template<template<class> class PatchField, class pointPatch>
+-void det
++inline void det
+ (
+     pointPatchField<scalar>&,
+     const pointPatchField<tensor>&
+ )
+ {}
+-template<template<class> class PatchField, class pointPatch>
+-void inv
++inline void inv
+ (
+     pointPatchField<tensor>&,
+     const pointPatchField<tensor>&
+ )
+ {}
+-template<template<class> class PatchField, class pointPatch>
+-void symm
++inline void symm
+ (
+     pointPatchField<tensor>&,
+     const pointPatchField<tensor>&
+ )
+ {}
+-template<template<class> class PatchField, class pointPatch>
+-void twoSymm
++inline void twoSymm
+ (
+     pointPatchField<tensor>&,
+     const pointPatchField<tensor>&
+ )
+ {}
+-template<template<class> class PatchField, class pointPatch>
+-void skew
++inline void skew
+ (
+     pointPatchField<tensor>&,
+     const pointPatchField<tensor>&
+ )
+ {}
+-template<template<class> class PatchField, class pointPatch>
+-void eigenValues
++inline void eigenValues
+ (
+     pointPatchField<vector>&,
+     const pointPatchField<tensor>&
+ )
+ {}
+-template<template<class> class PatchField, class pointPatch>
+-void eigenVectors
++inline void eigenVectors
+ (
+     pointPatchField<tensor>&,
+     const pointPatchField<tensor>&
+ )
+ {}
+Index: OpenFOAM/fields/Fields/symmTensorField/symmTensorField.C
+===================================================================
+--- src/OpenFOAM/fields/Fields/symmTensorField/symmTensorField.C       (Revision 30)
++++ src/OpenFOAM/fields/Fields/symmTensorField/symmTensorField.C       (Revision 439)
+@@ -131,16 +131,15 @@
+ template<>
+ tmp<Field<symmTensor> > transformFieldMask<symmTensor>
+ (
+     const tmp<tensorField>& ttf
+ )
+ {
+-    tmp<Field<symmTensor> > ret =
+-        transformFieldMask<symmTensor>(ttf());
++    tmp<Field<symmTensor> > ret = transformFieldMask<symmTensor>(ttf());
+     ttf.clear();
+     return ret;
+ }
+ template<>
+ tmp<Field<symmTensor> > transformFieldMask<symmTensor>
+@@ -153,18 +152,15 @@
+ template<>
+ tmp<Field<symmTensor> > transformFieldMask<symmTensor>
+ (
+     const tmp<symmTensorField>& tstf
+ )
+ {
+-    tmp<Field<symmTensor> > ret =
+-        transformFieldMask<symmTensor>(tstf());
+-    tstf.clear();
+-    return ret;
++    return tstf;
+ }
+ // * * * * * * * * * * * * * * * global operators  * * * * * * * * * * * * * //
+ UNARY_OPERATOR(vector, symmTensor, *, hdual)
+Index: OpenFOAM/primitives/Tensor/TensorI.H
+===================================================================
+--- src/OpenFOAM/primitives/Tensor/TensorI.H   (Revision 30)
++++ src/OpenFOAM/primitives/Tensor/TensorI.H   (Revision 439)
+@@ -358,14 +358,23 @@
+         v1.x()*v2.x(), v1.x()*v2.y(), v1.x()*v2.z(),
+         v1.y()*v2.x(), v1.y()*v2.y(), v1.y()*v2.z(),
+         v1.z()*v2.x(), v1.z()*v2.y(), v1.z()*v2.z()
+     );
+ }
++//- Division of a vector by a tensor, i.e. dot-product with the tensor inverse
++template <class Cmpt>
++inline typename innerProduct<Vector<Cmpt>, Tensor<Cmpt> >::type
++operator/(const Vector<Cmpt>& v, const Tensor<Cmpt>& t)
++{
++    return inv(t) & v;
++}
++
++
+ // * * * * * * * * * * * * * * * Global Functions  * * * * * * * * * * * * * //
+ //- Return the trace of a tensor
+ template <class Cmpt>
+ inline Cmpt tr(const Tensor<Cmpt>& t)
+ {
+     return t.xx() + t.yy() + t.zz();
+@@ -790,46 +799,30 @@
+ //- Double-dot-product between a spherical tensor and a tensor
+ template <class Cmpt>
+ inline Cmpt
+ operator&&(const SymmTensor<Cmpt>& st1, const Tensor<Cmpt>& t2)
+ {
+     return
+     (
+-        st1.xx()*t2.xx() + st1.xy()*t2.yx() + st1.xz()*t2.zx() +
+-        st1.xx()*t2.xy() + st1.xy()*t2.yy() + st1.xz()*t2.zy() +
+-        st1.xx()*t2.xz() + st1.xy()*t2.yz() + st1.xz()*t2.zz() +
+-
+-        st1.xy()*t2.xx() + st1.yy()*t2.yx() + st1.yz()*t2.zx() +
+-        st1.xy()*t2.xy() + st1.yy()*t2.yy() + st1.yz()*t2.zy() +
+-        st1.xy()*t2.xz() + st1.yy()*t2.yz() + st1.yz()*t2.zz() +
+-
+-        st1.xz()*t2.xx() + st1.yz()*t2.yx() + st1.zz()*t2.zx() +
+-        st1.xz()*t2.xy() + st1.yz()*t2.yy() + st1.zz()*t2.zy() +
+-        st1.xz()*t2.xz() + st1.yz()*t2.yz() + st1.zz()*t2.zz()
++        st1.xx()*t2.xx() + st1.xy()*t2.xy() + st1.xz()*t2.xz() +
++        st1.xy()*t2.yx() + st1.yy()*t2.yy() + st1.yz()*t2.yz() +
++        st1.xz()*t2.zx() + st1.yz()*t2.zy() + st1.zz()*t2.zz()
+     );
+ }
+ //- Double-dot-product between a tensor and a spherical tensor
+ template <class Cmpt>
+ inline Cmpt
+ operator&&(const Tensor<Cmpt>& t1, const SymmTensor<Cmpt>& st2)
+ {
+     return
+     (
+         t1.xx()*st2.xx() + t1.xy()*st2.xy() + t1.xz()*st2.xz() +
+-        t1.xx()*st2.xy() + t1.xy()*st2.yy() + t1.xz()*st2.yz() +
+-        t1.xx()*st2.xz() + t1.xy()*st2.yz() + t1.xz()*st2.zz() +
+-
+-        t1.yx()*st2.xx() + t1.yy()*st2.xy() + t1.yz()*st2.xz() +
+         t1.yx()*st2.xy() + t1.yy()*st2.yy() + t1.yz()*st2.yz() +
+-        t1.yx()*st2.xz() + t1.yy()*st2.yz() + t1.yz()*st2.zz() +
+-
+-        t1.zx()*st2.xx() + t1.zy()*st2.xy() + t1.zz()*st2.xz() +
+-        t1.zx()*st2.xy() + t1.zy()*st2.yy() + t1.zz()*st2.yz() +
+         t1.zx()*st2.xz() + t1.zy()*st2.yz() + t1.zz()*st2.zz()
+     );
+ }
+ template<class Cmpt>
+ class typeOfSum<SymmTensor<Cmpt>, Tensor<Cmpt> >
+
+Index: finiteVolume/fvMatrices/fvMatrix/fvMatrixSolve.C
+===================================================================
+--- src/finiteVolume/fvMatrices/fvMatrix/fvMatrixSolve.C       (Revision 30)
++++ src/finiteVolume/fvMatrices/fvMatrix/fvMatrixSolve.C       (Revision 439)
+@@ -20,23 +20,18 @@
+     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
+ \*---------------------------------------------------------------------------*/
+-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+-
+-namespace Foam
+-{
+-
+ // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
+ template<class Type>
+-void fvMatrix<Type>::setComponentReference
++void Foam::fvMatrix<Type>::setComponentReference
+ (
+     const label patchi,
+     const label facei,
+     const direction cmpt,
+     const scalar value
+ )
+ {
+@@ -52,15 +47,18 @@
+                *value;
+         }
+     }
+ }
+ template<class Type>
+-lduMatrix::solverPerformance fvMatrix<Type>::solve(Istream& solverControls)
++Foam::lduMatrix::solverPerformance Foam::fvMatrix<Type>::solve
++(
++    Istream& solverControls
++)
+ {
+     if (debug)
+     {
+         Info<< "fvMatrix<Type>::solve(Istream& solverControls) : "
+                "solving fvMatrix<Type>"
+             << endl;
+     }
+@@ -70,15 +68,19 @@
+         "fvMatrix<Type>::solve",
+         psi_.name()
+     );
+     scalarField saveDiag = diag();
+     Field<Type> source = source_;
+-    addBoundarySource(source, false);
++
++    // At this point include the boundary source from the coupled boundaries.
++    // This is corrected for the implict part by updateMatrixInterfaces within
++    // the component loop.
++    addBoundarySource(source);
+     typename Type::labelType validComponents
+     (
+         pow
+         (
+             psi_.mesh().directions(),
+             pTraits<typename powProduct<Vector<label>, Type::rank>::type>::zero
+@@ -105,14 +107,35 @@
+         (
+             internalCoeffs_.component(cmpt)
+         );
+         lduInterfaceFieldPtrsList interfaces = 
+             psi_.boundaryField().interfaces();
++        // Use the initMatrixInterfaces and updateMatrixInterfaces to correct
++        // bouCoeffsCmpt for the explicit part of the coupled boundary
++        // conditions
++        initMatrixInterfaces
++        (
++            bouCoeffsCmpt,
++            interfaces,
++            psiCmpt,
++            sourceCmpt,
++            cmpt
++        );
++
++        updateMatrixInterfaces
++        (
++            bouCoeffsCmpt,
++            interfaces,
++            psiCmpt,
++            sourceCmpt,
++            cmpt
++        );
++
+         lduMatrix::solverPerformance solverPerf;
+         // Solver call
+         solverPerf = lduMatrix::solver::New
+         (
+             psi_.name() + pTraits<Type>::componentNames[cmpt],
+             *this,
+@@ -140,35 +163,36 @@
+     psi_.correctBoundaryConditions();
+     return solverPerfVec;
+ }
+ template<class Type>
+-autoPtr<typename fvMatrix<Type>::fvSolver> fvMatrix<Type>::solver()
++Foam::autoPtr<typename Foam::fvMatrix<Type>::fvSolver>
++Foam::fvMatrix<Type>::solver()
+ {
+     return solver(psi_.mesh().solver(psi_.name()));
+ }
+ template<class Type>
+-lduMatrix::solverPerformance fvMatrix<Type>::fvSolver::solve()
++Foam::lduMatrix::solverPerformance Foam::fvMatrix<Type>::fvSolver::solve()
+ {
+     return solve(psi_.mesh().solver(psi_.name()));
+ }
+ template<class Type>
+-lduMatrix::solverPerformance fvMatrix<Type>::solve()
++Foam::lduMatrix::solverPerformance Foam::fvMatrix<Type>::solve()
+ {
+     return solve(psi_.mesh().solver(psi_.name()));
+ }
+ template<class Type>
+-tmp<Field<Type> > fvMatrix<Type>::residual() const
++Foam::tmp<Foam::Field<Type> > Foam::fvMatrix<Type>::residual() const
+ {
+     tmp<Field<Type> > tres(source_);
+     Field<Type>& res = tres();
+     addBoundarySource(res);
+     // Loop over field components
+@@ -198,12 +222,8 @@
+         );
+     }
+     return tres;
+ }
+-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+-
+-} // End namespace Foam
+-
+ // ************************************************************************* //
+Index: finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValueFvPatchField.C
+===================================================================
+--- src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValueFvPatchField.C        (Revision 30)
++++ src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValueFvPatchField.C        (Revision 439)
+@@ -181,14 +181,15 @@
+ )
+ :
+     fixedValueFvPatchField<Type>(ptf, iF),
+     setAverage_(ptf.setAverage_),
+     referenceCS_(ptf.referenceCS_),
+     nearestVertex_(ptf.nearestVertex_),
+     nearestVertexWeight_(ptf.nearestVertexWeight_),
++    fieldName_(ptf.fieldName_),
+     sampleTimes_(ptf.sampleTimes_),
+     startSampleTime_(ptf.startSampleTime_),
+     startSampledValues_(ptf.startSampledValues_),
+     startAverage_(ptf.startAverage_),
+     endSampleTime_(ptf.endSampleTime_),
+     endSampledValues_(ptf.endSampledValues_),
+     endAverage_(ptf.endAverage_)
+Index: finiteVolume/finiteVolume/ddtSchemes/backwardDdtScheme/backwardDdtScheme.C
+===================================================================
+--- src/finiteVolume/finiteVolume/ddtSchemes/backwardDdtScheme/backwardDdtScheme.C     (Revision 30)
++++ src/finiteVolume/finiteVolume/ddtSchemes/backwardDdtScheme/backwardDdtScheme.C     (Revision 439)
+@@ -323,15 +323,15 @@
+                        *vf.oldTime().internalField()*mesh().V0()
+                       - coefft00*rho.oldTime().oldTime().internalField()
+                        *vf.oldTime().oldTime().internalField()*mesh().V00()
+                     )/mesh().V()
+                 ),
+                 rDeltaT.value()*
+                 (
+-                    coefft*vf.boundaryField() -
++                    coefft*rho.boundaryField()*vf.boundaryField() -
+                     (
+                         coefft0*rho.oldTime().boundaryField()
+                        *vf.oldTime().boundaryField()
+                       - coefft00*rho.oldTime().oldTime().boundaryField()
+                        *vf.oldTime().oldTime().boundaryField()
+                     )
+                 )
+Index: finiteVolume/finiteVolume/gradSchemes/leastSquaresGrad/leastSquaresVectors.C
+===================================================================
+--- src/finiteVolume/finiteVolume/gradSchemes/leastSquaresGrad/leastSquaresVectors.C   (Revision 30)
++++ src/finiteVolume/finiteVolume/gradSchemes/leastSquaresGrad/leastSquaresVectors.C   (Revision 439)
+@@ -150,15 +150,15 @@
+         if (p.coupled())
+         {
+             forAll(pd, patchFacei)
+             {
+                 const vector& d = pd[patchFacei];
+                 dd[faceCells[patchFacei]] +=
+-                    (pw[patchFacei]*pMagSf[patchFacei]/magSqr(d))*sqr(d);
++                    ((1 - pw[patchFacei])*pMagSf[patchFacei]/magSqr(d))*sqr(d);
+             }
+         }
+         else
+         {
+             forAll(pd, patchFacei)
+             {
+                 const vector& d = pd[patchFacei];
+
+Index: turbulenceModels/compressible/kOmegaSST/kOmegaSST.C
+===================================================================
+--- src/turbulenceModels/compressible/kOmegaSST/kOmegaSST.C    (Revision 30)
++++ src/turbulenceModels/compressible/kOmegaSST/kOmegaSST.C    (Revision 439)
+@@ -237,15 +237,15 @@
+     {
+         y_.correct();
+         divU += fvc::div(mesh_.phi());
+     }
+     tmp<volTensorField> tgradU = fvc::grad(U_);
+     volScalarField S2 = magSqr(symm(tgradU()));
+-    volScalarField GbyMu = 2*mut_*(tgradU() && dev(symm(tgradU())));
++    volScalarField GbyMu = 2*(tgradU() && dev(symm(tgradU())));
+     volScalarField G = mut_*GbyMu;
+     tgradU.clear();
+ #   include "kOmegaWallFunctionsI.H"
+     volScalarField CDkOmega =
+         (2*alphaOmega2)*(fvc::grad(k_) & fvc::grad(omega_))/omega_;
+@@ -280,15 +280,15 @@
+     // Turbulent kinetic energy equation
+     tmp<fvScalarMatrix> kEqn
+     (
+         fvm::ddt(rho_, k_)
+       + fvm::div(phi_, k_)
+       - fvm::laplacian(DkEff(F1), k_)
+      ==
+-        min(G, c1*betaStar*k_*omega_)
++        min(G, (c1*betaStar)*rho_*k_*omega_)
+       - fvm::SuSp(2.0/3.0*rho_*divU, k_)
+       - fvm::Sp(rho_*betaStar*omega_, k_)
+     );
+     kEqn().relax();
+     solve(kEqn);
+     bound(k_, k0_);
+
diff --git a/sci-libs/openfoam-kernel/files/openfoam-kernel-compile-1.4.1_p20080131.patch b/sci-libs/openfoam-kernel/files/openfoam-kernel-compile-1.4.1_p20080131.patch
new file mode 100644 (file)
index 0000000..708c0de
--- /dev/null
@@ -0,0 +1,231 @@
+diff -ur OpenFOAM-1.4.1-src/src/Allwmake OpenFOAM-1.4.1/src/Allwmake
+--- OpenFOAM-1.4.1-src/src/Allwmake    2007-07-27 17:54:28.000000000 +0200
++++ OpenFOAM-1.4.1/src/Allwmake        2007-10-18 21:04:12.000000000 +0200
+@@ -3,103 +3,103 @@
+ (cd $FOAM_SRC/OpenFOAM ; wmakeLnInclude . )
+-wmake libso zlib-1.2.1
+-
+-if [ "$WM_MPLIB" = "OPENMPI" -a ! -r $OPENMPI_ARCH_PATH/lib/libmpi.a -a ! -r $OPENMPI_ARCH_PATH/lib/libmpi.so ]
+-then
+-
+-    cd $OPENMPI_HOME
+-
+-        gmake distclean
+-        rm -rf $OPENMPI_ARCH_PATH
+-
+-        ./configure \
+-            --prefix=$OPENMPI_ARCH_PATH \
+-            --disable-mpirun-prefix-by-default \
+-            --disable-orterun-prefix-by-default \
+-            --enable-shared --disable-static \
+-            --disable-mpi-f77 --disable-mpi-f90 --disable-mpi-cxx \
+-            --disable-mpi-profile
+-
+-        gmake
+-        gmake install
+-        gmake distclean
+-
+-    cd $FOAM_SRC
+-fi
+-
+-if [ "$WM_MPLIB" = "LAM" -a ! -r $LAM_ARCH_PATH/lib/libmpi.a -a ! -r $LAM_ARCH_PATH/lib/libmpi.so ]
+-then
+-
+-    cd $LAMHOME
+-
+-        gmake distclean
+-        rm -rf $LAM_ARCH_PATH
+-
+-        ./configure \
+-            --prefix=$LAM_ARCH_PATH \
+-            --enable-shared \
+-            --disable-static \
+-            --without-romio \
+-            --without-mpi2cpp \
+-            --without-profiling \
+-            --without-fc
+-
+-        gmake
+-        gmake install
+-        gmake distclean
+-
+-    cd $FOAM_SRC
+-fi
+-
+-if [ "$WM_MPLIB" = "MPICH" -a ! -r $MPICH_ARCH_PATH/lib/libmpich.a -a ! -r $MPICH_ARCH_PATH/lib/libmpich.so ]
+-then
+-    
+-    cd $MPICH_PATH
+-
+-        make distclean
+-        rm -rf $MPICH_ARCH_PATH
+-        rm util/machines/machines.*
+-
+-        ./configure \
+-            --without-mpe \
+-            --disable-f77 \
+-            --disable-f90 \
+-            --disable-f90modules \
+-            --disable-c++ \
+-            --disable-mpedbg \
+-            --disable-devdebug \
+-            --disable-debug \
+-            --enable-sharedlib=$MPICH_ARCH_PATH/lib \
+-            --with-device=ch_p4 \
+-            -prefix=$MPICH_ARCH_PATH
+-        make
+-        make install
+-        make distclean
+-
+-        if [ -r $MPICH_ARCH_PATH ]
+-        then
+-            cd $MPICH_ARCH_PATH/bin
+-            for file in *
+-            do
+-                sed s%$MPICH_ARCH_PATH%'$MPICH_ARCH_PATH'%g $file > temp.$$
+-                mv temp.$$ $file
+-                chmod ugo+rx $file
+-            done
+-
+-            cd $MPICH_ARCH_PATH/lib
+-
+-            if [ -r libmpich.so.1.0 ]
+-            then
+-                rm *.so
+-                ln -s libmpich.so.1.0 libmpich.so
+-            fi
+-
+-            cd $MPICH_ARCH_PATH
+-        fi
+-
+-    cd $FOAM_SRC
+-fi
++# wmake libso zlib-1.2.1
++#
++# if [ "$WM_MPLIB" = "OPENMPI" -a ! -r $OPENMPI_ARCH_PATH/lib/libmpi.a -a ! -r $OPENMPI_ARCH_PATH/lib/libmpi.so ]
++# then
++# 
++#     cd $OPENMPI_HOME
++# 
++#         gmake distclean
++#         rm -rf $OPENMPI_ARCH_PATH
++# 
++#         ./configure \
++#             --prefix=$OPENMPI_ARCH_PATH \
++#             --disable-mpirun-prefix-by-default \
++#             --disable-orterun-prefix-by-default \
++#             --enable-shared --disable-static \
++#             --disable-mpi-f77 --disable-mpi-f90 --disable-mpi-cxx \
++#             --disable-mpi-profile
++# 
++#         gmake
++#         gmake install
++#         gmake distclean
++# 
++#     cd $FOAM_SRC
++# fi
++# 
++# if [ "$WM_MPLIB" = "LAM" -a ! -r $LAM_ARCH_PATH/lib/libmpi.a -a ! -r $LAM_ARCH_PATH/lib/libmpi.so ]
++# then
++# 
++#     cd $LAMHOME
++# 
++#         gmake distclean
++#         rm -rf $LAM_ARCH_PATH
++# 
++#         ./configure \
++#             --prefix=$LAM_ARCH_PATH \
++#             --enable-shared \
++#             --disable-static \
++#             --without-romio \
++#             --without-mpi2cpp \
++#             --without-profiling \
++#             --without-fc
++# 
++#         gmake
++#         gmake install
++#         gmake distclean
++# 
++#     cd $FOAM_SRC
++# fi
++# 
++# if [ "$WM_MPLIB" = "MPICH" -a ! -r $MPICH_ARCH_PATH/lib/libmpich.a -a ! -r $MPICH_ARCH_PATH/lib/libmpich.so ]
++# then
++#     
++#     cd $MPICH_PATH
++# 
++#         make distclean
++#         rm -rf $MPICH_ARCH_PATH
++#         rm util/machines/machines.*
++# 
++#         ./configure \
++#             --without-mpe \
++#             --disable-f77 \
++#             --disable-f90 \
++#             --disable-f90modules \
++#             --disable-c++ \
++#             --disable-mpedbg \
++#             --disable-devdebug \
++#             --disable-debug \
++#             --enable-sharedlib=$MPICH_ARCH_PATH/lib \
++#             --with-device=ch_p4 \
++#             -prefix=$MPICH_ARCH_PATH
++#         make
++#         make install
++#         make distclean
++# 
++#         if [ -r $MPICH_ARCH_PATH ]
++#         then
++#             cd $MPICH_ARCH_PATH/bin
++#             for file in *
++#             do
++#                 sed s%$MPICH_ARCH_PATH%'$MPICH_ARCH_PATH'%g $file > temp.$$
++#                 mv temp.$$ $file
++#                 chmod ugo+rx $file
++#             done
++# 
++#             cd $MPICH_ARCH_PATH/lib
++# 
++#             if [ -r libmpich.so.1.0 ]
++#             then
++#                 rm *.so
++#                 ln -s libmpich.so.1.0 libmpich.so
++#             fi
++# 
++#             cd $MPICH_ARCH_PATH
++#         fi
++# 
++#     cd $FOAM_SRC
++# fi
+ (cd Pstream ; ./Allwmake)
+ wmake libso OpenFOAM
+diff -ur OpenFOAM-1.4.1-src/src/Allwmake OpenFOAM-1.4.1/src/Allwmake
+--- OpenFOAM-1.4.1-src/src/Allwmake    2007-07-27 17:54:28.000000000 +0200
++++ OpenFOAM-1.4.1/src/Allwmake        2007-10-18 21:04:12.000000000 +0200
+@@ -141,13 +141,13 @@
+ (cd malloc ; ./Allwmake)
+-if [ ! -r $MICO_ARCH_PATH/lib/libmico${MICO_VERSION}.a ]
+-then
+-    cd $MICO_PATH
+-    gmake distclean
+-    ./configure --prefix=$MICO_ARCH_PATH --disable-shared --without-x
+-    gmake
+-    gmake install
+-    gmake distclean
+-    cd ..
+-fi
++# if [ ! -r $MICO_ARCH_PATH/lib/libmico${MICO_VERSION}.a ]
++# then
++#     cd $MICO_PATH
++#     gmake distclean
++#     ./configure --prefix=$MICO_ARCH_PATH --disable-shared --without-x
++#     gmake
++#     gmake install
++#     gmake distclean
++#     cd ..
++# fi
diff --git a/sci-libs/openfoam-kernel/openfoam-kernel-1.4.1_p20080131.ebuild b/sci-libs/openfoam-kernel/openfoam-kernel-1.4.1_p20080131.ebuild
new file mode 100644 (file)
index 0000000..390872e
--- /dev/null
@@ -0,0 +1,73 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header:  $
+
+inherit eutils java-pkg-2 versionator multilib toolchain-funcs
+
+MY_PN="OpenFOAM"
+MY_PV=$(get_version_component_range 1-3 ${PV})
+MY_P="${MY_PN}-${MY_PV}"
+
+DESCRIPTION="OpenFOAM - Kernel package"
+HOMEPAGE="http://www.opencfd.co.uk/openfoam/"
+SRC_URI="mirror://sourceforge/foam/${MY_P}.General.gtgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RDEPEND="!sci-libs/openfoam
+       !sci-libs/openfoam-bin
+       <virtual/jdk-1.5
+       >=sci-libs/openfoam-wmake-${MY_PV}"
+DEPEND="${RDEPEND}"
+
+S=${WORKDIR}/${MY_P}
+INSDIR=/usr/$(get_libdir)/${MY_PN}/${MY_P}
+
+pkg_setup() {
+       if ! version_is_at_least 4.1 $(gcc-version) ; then
+               die "${PN} requires >=sys-devel/gcc-4.1 to compile."
+       fi
+
+       java-pkg-2_pkg_setup
+}
+
+src_unpack() {
+       ln -s "${DISTDIR}"/${MY_P}.General.gtgz ${MY_P}.General.tgz
+       unpack ./${MY_P}.General.tgz
+
+       cd "${S}"
+       epatch "${FILESDIR}"/${P}.patch
+       epatch "${FILESDIR}"/${PN}-compile-${PV}.patch
+}
+
+src_compile() {
+       cp -a ${INSDIR}/.bashrc "${S}"/.bashrc || "cannot copy .bashrc"
+       cp -a ${INSDIR}/.${MY_P}/bashrc "${S}"/.${MY_P}/bashrc.bak || "cannot copy bashrc"
+
+       use amd64 && export WM_64="on"
+
+       sed -i -e "s|WM_PROJECT_INST_DIR=/usr/$(get_libdir)/\$WM_PROJECT|WM_PROJECT_INST_DIR="${WORKDIR}"|"             \
+               -e "s|WM_PROJECT_DIR=\$WM_PROJECT_INST_DIR/\$WM_PROJECT-\$WM_PROJECT_VERSION|WM_PROJECT_DIR="${S}"|"    \
+               "${S}"/.${MY_P}/bashrc.bak      \
+               || die "could not replace source options"
+
+       sed -i -e "s|\$WM_PROJECT_DIR/wmake|"${INSDIR}"/wmake|" \
+               -e "s|\$WM_PROJECT_INST_DIR/\$WM_ARCH/bin|"${INSDIR}"/bin|"     \
+               -e "s|FOAM_LIBBIN=\$FOAM_LIB|FOAM_LIBBIN=\$FOAM_LIB/\$WM_OPTIONS|"      \
+               -e "s|applications/bin|applications/bin/\$WM_OPTIONS|"  \
+               "${S}"/.bashrc || die "could not replace paths"
+
+       source "${S}"/.${MY_P}/bashrc.bak
+
+       cd "${S}"/src
+       ./Allwmake || die "could not build OpenFOAM kernel"
+}
+
+src_install() {
+       insopts -m0755
+       insinto /usr/$(get_libdir)/${MY_PN}/${MY_P}/lib
+       doins -r lib/${WM_OPTIONS}/*
+}