Compilation updates

This commit is contained in:
Hrvoje Jasak 2010-08-30 18:57:22 +01:00
parent f7bcda9b9a
commit 3ed10cf177
121 changed files with 993 additions and 3796 deletions

View file

@ -38,7 +38,7 @@ export WM_PROJECT_VERSION=1.6-ext
# helps to easily write #ifdefs to detect a dev-version
export FOAM_DEV=1
################################################################################
###############################################################################
# USER EDITABLE PART
#
# either set $FOAM_INST_DIR before sourcing this file or set
@ -133,8 +133,6 @@ Linux)
case $WM_ARCH_OPTION in
32)
export WM_COMPILER_ARCH='-64'
export WM_CC='gcc'
export WM_CXX='g++'
export WM_CFLAGS='-m32 -fPIC'
export WM_CXXFLAGS='-m32 -fPIC'
export WM_LDFLAGS='-m32'
@ -142,8 +140,6 @@ Linux)
64)
WM_ARCH=linux64
export WM_COMPILER_LIB_ARCH=64
export WM_CC='gcc'
export WM_CXX='g++'
export WM_CFLAGS='-m64 -fPIC'
export WM_CXXFLAGS='-m64 -fPIC'
export WM_LDFLAGS='-m64'
@ -162,8 +158,6 @@ Linux)
mips64)
WM_ARCH=SiCortex64
export WM_COMPILER_LIB_ARCH=64
export WM_CC='gcc'
export WM_CXX='g++'
export WM_CFLAGS='-mabi=64 -fPIC'
export WM_CXXFLAGS='-mabi=64 -fPIC'
export WM_LDFLAGS='-mabi=64 -G0'
@ -173,8 +167,6 @@ Linux)
ppc64)
WM_ARCH=linuxPPC64
export WM_COMPILER_LIB_ARCH=64
export WM_CC='gcc'
export WM_CXX='g++'
export WM_CFLAGS='-m64 -fPIC'
export WM_CXXFLAGS='-m64 -fPIC'
export WM_LDFLAGS='-m64'
@ -204,8 +196,6 @@ Darwin)
SunOS)
WM_ARCH=SunOS64
export WM_COMPILER_LIB_ARCH=64
export WM_CC='gcc'
export WM_CXX='g++'
export WM_CFLAGS='-mabi=64 -fPIC'
export WM_CXXFLAGS='-mabi=64 -fPIC'
export WM_LDFLAGS='-mabi=64 -G0'

View file

@ -129,8 +129,6 @@ case Linux:
case 32:
setenv WM_ARCH linux
setenv WM_COMPILER_ARCH '-64'
setenv WM_CC 'gcc'
setenv WM_CXX 'g++'
setenv WM_CFLAGS '-m32 -fPIC'
setenv WM_CXXFLAGS '-m32 -fPIC'
setenv WM_LDFLAGS '-m32'
@ -139,8 +137,6 @@ case Linux:
case 64:
setenv WM_ARCH linux64
setenv WM_COMPILER_LIB_ARCH 64
setenv WM_CC 'gcc'
setenv WM_CXX 'g++'
setenv WM_CFLAGS '-m64 -fPIC'
setenv WM_CXXFLAGS '-m64 -fPIC'
setenv WM_LDFLAGS '-m64'
@ -161,8 +157,6 @@ case Linux:
case mips64:
setenv WM_ARCH SiCortex64
setenv WM_COMPILER_LIB_ARCH 64
setenv WM_CC 'gcc'
setenv WM_CXX 'g++'
setenv WM_CFLAGS '-mabi=64 -fPIC'
setenv WM_CXXFLAGS '-mabi=64 -fPIC'
setenv WM_LDFLAGS '-mabi=64 -G0'
@ -176,8 +170,6 @@ case Linux:
case ppc64:
setenv WM_ARCH linuxPPC64
setenv WM_COMPILER_LIB_ARCH 64
setenv WM_CC 'gcc'
setenv WM_CXX 'g++'
setenv WM_CFLAGS '-m64 -fPIC'
setenv WM_CXXFLAGS '-m64 -fPIC'
setenv WM_LDFLAGS '-m64'
@ -193,8 +185,6 @@ case Linux:
case SunOS:
setenv WM_ARCH SunOS64
setenv WM_COMPILER_LIB_ARCH 64
setenv WM_CC 'gcc'
setenv WM_CXX 'g++'
setenv WM_CFLAGS '-mabi=64 -fPIC'
setenv WM_CXXFLAGS '-mabi=64 -fPIC'
setenv WM_LDFLAGS '-mabi=64 -G0'

View file

@ -126,6 +126,17 @@ case OpenFOAM:
endsw
switch ("$WM_COMPILER")
case Gcc:
setenv WM_CC 'gcc'
setenv WM_CXX 'g++'
breaksw
case Icc:
setenv WM_CC 'icc'
setenv WM_CXX 'icpc'
breaksw
endsw
# Communications library
# ~~~~~~~~~~~~~~~~~~~~~~
@ -133,7 +144,7 @@ unset MPI_ARCH_PATH
switch ("$WM_MPLIB")
case OPENMPI:
set mpi_version=openmpi-1.3.3
set mpi_version=openmpi-1.4.1
setenv MPI_HOME $WM_THIRD_PARTY_DIR/$mpi_version
setenv MPI_ARCH_PATH $MPI_HOME/platforms/$WM_OPTIONS

View file

@ -148,6 +148,19 @@ fi
unset compilerBin compilerLib compilerInstall
case "$WM_COMPILER" in
Gcc)
export WM_CC='gcc'
export WM_CXX='g++'
;;
Icc)
export WM_CC='icc'
export WM_CXX='icpc'
;;
esac
# Communications library
# ~~~~~~~~~~~~~~~~~~~~~~
@ -155,7 +168,7 @@ unset MPI_ARCH_PATH
case "$WM_MPLIB" in
OPENMPI)
mpi_version=openmpi-1.3.3
mpi_version=openmpi-1.4.1
export MPI_HOME=$WM_THIRD_PARTY_DIR/$mpi_version
export MPI_ARCH_PATH=$MPI_HOME/platforms/$WM_OPTIONS

View file

@ -1,10 +1,14 @@
#!/bin/sh
set -x
( cd OpenFOAM && wmakeLnInclude . )
( cd finiteVolume && wmakeLnInclude . )
( cd Pstream && ./Allwmake )
wmake libo OSspecific/$WM_OS
# update OpenFOAM version strings if required
wmakePrintBuild -check || /bin/rm -f OpenFOAM/Make/$WM_OPTIONS/global.? 2>/dev/null
wmakeLnInclude OpenFOAM
wmakeLnInclude OSspecific/$WM_OSTYPE
Pstream/Allwmake
wmake libo OSspecific/$WM_OSTYPE
wmake libso OpenFOAM
( cd decompositionAgglomeration && ./Allwmake )

View file

@ -83,6 +83,25 @@ public:
);
// Member functions
//- Reset the SubList
//- Construct from UList and SubList size
inline void reset
(
const UList<T>& list,
const label subSize
);
//- Construct from UList, start and end indices
inline void reset
(
const UList<T>& list,
const label subSize,
const label startIndex
);
// Member operators
//- Allow cast to a const List<T>&

View file

