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

View file

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

View file

@ -126,6 +126,17 @@ case OpenFOAM:
endsw 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 # Communications library
# ~~~~~~~~~~~~~~~~~~~~~~ # ~~~~~~~~~~~~~~~~~~~~~~
@ -133,7 +144,7 @@ unset MPI_ARCH_PATH
switch ("$WM_MPLIB") switch ("$WM_MPLIB")
case OPENMPI: 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_HOME $WM_THIRD_PARTY_DIR/$mpi_version
setenv MPI_ARCH_PATH $MPI_HOME/platforms/$WM_OPTIONS setenv MPI_ARCH_PATH $MPI_HOME/platforms/$WM_OPTIONS

View file

@ -148,6 +148,19 @@ fi
unset compilerBin compilerLib compilerInstall 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 # Communications library
# ~~~~~~~~~~~~~~~~~~~~~~ # ~~~~~~~~~~~~~~~~~~~~~~
@ -155,7 +168,7 @@ unset MPI_ARCH_PATH
case "$WM_MPLIB" in case "$WM_MPLIB" in
OPENMPI) OPENMPI)
mpi_version=openmpi-1.3.3 mpi_version=openmpi-1.4.1
export MPI_HOME=$WM_THIRD_PARTY_DIR/$mpi_version export MPI_HOME=$WM_THIRD_PARTY_DIR/$mpi_version
export MPI_ARCH_PATH=$MPI_HOME/platforms/$WM_OPTIONS export MPI_ARCH_PATH=$MPI_HOME/platforms/$WM_OPTIONS

View file

