Bug fixes and Apple Mac OS X porting

This commit is contained in:
Hrvoje Jasak 2010-11-07 06:15:27 +00:00
parent 49f6442fc9
commit 0537b5ff97
19 changed files with 74 additions and 52 deletions

View file

@ -124,7 +124,7 @@ void starMesh::createCoupleMatches()
cellRemovedFaces.insert cellRemovedFaces.insert
( (
fp.masterCell(), fp.masterCell(),
fp.masterFace() SLList<label>(fp.masterFace())
); );
} }
else else
@ -1363,7 +1363,7 @@ void starMesh::createCoupleMatches()
cellRemovedFaces.insert cellRemovedFaces.insert
( (
fp.masterCell(), fp.masterCell(),
fp.masterFace() SLList<label>(fp.masterFace())
); );
} }
else else
@ -1379,7 +1379,7 @@ void starMesh::createCoupleMatches()
cellRemovedFaces.insert cellRemovedFaces.insert
( (
fp.slaveCell(), fp.slaveCell(),
fp.slaveFace() SLList<label>(fp.slaveFace())
); );
} }
else else

View file

@ -43,8 +43,7 @@ threadHandler<T>::threadHandler
threader_(threader), threader_(threader),
argList_(0), argList_(0),
nThreads_(threader.getNumThreads()), nThreads_(threader.getNumThreads()),
pthreadID_(0),//HJ, bug fix - please review (-1 not allowed) pthreadID_(pthread_self()),
// pthreadID_(-1),
master_(false), master_(false),
predicate_(false) predicate_(false)
{} {}

View file

@ -578,8 +578,6 @@ $(writers)/gnuplotGraph/gnuplotGraph.C
$(writers)/xmgrGraph/xmgrGraph.C $(writers)/xmgrGraph/xmgrGraph.C
$(writers)/jplotGraph/jplotGraph.C $(writers)/jplotGraph/jplotGraph.C
//- Block Matrix Additions
//- I. Clifford 03-12-2009
primitives/BlockCoeff/blockCoeffBase.C primitives/BlockCoeff/blockCoeffBase.C
primitives/BlockCoeff/scalarBlockCoeff.C primitives/BlockCoeff/scalarBlockCoeff.C
primitives/BlockCoeff/sphericalTensorBlockCoeff.C primitives/BlockCoeff/sphericalTensorBlockCoeff.C
@ -589,14 +587,14 @@ primitives/BlockCoeff/tensorBlockCoeff.C
fields/expandContract/expandTensorField.C fields/expandContract/expandTensorField.C
fields/CoeffField/scalarCoeffField.C fields/CoeffField/scalarCoeffField.C
// fields/CoeffField/sphericalTensorCoeffField.C fields/CoeffField/sphericalTensorCoeffField.C
// fields/CoeffField/symmTensorCoeffField.C fields/CoeffField/symmTensorCoeffField.C
fields/CoeffField/tensorCoeffField.C fields/CoeffField/tensorCoeffField.C
matrices/blockLduMatrix/BlockLduMatrix/blockLduMatrices.C matrices/blockLduMatrix/BlockLduMatrix/blockLduMatrices.C
matrices/blockLduMatrix/BlockLduMatrix/scalarBlockLduMatrix.C matrices/blockLduMatrix/BlockLduMatrix/scalarBlockLduMatrix.C
// matrices/blockLduMatrix/BlockLduMatrix/sphericalTensorBlockLduMatrix.C matrices/blockLduMatrix/BlockLduMatrix/sphericalTensorBlockLduMatrix.C
// matrices/blockLduMatrix/BlockLduMatrix/symmTensorBlockLduMatrix.C matrices/blockLduMatrix/BlockLduMatrix/symmTensorBlockLduMatrix.C
matrices/blockLduMatrix/BlockLduMatrix/tensorBlockLduMatrix.C matrices/blockLduMatrix/BlockLduMatrix/tensorBlockLduMatrix.C
matrices/blockLduMatrix/BlockLduMatrix/BlockConstraint/scalarBlockConstraint.C matrices/blockLduMatrix/BlockLduMatrix/BlockConstraint/scalarBlockConstraint.C
@ -616,12 +614,12 @@ matrices/blockLduMatrix/BlockLduPrecons/BlockCholeskyPrecon/tensorBlockCholeskyP
matrices/blockLduMatrix/BlockLduPrecons/BlockCholeskyPrecon/blockCholeskyPrecons.C matrices/blockLduMatrix/BlockLduPrecons/BlockCholeskyPrecon/blockCholeskyPrecons.C
matrices/blockLduMatrix/BlockLduSmoothers/BlockLduSmoother/blockLduSmoothers.C matrices/blockLduMatrix/BlockLduSmoothers/BlockLduSmoother/blockLduSmoothers.C
// matrices/blockLduMatrix/BlockLduSmoothers/BlockGaussSeidelSmoother/blockGaussSeidelSmoothers.C matrices/blockLduMatrix/BlockLduSmoothers/BlockGaussSeidelSmoother/blockGaussSeidelSmoothers.C
matrices/blockLduMatrix/BlockLduSmoothers/BlockILUSmoother/blockILUSmoothers.C matrices/blockLduMatrix/BlockLduSmoothers/BlockILUSmoother/blockILUSmoothers.C
matrices/blockLduMatrix/BlockLduSolvers/BlockLduSolver/blockLduSolvers.C matrices/blockLduMatrix/BlockLduSolvers/BlockLduSolver/blockLduSolvers.C
matrices/blockLduMatrix/BlockLduSolvers/BlockDiagonal/blockDiagonalSolvers.C matrices/blockLduMatrix/BlockLduSolvers/BlockDiagonal/blockDiagonalSolvers.C
// matrices/blockLduMatrix/BlockLduSolvers/Segregated/segregatedSolvers.C /*HJ matrices/blockLduMatrix/BlockLduSolvers/Segregated/segregatedSolvers.C */
matrices/blockLduMatrix/BlockLduSolvers/BlockGaussSeidel/blockGaussSeidelSolvers.C matrices/blockLduMatrix/BlockLduSolvers/BlockGaussSeidel/blockGaussSeidelSolvers.C
matrices/blockLduMatrix/BlockLduSolvers/BlockCG/blockCGSolvers.C matrices/blockLduMatrix/BlockLduSolvers/BlockCG/blockCGSolvers.C
matrices/blockLduMatrix/BlockLduSolvers/BlockBiCGStab/blockBiCGStabSolvers.C matrices/blockLduMatrix/BlockLduSolvers/BlockBiCGStab/blockBiCGStabSolvers.C