@ -72,6 +72,50 @@ inline Foam::SubList<T>::SubList
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class T>
inline void Foam::SubList<T>::reset
(
const UList<T>& list,
const label subSize
)
{
UList<T>::reset(list.v_, subSize);
# ifdef FULLDEBUG
list.checkSize(subSize);
# endif
}
template<class T>
inline void Foam::SubList<T>::reset
(
const UList<T>& list,
const label subSize,
const label startIndex
)
{
UList<T>::reset(&(list.v_[startIndex]), subSize);
# ifdef FULLDEBUG
// Artificially allowing the start of a zero-sized subList to be
// one past the end of the original list.
if (subSize > 0)
{
list.checkStart(startIndex);
list.checkSize(startIndex + subSize);
}
else
{
// Start index needs to fall between 0 and size. One position
// behind the last element is allowed
list.checkSize(startIndex);
}
# endif
}
template<class T>
inline const Foam::SubList<T>& Foam::SubList<T>::null()
{

View file

@ -322,11 +322,11 @@ void GGIInterpolation<MasterPatch, SlavePatch>::findNeighboursAABB
curFacePoints += forwardSep_[0];
}
else
{
{
curFacePoints += forwardSep_[faceSi];
}
}
slavePatchBB[faceSi] = boundBox(curFacePoints, false);
// We compute the extent of the slave face BB.
@ -358,7 +358,7 @@ void GGIInterpolation<MasterPatch, SlavePatch>::findNeighboursAABB
masterPatchBB[faceMi].max() + deltaBBSlave[faceSi]
);
if (augmentedBBMaster.intersects(slavePatchBB[faceSi]))
if (augmentedBBMaster.overlaps(slavePatchBB[faceSi]))
{
// Compute featureCos between the two face normals
// before adding to the list of candidates

View file

@ -33,7 +33,7 @@ Author
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
const Foam::scalarMatrix& Foam::RBFInterpolation::B() const
const Foam::scalarSquareMatrix& Foam::RBFInterpolation::B() const
{
if (!BPtr_)
{
@ -48,6 +48,7 @@ void Foam::RBFInterpolation::calcB() const
{
// Determine inverse of boundary connectivity matrix
label polySize(4);
if(!polynomials_)
{
polySize = 0;
@ -151,7 +152,7 @@ void Foam::RBFInterpolation::calcB() const
// Collect ALL control points from ALL CPUs
// Create an identical inverse for all CPUs
BPtr_ = new scalarMatrix(A.LUinvert());
BPtr_ = new scalarSquareMatrix(A.LUinvert());
}

View file

@ -99,7 +99,7 @@ class RBFInterpolation
autoPtr<RBFFunction> RBF_;
//- Interpolation matrix
mutable scalarMatrix* BPtr_;
mutable scalarSquareMatrix* BPtr_;
//- Focal point for cut-off radii
point focalPoint_;
@ -124,7 +124,7 @@ class RBFInterpolation
//- Return interpolation matrix
const scalarMatrix& B() const;
const scalarSquareMatrix& B() const;
//- Calculate interpolation matrix
void calcB() const;

View file

@ -72,7 +72,7 @@ Foam::tmp<Foam::Field<Type> > Foam::RBFInterpolation::interpolate
// 3) Return displacements using tresult()
const label nControlPoints = controlPoints_.size();
const scalarMatrix& B_ = B();
const scalarSquareMatrix& mat = B();
// Determine interpolation coefficients
Field<Type> alpha(nControlPoints, pTraits<Type>::zero);
@ -82,7 +82,7 @@ Foam::tmp<Foam::Field<Type> > Foam::RBFInterpolation::interpolate
{
for (label col = 0; col < nControlPoints; col++)
{
alpha[row] += B_[row][col]*ctrlField[col];
alpha[row] += mat[row][col]*ctrlField[col];
}
}
@ -97,7 +97,7 @@ Foam::tmp<Foam::Field<Type> > Foam::RBFInterpolation::interpolate
{
for (label col = 0; col < nControlPoints; col++)
{
beta[row - nControlPoints] += B_[row][col]*ctrlField[col];
beta[row - nControlPoints] += mat[row][col]*ctrlField[col];
}
}
}

View file

@ -101,7 +101,7 @@ Foam::LUscalarMatrix::LUscalarMatrix
nCells += lduMatrices[i].size();
}
scalarSquareMatrix m(nCells, nCells, 0.0);
scalarSquareMatrix m(nCells, 0.0);
transfer(m);
convert(lduMatrices);
}
@ -109,7 +109,7 @@ Foam::LUscalarMatrix::LUscalarMatrix
else
{
label nCells = ldum.lduAddr().size();
scalarSquareMatrix m(nCells, nCells, 0.0);
scalarSquareMatrix m(nCells, 0.0);
transfer(m);
convert(ldum, interfaceCoeffs, interfaces);
}

View file

@ -65,14 +65,9 @@ public:
//- Construct given number of rows/columns.
inline SquareMatrix(const label n);
//- Construct given number of rows and columns,
// It checks that m == n.
inline SquareMatrix(const label m, const label n);
//- Construct with given number of rows and rows
// and value for all elements.
// It checks that m == n.
inline SquareMatrix(const label m, const label n, const Type&);
inline SquareMatrix(const label n, const Type&);
//- Construct from Istream.
inline SquareMatrix(Istream&);

View file

@ -33,45 +33,24 @@ inline Foam::SquareMatrix<Type>::SquareMatrix()
Matrix<SquareMatrix<Type>, Type>()
{}
template<class Type>
inline Foam::SquareMatrix<Type>::SquareMatrix(const label n)
:
Matrix<SquareMatrix<Type>, Type>(n, n)
{}
template<class Type>
inline Foam::SquareMatrix<Type>::SquareMatrix(const label m, const label n)
:
Matrix<SquareMatrix<Type>, Type>(m, n)
{
if (m != n)
{
FatalErrorIn
(
"SquareMatrix<Type>::SquareMatrix(const label m, const label n)"
) << "m != n for constructing a square matrix" << exit(FatalError);
}
}
template<class Type>
inline Foam::SquareMatrix<Type>::SquareMatrix
(
const label m,
const label n,
const Type& t
)
:
Matrix<SquareMatrix<Type>, Type>(m, n, t)
{
if (m != n)
{
FatalErrorIn
(
"SquareMatrix<Type>::SquareMatrix"
"(const label m, const label n, const Type&)"
) << "m != n for constructing a square matrix" << exit(FatalError);
}
}
Matrix<SquareMatrix<Type>, Type>(n, n, t)
{}
template<class Type>
inline Foam::SquareMatrix<Type>::SquareMatrix(Istream& is)
@ -79,6 +58,7 @@ inline Foam::SquareMatrix<Type>::SquareMatrix(Istream& is)
Matrix<SquareMatrix<Type>, Type>(is)
{}
template<class Type>
inline Foam::autoPtr<Foam::SquareMatrix<Type> >
Foam::SquareMatrix<Type>::clone() const

View file

@ -27,114 +27,6 @@ License
#include "scalarMatrices.H"
#include "SVD.H"
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::LUDecompose
(
scalarSquareMatrix& matrix,
labelList& pivotIndices
)
{
label n = matrix.n();
scalar vv[n];
for (register label i=0; i<n; i++)
{
scalar largestCoeff = 0.0;
scalar temp;
const scalar* __restrict__ matrixi = matrix[i];
for (register label j=0; j<n; j++)
{
if ((temp = mag(matrixi[j])) > largestCoeff)
{
largestCoeff = temp;
}
}
if (largestCoeff == 0.0)
{
FatalErrorIn
(
"LUdecompose"
"(scalarSquareMatrix& matrix, labelList& rowIndices)"
) << "Singular matrix" << exit(FatalError);
}
vv[i] = 1.0/largestCoeff;
}
for (register label j=0; j<n; j++)
{
scalar* __restrict__ matrixj = matrix[j];
for (register label i=0; i<j; i++)
{
scalar* __restrict__ matrixi = matrix[i];
scalar sum = matrixi[j];
for (register label k=0; k<i; k++)
{
sum -= matrixi[k]*matrix[k][j];
}
matrixi[j] = sum;
}
label iMax = 0;
scalar largestCoeff = 0.0;
for (register label i=j; i<n; i++)
{
scalar* __restrict__ matrixi = matrix[i];
scalar sum = matrixi[j];
for (register label k=0; k<j; k++)
{
sum -= matrixi[k]*matrix[k][j];
}
matrixi[j] = sum;
scalar temp;
if ((temp = vv[i]*mag(sum)) >= largestCoeff)
{
largestCoeff = temp;
iMax = i;
}
}
pivotIndices[j] = iMax;
if (j != iMax)
{
scalar* __restrict__ matrixiMax = matrix[iMax];
for (register label k=0; k<n; k++)
{
Swap(matrixj[k], matrixiMax[k]);
}
vv[iMax] = vv[j];
}
if (matrixj[j] == 0.0)
{
matrixj[j] = SMALL;
}
if (j != n-1)
{
scalar rDiag = 1.0/matrixj[j];
for (register label i=j+1; i<n; i++)
{
matrix[i][j] *= rDiag;
}
}
}
}
// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
void Foam::multiply

View file

@ -40,6 +40,8 @@ SourceFiles
#include "RectangularMatrix.H"
#include "SquareMatrix.H"
#include "DiagonalMatrix.H"
#include "scalarSquareMatrix.H"
#include "scalarField.H"
#include "labelList.H"
@ -49,46 +51,8 @@ namespace Foam
{
typedef RectangularMatrix<scalar> scalarRectangularMatrix;
typedef SquareMatrix<scalar> scalarSquareMatrix;
typedef DiagonalMatrix<scalar> scalarDiagonalMatrix;
//- Solve the matrix using Gaussian elimination with pivoting,
// returning the solution in the source
template<class Type>
void solve(scalarSquareMatrix& matrix, Field<Type>& source);
//- Solve the matrix using Gaussian elimination with pivoting
// and return the solution
template<class Type>
void solve
(
Field<Type>& psi,
const scalarSquareMatrix& matrix,
const Field<Type>& source
);
//- LU decompose the matrix with pivoting
void LUDecompose
(
scalarSquareMatrix& matrix,
labelList& pivotIndices
);
//- LU back-substitution with given source, returning the solution
// in the source
template<class Type>
void LUBacksubstitute
(
const scalarSquareMatrix& luMmatrix,
const labelList& pivotIndices,
Field<Type>& source
);
//- Solve the matrix using LU decomposition with pivoting
// returning the LU form of the matrix and the solution in the source
template<class Type>
void LUsolve(scalarSquareMatrix& matrix, Field<Type>& source);
void multiply
(
scalarRectangularMatrix& answer, // value changed in return
@ -108,7 +72,7 @@ void multiply
(
scalarRectangularMatrix& answer, // value changed in return
const scalarRectangularMatrix& A,
const DiagonalMatrix<scalar>& B,
const scalarDiagonalMatrix& B,
const scalarRectangularMatrix& C
);
@ -126,12 +90,6 @@ scalarRectangularMatrix SVDinv
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "scalarMatricesTemplates.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -1,180 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 "scalarMatrices.H"
#include "Swap.H"
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
void Foam::solve
(
scalarSquareMatrix& tmpMatrix,
Field<Type>& sourceSol
)
{
label n = tmpMatrix.n();
// Elimination
for (register label i=0; i<n; i++)
{
label iMax = i;
scalar largestCoeff = mag(tmpMatrix[iMax][i]);
// Swap entries around to find a good pivot
for (register label j=i+1; j<n; j++)
{
if (mag(tmpMatrix[j][i]) > largestCoeff)
{
iMax = j;
largestCoeff = mag(tmpMatrix[iMax][i]);
}
}
if (i != iMax)
{
//Info<< "Pivoted on " << i << " " << iMax << endl;
for (register label k=i; k<n; k++)
{
Swap(tmpMatrix[i][k], tmpMatrix[iMax][k]);
}
Swap(sourceSol[i], sourceSol[iMax]);
}
// Check that the system of equations isn't singular
if (mag(tmpMatrix[i][i]) < 1e-20)
{
FatalErrorIn("solve(scalarSquareMatrix&, Field<Type>& sourceSol)")
<< "Singular Matrix"
<< exit(FatalError);
}
// Reduce to upper triangular form
for (register label j=i+1; j<n; j++)
{
sourceSol[j] -= sourceSol[i]*(tmpMatrix[j][i]/tmpMatrix[i][i]);
for (register label k=n-1; k>=i; k--)
{
tmpMatrix[j][k] -=
tmpMatrix[i][k]*tmpMatrix[j][i]/tmpMatrix[i][i];
}
}
}
// Back-substitution
for (register label j=n-1; j>=0; j--)
{
Type ntempvec = pTraits<Type>::zero;
for (register label k=j+1; k<n; k++)
{
ntempvec += tmpMatrix[j][k]*sourceSol[k];
}
sourceSol[j] = (sourceSol[j] - ntempvec)/tmpMatrix[j][j];
}
}
template<class Type>
void Foam::solve
(
Field<Type>& psi,
const scalarSquareMatrix& matrix,
const Field<Type>& source
)
{
scalarSquareMatrix tmpMatrix = matrix;
psi = source;
solve(tmpMatrix, psi);
}
template<class Type>
void Foam::LUBacksubstitute
(
const scalarSquareMatrix& luMatrix,
const labelList& pivotIndices,
Field<Type>& sourceSol
)
{
label n = luMatrix.n();
label ii = 0;
for (register label i=0; i<n; i++)
{
label ip = pivotIndices[i];
Type sum = sourceSol[ip];
sourceSol[ip] = sourceSol[i];
const scalar* __restrict__ luMatrixi = luMatrix[i];
if (ii != 0)
{
for (label j=ii-1; j<i; j++)
{
sum -= luMatrixi[j]*sourceSol[j];
}
}
else if (sum != pTraits<Type>::zero)
{
ii = i+1;
}
sourceSol[i] = sum;
}
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<n; j++)
{
sum -= luMatrixi[j]*sourceSol[j];
}
sourceSol[i] = sum/luMatrixi[i];
}
}
template<class Type>
void Foam::LUsolve
(
scalarSquareMatrix& matrix,
Field<Type>& sourceSol
)
{
labelList pivotIndices(matrix.n());
LUDecompose(matrix, pivotIndices);
LUBacksubstitute(matrix, pivotIndices, sourceSol);
}
// ************************************************************************* //

View file

@ -49,8 +49,8 @@ Foam::simpleMatrix<Type>::simpleMatrix
{}
template<class T>
Foam::simpleMatrix<T>::simpleMatrix
template<class Type>
Foam::simpleMatrix<Type>::simpleMatrix
(
const scalarSquareMatrix& matrix,
const Field<Type>& source
@ -76,10 +76,10 @@ Foam::Field<Type> Foam::simpleMatrix<Type>::solve() const
{
// Since matrix and source are trashed during solution,
// a copy is made. HJ, 23/Dec/2008
scalarMatrix tmpMatrix = *this;
Field<T> sourceSol = source_;
scalarSquareMatrix tmpMatrix = *this;
Field<Type> sourceSol = source_;
scalarMatrix::solve(tmpMatrix, sourceSol);
scalarSquareMatrix::solve(tmpMatrix, sourceSol);
return sourceSol;
}
@ -90,10 +90,10 @@ Foam::Field<Type> Foam::simpleMatrix<Type>::LUsolve() const
{
// Since matrix and source are trashed during solution,
// a copy is made. HJ, 23/Dec/2008
scalarMatrix luMatrix = *this;
Field<T> sourceSol = source_;
scalarSquareMatrix luMatrix = *this;
Field<Type> sourceSol = source_;
scalarMatrix::LUsolve(luMatrix, sourceSol);
scalarSquareMatrix::LUsolve(luMatrix, sourceSol);
return sourceSol;
}

View file

@ -148,14 +148,10 @@ public:
void operator=(const simpleMatrix<Type>&);
// Friend Operators
// Ostream Operator
friend simpleMatrix<T> operator+ <T>
friend Ostream& operator<< <Type>
(
const simpleMatrix<T>&,
const simpleMatrix<T>&
Ostream&,
const simpleMatrix<Type>&
);

View file

@ -59,7 +59,10 @@ const Type& Foam::MeshObject<Mesh, Type>::New
}
else
{
return mesh.thisDb().objectRegistry::lookupObject<Type>(Type::typeName);
return mesh.thisDb().objectRegistry::lookupObject<Type>
(
Type::typeName
);
}
}
@ -78,7 +81,10 @@ const Type& Foam::MeshObject<Mesh, Type>::New
}
else
{
return mesh.thisDb().objectRegistry::lookupObject<Type>(Type::typeName);
return mesh.thisDb().objectRegistry::lookupObject<Type>
(
Type::typeName
);
}
}
@ -98,7 +104,10 @@ const Type& Foam::MeshObject<Mesh, Type>::New
}
else
{
return mesh.thisDb().objectRegistry::lookupObject<Type>(Type::typeName);
return mesh.thisDb().objectRegistry::lookupObject<Type>
(
Type::typeName
);
}
}
@ -119,7 +128,10 @@ const Type& Foam::MeshObject<Mesh, Type>::New
}
else
{
return mesh.thisDb().objectRegistry::lookupObject<Type>(Type::typeName);
return mesh.thisDb().objectRegistry::lookupObject<Type>
(
Type::typeName
);
}
}
@ -141,7 +153,10 @@ const Type& Foam::MeshObject<Mesh, Type>::New
}
else
{
return mesh.thisDb().objectRegistry::lookupObject<Type>(Type::typeName);
return mesh.thisDb().objectRegistry::lookupObject<Type>
(
Type::typeName
);
}
}
@ -178,4 +193,17 @@ Foam::MeshObject<Mesh, Type>::~MeshObject()
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Mesh, class Type>
bool Foam::MeshObject<Mesh, Type>::deleteObject() const
{
return mesh().thisDb().checkOut
(
const_cast<MeshObject<Mesh, Type>&>(*this)
);
}
// ************************************************************************* //