@ -1,10 +1,14 @@
#!/bin/sh #!/bin/sh
set -x set -x
( cd OpenFOAM && wmakeLnInclude . ) # update OpenFOAM version strings if required
( cd finiteVolume && wmakeLnInclude . ) wmakePrintBuild -check || /bin/rm -f OpenFOAM/Make/$WM_OPTIONS/global.? 2>/dev/null
( cd Pstream && ./Allwmake )
wmake libo OSspecific/$WM_OS wmakeLnInclude OpenFOAM
wmakeLnInclude OSspecific/$WM_OSTYPE
Pstream/Allwmake
wmake libo OSspecific/$WM_OSTYPE
wmake libso OpenFOAM wmake libso OpenFOAM
( cd decompositionAgglomeration && ./Allwmake ) ( 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 // Member operators
//- Allow cast to a const List<T>& //- Allow cast to a const List<T>&

View file

@ -72,6 +72,50 @@ inline Foam::SubList<T>::SubList
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * 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> template<class T>
inline const Foam::SubList<T>& Foam::SubList<T>::null() inline const Foam::SubList<T>& Foam::SubList<T>::null()
{ {

View file

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

View file

@ -33,7 +33,7 @@ Author
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
const Foam::scalarMatrix& Foam::RBFInterpolation::B() const const Foam::scalarSquareMatrix& Foam::RBFInterpolation::B() const
{ {
if (!BPtr_) if (!BPtr_)
{ {
@ -48,6 +48,7 @@ void Foam::RBFInterpolation::calcB() const
{ {
// Determine inverse of boundary connectivity matrix // Determine inverse of boundary connectivity matrix
label polySize(4); label polySize(4);
if(!polynomials_) if(!polynomials_)
{ {
polySize = 0; polySize = 0;
@ -151,7 +152,7 @@ void Foam::RBFInterpolation::calcB() const
// Collect ALL control points from ALL CPUs // Collect ALL control points from ALL CPUs
// Create an identical inverse for 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_; autoPtr<RBFFunction> RBF_;
//- Interpolation matrix //- Interpolation matrix
mutable scalarMatrix* BPtr_; mutable scalarSquareMatrix* BPtr_;
//- Focal point for cut-off radii //- Focal point for cut-off radii
point focalPoint_; point focalPoint_;
@ -124,7 +124,7 @@ class RBFInterpolation
//- Return interpolation matrix //- Return interpolation matrix
const scalarMatrix& B() const; const scalarSquareMatrix& B() const;
//- Calculate interpolation matrix //- Calculate interpolation matrix
void calcB() const; void calcB() const;

View file

@ -72,7 +72,7 @@ Foam::tmp<Foam::Field<Type> > Foam::RBFInterpolation::interpolate
// 3) Return displacements using tresult() // 3) Return displacements using tresult()
const label nControlPoints = controlPoints_.size(); const label nControlPoints = controlPoints_.size();
const scalarMatrix& B_ = B(); const scalarSquareMatrix& mat = B();
// Determine interpolation coefficients // Determine interpolation coefficients
Field<Type> alpha(nControlPoints, pTraits<Type>::zero); 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++) 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++) 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(); nCells += lduMatrices[i].size();
} }
scalarSquareMatrix m(nCells, nCells, 0.0); scalarSquareMatrix m(nCells, 0.0);
transfer(m); transfer(m);
convert(lduMatrices); convert(lduMatrices);
} }
@ -109,7 +109,7 @@ Foam::LUscalarMatrix::LUscalarMatrix
else else
{ {
label nCells = ldum.lduAddr().size(); label nCells = ldum.lduAddr().size();
scalarSquareMatrix m(nCells, nCells, 0.0); scalarSquareMatrix m(nCells, 0.0);
transfer(m); transfer(m);
convert(ldum, interfaceCoeffs, interfaces); convert(ldum, interfaceCoeffs, interfaces);
} }

View file

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

View file

@ -33,45 +33,24 @@ inline Foam::SquareMatrix<Type>::SquareMatrix()
Matrix<SquareMatrix<Type>, Type>() Matrix<SquareMatrix<Type>, Type>()
{} {}
template<class Type> template<class Type>
inline Foam::SquareMatrix<Type>::SquareMatrix(const label n) inline Foam::SquareMatrix<Type>::SquareMatrix(const label n)
: :
Matrix<SquareMatrix<Type>, Type>(n, 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> template<class Type>
inline Foam::SquareMatrix<Type>::SquareMatrix inline Foam::SquareMatrix<Type>::SquareMatrix
( (
const label m,
const label n, const label n,
const Type& t const Type& t
) )
: :
Matrix<SquareMatrix<Type>, Type>(m, n, t) Matrix<SquareMatrix<Type>, Type>(n, 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);
}
}
template<class Type> template<class Type>
inline Foam::SquareMatrix<Type>::SquareMatrix(Istream& is) inline Foam::SquareMatrix<Type>::SquareMatrix(Istream& is)
@ -79,6 +58,7 @@ inline Foam::SquareMatrix<Type>::SquareMatrix(Istream& is)
Matrix<SquareMatrix<Type>, Type>(is) Matrix<SquareMatrix<Type>, Type>(is)
{} {}
template<class Type> template<class Type>
inline Foam::autoPtr<Foam::SquareMatrix<Type> > inline Foam::autoPtr<Foam::SquareMatrix<Type> >
Foam::SquareMatrix<Type>::clone() const Foam::SquareMatrix<Type>::clone() const

View file

@ -27,114 +27,6 @@ License
#include "scalarMatrices.H" #include "scalarMatrices.H"
#include "SVD.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 * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
void Foam::multiply void Foam::multiply

View file

@ -40,6 +40,8 @@ SourceFiles
#include "RectangularMatrix.H" #include "RectangularMatrix.H"
#include "SquareMatrix.H" #include "SquareMatrix.H"
#include "DiagonalMatrix.H" #include "DiagonalMatrix.H"
#include "scalarSquareMatrix.H"
#include "scalarField.H" #include "scalarField.H"
#include "labelList.H" #include "labelList.H"
@ -49,46 +51,8 @@ namespace Foam
{ {
typedef RectangularMatrix<scalar> scalarRectangularMatrix; typedef RectangularMatrix<scalar> scalarRectangularMatrix;
typedef SquareMatrix<scalar> scalarSquareMatrix;
typedef DiagonalMatrix<scalar> scalarDiagonalMatrix; 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 void multiply
( (
scalarRectangularMatrix& answer, // value changed in return scalarRectangularMatrix& answer, // value changed in return
@ -108,7 +72,7 @@ void multiply
( (
scalarRectangularMatrix& answer, // value changed in return scalarRectangularMatrix& answer, // value changed in return
const scalarRectangularMatrix& A, const scalarRectangularMatrix& A,
const DiagonalMatrix<scalar>& B, const scalarDiagonalMatrix& B,
const scalarRectangularMatrix& C const scalarRectangularMatrix& C
); );
@ -126,12 +90,6 @@ scalarRectangularMatrix SVDinv
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "scalarMatricesTemplates.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#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> template<class Type>
Foam::simpleMatrix<T>::simpleMatrix Foam::simpleMatrix<Type>::simpleMatrix
( (
const scalarSquareMatrix& matrix, const scalarSquareMatrix& matrix,
const Field<Type>& source const Field<Type>& source
@ -76,10 +76,10 @@ Foam::Field<Type> Foam::simpleMatrix<Type>::solve() const
{ {
// Since matrix and source are trashed during solution, // Since matrix and source are trashed during solution,
// a copy is made. HJ, 23/Dec/2008 // a copy is made. HJ, 23/Dec/2008
scalarMatrix tmpMatrix = *this; scalarSquareMatrix tmpMatrix = *this;
Field<T> sourceSol = source_; Field<Type> sourceSol = source_;
scalarMatrix::solve(tmpMatrix, sourceSol); scalarSquareMatrix::solve(tmpMatrix, sourceSol);
return sourceSol; return sourceSol;
} }
@ -90,10 +90,10 @@ Foam::Field<Type> Foam::simpleMatrix<Type>::LUsolve() const
{ {
// Since matrix and source are trashed during solution, // Since matrix and source are trashed during solution,
// a copy is made. HJ, 23/Dec/2008 // a copy is made. HJ, 23/Dec/2008
scalarMatrix luMatrix = *this; scalarSquareMatrix luMatrix = *this;
Field<T> sourceSol = source_; Field<Type> sourceSol = source_;
scalarMatrix::LUsolve(luMatrix, sourceSol); scalarSquareMatrix::LUsolve(luMatrix, sourceSol);
return sourceSol; return sourceSol;
} }

View file

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

View file

@ -59,7 +59,10 @@ const Type& Foam::MeshObject<Mesh, Type>::New
} }
else 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 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 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 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 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 // Member Functions
//- Delete object from database
virtual bool deleteObject() const;
//- Return mesh reference //- Return mesh reference
const Mesh& mesh() const const Mesh& mesh() const
{ {

View file

@ -32,7 +32,7 @@ Description
Author Author
Hrvoje Jasak, Wikki Ltd Hrvoje Jasak, Wikki Ltd
\*----------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "meshObjectBase.H" #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 // Destructor
@ -143,6 +169,9 @@ public:
//- Update after topology change //- Update after topology change
virtual bool updateMesh(const mapPolyMesh&) const = 0; 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; pointPatchList& patches = *this;
forAll(patches, patchi) forAll(patches, patchi)
{ {
patches[patchi].initMovePoints(p); patches[patchi].movePoints();
}
forAll(patches, patchi)
{
patches[patchi].movePoints(p);
} }
} }

View file

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

View file

@ -32,9 +32,14 @@ License
#include "MapGeometricFields.H" #include "MapGeometricFields.H"
#include "MapPointField.H" #include "MapPointField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
defineTypeNameAndDebug(Foam::pointMesh, 0);
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void Foam::pointMesh::mapFields(const mapPolyMesh& mpm) void Foam::pointMesh::mapFields(const mapPolyMesh& mpm) const
{ {
// Create a mapper // Create a mapper
const pointMeshMapper m(*this, mpm); const pointMeshMapper m(*this, mpm);
@ -48,8 +53,10 @@ void Foam::pointMesh::mapFields(const mapPolyMesh& mpm)
pointMeshMapper, pointMeshMapper,
pointMesh pointMesh
>(m); >(m);
MapGeometricFields<symmTensor, pointPatchField, pointMeshMapper, pointMesh> MapGeometricFields<symmTensor, pointPatchField, pointMeshMapper, pointMesh>
(m); (m);
MapGeometricFields<tensor, 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 // Map all registered point fields
mapFields(mpm); mapFields(mpm);
return true;
} }

View file

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

View file

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

View file

@ -76,11 +76,8 @@ protected:
//- Calculate the patch geometry //- Calculate the patch geometry
virtual void calcGeometry() = 0; virtual void calcGeometry() = 0;
//- Initialise the patches for moving points
virtual void initMovePoints(const pointField&) = 0;
//- Correct patches after moving points //- Correct patches after moving points
virtual void movePoints(const pointField&) = 0; virtual void movePoints() = 0;
//- Initialise the update of the patch topology //- Initialise the update of the patch topology
virtual void initUpdateMesh() = 0; 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() void cyclicPointPatch::initUpdateMesh()
{ {
facePointPatch::initUpdateMesh(); facePointPatch::initUpdateMesh();

View file

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

View file

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

View file

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

View file

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

View file

@ -291,7 +291,8 @@ void Foam::processorPointPatch::calcPatchPatchPoints()
const labelList& patchPoints = patchPatchPoints[patchi]; const labelList& patchPoints = patchPatchPoints[patchi];
const List<vector>& patchPointNormals = patchPatchPointNormals[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()) if (patchPoints.size())
{ {
// Get the current meshPoints list for the patch // 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() void processorPointPatch::initUpdateMesh()
{ {
facePointPatch::initUpdateMesh(); facePointPatch::initUpdateMesh();

View file

@ -66,27 +66,34 @@ class processorPointPatch
// Private Member Functions // 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(); virtual void initGeometry();
//- Calculate the patch geometry //- Calculate the patch geometry
virtual void calcGeometry(); 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 //- Correct patches after moving points
virtual void movePoints(const pointField&); virtual void movePoints()
{}
//- Initialise the update of the patch topology //- Initialise the update of the patch topology
virtual void initUpdateMesh(); virtual void initUpdateMesh();
@ -95,12 +102,6 @@ class processorPointPatch
virtual void updateMesh(); virtual void updateMesh();
//- Disallow default construct as copy
processorPointPatch(const processorPointPatch&);
//- Disallow default assignment
void operator=(const processorPointPatch&);
public: public:
typedef coupledPointPatch CoupledPointPatch; typedef coupledPointPatch CoupledPointPatch;

View file

@ -60,6 +60,7 @@ void Foam::regionCouplePointPatch::calcGeometry()
meshPoints_ = regionCouplePolyPatch_.meshPoints(); meshPoints_ = regionCouplePolyPatch_.meshPoints();
nonGlobalPatchPoints_.setSize(meshPoints_.size()); nonGlobalPatchPoints_.setSize(meshPoints_.size());
forAll(nonGlobalPatchPoints_, i) forAll(nonGlobalPatchPoints_, i)
{ {
nonGlobalPatchPoints_[i] = 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() void Foam::regionCouplePointPatch::initUpdateMesh()
{ {
facePointPatch::initUpdateMesh(); facePointPatch::initUpdateMesh();

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -31,6 +31,7 @@ Description
#include "mapPolyMesh.H" #include "mapPolyMesh.H"
#include "Time.H" #include "Time.H"
#include "globalMeshData.H" #include "globalMeshData.H"
#include "meshObjectBase.H"
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
@ -74,6 +75,12 @@ void Foam::polyMesh::updateMesh(const mapPolyMesh& mpm)
geometricD_ = Vector<label>::zero; geometricD_ = Vector<label>::zero;
solutionD_ = 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 // Sync mesh update with changes on other processors
void Foam::polyMesh::syncUpdateMesh() void Foam::polyMesh::syncUpdateMesh()
{ {
@ -89,10 +96,18 @@ void Foam::polyMesh::syncUpdateMesh()
deleteDemandDrivenData(globalMeshDataPtr_); deleteDemandDrivenData(globalMeshDataPtr_);
setInstance(time().timeName()); setInstance(time().timeName());
// Reset valid directions (could change by faces put into empty patches) // Reset valid directions (could change by faces put into empty patches)
geometricD_ = Vector<label>::zero; geometricD_ = Vector<label>::zero;
solutionD_ = 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); defineTypeNameAndDebug(Foam::coupledPolyPatch, 0);
Foam::scalar Foam::coupledPolyPatch::matchTol = 1E-3;
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // // * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -134,7 +134,6 @@ $(derivedFvPatchFields)/movingWallVelocity/movingWallVelocityFvPatchVectorField.
$(derivedFvPatchFields)/translatingWallVelocity/translatingWallVelocityFvPatchVectorField.C $(derivedFvPatchFields)/translatingWallVelocity/translatingWallVelocityFvPatchVectorField.C
$(derivedFvPatchFields)/rotatingWallVelocity/rotatingWallVelocityFvPatchVectorField.C $(derivedFvPatchFields)/rotatingWallVelocity/rotatingWallVelocityFvPatchVectorField.C
$(derivedFvPatchFields)/movingRotatingWallVelocity/movingRotatingWallVelocityFvPatchVectorField.C $(derivedFvPatchFields)/movingRotatingWallVelocity/movingRotatingWallVelocityFvPatchVectorField.C
$(derivedFvPatchFields)/activeBaffleVelocity/activeBaffleVelocityFvPatchVectorField.C
$(derivedFvPatchFields)/oscillatingFixedValue/oscillatingFixedValueFvPatchFields.C $(derivedFvPatchFields)/oscillatingFixedValue/oscillatingFixedValueFvPatchFields.C
$(derivedFvPatchFields)/fixedMeanValue/fixedMeanValueFvPatchFields.C $(derivedFvPatchFields)/fixedMeanValue/fixedMeanValueFvPatchFields.C
$(derivedFvPatchFields)/outletInlet/outletInletFvPatchFields.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 void Foam::MRFZones::addCoriolis
( (
const volScalarField& rho, 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 void Foam::MRFZones::relativeVelocity(volVectorField& U) const
{ {
forAll(*this, i) 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 void Foam::MRFZones::correctBoundaryVelocity(volVectorField& U) const
{ {
forAll(*this, i) forAll(*this, i)

View file

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

View file

@ -160,10 +160,6 @@ void directMappedFixedValueFvPatchField<Type>::updateCoeffs()
); );
const mapDistribute& distMap = mpp.map(); 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 // Force recalculation of schedule
distMap.schedule(); distMap.schedule();

View file

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

View file

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

View file

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

View file

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

View file

@ -44,7 +44,7 @@ namespace Foam
{ {
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class centredCECCellToFaceStencilObject Declaration Class centredCECCellToFaceStencilObject Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
class centredCECCellToFaceStencilObject class centredCECCellToFaceStencilObject
@ -81,6 +81,23 @@ public:
virtual ~centredCECCellToFaceStencilObject() 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 class centredCFCCellToFaceStencilObject
@ -80,6 +80,24 @@ public:
//- Destructor //- Destructor
virtual ~centredCFCCellToFaceStencilObject() 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 class centredCPCCellToFaceStencilObject
@ -81,6 +81,23 @@ public:
virtual ~centredCPCCellToFaceStencilObject() 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 class centredFECCellToFaceStencilObject
@ -81,6 +81,23 @@ public:
virtual ~centredFECCellToFaceStencilObject() 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() 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 class upwindCECCellToFaceStencilObject
@ -88,6 +88,23 @@ public:
virtual ~upwindCECCellToFaceStencilObject() 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 class upwindCFCCellToFaceStencilObject
@ -88,6 +88,23 @@ public:
virtual ~upwindCFCCellToFaceStencilObject() 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 class upwindCPCCellToFaceStencilObject
@ -88,6 +88,23 @@ public:
virtual ~upwindCPCCellToFaceStencilObject() 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 class upwindFECCellToFaceStencilObject
@ -88,6 +88,23 @@ public:
virtual ~upwindFECCellToFaceStencilObject() 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 * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::extendedCellToFaceStencil::extendedCellToFaceStencil(const polyMesh& mesh) Foam::extendedCellToFaceStencil::extendedCellToFaceStencil
(
const polyMesh& mesh
)
: :
mesh_(mesh) mesh_(mesh)
{ {

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -73,6 +73,23 @@ public:
//- Destructor //- Destructor
virtual ~centredCFCFaceToCellStencilObject() 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 // Mesh motion flux cannot be deleted here because the old-time flux
// needs to be saved. // 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_); deleteDemandDrivenData(lduPtr_);
// Hack until proper callbacks. Below are all the fvMesh-MeshObjects. // Geometry dependent object updated through call-back
// "Reserve" optional delete. Reconsider
// HJ, review delete of new function objects // HJ, 29/Aug/2010
/* // meshObjectBase::allDelete(*this);
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);
*/
} }
@ -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) if (debug)
{ {
Info<< "void fvMesh::mapFields(const mapPolyMesh& meshMap): " Info<< "void fvMesh::mapFields(const mapPolyMesh& meshMap) const: "
<< "Mapping fv fields." << "Mapping fv fields."
<< endl; << endl;
} }
@ -445,18 +413,24 @@ void fvMesh::mapFields(const mapPolyMesh& meshMap)
MapGeometricFields<vector, fvPatchField, fvMeshMapper, volMesh>(mapper); MapGeometricFields<vector, fvPatchField, fvMeshMapper, volMesh>(mapper);
MapGeometricFields<sphericalTensor, fvPatchField, fvMeshMapper, volMesh> MapGeometricFields<sphericalTensor, fvPatchField, fvMeshMapper, volMesh>
(mapper); (mapper);
MapGeometricFields<symmTensor, fvPatchField, fvMeshMapper, volMesh>(mapper);
MapGeometricFields<symmTensor, fvPatchField, fvMeshMapper, volMesh>
(mapper);
MapGeometricFields<tensor, fvPatchField, fvMeshMapper, volMesh>(mapper); MapGeometricFields<tensor, fvPatchField, fvMeshMapper, volMesh>(mapper);
// Map all the surfaceFields in the objectRegistry // Map all the surfaceFields in the objectRegistry
MapGeometricFields<scalar, fvsPatchField, fvMeshMapper, surfaceMesh> MapGeometricFields<scalar, fvsPatchField, fvMeshMapper, surfaceMesh>
(mapper); (mapper);
MapGeometricFields<vector, fvsPatchField, fvMeshMapper, surfaceMesh> MapGeometricFields<vector, fvsPatchField, fvMeshMapper, surfaceMesh>
(mapper); (mapper);
MapGeometricFields MapGeometricFields
<sphericalTensor, fvsPatchField, fvMeshMapper, surfaceMesh>(mapper); <sphericalTensor, fvsPatchField, fvMeshMapper, surfaceMesh>(mapper);
MapGeometricFields<symmTensor, fvsPatchField, fvMeshMapper, surfaceMesh> MapGeometricFields<symmTensor, fvsPatchField, fvMeshMapper, surfaceMesh>
(mapper); (mapper);
MapGeometricFields<tensor, fvsPatchField, fvMeshMapper, surfaceMesh> MapGeometricFields<tensor, fvsPatchField, fvMeshMapper, surfaceMesh>
(mapper); (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(); 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! // Update polyMesh. This needs to keep volume existent!
polyMesh::updateMesh(mpm); polyMesh::updateMesh(mpm);
@ -545,11 +519,12 @@ void fvMesh::updateMesh(const mapPolyMesh& mpm)
// This is a temporary solution // This is a temporary solution
surfaceInterpolation::movePoints(); 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! // Update polyMesh. This needs to keep volume existent!
polyMesh::syncUpdateMesh(); polyMesh::syncUpdateMesh();
@ -568,11 +543,11 @@ void fvMesh::syncUpdateMesh()
// Instantiate a dummy mapPolyMesh // Instantiate a dummy mapPolyMesh
autoPtr<mapPolyMesh> mapPtr(new mapPolyMesh(*this)); 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) Foam::tmp<Foam::scalarField> Foam::fvMesh::movePoints(const pointField& p)
{ {
// Grab old time volumes if the time has been incremented // 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(); boundary_.movePoints();
surfaceInterpolation::movePoints(); surfaceInterpolation::movePoints();
meshObjectBase::allMovePoints<fvMesh>(*this);
HJ, review // Function object update moved to polyMesh
// HJ, 29/Aug/2010
/*
// 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);
*/
return tsweptVols; return tsweptVols;
} }

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -318,9 +318,12 @@ void Foam::FitData<FitDataType, ExtendedStencil, Polynomial>::calcFit
template<class FitDataType, class ExtendedStencil, class Polynomial> 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; return true;
} }

View file

@ -143,7 +143,15 @@ public:
//- Recalculate weights (but not stencil) when the mesh moves //- 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 // patch
const fvBoundaryMesh& bm = fvMesh_.boundary(); const fvBoundaryMesh& bm = fvMesh_.boundary();
const pointBoundaryMesh& pbm = pointMesh_.boundary(); const pointBoundaryMesh& pbm = pointMesh::New(fvMesh_).boundary();
forAll(bm, patchi) forAll(bm, patchi)
{ {

View file

@ -301,13 +301,6 @@ pointPatchInterpolation::~pointPatchInterpolation()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void pointPatchInterpolation::updateMesh()
{
makePatchPatchAddressing();
makePatchPatchWeights();
}
bool pointPatchInterpolation::movePoints() bool pointPatchInterpolation::movePoints()
{ {
forAll(patchInterpolators_, patchi) 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 // no constraint need be applied
template<> template<>
void pointPatchInterpolation::applyCornerConstraints<scalar> void pointPatchInterpolation::applyCornerConstraints<scalar>

View file

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

View file

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

View file

@ -60,9 +60,6 @@ $(topoSets)/cellSet.C
$(topoSets)/topoSet.C $(topoSets)/topoSet.C
$(topoSets)/faceSet.C $(topoSets)/faceSet.C
$(topoSets)/pointSet.C $(topoSets)/pointSet.C
$(topoSets)/cellZoneSet.C
$(topoSets)/faceZoneSet.C
$(topoSets)/pointZoneSet.C
sets/topoSetSource/topoSetSource.C sets/topoSetSource/topoSetSource.C
@ -108,18 +105,6 @@ $(pointSources)/zoneToPoint/zoneToPoint.C
$(pointSources)/setToPoint/setToPoint.C $(pointSources)/setToPoint/setToPoint.C
$(pointSources)/nearestToPoint/nearestToPoint.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 surfaceSets/surfaceSets.C
triSurface/orientedSurface/orientedSurface.C triSurface/orientedSurface/orientedSurface.C

View file

@ -107,7 +107,7 @@ bool Foam::octreeDataEdges::overlaps
const treeBoundBox& sampleBb const treeBoundBox& sampleBb
) const ) 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. 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 // Clear the addressing
mesh.clearOut(); mesh.clearOut();

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