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

This commit is contained in:
andy
2008-05-27 16:21:35 +01:00
11 changed files with 46 additions and 57 deletions

View File

@ -162,7 +162,21 @@ inline void Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::append
const T& e const T& e
) )
{ {
operator()(size()) = e; nextFree_++;
if (nextFree_ > List<T>::size())
{
List<T>::setSize
(
max
(
nextFree_,
label(SizeMult*List<T>::size()/SizeDiv + SizeInc)
)
);
}
this->operator[](nextFree_ - 1) = e;
} }
@ -186,7 +200,7 @@ inline T Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::remove()
template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv> template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
inline T& Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::operator() inline T& Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::operator()
( (
const Foam::label i const label i
) )
{ {
nextFree_ = max(nextFree_, i + 1); nextFree_ = max(nextFree_, i + 1);

View File

@ -34,21 +34,15 @@ Description
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam char Foam::ISstream::nextValid()
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Get next 'valid character': i.e. not white space or comment.
char ISstream::nextValid()
{ {
char c = 0; char c = 0;
for (;;) for (;;)
{ {
// Get next non-whitespace character // Get next non-whitespace character
while (get(c) && isspace(c)); while (get(c) && isspace(c))
{}
// Return if stream is bad // Return if stream is bad
if (bad() || isspace(c)) if (bad() || isspace(c))
@ -67,7 +61,8 @@ char ISstream::nextValid()
if (c == '/') // This is the start of a C++ style one line comment if (c == '/') // This is the start of a C++ style one line comment
{ {
while (get(c) && c != '\n'); while (get(c) && c != '\n')
{}
} }
else if (c == '*') // This is the start of a C style comment else if (c == '*') // This is the start of a C style comment
{ {
@ -105,8 +100,4 @@ char ISstream::nextValid()
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* // // ************************************************************************* //

View File

@ -31,12 +31,7 @@ Description
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam Foam::label Foam::readHexLabel(ISstream& is)
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
label readHexLabel(ISstream& is)
{ {
register label result = 0; register label result = 0;
@ -48,7 +43,8 @@ label readHexLabel(ISstream& is)
static const label alphaOffset = toupper('A') - 10; static const label alphaOffset = toupper('A') - 10;
// Get next non-whitespace character // Get next non-whitespace character
while (is.get(c) && isspace(c)); while (is.get(c) && isspace(c))
{}
do do
{ {
@ -77,8 +73,4 @@ label readHexLabel(ISstream& is)
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* // // ************************************************************************* //

View File

@ -47,7 +47,8 @@ bool Foam::dictionary::read(Istream& is)
is.putBack(currToken); is.putBack(currToken);
} }
while (!is.eof() && entry::New(*this, is)); while (!is.eof() && entry::New(*this, is))
{}
// Remove the FoamFile header entry if it exists // Remove the FoamFile header entry if it exists
remove("FoamFile"); remove("FoamFile");

View File

@ -172,7 +172,7 @@ void Foam::GAMGSolver::Vcycle
{ {
scalar sf = scalingFactor scalar sf = scalingFactor
( (
reinterpret_cast<scalarField&>(ACf), const_cast<scalarField&>(ACf.operator const scalarField&()),
matrixLevels_[leveli], matrixLevels_[leveli],
coarseCorrFields[leveli], coarseCorrFields[leveli],
interfaceLevelsBouCoeffs_[leveli], interfaceLevelsBouCoeffs_[leveli],
@ -192,7 +192,7 @@ void Foam::GAMGSolver::Vcycle
// Correct the residual with the new solution // Correct the residual with the new solution
matrixLevels_[leveli].Amul matrixLevels_[leveli].Amul
( (
reinterpret_cast<scalarField&>(ACf), const_cast<scalarField&>(ACf.operator const scalarField&()),
coarseCorrFields[leveli], coarseCorrFields[leveli],
interfaceLevelsBouCoeffs_[leveli], interfaceLevelsBouCoeffs_[leveli],
interfaceLevels_[leveli], interfaceLevels_[leveli],
@ -269,7 +269,7 @@ void Foam::GAMGSolver::Vcycle
scalar sf = scalingFactor scalar sf = scalingFactor
( (
reinterpret_cast<scalarField&>(ACf), const_cast<scalarField&>(ACf.operator const scalarField&()),
matrixLevels_[leveli], matrixLevels_[leveli],
coarseCorrFields[leveli], coarseCorrFields[leveli],
interfaceLevelsBouCoeffs_[leveli], interfaceLevelsBouCoeffs_[leveli],

View File

@ -108,8 +108,8 @@ scalar face::areaInContact
if if
( (
vertexValue[vI] > 0 && vertexValue[vI + 1] < 0 (vertexValue[vI] > 0 && vertexValue[vI + 1] < 0)
|| vertexValue[vI] < 0 && vertexValue[vI + 1] > 0 || (vertexValue[vI] < 0 && vertexValue[vI + 1] > 0)
) )
{ {
// Edge intersection. Calculate intersection point and add to list // Edge intersection. Calculate intersection point and add to list
@ -133,8 +133,8 @@ scalar face::areaInContact
if if
( (
vertexValue[size() - 1] > 0 && vertexValue[0] < 0 (vertexValue[size() - 1] > 0 && vertexValue[0] < 0)
|| vertexValue[size() - 1] < 0 && vertexValue[0] > 0 || (vertexValue[size() - 1] < 0 && vertexValue[0] > 0)
) )
{ {
// Edge intersection. Calculate intersection point and add to list // Edge intersection. Calculate intersection point and add to list

View File

@ -511,7 +511,7 @@ bool Foam::polyBoundaryMesh::checkParallelSync(const bool report) const
{ {
boundaryError = true; boundaryError = true;
if (debug || report && Pstream::master()) if (debug || (report && Pstream::master()))
{ {
Info<< " ***Inconsistent patches across processors, " Info<< " ***Inconsistent patches across processors, "
"processor 0 has patch names:" << allNames[0] "processor 0 has patch names:" << allNames[0]

View File

@ -28,14 +28,9 @@ License
#include "DynamicList.H" #include "DynamicList.H"
#include "ListOps.H" #include "ListOps.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void primitiveMesh::calcCellEdges() const void Foam::primitiveMesh::calcCellEdges() const
{ {
// Loop through all faces and mark up cells with edges of the face. // Loop through all faces and mark up cells with edges of the face.
// Check for duplicates // Check for duplicates
@ -78,7 +73,7 @@ void primitiveMesh::calcCellEdges() const
if (findIndex(curCellEdges, curEdges[edgeI]) == -1) if (findIndex(curCellEdges, curEdges[edgeI]) == -1)
{ {
// Add the edge // Add the edge
curCellEdges.append(curEdges[edgeI]); //curCellEdges.append(curEdges[edgeI]);
} }
} }
} }
@ -94,7 +89,7 @@ void primitiveMesh::calcCellEdges() const
if (findIndex(curCellEdges, curEdges[edgeI]) == -1) if (findIndex(curCellEdges, curEdges[edgeI]) == -1)
{ {
// add the edge // add the edge
curCellEdges.append(curEdges[edgeI]); //curCellEdges.append(curEdges[edgeI]);
} }
} }
} }
@ -113,7 +108,7 @@ void primitiveMesh::calcCellEdges() const
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
const labelListList& primitiveMesh::cellEdges() const const Foam::labelListList& Foam::primitiveMesh::cellEdges() const
{ {
if (!cePtr_) if (!cePtr_)
{ {
@ -124,8 +119,4 @@ const labelListList& primitiveMesh::cellEdges() const
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* // // ************************************************************************* //