View file

@ -115,6 +115,9 @@ public:
// Member Functions
//- Delete object from database
virtual bool deleteObject() const;
//- Return mesh reference
const Mesh& mesh() const
{

View file

@ -32,7 +32,7 @@ Description
Author
Hrvoje Jasak, Wikki Ltd
\*----------------------------------------------------------------------------*/
\*---------------------------------------------------------------------------*/
#include "meshObjectBase.H"

View file

@ -129,6 +129,32 @@ public:
}
}
//- Move points on all mesh objects
template<class Mesh>
static void allDelete(const Mesh& mesh)
{
HashTable<const meshObjectBase*> tbl =
mesh.objectRegistry::lookupClass<meshObjectBase>();
for
(
HashTable<const meshObjectBase*>::iterator iter =
tbl.begin();
iter != tbl.end();
++iter
)
{
const meshObjectBase& obj = *(iter());
if (Mesh::debug)
{
Info << "Deleting object " << obj.type() << endl;
obj.deleteObject();
}
}
}
// Destructor
@ -143,6 +169,9 @@ public:
//- Update after topology change
virtual bool updateMesh(const mapPolyMesh&) const = 0;
//- Delete object from database
virtual bool deleteObject() const = 0;
};

View file

@ -95,18 +95,13 @@ Foam::pointBoundaryMesh::globalPatch() const
}
void Foam::pointBoundaryMesh::movePoints(const pointField& p)
void Foam::pointBoundaryMesh::movePoints()
{
pointPatchList& patches = *this;
forAll(patches, patchi)
{
patches[patchi].initMovePoints(p);
}
forAll(patches, patchi)
{
patches[patchi].movePoints(p);
patches[patchi].movePoints();
}
}

View file

@ -102,7 +102,7 @@ public:
const globalPointPatch& globalPatch() const;
//- Correct polyBoundaryMesh after moving points
void movePoints(const pointField&);
void movePoints();
//- Correct polyBoundaryMesh after topology update
void updateMesh();

View file

@ -32,9 +32,14 @@ License
#include "MapGeometricFields.H"
#include "MapPointField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
defineTypeNameAndDebug(Foam::pointMesh, 0);
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void Foam::pointMesh::mapFields(const mapPolyMesh& mpm)
void Foam::pointMesh::mapFields(const mapPolyMesh& mpm) const
{
// Create a mapper
const pointMeshMapper m(*this, mpm);
@ -48,8 +53,10 @@ void Foam::pointMesh::mapFields(const mapPolyMesh& mpm)
pointMeshMapper,
pointMesh
>(m);
MapGeometricFields<symmTensor, pointPatchField, pointMeshMapper, pointMesh>
(m);
MapGeometricFields<tensor, pointPatchField, pointMeshMapper, pointMesh>(m);
}
@ -91,18 +98,26 @@ Foam::pointMesh::pointMesh
}
void Foam::pointMesh::movePoints(const pointField& newPoints)
bool Foam::pointMesh::movePoints() const
{
boundary_.movePoints(newPoints);
// Casting const-ness to answer the interface of meshObject
// HJ, 30/Aug/2010
const_cast<pointBoundaryMesh&>(boundary_).movePoints();
return true;
}
void Foam::pointMesh::updateMesh(const mapPolyMesh& mpm)
bool Foam::pointMesh::updateMesh(const mapPolyMesh& mpm) const
{
boundary_.updateMesh();
// Casting const-ness to answer the interface of meshObject
// HJ, 30/Aug/2010
const_cast<pointBoundaryMesh&>(boundary_).updateMesh();
// Map all registered point fields
mapFields(mpm);
return true;
}

View file

@ -60,18 +60,21 @@ class pointMesh
// Private Member Functions
//- Map all fields
void mapFields(const mapPolyMesh&);
//- Disallow default bitwise copy construct
pointMesh(const pointMesh&);
//- Disallow default bitwise assignment
void operator=(const pointMesh&);
//- Map all fields
void mapFields(const mapPolyMesh&) const;
public:
// Declare name of the class and its debug switch
ClassName("pointMesh");
typedef pointMesh Mesh;
typedef pointBoundaryMesh BoundaryMesh;
@ -106,7 +109,7 @@ public:
// HJ, 16/Oct/2008
label nPoints() const
{
return mesh.GeoMesh<polyMesh>::mesh_.nPoints();
return GeoMesh<polyMesh>::mesh_.nPoints();
}
//- Return number of points
@ -115,7 +118,7 @@ public:
// HJ, 16/Oct/2008
label nCells() const
{
return mesh.GeoMesh<polyMesh>::mesh_.nCells();
return GeoMesh<polyMesh>::mesh_.nCells();
}
//- Return reference to boundary mesh
@ -140,10 +143,10 @@ public:
// Mesh motion
//- Move points, returns volumes swept by faces in motion
void movePoints(const pointField&);
virtual bool movePoints() const;
//- Update the mesh corresponding to given map
void updateMesh(const mapPolyMesh& mpm);
virtual bool updateMesh(const mapPolyMesh& mpm) const;
// Member Operators

View file

@ -100,7 +100,7 @@ public:
//- Return reference to objectRegistry storing fields. Can be
// removed once fields stored on pointMesh.
const objectRegistry& db() const
const objectRegistry& thisDb() const
{
return mesh_();
}

View file

@ -76,11 +76,8 @@ protected:
//- Calculate the patch geometry
virtual void calcGeometry() = 0;
//- Initialise the patches for moving points
virtual void initMovePoints(const pointField&) = 0;
//- Correct patches after moving points
virtual void movePoints(const pointField&) = 0;
virtual void movePoints() = 0;
//- Initialise the update of the patch topology
virtual void initUpdateMesh() = 0;

View file