View file

@ -60,7 +60,7 @@ public:
{} {}
//- Construct given initial T //- Construct given initial T
SLList(T a) explicit SLList(T a)
: :
LList<SLListBase, T>(a) LList<SLListBase, T>(a)
{} {}

View file

@ -91,6 +91,7 @@ public:
class Hash class Hash
{ {
public: public:
Hash() Hash()
{} {}
@ -116,7 +117,7 @@ public:
inline FixedList(const T v[Size]); inline FixedList(const T v[Size]);
//- Construct from value //- Construct from value
inline FixedList(const T&); explicit inline FixedList(const T&);
//- Construct from UList. //- Construct from UList.
inline FixedList(const UList<T>&); inline FixedList(const UList<T>&);

View file

@ -88,7 +88,7 @@ inline Foam::FixedList<T, Size>::FixedList(const SLList<T>& lst)
template<class T, unsigned Size> template<class T, unsigned Size>
inline Foam::FixedList<T, Size>::FixedList(const FixedList<T, Size>& lst) inline Foam::FixedList<T, Size>::FixedList(const FixedList<T, Size>& lst)
{ {
for (register unsigned i=0; i<Size; i++) for (register unsigned i = 0; i < Size; i++)
{ {
v_[i] = lst[i]; v_[i] = lst[i];
} }

View file

@ -644,6 +644,7 @@ Foam::List<Container> Foam::initListList(const T elems[nRows][nColumns])
List<Container> lst(nRows); List<Container> lst(nRows);
Container cols(nColumns); Container cols(nColumns);
forAll(lst, rowI) forAll(lst, rowI)
{ {
forAll(cols, colI) forAll(cols, colI)

View file

@ -88,6 +88,7 @@ public:
typedef Field<Type> TypeField; typedef Field<Type> TypeField;
typedef BlockConstraint<Type> ConstraintType; typedef BlockConstraint<Type> ConstraintType;
private: private:
// Private data // Private data
@ -148,15 +149,16 @@ private:
void decoupledMultEqOp(const scalarField& sf); void decoupledMultEqOp(const scalarField& sf);
//- Matrix multiplication without coupled interface update, //- Matrix multiplication without coupled interface update,
// decoupled version // Decoupled version
void decoupledAmulCore void decoupledAmulCore
( (
TypeField& Ax, TypeField& Ax,
const TypeField& x const TypeField& x
) const; ) const;
//- Matrix transpose multiplication without coupled interface update //- Matrix transpose multiplication without coupled
// decoupled version // interface update
// Decoupled version
void decoupledTmulCore void decoupledTmulCore
( (
TypeField& Tx, TypeField& Tx,
@ -164,11 +166,11 @@ private:
) const; ) const;
//- Return L-U vector-matrix multiplication in row-form, //- Return L-U vector-matrix multiplication in row-form,
// decoupled version // Decoupled version
tmp<TypeField> decoupledH(const TypeField& x) const; tmp<TypeField> decoupledH(const TypeField& x) const;
//- Return L-U vector-matrix multiplication in off-diagonal form, //- Return L-U vector-matrix multiplication in off-diagonal form,
// decoupled version // Decoupled version
tmp<TypeField> decoupledFaceH(const TypeField& x) const; tmp<TypeField> decoupledFaceH(const TypeField& x) const;
@ -319,7 +321,8 @@ public:
TypeField& Ax, TypeField& Ax,
const TypeField& x, const TypeField& x,
const FieldField<CoeffField, Type>& boundaryCoeffs, const FieldField<CoeffField, Type>& boundaryCoeffs,
const typename BlockLduInterfaceFieldPtrsList<Type>::Type& interfaces const typename BlockLduInterfaceFieldPtrsList<Type>::Type&
interfaces
) const; ) const;
//- Matrix multiplication without coupled interface update //- Matrix multiplication without coupled interface update
@ -335,10 +338,12 @@ public:
TypeField& Ax, TypeField& Ax,
const TypeField& x, const TypeField& x,
const FieldField<CoeffField, Type>& boundaryCoeffs, const FieldField<CoeffField, Type>& boundaryCoeffs,
const typename BlockLduInterfaceFieldPtrsList<Type>::Type& interfaces const typename BlockLduInterfaceFieldPtrsList<Type>::Type&
interfaces
) const; ) const;
//- Matrix transpose multiplication without coupled interface update //- Matrix transpose multiplication without coupled
// interface update
void TmulCore void TmulCore
( (
TypeField& Ax, TypeField& Ax,

View file

@ -129,7 +129,8 @@ public:
const word& fieldName, const word& fieldName,
BlockLduMatrix<Type>& matrix, BlockLduMatrix<Type>& matrix,
const FieldField<CoeffField, Type>& boundaryCoeffs, const FieldField<CoeffField, Type>& boundaryCoeffs,
const typename BlockLduInterfaceFieldPtrsList<Type>::Type& interfaces, const typename BlockLduInterfaceFieldPtrsList<Type>::Type&
interfaces,
const dictionary& dict const dictionary& dict
), ),
( (
@ -150,7 +151,8 @@ public:
const word& fieldName, const word& fieldName,
BlockLduMatrix<Type>& matrix, BlockLduMatrix<Type>& matrix,
const FieldField<CoeffField, Type>& boundaryCoeffs, const FieldField<CoeffField, Type>& boundaryCoeffs,
const typename BlockLduInterfaceFieldPtrsList<Type>::Type& interfaces, const typename BlockLduInterfaceFieldPtrsList<Type>::Type&
interfaces,
const dictionary& dict const dictionary& dict
), ),
( (

View file

@ -38,7 +38,7 @@ Foam::SegregatedSolver<Type>::SegregatedSolver
( (
const word& fieldName, const word& fieldName,
const BlockLduMatrix<Type>& matrix, const BlockLduMatrix<Type>& matrix,
const FieldField<CoeffField, Type>& boundaryCoeffs,, const FieldField<CoeffField, Type>& boundaryCoeffs,
const typename BlockLduInterfaceFieldPtrsList<Type>::Type& interfaces, const typename BlockLduInterfaceFieldPtrsList<Type>::Type& interfaces,
const dictionary& dict const dictionary& dict
) )
@ -181,8 +181,8 @@ Foam::BlockSolverPerformance<Type> Foam::SegregatedSolver<Type>::solve
( (
this->fieldName(), this->fieldName(),
scalarMatrix_, scalarMatrix_,
BlockLduSolver<Type>::boundaryCoeffs, boundaryCoeffs,
BlockLduSolver<Type>::interfaces_, interfaces_,
this->dict() this->dict()
)->solve(scalarX_, scalarB_); )->solve(scalarX_, scalarB_);

View file

@ -40,10 +40,10 @@ makeBlockSolverTypeName(segregatedSolverVector);
makeBlockSolverTypeName(segregatedSolverTensor); makeBlockSolverTypeName(segregatedSolverTensor);
addSolverToBlockMatrix(Vector, segregatedSolverVector, symMatrix); addSolverToBlockMatrix(Vector, segregatedSolverVector, symMatrix);
addSolverToBlockMatrix(Tensor, segregatedSolverTensor, symMatrix); // addSolverToBlockMatrix(Tensor, segregatedSolverTensor, symMatrix);
addSolverToBlockMatrix(Vector, segregatedSolverVector, asymMatrix); addSolverToBlockMatrix(Vector, segregatedSolverVector, asymMatrix);
addSolverToBlockMatrix(Tensor, segregatedSolverTensor, asymMatrix); // addSolverToBlockMatrix(Tensor, segregatedSolverTensor, asymMatrix);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View file

@ -113,7 +113,7 @@ Foam::cyclicGAMGInterface::cyclicGAMGInterface
if (!nbrFound) if (!nbrFound)
{ {
curNbrs.append(curSlave); curNbrs.append(curSlave);
curFaceFaces.append(ffi); curFaceFaces.append(SLList<label>(ffi));
// New coarse face created // New coarse face created
nCoarseFaces++; nCoarseFaces++;
@ -124,7 +124,11 @@ Foam::cyclicGAMGInterface::cyclicGAMGInterface
// This master has got no neighbours yet. Add a neighbour // This master has got no neighbours yet. Add a neighbour
// and a coefficient, thus creating a new face // and a coefficient, thus creating a new face
neighboursTable.insert(curMaster, SLList<label>(curSlave)); neighboursTable.insert(curMaster, SLList<label>(curSlave));
faceFaceTable.insert(curMaster, SLList<SLList<label> >(ffi)); faceFaceTable.insert
(
curMaster,
SLList<SLList<label> >(SLList<label>(ffi))
);
// New coarse face created // New coarse face created
nCoarseFaces++; nCoarseFaces++;

View file

@ -228,8 +228,8 @@ Foam::ggiGAMGInterface::ggiGAMGInterface
if (!nbrFound) if (!nbrFound)
{ {
curNbrs.append(curSlave); curNbrs.append(curSlave);
curFaceFaces.append(ffI); curFaceFaces.append(SLList<label>(ffI));
curFaceWeights.append(curNW); curFaceWeights.append(SLList<scalar>(curNW));
// New coarse face created // New coarse face created
nCoarseFaces++; nCoarseFaces++;
@ -245,13 +245,13 @@ Foam::ggiGAMGInterface::ggiGAMGInterface
faceFaceTable.insert faceFaceTable.insert
( (
curMaster, curMaster,
SLList<SLList<label> >(ffI) SLList<SLList<label> >(SLList<label>(ffI))
); );
faceFaceWeightsTable.insert faceFaceWeightsTable.insert
( (
curMaster, curMaster,
SLList<SLList<scalar> >(curNW) SLList<SLList<scalar> >(SLList<scalar>(curNW))
); );
// New coarse face created // New coarse face created
@ -335,9 +335,9 @@ Foam::ggiGAMGInterface::ggiGAMGInterface
if (!nbrFound) if (!nbrFound)
{ {
curNbrs.append(curSlave); curNbrs.append(curSlave);
curFaceFaces.append(ffi); curFaceFaces.append(SLList<label>(ffi));
// Add dummy weight // Add dummy weight
curFaceWeights.append(1.0); curFaceWeights.append(SLList<scalar>(1.0));
// New coarse face created // New coarse face created
nCoarseFaces++; nCoarseFaces++;
@ -350,13 +350,17 @@ Foam::ggiGAMGInterface::ggiGAMGInterface
// and a coefficient, thus creating a new face // and a coefficient, thus creating a new face
neighboursTable.insert(curMaster, SLList<label>(curSlave)); neighboursTable.insert(curMaster, SLList<label>(curSlave));
faceFaceTable.insert(curMaster, SLList<SLList<label> >(ffi)); faceFaceTable.insert
(
curMaster,
SLList<SLList<label> >(SLList<label>(ffi))
);
// Add dummy weight // Add dummy weight
faceFaceWeightsTable.insert faceFaceWeightsTable.insert
( (
curMaster, curMaster,
SLList<SLList<scalar> >(1.0) SLList<SLList<scalar> >(SLList<scalar>(1.0))
); );
// New coarse face created // New coarse face created

View file

@ -125,7 +125,7 @@ Foam::processorGAMGInterface::processorGAMGInterface
if (!nbrFound) if (!nbrFound)
{ {
curNbrs.append(curSlave); curNbrs.append(curSlave);
curFaceFaces.append(ffi); curFaceFaces.append(SLList<label>(ffi));
// New coarse face created // New coarse face created
nCoarseFaces++; nCoarseFaces++;
@ -136,7 +136,11 @@ Foam::processorGAMGInterface::processorGAMGInterface
// This master has got no neighbours yet. Add a neighbour // This master has got no neighbours yet. Add a neighbour
// and a coefficient, thus creating a new face // and a coefficient, thus creating a new face
neighboursTable.insert(curMaster, SLList<label>(curSlave)); neighboursTable.insert(curMaster, SLList<label>(curSlave));
faceFaceTable.insert(curMaster, SLList<SLList<label> >(ffi)); faceFaceTable.insert
(
curMaster,
SLList<SLList<label> >(SLList<label>(ffi))
);
// New coarse face created // New coarse face created
nCoarseFaces++; nCoarseFaces++;

View file

@ -74,6 +74,11 @@ public:
//- Null constructor for lists //- Null constructor for lists
inline edge(); inline edge();
//- Constructor given size
// Nasty hack for consistency in creation of edges/faces/cells
// HJ, 6/Nov/2010
explicit inline edge(const label size);
//- Construct from components //- Construct from components
inline edge(const label a, const label b); inline edge(const label a, const label b);

View file

@ -28,7 +28,6 @@ License
// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * // // * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
// return // return
// - 0: different // - 0: different
// - +1: identical // - +1: identical
@ -56,6 +55,10 @@ inline Foam::edge::edge()
{} {}
inline Foam::edge::edge(const label)
{}
inline Foam::edge::edge(const label a, const label b) inline Foam::edge::edge(const label a, const label b)
{ {
start() = a; start() = a;

View file

@ -1519,10 +1519,6 @@ void dynamicTopoFvMesh::initializeThreadingEnvironment
if (threadI == 0) if (threadI == 0)
{ {
// HJ, bug fix - please review: negative number not allowed
// HJ, 6/Nov/2010
handlerPtr_[0].setID(0);
// handlerPtr_[0].setID(-1);
handlerPtr_[0].setMaster(); handlerPtr_[0].setMaster();
} }
else else

View file

@ -33,7 +33,7 @@ Author
University of Massachusetts Amherst University of Massachusetts Amherst
All rights reserved All rights reserved
\*----------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "dynamicTopoFvMesh.H" #include "dynamicTopoFvMesh.H"

View file

@ -307,7 +307,7 @@ const changeMap dynamicTopoFvMesh::collapseQuadFace
// Configure the new point-positions // Configure the new point-positions
FixedList<bool, 2> check(false); FixedList<bool, 2> check(false);
FixedList<FixedList<label, 2>, 2> checkPoints(-1); FixedList<FixedList<label, 2>, 2> checkPoints(FixedList<label, 2>(-1));
FixedList<point, 2> newPoint(vector::zero); FixedList<point, 2> newPoint(vector::zero);
FixedList<point, 2> oldPoint(vector::zero); FixedList<point, 2> oldPoint(vector::zero);