mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' into cvm
This commit is contained in:
@ -156,7 +156,7 @@ Foam::Istream& Foam::operator>>(Istream& is, boundBox& bb)
|
||||
{
|
||||
if (is.format() == IOstream::ASCII)
|
||||
{
|
||||
return is >> bb.min_ >> bb.max_;
|
||||
is >> bb.min_ >> bb.max_;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -32,7 +32,37 @@ License
|
||||
|
||||
//! @cond fileScope
|
||||
const char hexChars[] = "0123456789abcdef";
|
||||
//! @endcond
|
||||
//! @endcond fileScope
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
unsigned char Foam::SHA1Digest::readHexDigit(Istream& is)
|
||||
{
|
||||
// Takes into account that 'a' (or 'A') is 10
|
||||
static const label alphaOffset = toupper('A') - 10;
|
||||
// Takes into account that '0' is 0
|
||||
static const label zeroOffset = int('0');
|
||||
|
||||
char c = 0;
|
||||
is.read(c);
|
||||
|
||||
if (!isxdigit(c))
|
||||
{
|
||||
FatalIOErrorIn("SHA1Digest::readHexDigit(Istream&)", is)
|
||||
<< "Illegal hex digit: '" << c << "'"
|
||||
<< exit(FatalIOError);
|
||||
}
|
||||
|
||||
if (isdigit(c))
|
||||
{
|
||||
return int(c) - zeroOffset;
|
||||
}
|
||||
else
|
||||
{
|
||||
return toupper(c) - alphaOffset;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
@ -43,6 +73,12 @@ Foam::SHA1Digest::SHA1Digest()
|
||||
}
|
||||
|
||||
|
||||
Foam::SHA1Digest::SHA1Digest(Istream& is)
|
||||
{
|
||||
is >> *this;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::SHA1Digest::clear()
|
||||
@ -75,6 +111,23 @@ bool Foam::SHA1Digest::operator!=(const SHA1Digest& rhs) const
|
||||
|
||||
// * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::Istream& Foam::operator>>(Istream& is, SHA1Digest& dig)
|
||||
{
|
||||
unsigned char *v = dig.v_;
|
||||
|
||||
for (unsigned i = 0; i < dig.length; ++i)
|
||||
{
|
||||
unsigned char c1 = SHA1Digest::readHexDigit(is);
|
||||
unsigned char c2 = SHA1Digest::readHexDigit(is);
|
||||
|
||||
v[i] = (c1 << 4) + c2;
|
||||
}
|
||||
|
||||
is.check("Istream& operator>>(Istream&, SHA1Digest&)");
|
||||
return is;
|
||||
}
|
||||
|
||||
|
||||
Foam::Ostream& Foam::operator<<(Ostream& os, const SHA1Digest& dig)
|
||||
{
|
||||
const unsigned char *v = dig.v_;
|
||||
|
||||
@ -45,11 +45,13 @@ namespace Foam
|
||||
|
||||
// Forward declaration of classes
|
||||
class Ostream;
|
||||
class Istream;
|
||||
|
||||
// Forward declaration of friend functions and operators
|
||||
class SHA1;
|
||||
class SHA1Digest;
|
||||
Ostream& operator<<(Ostream&, const SHA1Digest&);
|
||||
Istream& operator>>(Istream&, SHA1Digest&);
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
@ -67,6 +69,9 @@ public:
|
||||
//- Construct a zero digest
|
||||
SHA1Digest();
|
||||
|
||||
//- Construct read a digest
|
||||
SHA1Digest(Istream&);
|
||||
|
||||
//- Reset the digest to zero
|
||||
void clear();
|
||||
|
||||
@ -77,11 +82,14 @@ public:
|
||||
bool operator!=(const SHA1Digest&) const;
|
||||
|
||||
friend Ostream& operator<<(Ostream&, const SHA1Digest&);
|
||||
friend Istream& operator>>(Istream&, SHA1Digest&);
|
||||
|
||||
private:
|
||||
|
||||
//- The digest contents
|
||||
unsigned char v_[length];
|
||||
|
||||
static unsigned char readHexDigit(Istream&);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -94,7 +94,7 @@ Foam::string& Foam::string::replaceAll
|
||||
|
||||
|
||||
// Expand all occurences of environment variables and initial tilde sequences
|
||||
Foam::string& Foam::string::expand()
|
||||
Foam::string& Foam::string::expand(const bool recurse)
|
||||
{
|
||||
size_type startEnvar = 0;
|
||||
|
||||
@ -140,6 +140,10 @@ Foam::string& Foam::string::expand()
|
||||
|
||||
if (enVarString.size())
|
||||
{
|
||||
if (recurse)
|
||||
{
|
||||
enVarString.expand();
|
||||
}
|
||||
std::string::replace
|
||||
(
|
||||
startEnvar,
|
||||
|
||||
@ -182,7 +182,7 @@ public:
|
||||
//
|
||||
// @sa
|
||||
// Foam::findEtcFile
|
||||
string& expand();
|
||||
string& expand(const bool recurse=false);
|
||||
|
||||
//- Remove repeated characters returning true if string changed
|
||||
bool removeRepeated(const char);
|
||||
|
||||
@ -9,7 +9,8 @@
|
||||
(
|
||||
dynamicFvMesh::defaultRegion,
|
||||
runTime.timeName(),
|
||||
runTime
|
||||
runTime,
|
||||
IOobject::MUST_READ
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
@ -25,11 +25,8 @@ License
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "directionInfo.H"
|
||||
//#include "hexMatcher.H"
|
||||
//#include "meshTools.H"
|
||||
#include "polyMesh.H"
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
// Find edge among edgeLabels that uses v0 and v1
|
||||
@ -209,13 +206,44 @@ Foam::Ostream& Foam::operator<<
|
||||
const Foam::directionInfo& wDist
|
||||
)
|
||||
{
|
||||
return os << wDist.index_ << wDist.n_;
|
||||
if (os.format() == IOstream::ASCII)
|
||||
{
|
||||
os << wDist.index_ << wDist.n_;
|
||||
}
|
||||
else
|
||||
{
|
||||
os.write
|
||||
(
|
||||
reinterpret_cast<const char*>(&wDist.index_),
|
||||
sizeof(directionInfo)
|
||||
);
|
||||
}
|
||||
|
||||
// Check state of Ostream
|
||||
os.check("Ostream& operator<<(Ostream&, const directionInfo&)");
|
||||
return os;
|
||||
|
||||
}
|
||||
|
||||
|
||||
Foam::Istream& Foam::operator>>(Foam::Istream& is, Foam::directionInfo& wDist)
|
||||
{
|
||||
return is >> wDist.index_ >> wDist.n_;
|
||||
if (is.format() == IOstream::ASCII)
|
||||
{
|
||||
is >> wDist.index_ >> wDist.n_;
|
||||
}
|
||||
else
|
||||
{
|
||||
is.read
|
||||
(
|
||||
reinterpret_cast<char*>(&wDist.index_),
|
||||
sizeof(directionInfo)
|
||||
);
|
||||
}
|
||||
|
||||
// Check state of Istream
|
||||
is.check("Istream& operator>>(Istream&, directionInfo&)");
|
||||
return is;
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -251,6 +251,14 @@ public:
|
||||
};
|
||||
|
||||
|
||||
//- Data associated with directionInfo type are contiguous
|
||||
template<>
|
||||
inline bool contiguous<directionInfo>()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
@ -33,12 +33,42 @@ Foam::Ostream& Foam::operator<<
|
||||
const Foam::wallNormalInfo& wDist
|
||||
)
|
||||
{
|
||||
return os << wDist.normal();
|
||||
if (os.format() == IOstream::ASCII)
|
||||
{
|
||||
os << wDist.normal();
|
||||
}
|
||||
else
|
||||
{
|
||||
os.write
|
||||
(
|
||||
reinterpret_cast<const char*>(&wDist.normal_),
|
||||
sizeof(vector)
|
||||
);
|
||||
}
|
||||
|
||||
// Check state of Ostream
|
||||
os.check("Ostream& operator<<(Ostream&, const wallNormalInfo&)");
|
||||
return os;
|
||||
}
|
||||
|
||||
Foam::Istream& Foam::operator>>(Foam::Istream& is, Foam::wallNormalInfo& wDist)
|
||||
{
|
||||
return is >> wDist.normal_;
|
||||
if (is.format() == IOstream::ASCII)
|
||||
{
|
||||
is >> wDist.normal_;
|
||||
}
|
||||
else
|
||||
{
|
||||
is.read
|
||||
(
|
||||
reinterpret_cast<char*>(&wDist.normal_),
|
||||
sizeof(vector)
|
||||
);
|
||||
}
|
||||
|
||||
// Check state of Istream
|
||||
is.check("Istream& operator>>(Istream&, wallNormalInfo&)");
|
||||
return is;
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -191,6 +191,14 @@ public:
|
||||
};
|
||||
|
||||
|
||||
//- Data associated with wallNormalInfo type are contiguous
|
||||
template<>
|
||||
inline bool contiguous<wallNormalInfo>()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
@ -33,13 +33,43 @@ Foam::Ostream& Foam::operator<<
|
||||
const Foam::refinementData& wDist
|
||||
)
|
||||
{
|
||||
return os << wDist.refinementCount_ << token::SPACE << wDist.count_;
|
||||
if (os.format() == IOstream::ASCII)
|
||||
{
|
||||
os << wDist.refinementCount_ << token::SPACE << wDist.count_;
|
||||
}
|
||||
else
|
||||
{
|
||||
os.write
|
||||
(
|
||||
reinterpret_cast<const char*>(&wDist.refinementCount_),
|
||||
sizeof(refinementData)
|
||||
);
|
||||
}
|
||||
|
||||
// Check state of Ostream
|
||||
os.check("Ostream& operator<<(Ostream&, const refinementData&)");
|
||||
return os;
|
||||
}
|
||||
|
||||
|
||||
Foam::Istream& Foam::operator>>(Foam::Istream& is, Foam::refinementData& wDist)
|
||||
{
|
||||
return is >> wDist.refinementCount_ >> wDist.count_;
|
||||
if (is.format() == IOstream::ASCII)
|
||||
{
|
||||
is >> wDist.refinementCount_ >> wDist.count_;
|
||||
}
|
||||
else
|
||||
{
|
||||
is.read
|
||||
(
|
||||
reinterpret_cast<char*>(&wDist.refinementCount_),
|
||||
sizeof(refinementData)
|
||||
);
|
||||
}
|
||||
|
||||
// Check state of Istream
|
||||
is.check("Istream& operator>>(Istream&, refinementData&)");
|
||||
return is;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -208,6 +208,14 @@ public:
|
||||
};
|
||||
|
||||
|
||||
//- Data associated with refinementData type are contiguous
|
||||
template<>
|
||||
inline bool contiguous<refinementData>()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
@ -242,6 +242,14 @@ public:
|
||||
};
|
||||
|
||||
|
||||
//- Data associated with refinementDistanceData type are contiguous
|
||||
template<>
|
||||
inline bool contiguous<refinementDistanceData>()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
@ -227,6 +227,7 @@ $(schemes)/clippedLinear/clippedLinear.C
|
||||
$(schemes)/harmonic/harmonic.C
|
||||
$(schemes)/fixedBlended/fixedBlended.C
|
||||
$(schemes)/localBlended/localBlended.C
|
||||
$(schemes)/limiterBlended/limiterBlended.C
|
||||
$(schemes)/localMax/localMax.C
|
||||
$(schemes)/localMin/localMin.C
|
||||
|
||||
|
||||
@ -219,6 +219,14 @@ public:
|
||||
};
|
||||
|
||||
|
||||
//- Data associated with smoothData type are contiguous
|
||||
template<>
|
||||
inline bool contiguous<smoothData>()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
@ -210,6 +210,14 @@ public:
|
||||
};
|
||||
|
||||
|
||||
//- Data associated with sweepData type are contiguous
|
||||
template<>
|
||||
inline bool contiguous<sweepData>()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
@ -144,6 +144,14 @@ public:
|
||||
};
|
||||
|
||||
|
||||
//- Data associated with pointEdgePoint type as contiguous as underlying type
|
||||
template<>
|
||||
inline bool contiguous<wallPointYPlus>()
|
||||
{
|
||||
return contiguous<wallPointData<scalar> >();
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
|
||||
@ -0,0 +1,36 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ 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 3 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, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fvMesh.H"
|
||||
#include "limiterBlended.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
makeSurfaceInterpolationScheme(limiterBlended)
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,229 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ 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 3 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, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::limiterBlended
|
||||
|
||||
Description
|
||||
Blends two specified schemes using the limiter function provided by a
|
||||
limitedSurfaceInterpolationScheme.
|
||||
|
||||
The limited scheme is specified first followed by the scheme to be scaled
|
||||
by the limiter and then the scheme scaled by 1 - limiter.
|
||||
|
||||
SourceFiles
|
||||
limiterBlended.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef limiterBlended_H
|
||||
#define limiterBlended_H
|
||||
|
||||
#include "limitedSurfaceInterpolationScheme.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class limiterBlended Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class Type>
|
||||
class limiterBlended
|
||||
:
|
||||
public surfaceInterpolationScheme<Type>
|
||||
{
|
||||
// Private Member Functions
|
||||
|
||||
//- Limited scheme providing the limiter
|
||||
tmp<limitedSurfaceInterpolationScheme<Type> > tLimitedScheme_;
|
||||
|
||||
//- Scheme 1
|
||||
tmp<surfaceInterpolationScheme<Type> > tScheme1_;
|
||||
|
||||
//- Scheme 2
|
||||
tmp<surfaceInterpolationScheme<Type> > tScheme2_;
|
||||
|
||||
|
||||
//- Disallow default bitwise copy construct
|
||||
limiterBlended(const limiterBlended&);
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const limiterBlended&);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("limiterBlended");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from mesh and Istream.
|
||||
// The name of the flux field is read from the Istream and looked-up
|
||||
// from the mesh objectRegistry
|
||||
limiterBlended
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
Istream& is
|
||||
)
|
||||
:
|
||||
surfaceInterpolationScheme<Type>(mesh),
|
||||
tLimitedScheme_
|
||||
(
|
||||
limitedSurfaceInterpolationScheme<Type>::New(mesh, is)
|
||||
),
|
||||
tScheme1_
|
||||
(
|
||||
surfaceInterpolationScheme<Type>::New(mesh, is)
|
||||
),
|
||||
tScheme2_
|
||||
(
|
||||
surfaceInterpolationScheme<Type>::New(mesh, is)
|
||||
)
|
||||
{}
|
||||
|
||||
//- Construct from mesh, faceFlux and Istream
|
||||
limiterBlended
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
const surfaceScalarField& faceFlux,
|
||||
Istream& is
|
||||
)
|
||||
:
|
||||
surfaceInterpolationScheme<Type>(mesh),
|
||||
tLimitedScheme_
|
||||
(
|
||||
limitedSurfaceInterpolationScheme<Type>::New(mesh, faceFlux, is)
|
||||
),
|
||||
tScheme1_
|
||||
(
|
||||
surfaceInterpolationScheme<Type>::New(mesh, faceFlux, is)
|
||||
),
|
||||
tScheme2_
|
||||
(
|
||||
surfaceInterpolationScheme<Type>::New(mesh, faceFlux, is)
|
||||
)
|
||||
{}
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Return the interpolation weighting factors
|
||||
tmp<surfaceScalarField> weights
|
||||
(
|
||||
const GeometricField<Type, fvPatchField, volMesh>& vf
|
||||
) const
|
||||
{
|
||||
surfaceScalarField blendingFactor =
|
||||
tLimitedScheme_().limiter(vf);
|
||||
|
||||
return
|
||||
blendingFactor*tScheme1_().weights(vf)
|
||||
+ (scalar(1) - blendingFactor)*tScheme2_().weights(vf);
|
||||
}
|
||||
|
||||
//- Return the face-interpolate of the given cell field
|
||||
// with explicit correction
|
||||
tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
|
||||
interpolate(const GeometricField<Type, fvPatchField, volMesh>& vf) const
|
||||
{
|
||||
surfaceScalarField blendingFactor =
|
||||
tLimitedScheme_().limiter(vf);
|
||||
|
||||
return
|
||||
blendingFactor*tScheme1_().interpolate(vf)
|
||||
+ (scalar(1) - blendingFactor)*tScheme2_().interpolate(vf);
|
||||
}
|
||||
|
||||
|
||||
//- Return true if this scheme uses an explicit correction
|
||||
virtual bool corrected() const
|
||||
{
|
||||
return tScheme1_().corrected() || tScheme2_().corrected();
|
||||
}
|
||||
|
||||
|
||||
//- Return the explicit correction to the face-interpolate
|
||||
// for the given field
|
||||
virtual tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
|
||||
correction
|
||||
(
|
||||
const GeometricField<Type, fvPatchField, volMesh>& vf
|
||||
) const
|
||||
{
|
||||
surfaceScalarField blendingFactor =
|
||||
tLimitedScheme_().limiter(vf);
|
||||
|
||||
if (tScheme1_().corrected())
|
||||
{
|
||||
if (tScheme2_().corrected())
|
||||
{
|
||||
return
|
||||
(
|
||||
blendingFactor
|
||||
* tScheme1_().correction(vf)
|
||||
+ (scalar(1.0) - blendingFactor)
|
||||
* tScheme2_().correction(vf)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
return
|
||||
(
|
||||
blendingFactor
|
||||
* tScheme1_().correction(vf)
|
||||
);
|
||||
}
|
||||
}
|
||||
else if (tScheme2_().corrected())
|
||||
{
|
||||
return
|
||||
(
|
||||
(scalar(1.0) - blendingFactor)
|
||||
* tScheme2_().correction(vf)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
return tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
|
||||
(
|
||||
NULL
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -218,6 +218,14 @@ public:
|
||||
};
|
||||
|
||||
|
||||
//- Data associated with pointEdgeStructuredWalk type are contiguous
|
||||
template<>
|
||||
inline bool contiguous<pointEdgeStructuredWalk>()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
@ -40,9 +40,6 @@ SourceFiles
|
||||
#define pointData_H
|
||||
|
||||
#include "pointEdgePoint.H"
|
||||
//#include "point.H"
|
||||
//#include "label.H"
|
||||
//#include "tensor.H"
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
@ -158,6 +155,14 @@ public:
|
||||
};
|
||||
|
||||
|
||||
//- Data associated with pointData as contiguous as pointEdgePoint
|
||||
template<>
|
||||
inline bool contiguous<pointData>()
|
||||
{
|
||||
return contiguous<pointEdgePoint>();
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
@ -226,6 +226,14 @@ public:
|
||||
};
|
||||
|
||||
|
||||
//- Data associated with pointEdgePoint type are contiguous
|
||||
template<>
|
||||
inline bool contiguous<pointEdgePoint>()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
@ -201,6 +201,14 @@ public:
|
||||
};
|
||||
|
||||
|
||||
//- Data associated with cellInfo type are contiguous
|
||||
template<>
|
||||
inline bool contiguous<cellInfo>()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
@ -223,6 +223,14 @@ public:
|
||||
};
|
||||
|
||||
|
||||
//- Data associated with wallPoint type are contiguous
|
||||
template<>
|
||||
inline bool contiguous<wallPoint>()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
@ -160,6 +160,46 @@ public:
|
||||
};
|
||||
|
||||
|
||||
//- Data associated with wallPointData type are contiguous. List the usual
|
||||
// ones.
|
||||
|
||||
template <>
|
||||
inline bool contiguous<wallPointData<bool> >()
|
||||
{
|
||||
return contiguous<wallPoint>();
|
||||
}
|
||||
template <>
|
||||
inline bool contiguous<wallPointData<label> >()
|
||||
{
|
||||
return contiguous<wallPoint>();
|
||||
}
|
||||
template <>
|
||||
inline bool contiguous<wallPointData<scalar> >()
|
||||
{
|
||||
return contiguous<wallPoint>();
|
||||
}
|
||||
template <>
|
||||
inline bool contiguous<wallPointData<vector> >()
|
||||
{
|
||||
return contiguous<wallPoint>();
|
||||
}
|
||||
template <>
|
||||
inline bool contiguous<wallPointData<sphericalTensor> >()
|
||||
{
|
||||
return contiguous<wallPoint>();
|
||||
}
|
||||
template <>
|
||||
inline bool contiguous<wallPointData<symmTensor> >()
|
||||
{
|
||||
return contiguous<wallPoint>();
|
||||
}
|
||||
template <>
|
||||
inline bool contiguous<wallPointData<tensor> >()
|
||||
{
|
||||
return contiguous<wallPoint>();
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
|
||||
@ -195,6 +195,14 @@ public:
|
||||
};
|
||||
|
||||
|
||||
//- Data associated with topoDistanceData type are contiguous
|
||||
template<>
|
||||
inline bool contiguous<topoDistanceData>()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
@ -52,6 +52,164 @@ class smoothDelta
|
||||
:
|
||||
public LESdelta
|
||||
{
|
||||
public:
|
||||
|
||||
//- Public member class used by mesh-wave to propagate the delta-ratio
|
||||
class deltaData
|
||||
{
|
||||
scalar delta_;
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Update. Gets information from neighbouring face/cell and
|
||||
// uses this to update itself (if nessecary) and return true.
|
||||
template<class TrackingData>
|
||||
inline bool update
|
||||
(
|
||||
const deltaData& w2,
|
||||
const scalar scale,
|
||||
const scalar tol,
|
||||
TrackingData& td
|
||||
);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct null
|
||||
inline deltaData();
|
||||
|
||||
//- Construct from origin, yStar, distance
|
||||
inline deltaData(const scalar delta);
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Access
|
||||
|
||||
scalar delta() const
|
||||
{
|
||||
return delta_;
|
||||
}
|
||||
|
||||
|
||||
// Needed by FaceCellWave
|
||||
|
||||
//- Check whether origin has been changed at all or
|
||||
// still contains original (invalid) value.
|
||||
template<class TrackingData>
|
||||
inline bool valid(TrackingData& td) const;
|
||||
|
||||
//- Check for identical geometrical data.
|
||||
// Used for cyclics checking.
|
||||
template<class TrackingData>
|
||||
inline bool sameGeometry
|
||||
(
|
||||
const polyMesh&,
|
||||
const deltaData&,
|
||||
const scalar,
|
||||
TrackingData& td
|
||||
) const;
|
||||
|
||||
//- Convert any absolute coordinates into relative to
|
||||
// (patch)face centre
|
||||
template<class TrackingData>
|
||||
inline void leaveDomain
|
||||
(
|
||||
const polyMesh&,
|
||||
const polyPatch&,
|
||||
const label patchFaceI,
|
||||
const point& faceCentre,
|
||||
TrackingData& td
|
||||
);
|
||||
|
||||
//- Reverse of leaveDomain
|
||||
template<class TrackingData>
|
||||
inline void enterDomain
|
||||
(
|
||||
const polyMesh&,
|
||||
const polyPatch&,
|
||||
const label patchFaceI,
|
||||
const point& faceCentre,
|
||||
TrackingData& td
|
||||
);
|
||||
|
||||
//- Apply rotation matrix to any coordinates
|
||||
template<class TrackingData>
|
||||
inline void transform
|
||||
(
|
||||
const polyMesh&,
|
||||
const tensor&,
|
||||
TrackingData& td
|
||||
);
|
||||
|
||||
//- Influence of neighbouring face.
|
||||
template<class TrackingData>
|
||||
inline bool updateCell
|
||||
(
|
||||
const polyMesh&,
|
||||
const label thisCellI,
|
||||
const label neighbourFaceI,
|
||||
const deltaData& neighbourInfo,
|
||||
const scalar tol,
|
||||
TrackingData& td
|
||||
);
|
||||
|
||||
//- Influence of neighbouring cell.
|
||||
template<class TrackingData>
|
||||
inline bool updateFace
|
||||
(
|
||||
const polyMesh&,
|
||||
const label thisFaceI,
|
||||
const label neighbourCellI,
|
||||
const deltaData& neighbourInfo,
|
||||
const scalar tol,
|
||||
TrackingData& td
|
||||
);
|
||||
|
||||
//- Influence of different value on same face.
|
||||
template<class TrackingData>
|
||||
inline bool updateFace
|
||||
(
|
||||
const polyMesh&,
|
||||
const label thisFaceI,
|
||||
const deltaData& neighbourInfo,
|
||||
const scalar tol,
|
||||
TrackingData& td
|
||||
);
|
||||
|
||||
//- Same (like operator==)
|
||||
template<class TrackingData>
|
||||
inline bool equal(const deltaData&, TrackingData& td) const;
|
||||
|
||||
// Member Operators
|
||||
|
||||
// Needed for List IO
|
||||
inline bool operator==(const deltaData&) const;
|
||||
|
||||
inline bool operator!=(const deltaData&) const;
|
||||
|
||||
// IOstream Operators
|
||||
|
||||
friend Ostream& operator<<
|
||||
(
|
||||
Ostream& os,
|
||||
const deltaData& wDist
|
||||
)
|
||||
{
|
||||
return os << wDist.delta_;
|
||||
}
|
||||
|
||||
friend Istream& operator>>(Istream& is, deltaData& wDist)
|
||||
{
|
||||
return is >> wDist.delta_;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
private:
|
||||
|
||||
// Private data
|
||||
|
||||
autoPtr<LESdelta> geometricDelta_;
|
||||
@ -67,159 +225,6 @@ class smoothDelta
|
||||
// Calculate the delta values
|
||||
void calcDelta();
|
||||
|
||||
//- Private member class used by mesh-wave to propagate the delta-ratio
|
||||
class deltaData
|
||||
{
|
||||
scalar delta_;
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Update. Gets information from neighbouring face/cell and
|
||||
// uses this to update itself (if nessecary) and return true.
|
||||
template<class TrackingData>
|
||||
inline bool update
|
||||
(
|
||||
const deltaData& w2,
|
||||
const scalar scale,
|
||||
const scalar tol,
|
||||
TrackingData& td
|
||||
);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct null
|
||||
inline deltaData();
|
||||
|
||||
//- Construct from origin, yStar, distance
|
||||
inline deltaData(const scalar delta);
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Access
|
||||
|
||||
scalar delta() const
|
||||
{
|
||||
return delta_;
|
||||
}
|
||||
|
||||
|
||||
// Needed by FaceCellWave
|
||||
|
||||
//- Check whether origin has been changed at all or
|
||||
// still contains original (invalid) value.
|
||||
template<class TrackingData>
|
||||
inline bool valid(TrackingData& td) const;
|
||||
|
||||
//- Check for identical geometrical data.
|
||||
// Used for cyclics checking.
|
||||
template<class TrackingData>
|
||||
inline bool sameGeometry
|
||||
(
|
||||
const polyMesh&,
|
||||
const deltaData&,
|
||||
const scalar,
|
||||
TrackingData& td
|
||||
) const;
|
||||
|
||||
//- Convert any absolute coordinates into relative to
|
||||
// (patch)face centre
|
||||
template<class TrackingData>
|
||||
inline void leaveDomain
|
||||
(
|
||||
const polyMesh&,
|
||||
const polyPatch&,
|
||||
const label patchFaceI,
|
||||
const point& faceCentre,
|
||||
TrackingData& td
|
||||
);
|
||||
|
||||
//- Reverse of leaveDomain
|
||||
template<class TrackingData>
|
||||
inline void enterDomain
|
||||
(
|
||||
const polyMesh&,
|
||||
const polyPatch&,
|
||||
const label patchFaceI,
|
||||
const point& faceCentre,
|
||||
TrackingData& td
|
||||
);
|
||||
|
||||
//- Apply rotation matrix to any coordinates
|
||||
template<class TrackingData>
|
||||
inline void transform
|
||||
(
|
||||
const polyMesh&,
|
||||
const tensor&,
|
||||
TrackingData& td
|
||||
);
|
||||
|
||||
//- Influence of neighbouring face.
|
||||
template<class TrackingData>
|
||||
inline bool updateCell
|
||||
(
|
||||
const polyMesh&,
|
||||
const label thisCellI,
|
||||
const label neighbourFaceI,
|
||||
const deltaData& neighbourInfo,
|
||||
const scalar tol,
|
||||
TrackingData& td
|
||||
);
|
||||
|
||||
//- Influence of neighbouring cell.
|
||||
template<class TrackingData>
|
||||
inline bool updateFace
|
||||
(
|
||||
const polyMesh&,
|
||||
const label thisFaceI,
|
||||
const label neighbourCellI,
|
||||
const deltaData& neighbourInfo,
|
||||
const scalar tol,
|
||||
TrackingData& td
|
||||
);
|
||||
|
||||
//- Influence of different value on same face.
|
||||
template<class TrackingData>
|
||||
inline bool updateFace
|
||||
(
|
||||
const polyMesh&,
|
||||
const label thisFaceI,
|
||||
const deltaData& neighbourInfo,
|
||||
const scalar tol,
|
||||
TrackingData& td
|
||||
);
|
||||
|
||||
//- Same (like operator==)
|
||||
template<class TrackingData>
|
||||
inline bool equal(const deltaData&, TrackingData& td) const;
|
||||
|
||||
// Member Operators
|
||||
|
||||
// Needed for List IO
|
||||
inline bool operator==(const deltaData&) const;
|
||||
|
||||
inline bool operator!=(const deltaData&) const;
|
||||
|
||||
// IOstream Operators
|
||||
|
||||
friend Ostream& operator<<
|
||||
(
|
||||
Ostream& os,
|
||||
const deltaData& wDist
|
||||
)
|
||||
{
|
||||
return os << wDist.delta_;
|
||||
}
|
||||
|
||||
friend Istream& operator>>(Istream& is, deltaData& wDist)
|
||||
{
|
||||
return is >> wDist.delta_;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
void setChangedFaces
|
||||
(
|
||||
@ -262,6 +267,14 @@ public:
|
||||
};
|
||||
|
||||
|
||||
//- Data associated with deltaData type are contiguous
|
||||
template<>
|
||||
inline bool contiguous<smoothDelta::deltaData>()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
Reference in New Issue
Block a user