@ -149,14 +149,6 @@ void Foam::cyclicPointPatch::calcGeometry()
}
void cyclicPointPatch::initMovePoints(const pointField&)
{}
void cyclicPointPatch::movePoints(const pointField&)
{}
void cyclicPointPatch::initUpdateMesh()
{
facePointPatch::initUpdateMesh();

View file

@ -58,6 +58,13 @@ class cyclicPointPatch
const cyclicPolyPatch& cyclicPolyPatch_;
// Demand driven private data
//- The set of pairs of points that require transformation
// and/or mapping
edgeList transformPairs_;
// Private Member Functions
//- Disallow default construct as copy
@ -67,11 +74,9 @@ class cyclicPointPatch
void operator=(const cyclicPointPatch&);
// Demand driven private data
protected:
//- The set of pairs of points that require transformation
// and/or mapping
edgeList transformPairs_;
// Protected Member Functions
//- Initialise the calculation of the patch geometry
virtual void initGeometry();
@ -79,11 +84,9 @@ class cyclicPointPatch
//- Calculate the patch geometry
virtual void calcGeometry();
//- Initialise the patches for moving points
virtual void initMovePoints(const pointField&);
//- Correct patches after moving points
virtual void movePoints(const pointField&);
virtual void movePoints()
{}
//- Initialise the update of the patch topology
virtual void initUpdateMesh();

View file

@ -65,14 +65,6 @@ void Foam::cyclicGgiPointPatch::calcGeometry()
}
void Foam::cyclicGgiPointPatch::initMovePoints(const pointField&)
{}
void Foam::cyclicGgiPointPatch::movePoints(const pointField&)
{}
void Foam::cyclicGgiPointPatch::initUpdateMesh()
{
facePointPatch::initUpdateMesh();

View file

@ -73,17 +73,19 @@ class cyclicGgiPointPatch
void operator=(const cyclicGgiPointPatch&);
protected:
// Protected Member Functions
//- Initialise the calculation of the patch geometry
virtual void initGeometry();
//- Calculate mesh points
virtual void calcGeometry();
//- Initialise the patches for moving points
virtual void initMovePoints(const pointField&);
//- Correct patches after moving points
virtual void movePoints(const pointField&);
virtual void movePoints()
{}
//- Initialise the update of the patch topology
virtual void initUpdateMesh();

View file

@ -65,14 +65,6 @@ void Foam::ggiPointPatch::calcGeometry()
}
void Foam::ggiPointPatch::initMovePoints(const pointField&)
{}
void Foam::ggiPointPatch::movePoints(const pointField&)
{}
void Foam::ggiPointPatch::initUpdateMesh()
{
facePointPatch::initUpdateMesh();

View file

@ -70,17 +70,19 @@ class ggiPointPatch
void operator=(const ggiPointPatch&);
protected:
// Protected Member Functions
//- Initialise the calculation of the patch geometry
virtual void initGeometry();
//- Calculate mesh points
virtual void calcGeometry();
//- Initialise the patches for moving points
virtual void initMovePoints(const pointField&);
//- Correct patches after moving points
virtual void movePoints(const pointField&);
virtual void movePoints()
{}
//- Initialise the update of the patch topology
virtual void initUpdateMesh();

View file

@ -65,14 +65,6 @@ void Foam::overlapGgiPointPatch::calcGeometry()
}
void Foam::overlapGgiPointPatch::initMovePoints(const pointField&)
{}
void Foam::overlapGgiPointPatch::movePoints(const pointField&)
{}
void Foam::overlapGgiPointPatch::initUpdateMesh()
{
facePointPatch::initUpdateMesh();

View file

@ -70,6 +70,10 @@ class overlapGgiPointPatch
void operator=(const overlapGgiPointPatch&);
protected:
// Protected Member Functions
//- Initialise the calculation of the patch geometry
virtual void initGeometry();
@ -80,7 +84,7 @@ class overlapGgiPointPatch
virtual void initMovePoints(const pointField&);
//- Correct patches after moving points
virtual void movePoints(const pointField&);
virtual void movePoints();
//- Initialise the update of the patch topology
virtual void initUpdateMesh();

View file

@ -291,7 +291,8 @@ void Foam::processorPointPatch::calcPatchPatchPoints()
const labelList& patchPoints = patchPatchPoints[patchi];
const List<vector>& patchPointNormals = patchPatchPointNormals[patchi];
// If there are potentially shared points for the patch being considered
// If there are potentially shared points for the patch
// being considered
if (patchPoints.size())
{
// Get the current meshPoints list for the patch
@ -360,14 +361,6 @@ void Foam::processorPointPatch::calcPatchPatchPoints()
}
void processorPointPatch::initMovePoints(const pointField&)
{}
void processorPointPatch::movePoints(const pointField&)
{}
void processorPointPatch::initUpdateMesh()
{
facePointPatch::initUpdateMesh();

View file

@ -66,27 +66,34 @@ class processorPointPatch
// Private Member Functions
//- Initialise the calculation of the patch geometry
//- Disallow default construct as copy
processorPointPatch(const processorPointPatch&);
//- Disallow default assignment
void operator=(const processorPointPatch&);
//- Initialise the points on this patch which are should also be
// on a neighbouring patch but are not part of faces of that patch
void initPatchPatchPoints();
//- Calculate the points on this patch which are should also be
// on a neighbouring patch but are not part of faces of that patch
void calcPatchPatchPoints();
protected:
//- Initialise the calculation of the patch geometry
virtual void initGeometry();
//- Calculate the patch geometry
virtual void calcGeometry();
//- Initialise the points on this patch which are should also be
// on a neighbouring patch but are not part of faces of that patch
void initPatchPatchPoints();
//- Calculate the points on this patch which are should also be
// on a neighbouring patch but are not part of faces of that patch
void calcPatchPatchPoints();
//- Initialise the patches for moving points
virtual void initMovePoints(const pointField&);
//- Correct patches after moving points
virtual void movePoints(const pointField&);
virtual void movePoints()
{}
//- Initialise the update of the patch topology
virtual void initUpdateMesh();
@ -95,12 +102,6 @@ class processorPointPatch
virtual void updateMesh();
//- Disallow default construct as copy
processorPointPatch(const processorPointPatch&);
//- Disallow default assignment
void operator=(const processorPointPatch&);
public:
typedef coupledPointPatch CoupledPointPatch;

View file

@ -60,6 +60,7 @@ void Foam::regionCouplePointPatch::calcGeometry()
meshPoints_ = regionCouplePolyPatch_.meshPoints();
nonGlobalPatchPoints_.setSize(meshPoints_.size());
forAll(nonGlobalPatchPoints_, i)
{
nonGlobalPatchPoints_[i] = i;
@ -67,14 +68,6 @@ void Foam::regionCouplePointPatch::calcGeometry()
}
void Foam::regionCouplePointPatch::initMovePoints(const pointField&)
{}
void Foam::regionCouplePointPatch::movePoints(const pointField&)
{}
void Foam::regionCouplePointPatch::initUpdateMesh()
{
facePointPatch::initUpdateMesh();

View file

@ -70,17 +70,19 @@ class regionCouplePointPatch
void operator=(const regionCouplePointPatch&);
protected:
// Protected Member Functions
//- Initialise the calculation of the patch geometry
virtual void initGeometry();
//- Calculate mesh points
virtual void calcGeometry();
//- Initialise the patches for moving points
virtual void initMovePoints(const pointField&);
//- Correct patches after moving points
virtual void movePoints(const pointField&);
virtual void movePoints()
{}
//- Initialise the update of the patch topology
virtual void initUpdateMesh();

View file

@ -26,8 +26,7 @@ License
#include "globalPointPatch.H"
#include "globalMeshData.H"
#include "triFace.H"
#include "triFaceList.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -55,7 +54,7 @@ Foam::globalPointPatch::~globalPointPatch()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
triFaceList globalPointPatch::faceTriangles
Foam::triFaceList Foam::globalPointPatch::faceTriangles
(
const label
) const
@ -65,67 +64,67 @@ triFaceList globalPointPatch::faceTriangles
"processorPointPatch::faceTriangles(label faceID) const"
);
return List<triFace>::null();
return triFaceList::null();
}
const edgeList& globalPointPatch::meshEdges() const
const Foam::edgeList& Foam::globalPointPatch::meshEdges() const
{
notImplemented("globalPointPatch::meshEdges() const");
return edgeList::null();
}
const labelList& globalPointPatch::sharedEdgeAddr() const
const Foam::labelList& Foam::globalPointPatch::sharedEdgeAddr() const
{
notImplemented("globalPointPatch::sharedEdgeAddr() const");
return labelList::null();
}
const edgeList& globalPointPatch::meshCutEdges() const
const Foam::edgeList& Foam::globalPointPatch::meshCutEdges() const
{
notImplemented("globalPointPatch::meshCutEdges() const");
return edgeList::null();
}
const scalarField& globalPointPatch::meshCutEdgeMask() const
const Foam::scalarField& Foam::globalPointPatch::meshCutEdgeMask() const
{
notImplemented("globalPointPatch::meshCutEdgeMask() const");
return scalarField::null();
}
const labelList& globalPointPatch::localEdgeIndices() const
const Foam::labelList& Foam::globalPointPatch::localEdgeIndices() const
{
notImplemented("globalPointPatch::localEdgeIndices() const");
return labelList::null();
}
const labelList& globalPointPatch::cutEdgeIndices() const
const Foam::labelList& Foam::globalPointPatch::cutEdgeIndices() const
{
notImplemented("globalPointPatch::cutEdgeIndices() const");
return labelList::null();
}
const labelList& globalPointPatch::cutEdgeOwnerIndices() const
const Foam::labelList& Foam::globalPointPatch::cutEdgeOwnerIndices() const
{
notImplemented("globalPointPatch::cutEdgeOwnerIndices() const");
return labelList::null();
}
const labelList& globalPointPatch::cutEdgeOwnerStart() const
const Foam::labelList& Foam::globalPointPatch::cutEdgeOwnerStart() const
{
notImplemented("globalPointPatch::cutEdgeOwnerStart() const");
return labelList::null();
}
const labelList& globalPointPatch::cutEdgeNeighbourIndices() const
const Foam::labelList& Foam::globalPointPatch::cutEdgeNeighbourIndices() const
{
notImplemented
(
@ -135,35 +134,35 @@ const labelList& globalPointPatch::cutEdgeNeighbourIndices() const
}
const labelList& globalPointPatch::cutEdgeNeighbourStart() const
const Foam::labelList& Foam::globalPointPatch::cutEdgeNeighbourStart() const
{
notImplemented("globalPointPatch::cutEdgeNeighbourStart() const");
return labelList::null();
}
const labelList& globalPointPatch::doubleCutEdgeIndices() const
const Foam::labelList& Foam::globalPointPatch::doubleCutEdgeIndices() const
{
notImplemented("globalPointPatch::doubleCutEdgeIndices() const");
return labelList::null();
}
const labelList& globalPointPatch::doubleCutOwner() const
const Foam::labelList& Foam::globalPointPatch::doubleCutOwner() const
{
notImplemented("globalPointPatch::doubleCutOwner() const");
return labelList::null();
}
const labelList& globalPointPatch::doubleCutNeighbour() const
const Foam::labelList& Foam::globalPointPatch::doubleCutNeighbour() const
{
notImplemented("globalPointPatch::doubleCutNeighbour() const");
return labelList::null();
}
const scalarField& globalPointPatch::ownNeiDoubleMask() const
const Foam::scalarField& Foam::globalPointPatch::ownNeiDoubleMask() const
{
notImplemented("globalPointPatch::ownNeiDoubleMask() const");
return scalarField::null();

View file

@ -64,6 +64,8 @@ class globalPointPatch
label index_;
protected:
// Protected Member Functions
//- Initialise the calculation of the patch geometry
@ -74,12 +76,8 @@ class globalPointPatch
virtual void calcGeometry()
{}
//- Initialise the patches for moving points
virtual void initMovePoints(const pointField&)
{}
//- Correct patches after moving points
virtual void movePoints(const pointField&)
virtual void movePoints()
{}
//- Initialise the update of the patch topology

View file

@ -30,4 +30,5 @@ License
defineTypeNameAndDebug(Foam::pointPatch, 0);
// ************************************************************************* //

View file

@ -75,7 +75,7 @@ protected:
// Protected Member Functions
// The pointPatch geometry initialisation is called by pointBoundaryMesh
// The geometry initialisation is called by pointBoundaryMesh
friend class pointBoundaryMesh;
//- Initialise the calculation of the patch geometry
@ -86,15 +86,11 @@ protected:
virtual void calcGeometry()
{}
//- Initialise the patches for moving points
virtual void initMovePoints(const pointField&)
{}
//- Correct patches after moving points
virtual void movePoints(const pointField&)
virtual void movePoints()
{}
//- Initialise the update of the patch topology
//- Initialise update of the patch topology
virtual void initUpdateMesh()
{}

View file

@ -31,7 +31,7 @@ License
#include "emptyPolyPatch.H"
#include "globalMeshData.H"
#include "processorPolyPatch.H"
#include "OSspecific.H"
#include "meshObjectBase.H"
#include "demandDrivenData.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -663,7 +663,6 @@ Foam::polyMesh::polyMesh
void Foam::polyMesh::resetPrimitives
(
const label nUsedFaces,
const Xfer<pointField>& pts,
const Xfer<faceList>& fcs,
const Xfer<labelList>& own,
@ -689,7 +688,8 @@ void Foam::polyMesh::resetPrimitives
if (&fcs)
{
allGaces_.transfer(fcs());
allFaces_.transfer(fcs());
// Faces will be reset in initMesh(), using size of owner list
}
if (&own)
@ -731,7 +731,6 @@ void Foam::polyMesh::resetPrimitives
(
"polyMesh::polyMesh::resetPrimitives\n"
"(\n"
" const label nUsedFaces,\n"
" const Xfer<pointField>& points,\n"
" const Xfer<faceList>& faces,\n"
" const Xfer<labelList>& owner,\n"
@ -748,7 +747,6 @@ void Foam::polyMesh::resetPrimitives
(
"polyMesh::polyMesh::resetPrimitives\n"
"(\n"
" const label nUsedFaces,\n"
" const Xfer<pointField>& points,\n"
" const Xfer<faceList>& faces,\n"
" const Xfer<labelList>& owner,\n"
@ -791,7 +789,6 @@ void Foam::polyMesh::resetPrimitives
(
"polyMesh::polyMesh::resetPrimitives\n"
"(\n"
" const label nUsedFaces,\n"
" const Xfer<pointField>&,\n"
" const Xfer<faceList>&,\n"
" const Xfer<labelList>& owner,\n"
@ -803,6 +800,11 @@ void Foam::polyMesh::resetPrimitives
<< "no points or no cells in mesh" << endl;
}
}
// Update zones. 1.6.x merge. HJ, 30/Aug/2010
pointZones_.updateMesh();
faceZones_.updateMesh();
cellZones_.updateMesh();
}
@ -1155,7 +1157,7 @@ Foam::tmp<Foam::scalarField> Foam::polyMesh::movePoints
tmp<scalarField> sweptVols = primitiveMesh::movePoints
(
points_,
oldAllPoints()
oldPoints()
);
// Adjust parallel shared points
@ -1177,6 +1179,10 @@ Foam::tmp<Foam::scalarField> Foam::polyMesh::movePoints
geometricD_ = Vector<label>::zero;
solutionD_ = Vector<label>::zero;
// Update all function objects
// Moved from fvMesh.C in 1.6.x merge. HJ, 29/Aug/2010
meshObjectBase::allMovePoints<polyMesh>(*this);
return sweptVols;
}
@ -1193,7 +1199,7 @@ void Foam::polyMesh::resetMotion() const
void Foam::polyMesh::setOldPoints
(
const pointField& setPoints
)
)
{
if(setPoints.size() != allPoints_.size())
@ -1204,7 +1210,8 @@ void Foam::polyMesh::setOldPoints
"(\n"
" const pointField& setPoints\n"
")\n"
) << "setPoints size " << setPoints.size() << "different from the mesh points size "
) << "setPoints size " << setPoints.size()
<< "different from the mesh points size "
<< allPoints_.size()
<< abort(FatalError);
}
@ -1215,7 +1222,7 @@ void Foam::polyMesh::setOldPoints
deleteDemandDrivenData(oldAllPointsPtr_);
deleteDemandDrivenData(oldPointsPtr_);
allPoints_ = setPoints;
oldAllPointsPtr_ = new pointField(allPoints_);
oldAllPointsPtr_ = new pointField(allPoints_);
oldPointsPtr_ = new pointField::subField(oldAllPoints(), nPoints());
curMotionTimeIndex_ = 0;
primitiveMesh::clearGeom();
@ -1323,6 +1330,7 @@ void Foam::polyMesh::removeFiles(const fileName& instanceDir) const
}
}
void Foam::polyMesh::removeFiles() const
{
removeFiles(instance());

View file

@ -478,7 +478,6 @@ public:
// patch ends at nActiveFaces) and change patches with addPatches.
void resetPrimitives
(
const label nUsedFaces,
const Xfer<pointField>& points,
const Xfer<faceList>& faces,
const Xfer<labelList>& owner,

View file

@ -29,9 +29,6 @@ License
#include "globalMeshData.H"
#include "demandDrivenData.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::polyMesh::removeBoundary()
@ -93,8 +90,6 @@ void Foam::polyMesh::clearGeom()
// Reset valid directions (could change with rotation)
geometricD_ = Vector<label>::zero;
solutionD_ = Vector<label>::zero;
pointMesh::Delete(*this);
}
@ -116,8 +111,6 @@ void Foam::polyMesh::clearAddressing()
// Reset valid directions
geometricD_ = Vector<label>::zero;
solutionD_ = Vector<label>::zero;
pointMesh::Delete(*this);
}

