Merge branch 'master' of /home/noisy3/OpenFOAM/OpenFOAM-dev

This commit is contained in:
mattijs
2009-04-01 10:45:33 +01:00
3 changed files with 45 additions and 32 deletions

View File

@ -57,22 +57,7 @@ Foam::tmp<Foam::Field<Type> > Foam::lduMatrix::H(const Field<Type>& psi) const
for (register label face=0; face<nFaces; face++)
{
#ifdef ICC_IA64_PREFETCH
__builtin_prefetch (&uPtr[face+32],0,0);
__builtin_prefetch (&lPtr[face+32],0,0);
__builtin_prefetch (&lowerPtr[face+32],0,1);
__builtin_prefetch (&psiPtr[lPtr[face+32]],0,1);
__builtin_prefetch (&HpsiPtr[uPtr[face+32]],0,1);
#endif
HpsiPtr[uPtr[face]] -= lowerPtr[face]*psiPtr[lPtr[face]];
#ifdef ICC_IA64_PREFETCH
__builtin_prefetch (&upperPtr[face+32],0,1);
__builtin_prefetch (&psiPtr[uPtr[face+32]],0,1);
__builtin_prefetch (&HpsiPtr[lPtr[face+32]],0,1);
#endif
HpsiPtr[lPtr[face]] -= upperPtr[face]*psiPtr[uPtr[face]];
}
}
@ -93,11 +78,12 @@ Foam::lduMatrix::H(const tmp<Field<Type> >& tpsi) const
template<class Type>
Foam::tmp<Foam::Field<Type> >
Foam::lduMatrix::faceH(const Field<Type>& psi) const
{
if (lowerPtr_ || upperPtr_)
{
const scalarField& Lower = const_cast<const lduMatrix&>(*this).lower();
const scalarField& Upper = const_cast<const lduMatrix&>(*this).upper();
// Take refereces to addressing
const unallocLabelList& l = lduAddr().lowerAddr();
const unallocLabelList& u = lduAddr().upperAddr();
@ -111,6 +97,16 @@ Foam::lduMatrix::faceH(const Field<Type>& psi) const
return tfaceHpsi;
}
else
{
FatalErrorIn("lduMatrix::faceH(const Field<Type>& psi) const")
<< "Cannot calculate faceH"
" the matrix does not have any off-diagonal coefficients."
<< exit(FatalError);
return tmp<Field<Type> >(NULL);
}
}
template<class Type>

View File

@ -1303,7 +1303,14 @@ Foam::tmp<Foam::fvMatrix<Type> > Foam::correction
const fvMatrix<Type>& A
)
{
return A - (A & A.psi());
tmp<Foam::fvMatrix<Type> > tAcorr = A - (A & A.psi());
if ((A.hasUpper() || A.hasLower()) && A.mesh().fluxRequired(A.psi().name()))
{
tAcorr().faceFluxCorrectionPtr() = (-A.flux()).ptr();
}
return tAcorr;
}
@ -1313,7 +1320,17 @@ Foam::tmp<Foam::fvMatrix<Type> > Foam::correction
const tmp<fvMatrix<Type> >& tA
)
{
return tA - (tA() & tA().psi());
tmp<Foam::fvMatrix<Type> > tAcorr = tA - (tA() & tA().psi());
// Note the matrix coefficients are still that of matrix A
const fvMatrix<Type>& A = tAcorr();
if ((A.hasUpper() || A.hasLower()) && A.mesh().fluxRequired(A.psi().name()))
{
tAcorr().faceFluxCorrectionPtr() = (-A.flux()).ptr();
}
return tAcorr;
}

View File

@ -1,6 +1,6 @@
.SUFFIXES: .L
Ltoo = flex --c++ -f $$SOURCE ; mv lex.yy.cc $*.C ; $(CC) $(c++FLAGS) -c $*.C -o $@
Ltoo = flex -+ -f $$SOURCE ; mv lex.yy.cc $*.C ; $(CC) $(c++FLAGS) -c $*.C -o $@
.L.dep:
$(MAKE_DEP)