View file

@ -31,6 +31,7 @@ Description
#include "mapPolyMesh.H"
#include "Time.H"
#include "globalMeshData.H"
#include "meshObjectBase.H"
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
@ -74,6 +75,12 @@ void Foam::polyMesh::updateMesh(const mapPolyMesh& mpm)
geometricD_ = Vector<label>::zero;
solutionD_ = Vector<label>::zero;
// Update all function objects
// Moved from fvMesh.C in 1.6.x merge. HJ, 29/Aug/2010
meshObjectBase::allUpdateTopology<polyMesh>(*this, mpm);
}
// Sync mesh update with changes on other processors
void Foam::polyMesh::syncUpdateMesh()
{
@ -89,10 +96,18 @@ void Foam::polyMesh::syncUpdateMesh()
deleteDemandDrivenData(globalMeshDataPtr_);
setInstance(time().timeName());
// Reset valid directions (could change by faces put into empty patches)
geometricD_ = Vector<label>::zero;
solutionD_ = Vector<label>::zero;
// Update all function objects
// Moved from fvMesh.C in 1.6.x merge. HJ, 29/Aug/2010
// Instantiate a dummy mapPolyMesh
autoPtr<mapPolyMesh> mapPtr(new mapPolyMesh(*this));
meshObjectBase::allUpdateTopology<polyMesh>(*this, mapPtr());
}

View file

@ -33,8 +33,6 @@ License
defineTypeNameAndDebug(Foam::coupledPolyPatch, 0);
Foam::scalar Foam::coupledPolyPatch::matchTol = 1E-3;
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //

View file

@ -538,7 +538,7 @@ void Foam::cyclicPolyPatch::getCentresAndAnchors
const primitivePatch& pp,
const faceList& half0Faces,
const faceList& half1Faces,
pointField& ppPoints,
pointField& half0Ctrs,
pointField& half1Ctrs,
pointField& anchors0,
@ -770,7 +770,7 @@ Foam::cyclicPolyPatch::cyclicPolyPatch
transform_(UNKNOWN),
rotationAxis_(vector::zero),
rotationCentre_(point::zero),
rotationAngle_(0)
rotationAngle_(0),
separationVector_(vector::zero)
{}
@ -790,7 +790,7 @@ Foam::cyclicPolyPatch::cyclicPolyPatch
transform_(UNKNOWN),
rotationAxis_(vector::zero),
rotationCentre_(point::zero),
rotationAngle_(0)
rotationAngle_(0),
separationVector_(vector::zero)
{
dict.readIfPresent("featureCos", featureCos_);

View file

@ -96,9 +96,6 @@ class cellZone
//- Build map of local cell indices
void calcCellLookupMap() const;
//- Clear addressing
void clearAddressing();
public:
@ -238,6 +235,9 @@ public:
//- Return zoneMesh reference
const cellZoneMesh& zoneMesh() const;
//- Clear addressing
void clearAddressing();
//- Check zone definition. Return true if in error.
bool checkDefinition(const bool report = false) const;

View file

@ -34,6 +34,7 @@ Description
#include "primitiveMesh.H"
#include "demandDrivenData.H"
#include "mapPolyMesh.H"
#include "syncTools.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -539,8 +540,9 @@ bool Foam::faceZone::checkParallelSync(const bool report) const
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
{
boolList neiZoneFace(mesh.nFaces()-mesh.nInternalFaces(), false);
boolList neiZoneFlip(mesh.nFaces()-mesh.nInternalFaces(), false);
boolList neiZoneFace(mesh.nFaces() - mesh.nInternalFaces(), false);
boolList neiZoneFlip(mesh.nFaces() - mesh.nInternalFaces(), false);
forAll(*this, i)
{
label faceI = operator[](i);
@ -551,6 +553,7 @@ bool Foam::faceZone::checkParallelSync(const bool report) const
neiZoneFlip[faceI-mesh.nInternalFaces()] = flipMap()[i];
}
}
boolList myZoneFace(neiZoneFace);
syncTools::swapBoundaryFaceList(mesh, neiZoneFace, false);
boolList myZoneFlip(neiZoneFlip);

View file

@ -127,9 +127,6 @@ class faceZone
//- Check addressing
void checkAddressing() const;
//- Clear addressing
void clearAddressing();
public:
@ -296,6 +293,9 @@ public:
const labelList& meshEdges() const;
//- Clear addressing
void clearAddressing();
//- Reset addressing and flip map (clearing demand-driven data)
void resetAddressing(const labelList&, const boolList&);

View file

@ -98,9 +98,6 @@ class pointZone
//- Build map of local point indices
void calcPointLookupMap() const;
//- Clear addressing
void clearAddressing();
public:
@ -240,6 +237,9 @@ public:
//- Return zoneMesh reference
const pointZoneMesh& zoneMesh() const;
//- Clear addressing
void clearAddressing();
//- Check zone definition. Return true if in error.
bool checkDefinition(const bool report = false) const;

View file

@ -27,8 +27,6 @@ License
#include "primitiveMesh.H"
#include "demandDrivenData.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
defineTypeNameAndDebug(Foam::primitiveMesh, 0);
@ -38,11 +36,7 @@ defineTypeNameAndDebug(Foam::primitiveMesh, 0);
Foam::primitiveMesh::primitiveMesh()
:
nInternalPoints_(0), // note: points are considered ordered on empty mesh
nPoints_(0),
nInternal0Edges_(-1),
nInternal1Edges_(-1),
nInternalEdges_(-1),
nEdges_(-1),
nInternalFaces_(0),
nFaces_(0),
@ -83,7 +77,6 @@ Foam::primitiveMesh::primitiveMesh
const label nCells
)
:
nInternalPoints_(-1),
nPoints_(nPoints),
nEdges_(-1),
nInternalFaces_(nInternalFaces),

View file

@ -197,11 +197,14 @@ class primitiveMesh
//- Calculate edge list
void calcCellEdges() const;
//- Calculate point-edge addressing
void calcPointEdges() const;
//- Calculate point-point addressing
void calcPointPoints() const;
//- Calculate edges, pointEdges and faceEdges
void calcEdges(const bool) const;
void calcEdges() const;
//- During edge calculation, a larger set of data is assembled.
// Create and destroy as a set, using clearOutEdges()
@ -218,7 +221,7 @@ class primitiveMesh
);
//- For on-the-fly addressing calculation
static label findFirstCommonElementFromSortedLists
(
(
const labelList&,
const labelList&
);

View file

@ -36,7 +36,8 @@ const Foam::labelListList& Foam::primitiveMesh::edgeCells() const
{
if (debug)
{
Pout<< "primitiveMesh::edgeCells() : calculating edgeCells" << endl;
Pout<< "primitiveMesh::edgeCells() : calculating edgeCells"
<< endl;
if (debug == -1)
{

View file

@ -35,7 +35,8 @@ const Foam::labelListList& Foam::primitiveMesh::edgeFaces() const
{
if (debug)
{
Pout<< "primitiveMesh::edgeFaces() : calculating edgeFaces" << endl;
Pout<< "primitiveMesh::edgeFaces() : calculating edgeFaces"
<< endl;
if (debug == -1)
{

View file

@ -202,7 +202,7 @@ void Foam::hierarchGeomDecomp::findBinary
while (true)
{
label size = returnReduce(mid-minIndex, sumOp<label>());
label size = returnReduce(mid - minIndex, sumOp<label>());
if (debug)
{
@ -277,10 +277,10 @@ void Foam::hierarchGeomDecomp::findBinary
while (true)
{
label weightedSize = returnReduce
scalar weightedSize = returnReduce
(
sortedWeightedSizes[mid] - sortedWeightedSizes[minIndex],
sumOp<label>()
sumOp<scalar>()
);
if (debug)

View file

@ -1,6 +1,5 @@
EXE_INC = \
-I$(WM_THIRD_PARTY_DIR)/scotch_5.1/src/libscotch/lnInclude \
-I/usr/include/scotch \
-I$(WM_THIRD_PARTY_DIR)/scotch_5.1/src/libscotch \
-I../decompositionMethods/lnInclude
LIB_LIBS = \

View file

@ -134,7 +134,6 @@ $(derivedFvPatchFields)/movingWallVelocity/movingWallVelocityFvPatchVectorField.
$(derivedFvPatchFields)/translatingWallVelocity/translatingWallVelocityFvPatchVectorField.C
$(derivedFvPatchFields)/rotatingWallVelocity/rotatingWallVelocityFvPatchVectorField.C
$(derivedFvPatchFields)/movingRotatingWallVelocity/movingRotatingWallVelocityFvPatchVectorField.C
$(derivedFvPatchFields)/activeBaffleVelocity/activeBaffleVelocityFvPatchVectorField.C
$(derivedFvPatchFields)/oscillatingFixedValue/oscillatingFixedValueFvPatchFields.C
$(derivedFvPatchFields)/fixedMeanValue/fixedMeanValueFvPatchFields.C
$(derivedFvPatchFields)/outletInlet/outletInletFvPatchFields.C

View file

@ -65,6 +65,24 @@ void Foam::MRFZones::addCoriolis(fvVectorMatrix& UEqn) const
}
void Foam::MRFZones::relativeFlux(surfaceScalarField& phi) const
{
forAll(*this, i)
{
operator[](i).relativeFlux(phi);
}
}
void Foam::MRFZones::absoluteFlux(surfaceScalarField& phi) const
{
forAll(*this, i)
{
operator[](i).absoluteFlux(phi);
}
}
void Foam::MRFZones::addCoriolis
(
const volScalarField& rho,
@ -78,6 +96,32 @@ void Foam::MRFZones::addCoriolis
}
void Foam::MRFZones::relativeFlux
(
const surfaceScalarField& rho,
surfaceScalarField& phi
) const
{
forAll(*this, i)
{
operator[](i).relativeFlux(rho, phi);
}
}
void Foam::MRFZones::absoluteFlux
(
const surfaceScalarField& rho,
surfaceScalarField& phi
) const
{
forAll(*this, i)
{
operator[](i).absoluteFlux(rho, phi);
}
}
void Foam::MRFZones::relativeVelocity(volVectorField& U) const
{
forAll(*this, i)
@ -96,50 +140,6 @@ void Foam::MRFZones::absoluteVelocity(volVectorField& U) const
}
void Foam::MRFZones::relativeFlux(surfaceScalarField& phi) const
{
forAll(*this, i)
{
operator[](i).relativeFlux(phi);
}
}
void Foam::MRFZones::relativeFlux
(
const surfaceScalarField& rho,
surfaceScalarField& phi
) const
{
forAll(*this, i)
{
operator[](i).relativeFlux(rho, phi);
}
}
void Foam::MRFZones::absoluteFlux(surfaceScalarField& phi) const
{
forAll(*this, i)
{
operator[](i).absoluteFlux(phi);
}
}
void Foam::MRFZones::absoluteFlux
(
const surfaceScalarField& rho,
surfaceScalarField& phi
) const
{
forAll(*this, i)
{
operator[](i).absoluteFlux(rho, phi);
}
}
void Foam::MRFZones::correctBoundaryVelocity(volVectorField& U) const
{
forAll(*this, i)

View file

@ -72,54 +72,61 @@ public:
// Member Functions
//- Return raw correction flux
tmp<surfaceScalarField> fluxCorrection() const;
//- Add the Coriolis force contribution to the momentum equation
void addCoriolis(fvVectorMatrix& UEqn) const;
//- Add the Coriolis force contribution to the momentum equation
void addCoriolis(const volScalarField& rho, fvVectorMatrix& UEqn) const;
//- Return raw correction flux
tmp<surfaceScalarField> fluxCorrection() const;
//- Make the given absolute velocity relative within the MRF region
void relativeVelocity(volVectorField& U) const;
// Incompressible MRF
//- Make the given relative velocity absolute within the MRF region
void absoluteVelocity(volVectorField& U) const;
//- Add the Coriolis force contribution to the momentum equation
void addCoriolis(fvVectorMatrix& UEqn) const;
//- Make the given absolute flux relative within the MRF region
void relativeFlux(surfaceScalarField& phi) const;
//- Make the given absolute flux relative within the MRF region
void relativeFlux(surfaceScalarField& phiAbs) const;
//- Make the given absolute mass-flux relative within the MRF region
void relativeFlux
(
const surfaceScalarField& rho,
surfaceScalarField& phi
//- Make the given relative flux absolute within the MRF region
void absoluteFlux(surfaceScalarField& phiRel) const;
// Compressible MRF
//- Add the Coriolis force contribution to the momentum equation
// Use for equations with prefactor fields, eg. density.
// This is typically visible in the ddt term
// HJ, 12/Dec/2009
void addCoriolis
(
const volScalarField& rho,
fvVectorMatrix& UEqn
) const;
) const;
//- Make the given relative flux absolute within the MRF region
void absoluteFlux(surfaceScalarField& phi) const;
//- Make the given relative mass-flux absolute within the MRF region
void absoluteFlux
//- Make the given absolute flux relative within the MRF region
// Use for fluxes with prefactor fields, eg. density.
// For consistency, requires face-interpolated prefactor
// HJ. 12/Dec/2009
//- Make the given relative mass-flux absolute within the
// MRF region
void absoluteFlux
(
const surfaceScalarField& rho,
surfaceScalarField& phi
) const;
//- Make the given absolute flux relative within the MRF region
void relativeFlux
(
const surfaceScalarField& rho,
(
const surfaceScalarField& rhof,
surfaceScalarField& phi
) const;
surfaceScalarField& phiRel
) const;
//- Make the given absolute velocity relative within the MRF region
void relativeVelocity(volVectorField& Uabs) const;
//- Make the given relative velocity absolute within the MRF region
void absoluteVelocity(volVectorField& Urel) const;
//- Correct the boundary velocity for the roation of the MRF region
void correctBoundaryVelocity(volVectorField& U) const;

View file

@ -160,10 +160,6 @@ void directMappedFixedValueFvPatchField<Type>::updateCoeffs()
);
const mapDistribute& distMap = mpp.map();
// Get the scheduling information
const List<labelPair>& schedule = mpp.schedule();
const labelListList& sendCellLabels = mpp.sendCellLabels();
const labelListList& receiveFaceLabels = mpp.receiveFaceLabels();
// Force recalculation of schedule
distMap.schedule();

View file

@ -358,7 +358,6 @@ void timeVaryingMappedFixedValueFvPatchField<Type>::readSamplePoints()
referenceCS_.reset
(
new coordinateSystem
new cartesianCS
(
"reference",
p0, // origin

View file

@ -61,7 +61,7 @@ waveTransmissiveFvPatchField<Type>::waveTransmissiveFvPatchField
:
advectiveFvPatchField<Type>(ptf, p, iF, mapper),
psiName_(ptf.psiName_),
psiName_(ptf.UName_),
UName_(ptf.UName_),
gamma_(ptf.gamma_)
{}

View file

@ -98,7 +98,7 @@ fvsPatchField<Type>::fvsPatchField
Field<Type>("value", dict, p.size())
);
}
else
else if (!valueRequired)
{
fvsPatchField<Type>::operator=(pTraits<Type>::zero);
}

View file

@ -128,6 +128,7 @@ public:
bool fluxRequired(const word& name) const;
bool cache(const word& name) const;
// Edit

View file

@ -44,7 +44,7 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class centredCECCellToFaceStencilObject Declaration
Class centredCECCellToFaceStencilObject Declaration
\*---------------------------------------------------------------------------*/
class centredCECCellToFaceStencilObject
@ -81,6 +81,23 @@ public:
virtual ~centredCECCellToFaceStencilObject()
{}
// Member functions
//- Delete the stencil when the mesh moves
virtual bool movePoints() const
{
deleteObject();
return true;
}
//- Delete the stencil when mesh updates
virtual bool updateMesh(const mapPolyMesh&) const
{
deleteObject();
return true;
}
};

View file

@ -44,7 +44,7 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class centredCFCCellToFaceStencilObject Declaration
Class centredCFCCellToFaceStencilObject Declaration
\*---------------------------------------------------------------------------*/
class centredCFCCellToFaceStencilObject
@ -80,6 +80,24 @@ public:
//- Destructor
virtual ~centredCFCCellToFaceStencilObject()
{}
// Member functions
//- Delete the stencil when the mesh moves
virtual bool movePoints() const
{
deleteObject();
return true;
}
//- Delete the stencil when mesh updates
virtual bool updateMesh(const mapPolyMesh&) const
{
deleteObject();
return true;
}
};

View file

@ -44,7 +44,7 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class centredCPCCellToFaceStencilObject Declaration
Class centredCPCCellToFaceStencilObject Declaration
\*---------------------------------------------------------------------------*/
class centredCPCCellToFaceStencilObject
@ -81,6 +81,23 @@ public:
virtual ~centredCPCCellToFaceStencilObject()
{}
// Member functions
//- Delete the stencil when the mesh moves
virtual bool movePoints() const
{
deleteObject();
return true;
}
//- Delete the stencil when mesh updates
virtual bool updateMesh(const mapPolyMesh&) const
{
deleteObject();
return true;
}
};

View file

@ -44,7 +44,7 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class centredFECCellToFaceStencilObject Declaration
Class centredFECCellToFaceStencilObject Declaration
\*---------------------------------------------------------------------------*/
class centredFECCellToFaceStencilObject
@ -81,6 +81,23 @@ public:
virtual ~centredFECCellToFaceStencilObject()
{}
// Member functions
//- Delete the stencil when the mesh moves
virtual bool movePoints() const
{
deleteObject();
return true;
}
//- Delete the stencil when mesh updates
virtual bool updateMesh(const mapPolyMesh&) const
{
deleteObject();
return true;
}
};

View file

@ -81,6 +81,23 @@ public:
virtual ~pureUpwindCFCCellToFaceStencilObject()
{}
// Member functions
//- Delete the stencil when the mesh moves
virtual bool movePoints() const
{
deleteObject();
return true;
}
//- Delete the stencil when mesh updates
virtual bool updateMesh(const mapPolyMesh&) const
{
deleteObject();
return true;
}
};

View file

@ -44,7 +44,7 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class upwindCECCellToFaceStencilObject Declaration
Class upwindCECCellToFaceStencilObject Declaration
\*---------------------------------------------------------------------------*/
class upwindCECCellToFaceStencilObject
@ -88,6 +88,23 @@ public:
virtual ~upwindCECCellToFaceStencilObject()
{}
// Member functions
//- Delete the stencil when the mesh moves
virtual bool movePoints() const
{
deleteObject();
return true;
}
//- Delete the stencil when mesh updates
virtual bool updateMesh(const mapPolyMesh&) const
{
deleteObject();
return true;
}
};

View file

@ -44,7 +44,7 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class upwindCFCCellToFaceStencilObject Declaration
Class upwindCFCCellToFaceStencilObject Declaration
\*---------------------------------------------------------------------------*/
class upwindCFCCellToFaceStencilObject
@ -88,6 +88,23 @@ public:
virtual ~upwindCFCCellToFaceStencilObject()
{}
// Member functions
//- Delete the stencil when the mesh moves
virtual bool movePoints() const
{
deleteObject();
return true;
}
//- Delete the stencil when mesh updates
virtual bool updateMesh(const mapPolyMesh&) const
{
deleteObject();
return true;
}
};

View file

@ -44,7 +44,7 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class upwindCPCCellToFaceStencilObject Declaration
Class upwindCPCCellToFaceStencilObject Declaration
\*---------------------------------------------------------------------------*/
class upwindCPCCellToFaceStencilObject
@ -88,6 +88,23 @@ public:
virtual ~upwindCPCCellToFaceStencilObject()
{}
// Member functions
//- Delete the stencil when the mesh moves
virtual bool movePoints() const
{
deleteObject();
return true;
}
//- Delete the stencil when mesh updates
virtual bool updateMesh(const mapPolyMesh&) const
{
deleteObject();
return true;
}
};

View file

@ -44,7 +44,7 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class upwindFECCellToFaceStencilObject Declaration
Class upwindFECCellToFaceStencilObject Declaration
\*---------------------------------------------------------------------------*/
class upwindFECCellToFaceStencilObject
@ -88,6 +88,23 @@ public:
virtual ~upwindFECCellToFaceStencilObject()
{}
// Member functions
//- Delete the stencil when the mesh moves
virtual bool movePoints() const
{
deleteObject();
return true;
}
//- Delete the stencil when mesh updates
virtual bool updateMesh(const mapPolyMesh&) const
{
deleteObject();
return true;
}
};

View file

@ -292,7 +292,10 @@ Foam::extendedCellToFaceStencil::calcDistributeMap
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::extendedCellToFaceStencil::extendedCellToFaceStencil(const polyMesh& mesh)
Foam::extendedCellToFaceStencil::extendedCellToFaceStencil
(
const polyMesh& mesh
)
:
mesh_(mesh)
{

View file

@ -61,7 +61,7 @@ namespace Foam
class globalIndex;
/*---------------------------------------------------------------------------*\
Class extendedCellToFaceStencil Declaration
Class extendedCellToFaceStencil Declaration
\*---------------------------------------------------------------------------*/
class extendedCellToFaceStencil
@ -70,13 +70,10 @@ protected:
// Protected data
//- Reference to mesh
const polyMesh& mesh_;
// Protected Member Functions
private:
// Private Member Functions
@ -98,6 +95,7 @@ protected:
const mapDistribute& map
);
public:
// Declare name of the class and its debug switch

View file

@ -45,7 +45,7 @@ namespace Foam
class cellToFaceStencil;
/*---------------------------------------------------------------------------*\
Class extendedCentredCellToFaceStencil Declaration
Class extendedCentredCellToFaceStencil Declaration
\*---------------------------------------------------------------------------*/
class extendedCentredCellToFaceStencil

View file

@ -55,7 +55,7 @@ namespace Foam
class cellToFaceStencil;
/*---------------------------------------------------------------------------*\
Class extendedUpwindCellToFaceStencil Declaration
Class extendedUpwindCellToFaceStencil Declaration
\*---------------------------------------------------------------------------*/
class extendedUpwindCellToFaceStencil

View file

@ -27,8 +27,6 @@ License
#include "CECCellToFaceStencil.H"
#include "CECCellToCellStencil.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::CECCellToFaceStencil::CECCellToFaceStencil(const polyMesh& mesh)

View file

@ -44,7 +44,7 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class CECCellToFaceStencil Declaration
Class CECCellToFaceStencil Declaration
\*---------------------------------------------------------------------------*/
class CECCellToFaceStencil

View file

@ -73,6 +73,23 @@ public:
//- Destructor
virtual ~centredCFCFaceToCellStencilObject()
{}
// Member functions
//- Delete the stencil when the mesh moves
virtual bool movePoints() const
{
deleteObject();
return true;
}
//- Delete the stencil when mesh updates
virtual bool updateMesh(const mapPolyMesh&) const
{
deleteObject();
return true;
}
};

View file

@ -88,22 +88,11 @@ void Foam::fvMesh::clearGeom()
// Mesh motion flux cannot be deleted here because the old-time flux
// needs to be saved.
HJ, review delete of new function objects
// Things geometry dependent that are not updated.
/*
volPointInterpolation::Delete(*this);
extendedLeastSquaresVectors::Delete(*this);
leastSquaresVectors::Delete(*this);
CentredFitData<linearFitPolynomial>::Delete(*this);
CentredFitData<quadraticFitPolynomial>::Delete(*this);
CentredFitData<quadraticLinearFitPolynomial>::Delete(*this);
skewCorrectionVectors::Delete(*this);
//quadraticFitSnGradData::Delete(*this);
*/
}
// Geometry dependent object updated through call-back
// "Reserve" optional delete. Reconsider
// HJ, 29/Aug/2010
// meshObjectBase::allDelete(*this);
}
@ -111,31 +100,10 @@ void Foam::fvMesh::clearAddressing()
{
deleteDemandDrivenData(lduPtr_);
// Hack until proper callbacks. Below are all the fvMesh-MeshObjects.
// HJ, review delete of new function objects
/*
volPointInterpolation::Delete(*this);
extendedLeastSquaresVectors::Delete(*this);
leastSquaresVectors::Delete(*this);
CentredFitData<linearFitPolynomial>::Delete(*this);
CentredFitData<quadraticFitPolynomial>::Delete(*this);
CentredFitData<quadraticLinearFitPolynomial>::Delete(*this);
skewCorrectionVectors::Delete(*this);
//quadraticFitSnGradData::Delete(*this);
centredCECCellToFaceStencilObject::Delete(*this);
centredCFCCellToFaceStencilObject::Delete(*this);
centredCPCCellToFaceStencilObject::Delete(*this);
centredFECCellToFaceStencilObject::Delete(*this);
// Is this geometry related - cells distorting to upwind direction?
upwindCECCellToFaceStencilObject::Delete(*this);
upwindCFCCellToFaceStencilObject::Delete(*this);
upwindCPCCellToFaceStencilObject::Delete(*this);
upwindFECCellToFaceStencilObject::Delete(*this);
centredCFCFaceToCellStencilObject::Delete(*this);
*/
// Geometry dependent object updated through call-back
// "Reserve" optional delete. Reconsider
// HJ, 29/Aug/2010
// meshObjectBase::allDelete(*this);
}
@ -428,11 +396,11 @@ const Foam::lduAddressing& Foam::fvMesh::lduAddr() const
}
void fvMesh::mapFields(const mapPolyMesh& meshMap)
void Foam::fvMesh::mapFields(const mapPolyMesh& meshMap) const
{
if (debug)
{
Info<< "void fvMesh::mapFields(const mapPolyMesh& meshMap): "
Info<< "void fvMesh::mapFields(const mapPolyMesh& meshMap) const: "
<< "Mapping fv fields."
<< endl;
}
@ -445,18 +413,24 @@ void fvMesh::mapFields(const mapPolyMesh& meshMap)
MapGeometricFields<vector, fvPatchField, fvMeshMapper, volMesh>(mapper);
MapGeometricFields<sphericalTensor, fvPatchField, fvMeshMapper, volMesh>
(mapper);
MapGeometricFields<symmTensor, fvPatchField, fvMeshMapper, volMesh>(mapper);
MapGeometricFields<symmTensor, fvPatchField, fvMeshMapper, volMesh>
(mapper);
MapGeometricFields<tensor, fvPatchField, fvMeshMapper, volMesh>(mapper);
// Map all the surfaceFields in the objectRegistry
MapGeometricFields<scalar, fvsPatchField, fvMeshMapper, surfaceMesh>
(mapper);
MapGeometricFields<vector, fvsPatchField, fvMeshMapper, surfaceMesh>
(mapper);
MapGeometricFields
<sphericalTensor, fvsPatchField, fvMeshMapper, surfaceMesh>(mapper);
MapGeometricFields<symmTensor, fvsPatchField, fvMeshMapper, surfaceMesh>
(mapper);
MapGeometricFields<tensor, fvsPatchField, fvMeshMapper, surfaceMesh>
(mapper);
@ -465,7 +439,7 @@ void fvMesh::mapFields(const mapPolyMesh& meshMap)
}
void fvMesh::mapOldVolumes(const mapPolyMesh& meshMap)
void Foam::fvMesh::mapOldVolumes(const mapPolyMesh& meshMap)
{
const labelList& cellMap = meshMap.cellMap();
@ -525,7 +499,7 @@ void fvMesh::mapOldVolumes(const mapPolyMesh& meshMap)
}
void fvMesh::updateMesh(const mapPolyMesh& mpm)
void Foam::fvMesh::updateMesh(const mapPolyMesh& mpm)
{
// Update polyMesh. This needs to keep volume existent!
polyMesh::updateMesh(mpm);
@ -545,11 +519,12 @@ void fvMesh::updateMesh(const mapPolyMesh& mpm)
// This is a temporary solution
surfaceInterpolation::movePoints();
meshObjectBase::allUpdateTopology<fvMesh>(*this, mpm);
// Function object update moved to polyMesh
// HJ, 29/Aug/2010
}
void fvMesh::syncUpdateMesh()
void Foam::fvMesh::syncUpdateMesh()
{
// Update polyMesh. This needs to keep volume existent!
polyMesh::syncUpdateMesh();
@ -568,11 +543,11 @@ void fvMesh::syncUpdateMesh()
// Instantiate a dummy mapPolyMesh
autoPtr<mapPolyMesh> mapPtr(new mapPolyMesh(*this));
meshObjectBase::allUpdateTopology<fvMesh>(*this, mapPtr());
// Function object update moved to polyMesh
// HJ, 29/Aug/2010
}
tmp<scalarField> fvMesh::movePoints(const pointField& p)
Foam::tmp<Foam::scalarField> Foam::fvMesh::movePoints(const pointField& p)
{
// Grab old time volumes if the time has been incremented
@ -668,22 +643,10 @@ Foam::tmp<Foam::scalarField> Foam::fvMesh::movePoints(const pointField& p)
boundary_.movePoints();
surfaceInterpolation::movePoints();
meshObjectBase::allMovePoints<fvMesh>(*this);
HJ, review
/*
// Hack until proper callbacks. Below are all the fvMesh MeshObjects with a
// movePoints function.
MeshObjectMovePoints<volPointInterpolation>(*this);
MeshObjectMovePoints<extendedLeastSquaresVectors>(*this);
MeshObjectMovePoints<leastSquaresVectors>(*this);
MeshObjectMovePoints<CentredFitData<linearFitPolynomial> >(*this);
MeshObjectMovePoints<CentredFitData<quadraticFitPolynomial> >(*this);
MeshObjectMovePoints<CentredFitData<quadraticLinearFitPolynomial> >(*this);
MeshObjectMovePoints<skewCorrectionVectors>(*this);
//MeshObjectMovePoints<quadraticFitSnGradData>(*this);
*/
// Function object update moved to polyMesh
// HJ, 29/Aug/2010
return tsweptVols;
}

View file

@ -318,7 +318,7 @@ public:
virtual tmp<scalarField> movePoints(const pointField&);
//- Map all fields in time using given map.
virtual void mapFields(const mapPolyMesh& mpm);
virtual void mapFields(const mapPolyMesh& mpm) const;
//- Map cell volumes in time using given map.
virtual void mapOldVolumes(const mapPolyMesh& mpm);

View file

@ -48,7 +48,7 @@ namespace Foam
bool Foam::fvMeshSubset::checkCellSubset() const
{
if (fvMeshSubsetPtr_.empty())
if (fvMeshSubsetPtr_)
{
FatalErrorIn("bool fvMeshSubset::checkCellSubset() const")
<< "Mesh subset not set. Please set the cell map using "

View file

@ -60,7 +60,7 @@ SourceFiles
#include "fvPatchFieldMapper.H"
#include "PointPatchFieldMapper.H"
#include "GeometricField.H"
#include "labelHashSet.H"
#include "HashSet.H"
#include "surfaceMesh.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View file

@ -1,3 +1,4 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
@ -156,20 +157,13 @@ limitedSurfaceInterpolationScheme<Type>::~limitedSurfaceInterpolationScheme()
template<class Type>
tmp<surfaceScalarField> limitedSurfaceInterpolationScheme<Type>::weights
(
const GeometricField<Type, fvPatchField, volMesh>& phi
const GeometricField<Type, fvPatchField, volMesh>& phi,
const surfaceScalarField& CDweights,
tmp<surfaceScalarField> tLimiter
) const
{
const fvMesh& mesh = this->mesh();
// Note that here the weights field is initialised as the limiter
// from which the weight is calculated using the limiter value
tmp<surfaceScalarField> tWeights(this->limiter(phi));
surfaceScalarField& Weights = tWeights();
const surfaceScalarField& CDweights = mesh.surfaceInterpolation::weights();
surfaceScalarField& Weights = tLimiter();
scalarField& pWeights = Weights.internalField();
@ -199,7 +193,6 @@ tmp<surfaceScalarField> limitedSurfaceInterpolationScheme<Type>::weights
}
}
return tWeights;
return tLimiter;
}

View file

@ -46,13 +46,18 @@ namespace Foam
class extendedCentredCellToFaceStencil;
/*---------------------------------------------------------------------------*\
Class CentredFitData Declaration
Class CentredFitData Declaration
\*---------------------------------------------------------------------------*/
template<class Polynomial>
class CentredFitData
:
public FitData<CentredFitData<Polynomial>, extendedCentredCellToFaceStencil, Polynomial>
public FitData
<
CentredFitData<Polynomial>,
extendedCentredCellToFaceStencil,
Polynomial
>
{
// Private data
@ -86,8 +91,9 @@ public:
//- Destructor
virtual ~CentredFitData()
{}
virtual ~CentredFitData()
{}
// Member functions

View file

@ -318,9 +318,12 @@ void Foam::FitData<FitDataType, ExtendedStencil, Polynomial>::calcFit
template<class FitDataType, class ExtendedStencil, class Polynomial>
bool Foam::FitData<FitDataType, ExtendedStencil, Polynomial>::movePoints()
bool
Foam::FitData<FitDataType, ExtendedStencil, Polynomial>::movePoints() const
{
calcFit();
const_cast<FitData<FitDataType, ExtendedStencil, Polynomial>&>
(*this).calcFit();
return true;
}

View file

@ -143,7 +143,15 @@ public:
//- Recalculate weights (but not stencil) when the mesh moves
bool movePoints();
virtual bool movePoints() const;
//- Delete the stencil when mesh updates
virtual bool updateMesh(const mapPolyMesh&) const
{
this->deleteObject();
return true;
}
};

View file

@ -62,7 +62,7 @@ void pointPatchInterpolation::interpolate
// patch
const fvBoundaryMesh& bm = fvMesh_.boundary();
const pointBoundaryMesh& pbm = pointMesh_.boundary();
const pointBoundaryMesh& pbm = pointMesh::New(fvMesh_).boundary();
forAll(bm, patchi)
{

View file

@ -301,13 +301,6 @@ pointPatchInterpolation::~pointPatchInterpolation()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void pointPatchInterpolation::updateMesh()
{
makePatchPatchAddressing();
makePatchPatchWeights();
}
bool pointPatchInterpolation::movePoints()
{
forAll(patchInterpolators_, patchi)
@ -321,7 +314,14 @@ bool pointPatchInterpolation::movePoints()
}
// Specialisaion of applyCornerConstraints for scalars because
void pointPatchInterpolation::updateMesh()
{
makePatchPatchAddressing();
makePatchPatchWeights();
}
// Specialisation of applyCornerConstraints for scalars because
// no constraint need be applied
template<>
void pointPatchInterpolation::applyCornerConstraints<scalar>

View file

@ -44,7 +44,7 @@ defineTypeNameAndDebug(volPointInterpolation, 0);
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void volPointInterpolation::makeWeights()
void volPointInterpolation::makeWeights() const
{
if (debug)
{
@ -87,7 +87,7 @@ void volPointInterpolation::makeWeights()
forAll(pcp, pointCelli)
{
pw[pointCelli] =
pw[pointCelli] =
1.0/mag(points[pointi] - cellCentres[pcp[pointCelli]]);
sumWeights[pointi] += pw[pointCelli];
@ -144,7 +144,7 @@ volPointInterpolation::volPointInterpolation(const fvMesh& vm)
MeshObject<fvMesh, volPointInterpolation>(vm),
boundaryInterpolator_(vm)
{
updateMesh();
makeWeights();
}
@ -156,17 +156,25 @@ volPointInterpolation::~volPointInterpolation()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void volPointInterpolation::updateMesh()
bool volPointInterpolation::movePoints() const
{
makeWeights();
boundaryInterpolator_.updateMesh();
// Updated for MeshObject handling
// HJ, 30/Aug/2010
const_cast<pointPatchInterpolation&>(boundaryInterpolator_).movePoints();
return true;
}
bool volPointInterpolation::movePoints()
bool volPointInterpolation::updateMesh(const mapPolyMesh&) const
{
makeWeights();
boundaryInterpolator_.movePoints();
// Updated for MeshObject handling
// HJ, 30/Aug/2010
const_cast<pointPatchInterpolation&>(boundaryInterpolator_).updateMesh();
return true;
}

View file

@ -58,17 +58,18 @@ class volPointInterpolation
{
// Private data
//- Boundary interpolation engine.
//- Boundary interpolation engine
pointPatchInterpolation boundaryInterpolator_;
//- Interpolation scheme weighting factor array.
scalarListList pointWeights_;
//- Interpolation scheme weighting factor array
// Updated for MeshObject. HJ, 30/Aug/2010
mutable scalarListList pointWeights_;
// Private member functions
//- Construct point weighting factors
void makeWeights();
void makeWeights() const;
//- Disallow default bitwise copy construct
volPointInterpolation(const volPointInterpolation&);
@ -106,11 +107,13 @@ public:
// Edit
//- Update mesh topology using the morph engine
void updateMesh();
//- Correct weighting factors for moving mesh.
bool movePoints();
// Updated for MeshObject. HJ, 30/Aug/2010
virtual bool movePoints() const;
//- Update mesh topology using the morph engine
// Updated for MeshObject. HJ, 30/Aug/2010
virtual bool updateMesh(const mapPolyMesh&) const;
// Interpolation functions

View file

@ -60,9 +60,6 @@ $(topoSets)/cellSet.C
$(topoSets)/topoSet.C
$(topoSets)/faceSet.C
$(topoSets)/pointSet.C
$(topoSets)/cellZoneSet.C
$(topoSets)/faceZoneSet.C
$(topoSets)/pointZoneSet.C
sets/topoSetSource/topoSetSource.C
@ -108,18 +105,6 @@ $(pointSources)/zoneToPoint/zoneToPoint.C
$(pointSources)/setToPoint/setToPoint.C
$(pointSources)/nearestToPoint/nearestToPoint.C
faceZoneSources = sets/faceZoneSources
$(faceZoneSources)/faceZoneToFaceZone/faceZoneToFaceZone.C
$(faceZoneSources)/setsToFaceZone/setsToFaceZone.C
$(faceZoneSources)/setToFaceZone/setToFaceZone.C
cellZoneSources = sets/cellZoneSources
$(cellZoneSources)/setToCellZone/setToCellZone.C
pointZoneSources = sets/pointZoneSources
$(pointZoneSources)/setToPointZone/setToPointZone.C
surfaceSets/surfaceSets.C
triSurface/orientedSurface/orientedSurface.C

View file

@ -107,7 +107,7 @@ bool Foam::octreeDataEdges::overlaps
const treeBoundBox& sampleBb
) const
{
return sampleBb.intersects(allBb_[index]);
return sampleBb.overlaps(allBb_[index]);
}

View file

@ -766,10 +766,6 @@ bool Foam::polyMeshZipUpCells(polyMesh& mesh)
true // boundary forms valid boundary mesh.
);
// Reset any addressing on face zones.
// 1.6.x merge change. Reconsider. HJ, 22/Aug/2010
mesh.faceZones().clearAddressing();
// Clear the addressing
mesh.clearOut();

Some files were not shown because too many files have changed in this diff Show more