mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' of ssh://noisy/home/noisy3/OpenFOAM/OpenFOAM-dev
This commit is contained in:
@ -39,6 +39,7 @@ parallel/decompose/AllwmakeLnInclude
|
||||
dummyThirdParty/Allwmake $*
|
||||
|
||||
wmake $makeOption lagrangian/basic
|
||||
wmake $makeOption lagrangian/distributionModels
|
||||
wmake $makeOption finiteVolume
|
||||
wmake $makeOption genericPatchFields
|
||||
|
||||
|
||||
@ -29,7 +29,7 @@ Description
|
||||
|
||||
SeeAlso
|
||||
The manpage regex(7) for more information about POSIX regular expressions.
|
||||
These differ somewhat from \c Perl and @c sed regular expressions.
|
||||
These differ somewhat from \c Perl and \c sed regular expressions.
|
||||
|
||||
SourceFiles
|
||||
regExp.C
|
||||
|
||||
@ -66,6 +66,7 @@ primitives/functions/DataEntry/makeDataEntries.C
|
||||
primitives/functions/DataEntry/polynomial/polynomial.C
|
||||
primitives/functions/DataEntry/polynomial/polynomialIO.C
|
||||
|
||||
primitives/functions/Polynomial/polynomialFunction.C
|
||||
|
||||
strings = primitives/strings
|
||||
$(strings)/string/string.C
|
||||
@ -164,11 +165,16 @@ $(functionEntries)/includeIfPresentEntry/includeIfPresentEntry.C
|
||||
$(functionEntries)/inputModeEntry/inputModeEntry.C
|
||||
$(functionEntries)/removeEntry/removeEntry.C
|
||||
|
||||
calcEntry = $(functionEntries)/calcEntry
|
||||
$(calcEntry)/calcEntryParser.atg
|
||||
$(calcEntry)/calcEntryInternal.C
|
||||
$(calcEntry)/calcEntry.C
|
||||
|
||||
/*
|
||||
* Requires customized coco-cpp
|
||||
* could be dropped or activated in the future
|
||||
*/
|
||||
/*
|
||||
calcEntry = $(functionEntries)/calcEntry
|
||||
$(calcEntry)/calcEntryParser.atg
|
||||
$(calcEntry)/calcEntryInternal.C
|
||||
$(calcEntry)/calcEntry.C
|
||||
*/
|
||||
|
||||
IOdictionary = db/IOobjects/IOdictionary
|
||||
$(IOdictionary)/IOdictionary.C
|
||||
|
||||
@ -27,7 +27,7 @@ Class
|
||||
Description
|
||||
Specify a file to include if it exists. Expects a single string to follow.
|
||||
|
||||
The \c \#includeIfPresent directive is similar to the @c \#include
|
||||
The \c \#includeIfPresent directive is similar to the \c \#include
|
||||
directive, but does not generate an error if the file does not exist.
|
||||
|
||||
See Also
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -21,9 +21,9 @@ License
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
@mainpage OpenFOAM®: open source CFD
|
||||
\mainpage OpenFOAM®: open source CFD
|
||||
|
||||
@section about About OpenFOAM
|
||||
\section about About OpenFOAM
|
||||
|
||||
OpenFOAM is a free, open source CFD software package produced by
|
||||
a commercial company,
|
||||
@ -35,7 +35,7 @@ License
|
||||
heat transfer, to solid dynamics and electromagnetics.
|
||||
<a href="http://www.openfoam.com/features">More ...</a>
|
||||
|
||||
@section users Our commitment to the users
|
||||
\section users Our commitment to the users
|
||||
|
||||
OpenFOAM comes with full commercial support from OpenCFD, including
|
||||
<a href="http://www.openfoam.com/support/software.php">
|
||||
@ -48,7 +48,7 @@ License
|
||||
These activities fund the development, maintenance and release of
|
||||
OpenFOAM to make it an extremely viable commercial open source product.
|
||||
|
||||
@section opensource Our commitment to open source
|
||||
\section opensource Our commitment to open source
|
||||
|
||||
OpenCFD is committed to open source software, continually developing and
|
||||
maintaining OpenFOAM under the
|
||||
|
||||
@ -550,11 +550,12 @@ Foam::label Foam::polyBoundaryMesh::whichPatch(const label faceIndex) const
|
||||
|
||||
Foam::labelHashSet Foam::polyBoundaryMesh::patchSet
|
||||
(
|
||||
const wordList& patchNames
|
||||
const wordReList& patchNames,
|
||||
const bool warnNotFound
|
||||
) const
|
||||
{
|
||||
wordList allPatchNames = names();
|
||||
labelHashSet ps(size());
|
||||
const wordList allPatchNames(this->names());
|
||||
labelHashSet ids(size());
|
||||
|
||||
forAll(patchNames, i)
|
||||
{
|
||||
@ -562,20 +563,23 @@ Foam::labelHashSet Foam::polyBoundaryMesh::patchSet
|
||||
// of all patch names for matches
|
||||
labelList patchIDs = findStrings(patchNames[i], allPatchNames);
|
||||
|
||||
if (patchIDs.empty())
|
||||
if (patchIDs.empty() && warnNotFound)
|
||||
{
|
||||
WarningIn("polyBoundaryMesh::patchSet(const wordList&)")
|
||||
<< "Cannot find any patch names matching " << patchNames[i]
|
||||
WarningIn
|
||||
(
|
||||
"polyBoundaryMesh::patchSet"
|
||||
"(const wordReList&, const bool) const"
|
||||
) << "Cannot find any patch names matching " << patchNames[i]
|
||||
<< endl;
|
||||
}
|
||||
|
||||
forAll(patchIDs, j)
|
||||
{
|
||||
ps.insert(patchIDs[j]);
|
||||
ids.insert(patchIDs[j]);
|
||||
}
|
||||
}
|
||||
|
||||
return ps;
|
||||
return ids;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -38,6 +38,7 @@ SourceFiles
|
||||
#include "polyPatchList.H"
|
||||
#include "regIOobject.H"
|
||||
#include "labelPair.H"
|
||||
#include "wordReList.H"
|
||||
#include "HashSet.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
@ -166,9 +167,13 @@ public:
|
||||
//- Per boundary face label the patch index
|
||||
const labelList& patchID() const;
|
||||
|
||||
//- Return the set of patch IDs corresponding to the given list of names
|
||||
// Wild cards are expanded.
|
||||
labelHashSet patchSet(const wordList&) const;
|
||||
//- Return the set of patch IDs corresponding to the given names
|
||||
// By default warns if given names are not found.
|
||||
labelHashSet patchSet
|
||||
(
|
||||
const wordReList& patchNames,
|
||||
const bool warnNotFound = true
|
||||
) const;
|
||||
|
||||
//- Check whether all procs have all patches and in same order. Return
|
||||
// true if in error.
|
||||
|
||||
@ -41,6 +41,18 @@ Foam::Polynomial<PolySize>::Polynomial()
|
||||
}
|
||||
|
||||
|
||||
template<int PolySize>
|
||||
Foam::Polynomial<PolySize>::Polynomial
|
||||
(
|
||||
const Polynomial<PolySize>& poly
|
||||
)
|
||||
:
|
||||
VectorSpace<Polynomial<PolySize>, scalar, PolySize>(poly),
|
||||
logActive_(poly.logActive_),
|
||||
logCoeff_(poly.logCoeff_)
|
||||
{}
|
||||
|
||||
|
||||
template<int PolySize>
|
||||
Foam::Polynomial<PolySize>::Polynomial(const scalar coeffs[PolySize])
|
||||
:
|
||||
@ -68,7 +80,7 @@ Foam::Polynomial<PolySize>::Polynomial(const UList<scalar>& coeffs)
|
||||
(
|
||||
"Polynomial<PolySize>::Polynomial(const UList<scalar>&)"
|
||||
) << "Size mismatch: Needed " << PolySize
|
||||
<< " but got " << coeffs.size()
|
||||
<< " but given " << coeffs.size()
|
||||
<< nl << exit(FatalError);
|
||||
}
|
||||
|
||||
@ -79,6 +91,39 @@ Foam::Polynomial<PolySize>::Polynomial(const UList<scalar>& coeffs)
|
||||
}
|
||||
|
||||
|
||||
// template<int PolySize>
|
||||
// Foam::Polynomial<PolySize>::Polynomial(const polynomialFunction& poly)
|
||||
// :
|
||||
// VectorSpace<Polynomial<PolySize>, scalar, PolySize>(),
|
||||
// logActive_(poly.logActive()),
|
||||
// logCoeff_(poly.logCoeff())
|
||||
// {
|
||||
// if (poly.size() != PolySize)
|
||||
// {
|
||||
// FatalErrorIn
|
||||
// (
|
||||
// "Polynomial<PolySize>::Polynomial(const polynomialFunction&)"
|
||||
// ) << "Size mismatch: Needed " << PolySize
|
||||
// << " but given " << poly.size()
|
||||
// << nl << exit(FatalError);
|
||||
// }
|
||||
//
|
||||
// for (int i = 0; i < PolySize; ++i)
|
||||
// {
|
||||
// this->v_[i] = poly[i];
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
template<int PolySize>
|
||||
Foam::Polynomial<PolySize>::Polynomial(Istream& is)
|
||||
:
|
||||
VectorSpace<Polynomial<PolySize>, scalar, PolySize>(is),
|
||||
logActive_(false),
|
||||
logCoeff_(0.0)
|
||||
{}
|
||||
|
||||
|
||||
template<int PolySize>
|
||||
Foam::Polynomial<PolySize>::Polynomial(const word& name, Istream& is)
|
||||
:
|
||||
@ -111,38 +156,17 @@ Foam::Polynomial<PolySize>::Polynomial(const word& name, Istream& is)
|
||||
}
|
||||
|
||||
|
||||
template<int PolySize>
|
||||
Foam::Polynomial<PolySize>::Polynomial(Istream& is)
|
||||
:
|
||||
VectorSpace<Polynomial<PolySize>, scalar, PolySize>(is),
|
||||
logActive_(false),
|
||||
logCoeff_(0.0)
|
||||
{}
|
||||
|
||||
|
||||
template<int PolySize>
|
||||
Foam::Polynomial<PolySize>::Polynomial
|
||||
(
|
||||
const Polynomial<PolySize>& poly
|
||||
)
|
||||
:
|
||||
VectorSpace<Polynomial<PolySize>, scalar, PolySize>(poly),
|
||||
logActive_(poly.logActive_),
|
||||
logCoeff_(poly.logCoeff_)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<int PolySize>
|
||||
bool& Foam::Polynomial<PolySize>::logActive()
|
||||
bool Foam::Polynomial<PolySize>::logActive() const
|
||||
{
|
||||
return logActive_;
|
||||
}
|
||||
|
||||
|
||||
template<int PolySize>
|
||||
Foam::scalar& Foam::Polynomial<PolySize>::logCoeff()
|
||||
Foam::scalar Foam::Polynomial<PolySize>::logCoeff() const
|
||||
{
|
||||
return logCoeff_;
|
||||
}
|
||||
@ -151,27 +175,27 @@ Foam::scalar& Foam::Polynomial<PolySize>::logCoeff()
|
||||
template<int PolySize>
|
||||
Foam::scalar Foam::Polynomial<PolySize>::value(const scalar x) const
|
||||
{
|
||||
scalar y = this->v_[0];
|
||||
scalar val = this->v_[0];
|
||||
|
||||
// avoid costly pow() in calculation
|
||||
scalar powX = x;
|
||||
for (label i=1; i<PolySize; ++i)
|
||||
{
|
||||
y += this->v_[i]*powX;
|
||||
val += this->v_[i]*powX;
|
||||
powX *= x;
|
||||
}
|
||||
|
||||
if (logActive_)
|
||||
{
|
||||
y += logCoeff_*log(x);
|
||||
val += logCoeff_*log(x);
|
||||
}
|
||||
|
||||
return y;
|
||||
return val;
|
||||
}
|
||||
|
||||
|
||||
template<int PolySize>
|
||||
Foam::scalar Foam::Polynomial<PolySize>::integrateLimits
|
||||
Foam::scalar Foam::Polynomial<PolySize>::integrate
|
||||
(
|
||||
const scalar x1,
|
||||
const scalar x2
|
||||
@ -181,7 +205,7 @@ Foam::scalar Foam::Polynomial<PolySize>::integrateLimits
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"scalar Polynomial<PolySize>::integrateLimits"
|
||||
"scalar Polynomial<PolySize>::integrate"
|
||||
"("
|
||||
"const scalar, "
|
||||
"const scalar"
|
||||
@ -190,22 +214,33 @@ Foam::scalar Foam::Polynomial<PolySize>::integrateLimits
|
||||
<< nl << abort(FatalError);
|
||||
}
|
||||
|
||||
intPolyType poly = this->integrate();
|
||||
|
||||
return poly.value(x2) - poly.value(x1);
|
||||
// avoid costly pow() in calculation
|
||||
scalar powX1 = x1;
|
||||
scalar powX2 = x2;
|
||||
|
||||
scalar val = this->v_[0]*(powX2 - powX1);
|
||||
for (label i=1; i<PolySize; ++i)
|
||||
{
|
||||
val += this->v_[i]/(i + 1) * (powX2 - powX1);
|
||||
powX1 *= x1;
|
||||
powX2 *= x2;
|
||||
}
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
|
||||
template<int PolySize>
|
||||
typename Foam::Polynomial<PolySize>::intPolyType
|
||||
Foam::Polynomial<PolySize>::integrate(const scalar intConstant)
|
||||
Foam::Polynomial<PolySize>::integral(const scalar intConstant) const
|
||||
{
|
||||
intPolyType newCoeffs;
|
||||
|
||||
newCoeffs[0] = intConstant;
|
||||
forAll(*this, i)
|
||||
{
|
||||
newCoeffs[i + 1] = this->v_[i]/(i + 1);
|
||||
newCoeffs[i+1] = this->v_[i]/(i + 1);
|
||||
}
|
||||
|
||||
return newCoeffs;
|
||||
@ -214,14 +249,14 @@ Foam::Polynomial<PolySize>::integrate(const scalar intConstant)
|
||||
|
||||
template<int PolySize>
|
||||
typename Foam::Polynomial<PolySize>::polyType
|
||||
Foam::Polynomial<PolySize>::integrateMinus1(const scalar intConstant)
|
||||
Foam::Polynomial<PolySize>::integralMinus1(const scalar intConstant) const
|
||||
{
|
||||
polyType newCoeffs;
|
||||
|
||||
if (this->v_[0] > VSMALL)
|
||||
{
|
||||
newCoeffs.logActive() = true;
|
||||
newCoeffs.logCoeff() = this->v_[0];
|
||||
newCoeffs.logActive_ = true;
|
||||
newCoeffs.logCoeff_ = this->v_[0];
|
||||
}
|
||||
|
||||
newCoeffs[0] = intConstant;
|
||||
|
||||
@ -29,14 +29,14 @@ Description
|
||||
|
||||
poly = logCoeff*log(x) + sum(coeff_[i]*x^i)
|
||||
|
||||
where 0 \<= i \<= n
|
||||
where 0 \<= i \<= N
|
||||
|
||||
- integer powers, starting at zero
|
||||
- value(x) to evaluate the poly for a given value
|
||||
- integrate(x1, x2) between two scalar values
|
||||
- integrate() to return a new, intergated coeff polynomial
|
||||
- integral() to return a new, integral coeff polynomial
|
||||
- increases the size (order)
|
||||
- integrateMinus1() to return a new, integrated coeff polynomial where
|
||||
- integralMinus1() to return a new, integral coeff polynomial where
|
||||
the base poly starts at order -1
|
||||
|
||||
SourceFiles
|
||||
@ -85,10 +85,10 @@ class Polynomial
|
||||
|
||||
// Private data
|
||||
|
||||
//- Include the log term? - only activated using integrateMinus1()
|
||||
//- Include the log term? - only activated using integralMinus1()
|
||||
bool logActive_;
|
||||
|
||||
//- Log coefficient - only activated using integrateMinus1()
|
||||
//- Log coefficient - only activated using integralMinus1()
|
||||
scalar logCoeff_;
|
||||
|
||||
|
||||
@ -104,6 +104,9 @@ public:
|
||||
//- Construct null, with all coefficients = 0.0
|
||||
Polynomial();
|
||||
|
||||
//- Copy constructor
|
||||
Polynomial(const Polynomial&);
|
||||
|
||||
//- Construct from C-array of coefficients
|
||||
explicit Polynomial(const scalar coeffs[PolySize]);
|
||||
|
||||
@ -111,24 +114,21 @@ public:
|
||||
explicit Polynomial(const UList<scalar>& coeffs);
|
||||
|
||||
//- Construct from Istream
|
||||
Polynomial(Istream& is);
|
||||
Polynomial(Istream&);
|
||||
|
||||
//- Construct from name and Istream
|
||||
Polynomial(const word& name, Istream& is);
|
||||
|
||||
//- Copy constructor
|
||||
Polynomial(const Polynomial& poly);
|
||||
Polynomial(const word& name, Istream&);
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Access
|
||||
|
||||
//- Return access to the log term active flag
|
||||
bool& logActive();
|
||||
//- Return true if the log term is active
|
||||
bool logActive() const;
|
||||
|
||||
//- Return access to the log coefficient
|
||||
scalar& logCoeff();
|
||||
//- Return the log coefficient
|
||||
scalar logCoeff() const;
|
||||
|
||||
|
||||
// Evaluation
|
||||
@ -136,16 +136,17 @@ public:
|
||||
//- Return polynomial value
|
||||
scalar value(const scalar x) const;
|
||||
|
||||
//- Return integrated polynomial coefficients
|
||||
// argument becomes zeroth element (constant of integration)
|
||||
intPolyType integrate(const scalar intConstant = 0.0);
|
||||
|
||||
//- Return integrated polynomial coefficients when lowest order
|
||||
// is -1. Argument added to zeroth element
|
||||
polyType integrateMinus1(const scalar intConstant = 0.0);
|
||||
|
||||
//- Integrate between two values
|
||||
scalar integrateLimits(const scalar x1, const scalar x2) const;
|
||||
scalar integrate(const scalar x1, const scalar x2) const;
|
||||
|
||||
|
||||
//- Return integral coefficients.
|
||||
// Argument becomes zeroth element (constant of integration)
|
||||
intPolyType integral(const scalar intConstant = 0.0) const;
|
||||
|
||||
//- Return integral coefficients when lowest order is -1.
|
||||
// Argument becomes zeroth element (constant of integration)
|
||||
polyType integralMinus1(const scalar intConstant = 0.0) const;
|
||||
|
||||
|
||||
//- Ostream Operator
|
||||
|
||||
@ -0,0 +1,415 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2011 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 "polynomialFunction.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
defineTypeNameAndDebug(polynomialFunction, 0);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
|
||||
|
||||
|
||||
Foam::polynomialFunction Foam::polynomialFunction::cloneIntegral
|
||||
(
|
||||
const polynomialFunction& poly,
|
||||
const scalar intConstant
|
||||
)
|
||||
{
|
||||
polynomialFunction newPoly(poly.size()+1);
|
||||
|
||||
newPoly[0] = intConstant;
|
||||
forAll(poly, i)
|
||||
{
|
||||
newPoly[i+1] = poly[i]/(i + 1);
|
||||
}
|
||||
|
||||
return newPoly;
|
||||
}
|
||||
|
||||
|
||||
Foam::polynomialFunction Foam::polynomialFunction::cloneIntegralMinus1
|
||||
(
|
||||
const polynomialFunction& poly,
|
||||
const scalar intConstant
|
||||
)
|
||||
{
|
||||
polynomialFunction newPoly(poly.size()+1);
|
||||
|
||||
if (poly[0] > VSMALL)
|
||||
{
|
||||
newPoly.logActive_ = true;
|
||||
newPoly.logCoeff_ = poly[0];
|
||||
}
|
||||
|
||||
newPoly[0] = intConstant;
|
||||
for (label i=1; i < poly.size(); ++i)
|
||||
{
|
||||
newPoly[i] = poly[i]/i;
|
||||
}
|
||||
|
||||
return newPoly;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::polynomialFunction::polynomialFunction(const label order)
|
||||
:
|
||||
scalarList(order, 0.0),
|
||||
logActive_(false),
|
||||
logCoeff_(0.0)
|
||||
{
|
||||
if (this->empty())
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"polynomialFunction::polynomialFunction(const label order)"
|
||||
) << "polynomialFunction coefficients are invalid (empty)"
|
||||
<< nl << exit(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Foam::polynomialFunction::polynomialFunction(const polynomialFunction& poly)
|
||||
:
|
||||
scalarList(poly),
|
||||
logActive_(poly.logActive_),
|
||||
logCoeff_(poly.logCoeff_)
|
||||
{}
|
||||
|
||||
|
||||
Foam::polynomialFunction::polynomialFunction(const UList<scalar>& coeffs)
|
||||
:
|
||||
scalarList(coeffs),
|
||||
logActive_(false),
|
||||
logCoeff_(0.0)
|
||||
{
|
||||
if (this->empty())
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"polynomialFunction::polynomialFunction(const UList<scalar>&)"
|
||||
) << "polynomialFunction coefficients are invalid (empty)"
|
||||
<< nl << exit(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Foam::polynomialFunction::polynomialFunction(Istream& is)
|
||||
:
|
||||
scalarList(is),
|
||||
logActive_(false),
|
||||
logCoeff_(0.0)
|
||||
{
|
||||
if (this->empty())
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"polynomialFunction::polynomialFunction(Istream&)"
|
||||
) << "polynomialFunction coefficients are invalid (empty)"
|
||||
<< nl << exit(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::polynomialFunction::~polynomialFunction()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
bool Foam::polynomialFunction::logActive() const
|
||||
{
|
||||
return logActive_;
|
||||
}
|
||||
|
||||
|
||||
Foam::scalar Foam::polynomialFunction::logCoeff() const
|
||||
{
|
||||
return logCoeff_;
|
||||
}
|
||||
|
||||
|
||||
Foam::scalar Foam::polynomialFunction::value(const scalar x) const
|
||||
{
|
||||
const scalarList& coeffs = *this;
|
||||
scalar val = coeffs[0];
|
||||
|
||||
// avoid costly pow() in calculation
|
||||
scalar powX = x;
|
||||
for (label i=1; i<coeffs.size(); ++i)
|
||||
{
|
||||
val += coeffs[i]*powX;
|
||||
powX *= x;
|
||||
}
|
||||
|
||||
if (logActive_)
|
||||
{
|
||||
val += this->logCoeff_*log(x);
|
||||
}
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
|
||||
Foam::scalar Foam::polynomialFunction::integrate
|
||||
(
|
||||
const scalar x1,
|
||||
const scalar x2
|
||||
) const
|
||||
{
|
||||
const scalarList& coeffs = *this;
|
||||
|
||||
if (logActive_)
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"scalar polynomialFunction::integrate"
|
||||
"("
|
||||
"const scalar, "
|
||||
"const scalar"
|
||||
") const"
|
||||
) << "Cannot integrate polynomial with logarithmic coefficients"
|
||||
<< nl << abort(FatalError);
|
||||
}
|
||||
|
||||
// avoid costly pow() in calculation
|
||||
scalar powX1 = x1;
|
||||
scalar powX2 = x2;
|
||||
|
||||
scalar val = coeffs[0]*(powX2 - powX1);
|
||||
for (label i=1; i<coeffs.size(); ++i)
|
||||
{
|
||||
val += coeffs[i]/(i + 1)*(powX2 - powX1);
|
||||
powX1 *= x1;
|
||||
powX2 *= x2;
|
||||
}
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
|
||||
Foam::polynomialFunction
|
||||
Foam::polynomialFunction::integral(const scalar intConstant) const
|
||||
{
|
||||
return cloneIntegral(*this, intConstant);
|
||||
}
|
||||
|
||||
|
||||
Foam::polynomialFunction
|
||||
Foam::polynomialFunction::integralMinus1(const scalar intConstant) const
|
||||
{
|
||||
return cloneIntegralMinus1(*this, intConstant);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::polynomialFunction&
|
||||
Foam::polynomialFunction::operator+=(const polynomialFunction& poly)
|
||||
{
|
||||
scalarList& coeffs = *this;
|
||||
|
||||
if (coeffs.size() > poly.size())
|
||||
{
|
||||
forAll(poly, i)
|
||||
{
|
||||
coeffs[i] += poly[i];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
coeffs.setSize(poly.size(), 0.0);
|
||||
|
||||
forAll(coeffs, i)
|
||||
{
|
||||
coeffs[i] += poly[i];
|
||||
}
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
Foam::polynomialFunction&
|
||||
Foam::polynomialFunction::operator-=(const polynomialFunction& poly)
|
||||
{
|
||||
scalarList& coeffs = *this;
|
||||
|
||||
if (coeffs.size() > poly.size())
|
||||
{
|
||||
forAll(poly, i)
|
||||
{
|
||||
coeffs[i] -= poly[i];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
coeffs.setSize(poly.size(), 0.0);
|
||||
|
||||
forAll(coeffs, i)
|
||||
{
|
||||
coeffs[i] -= poly[i];
|
||||
}
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
Foam::polynomialFunction&
|
||||
Foam::polynomialFunction::operator*=(const scalar s)
|
||||
{
|
||||
scalarList& coeffs = *this;
|
||||
forAll(coeffs, i)
|
||||
{
|
||||
coeffs[i] *= s;
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
Foam::polynomialFunction&
|
||||
Foam::polynomialFunction::operator/=(const scalar s)
|
||||
{
|
||||
scalarList& coeffs = *this;
|
||||
forAll(coeffs, i)
|
||||
{
|
||||
coeffs[i] /= s;
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
|
||||
|
||||
Foam::Ostream& Foam::operator<<(Ostream& os, const polynomialFunction& poly)
|
||||
{
|
||||
// output like VectorSpace
|
||||
os << token::BEGIN_LIST;
|
||||
|
||||
if (!poly.empty())
|
||||
{
|
||||
for (int i=0; i<poly.size()-1; i++)
|
||||
{
|
||||
os << poly[i] << token::SPACE;
|
||||
}
|
||||
os << poly.last();
|
||||
}
|
||||
os << token::END_LIST;
|
||||
|
||||
|
||||
// Check state of Ostream
|
||||
os.check("operator<<(Ostream&, const polynomialFunction&)");
|
||||
|
||||
return os;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Global Operators * * * * * * * * * * * * * //
|
||||
|
||||
Foam::polynomialFunction
|
||||
Foam::operator+
|
||||
(
|
||||
const polynomialFunction& p1,
|
||||
const polynomialFunction& p2
|
||||
)
|
||||
{
|
||||
polynomialFunction poly(p1);
|
||||
return poly += p2;
|
||||
}
|
||||
|
||||
|
||||
Foam::polynomialFunction
|
||||
Foam::operator-
|
||||
(
|
||||
const polynomialFunction& p1,
|
||||
const polynomialFunction& p2
|
||||
)
|
||||
{
|
||||
polynomialFunction poly(p1);
|
||||
return poly -= p2;
|
||||
}
|
||||
|
||||
|
||||
Foam::polynomialFunction
|
||||
Foam::operator*
|
||||
(
|
||||
const scalar s,
|
||||
const polynomialFunction& p
|
||||
)
|
||||
{
|
||||
polynomialFunction poly(p);
|
||||
return poly *= s;
|
||||
}
|
||||
|
||||
|
||||
Foam::polynomialFunction
|
||||
Foam::operator/
|
||||
(
|
||||
const scalar s,
|
||||
const polynomialFunction& p
|
||||
)
|
||||
{
|
||||
polynomialFunction poly(p);
|
||||
return poly /= s;
|
||||
}
|
||||
|
||||
|
||||
Foam::polynomialFunction
|
||||
Foam::operator*
|
||||
(
|
||||
const polynomialFunction& p,
|
||||
const scalar s
|
||||
)
|
||||
{
|
||||
polynomialFunction poly(p);
|
||||
return poly *= s;
|
||||
}
|
||||
|
||||
|
||||
Foam::polynomialFunction
|
||||
Foam::operator/
|
||||
(
|
||||
const polynomialFunction& p,
|
||||
const scalar s
|
||||
)
|
||||
{
|
||||
polynomialFunction poly(p);
|
||||
return poly /= s;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,246 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2011 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::polynomialFunction
|
||||
|
||||
Description
|
||||
Polynomial function representation
|
||||
|
||||
poly = logCoeff*log(x) + sum(coeff_[i]*x^i)
|
||||
|
||||
where 0 \<= i \<= N
|
||||
|
||||
- integer powers, starting at zero
|
||||
- value(x) to evaluate the poly for a given value
|
||||
- integrate(x1, x2) between two scalar values
|
||||
- integral() to return a new, integral coeff polynomial
|
||||
- increases the size (order)
|
||||
- integralMinus1() to return a new, integral coeff polynomial where
|
||||
the base poly starts at order -1
|
||||
|
||||
SeeAlso
|
||||
Foam::Polynomial for a templated implementation
|
||||
|
||||
SourceFiles
|
||||
polynomialFunction.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef polynomialFunction_H
|
||||
#define polynomialFunction_H
|
||||
|
||||
#include "scalarList.H"
|
||||
#include "Ostream.H"
|
||||
#include "runTimeSelectionTables.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// Forward declaration of classes
|
||||
class polynomialFunction;
|
||||
|
||||
// Forward declaration of friend functions
|
||||
Ostream& operator<<(Ostream&, const polynomialFunction&);
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class polynomialFunction Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class polynomialFunction
|
||||
:
|
||||
private scalarList
|
||||
{
|
||||
// Private data
|
||||
|
||||
//- Include the log term? - only activated using integralMinus1()
|
||||
bool logActive_;
|
||||
|
||||
//- Log coefficient - only activated using integralMinus1()
|
||||
scalar logCoeff_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Return integral coefficients.
|
||||
// Argument becomes zeroth element (constant of integration)
|
||||
static polynomialFunction cloneIntegral
|
||||
(
|
||||
const polynomialFunction&,
|
||||
const scalar intConstant = 0.0
|
||||
);
|
||||
|
||||
//- Return integral coefficients when lowest order is -1.
|
||||
// Argument becomes zeroth element (constant of integration)
|
||||
static polynomialFunction cloneIntegralMinus1
|
||||
(
|
||||
const polynomialFunction&,
|
||||
const scalar intConstant = 0.0
|
||||
);
|
||||
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const polynomialFunction&);
|
||||
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("polynomialFunction");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct a particular size, with all coefficients = 0.0
|
||||
explicit polynomialFunction(const label);
|
||||
|
||||
//- Copy constructor
|
||||
polynomialFunction(const polynomialFunction&);
|
||||
|
||||
//- Construct from a list of coefficients
|
||||
explicit polynomialFunction(const UList<scalar>& coeffs);
|
||||
|
||||
//- Construct from Istream
|
||||
polynomialFunction(Istream&);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~polynomialFunction();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Return the number of coefficients
|
||||
using scalarList::size;
|
||||
|
||||
//- Return coefficient
|
||||
using scalarList::operator[];
|
||||
|
||||
|
||||
// Access
|
||||
|
||||
|
||||
//- Return true if the log term is active
|
||||
bool logActive() const;
|
||||
|
||||
//- Return the log coefficient
|
||||
scalar logCoeff() const;
|
||||
|
||||
|
||||
// Evaluation
|
||||
|
||||
//- Return polynomial value
|
||||
scalar value(const scalar x) const;
|
||||
|
||||
//- Integrate between two values
|
||||
scalar integrate(const scalar x1, const scalar x2) const;
|
||||
|
||||
|
||||
//- Return integral coefficients.
|
||||
// Argument becomes zeroth element (constant of integration)
|
||||
polynomialFunction integral
|
||||
(
|
||||
const scalar intConstant = 0.0
|
||||
) const;
|
||||
|
||||
//- Return integral coefficients when lowest order is -1.
|
||||
// Argument becomes zeroth element (constant of integration)
|
||||
polynomialFunction integralMinus1
|
||||
(
|
||||
const scalar intConstant = 0.0
|
||||
) const;
|
||||
|
||||
|
||||
// Member Operators
|
||||
|
||||
polynomialFunction& operator+=(const polynomialFunction&);
|
||||
polynomialFunction& operator-=(const polynomialFunction&);
|
||||
|
||||
polynomialFunction& operator*=(const scalar);
|
||||
polynomialFunction& operator/=(const scalar);
|
||||
|
||||
|
||||
//- Ostream Operator
|
||||
friend Ostream& operator<<(Ostream&, const polynomialFunction&);
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
// * * * * * * * * * * * * * * * Global Operators * * * * * * * * * * * * * //
|
||||
|
||||
polynomialFunction operator+
|
||||
(
|
||||
const polynomialFunction&,
|
||||
const polynomialFunction&
|
||||
);
|
||||
|
||||
|
||||
polynomialFunction operator-
|
||||
(
|
||||
const polynomialFunction&,
|
||||
const polynomialFunction&
|
||||
);
|
||||
|
||||
|
||||
polynomialFunction operator*
|
||||
(
|
||||
const scalar,
|
||||
const polynomialFunction&
|
||||
);
|
||||
|
||||
|
||||
polynomialFunction operator/
|
||||
(
|
||||
const scalar,
|
||||
const polynomialFunction&
|
||||
);
|
||||
|
||||
|
||||
polynomialFunction operator*
|
||||
(
|
||||
const polynomialFunction&,
|
||||
const scalar
|
||||
);
|
||||
|
||||
|
||||
polynomialFunction operator/
|
||||
(
|
||||
const polynomialFunction&,
|
||||
const scalar
|
||||
);
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -35,7 +35,7 @@ Description
|
||||
write OpenFOAM meshes and/or results to another CFD format
|
||||
- currently just STAR-CD
|
||||
|
||||
@par Files
|
||||
\par Files
|
||||
|
||||
"constant/boundaryRegion" is an IOMap<dictionary> that contains
|
||||
the boundary type and names. eg,
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -36,6 +36,7 @@ SourceFiles
|
||||
#define inverseDistanceDiffusivity_H
|
||||
|
||||
#include "uniformDiffusivity.H"
|
||||
#include "wordReList.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -43,7 +44,7 @@ namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class inverseDistanceDiffusivity Declaration
|
||||
Class inverseDistanceDiffusivity Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class inverseDistanceDiffusivity
|
||||
@ -53,9 +54,8 @@ class inverseDistanceDiffusivity
|
||||
// Private data
|
||||
|
||||
//- Patches selected to base the distance on
|
||||
// These can contain regular expressions and the actual patch names
|
||||
// will be searched for.
|
||||
wordList patchNames_;
|
||||
// These can contain patch names or regular expressions to search for.
|
||||
wordReList patchNames_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -28,14 +28,9 @@ License
|
||||
#include "wallPolyPatch.H"
|
||||
#include "polyBoundaryMesh.H"
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
defineTypeNameAndDebug(cellDistFuncs, 0);
|
||||
|
||||
}
|
||||
defineTypeNameAndDebug(Foam::cellDistFuncs, 0);
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
@ -61,7 +56,6 @@ Foam::label Foam::cellDistFuncs::findIndex
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
// Construct from mesh
|
||||
Foam::cellDistFuncs::cellDistFuncs(const polyMesh& mesh)
|
||||
:
|
||||
mesh_(mesh)
|
||||
@ -70,36 +64,12 @@ Foam::cellDistFuncs::cellDistFuncs(const polyMesh& mesh)
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
// Get patch ids of named patches
|
||||
Foam::labelHashSet Foam::cellDistFuncs::getPatchIDs
|
||||
(
|
||||
const wordList& patchNames
|
||||
const wordReList& patchNames
|
||||
) const
|
||||
{
|
||||
const polyBoundaryMesh& bMesh = mesh().boundaryMesh();
|
||||
|
||||
// Construct Set of patchNames for easy checking if included
|
||||
HashSet<word> patchNamesHash(patchNames.size());
|
||||
|
||||
forAll(patchNames, patchI)
|
||||
{
|
||||
patchNamesHash.insert(patchNames[patchI]);
|
||||
}
|
||||
|
||||
// Loop over all patches and check if patch name in hashset
|
||||
|
||||
labelHashSet patchIDs(bMesh.size());
|
||||
|
||||
forAll(bMesh, patchI)
|
||||
{
|
||||
const polyPatch& patch = bMesh[patchI];
|
||||
|
||||
if (patchNamesHash.found(patch.name()))
|
||||
{
|
||||
patchIDs.insert(patchI);
|
||||
}
|
||||
}
|
||||
return patchIDs;
|
||||
return mesh().boundaryMesh().patchSet(patchNames, false);
|
||||
}
|
||||
|
||||
|
||||
@ -252,8 +222,10 @@ Foam::label Foam::cellDistFuncs::getPointNeighbours
|
||||
|
||||
|
||||
// size of largest patch (out of supplied subset of patches)
|
||||
Foam::label Foam::cellDistFuncs::maxPatchSize(const labelHashSet& patchIDs)
|
||||
const
|
||||
Foam::label Foam::cellDistFuncs::maxPatchSize
|
||||
(
|
||||
const labelHashSet& patchIDs
|
||||
) const
|
||||
{
|
||||
label maxSize = 0;
|
||||
|
||||
@ -271,8 +243,11 @@ Foam::label Foam::cellDistFuncs::maxPatchSize(const labelHashSet& patchIDs)
|
||||
|
||||
|
||||
// sum of patch sizes (out of supplied subset of patches)
|
||||
Foam::label Foam::cellDistFuncs::sumPatchSize(const labelHashSet& patchIDs)
|
||||
const
|
||||
Foam::label Foam::cellDistFuncs::sumPatchSize
|
||||
(
|
||||
const labelHashSet& patchIDs
|
||||
)
|
||||
const
|
||||
{
|
||||
label sum = 0;
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -39,7 +39,7 @@ SourceFiles
|
||||
#include "scalarField.H"
|
||||
#include "HashSet.H"
|
||||
#include "Map.H"
|
||||
#include "wordList.H"
|
||||
#include "wordReList.H"
|
||||
#include "scalarField.H"
|
||||
#include "point.H"
|
||||
#include "primitivePatch.H"
|
||||
@ -98,8 +98,8 @@ public:
|
||||
return mesh_;
|
||||
}
|
||||
|
||||
//- Get patchIDs of named patches
|
||||
labelHashSet getPatchIDs(const wordList&) const;
|
||||
//- Return the set of patch IDs corresponding to the given names
|
||||
labelHashSet getPatchIDs(const wordReList& patchNames) const;
|
||||
|
||||
//- Get patchIDs of/derived off certain type (e.g. 'processorPolyPatch')
|
||||
// Uses isA, not isType
|
||||
|
||||
@ -32,7 +32,7 @@ Description
|
||||
or (e3/e1). Any nonorthogonality will be absorbed into the second vector.
|
||||
|
||||
For convenience, the dictionary constructor forms allow a few shortcuts:
|
||||
- if the \c type is not otherwise specified, the type @c axes
|
||||
- if the \c type is not otherwise specified, the type \c axes
|
||||
is implicit
|
||||
- if an axes specification (eg, e3/e1) is used, the coordinateRotation
|
||||
sub-dictionary can be dropped.
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -87,8 +87,7 @@ void Foam::nearWallFields::read(const dictionary& dict)
|
||||
const fvMesh& mesh = refCast<const fvMesh>(obr_);
|
||||
|
||||
dict.lookup("fields") >> fieldSet_;
|
||||
patchSet_ =
|
||||
mesh.boundaryMesh().patchSet(wordList(dict.lookup("patches")));
|
||||
patchSet_ = mesh.boundaryMesh().patchSet(dict.lookup("patches"));
|
||||
distance_ = readScalar(dict.lookup("distance"));
|
||||
|
||||
|
||||
|
||||
@ -229,8 +229,7 @@ void Foam::forces::read(const dictionary& dict)
|
||||
|
||||
const fvMesh& mesh = refCast<const fvMesh>(obr_);
|
||||
|
||||
patchSet_ =
|
||||
mesh.boundaryMesh().patchSet(wordList(dict.lookup("patches")));
|
||||
patchSet_ = mesh.boundaryMesh().patchSet(dict.lookup("patches"));
|
||||
|
||||
if (directForceDensity_)
|
||||
{
|
||||
|
||||
@ -96,7 +96,7 @@ public:
|
||||
// One value per face or vertex (isNodeValues = true)
|
||||
virtual void write
|
||||
(
|
||||
const fileName& outputDir, // <root>/<case>/surface/TIME
|
||||
const fileName& outputDir, // <case>/surface/TIME
|
||||
const fileName& surfaceName, // name of surface
|
||||
const pointField& points,
|
||||
const faceList& faces,
|
||||
@ -110,7 +110,7 @@ public:
|
||||
// One value per face or vertex (isNodeValues = true)
|
||||
virtual void write
|
||||
(
|
||||
const fileName& outputDir, // <root>/<case>/surface/TIME
|
||||
const fileName& outputDir, // <case>/surface/TIME
|
||||
const fileName& surfaceName, // name of surface
|
||||
const pointField& points,
|
||||
const faceList& faces,
|
||||
@ -124,7 +124,7 @@ public:
|
||||
// One value per face or vertex (isNodeValues = true)
|
||||
virtual void write
|
||||
(
|
||||
const fileName& outputDir, // <root>/<case>/surface/TIME
|
||||
const fileName& outputDir, // <case>/surface/TIME
|
||||
const fileName& surfaceName, // name of surface
|
||||
const pointField& points,
|
||||
const faceList& faces,
|
||||
@ -138,7 +138,7 @@ public:
|
||||
// One value per face or vertex (isNodeValues = true)
|
||||
virtual void write
|
||||
(
|
||||
const fileName& outputDir, // <root>/<case>/surface/TIME
|
||||
const fileName& outputDir, // <case>/surface/TIME
|
||||
const fileName& surfaceName, // name of surface
|
||||
const pointField& points,
|
||||
const faceList& faces,
|
||||
@ -152,7 +152,7 @@ public:
|
||||
// One value per face or vertex (isNodeValues = true)
|
||||
virtual void write
|
||||
(
|
||||
const fileName& outputDir, // <root>/<case>/surface/TIME
|
||||
const fileName& outputDir, // <case>/surface/TIME
|
||||
const fileName& surfaceName, // name of surface
|
||||
const pointField& points,
|
||||
const faceList& faces,
|
||||
|
||||
@ -117,7 +117,7 @@ public:
|
||||
// One value per face or vertex (isNodeValues = true)
|
||||
virtual void write
|
||||
(
|
||||
const fileName& outputDir, // <root>/<case>/surface/TIME
|
||||
const fileName& outputDir, // <case>/surface/TIME
|
||||
const fileName& surfaceName, // name of surface
|
||||
const pointField& points,
|
||||
const faceList& faces,
|
||||
@ -131,7 +131,7 @@ public:
|
||||
// One value per face or vertex (isNodeValues = true)
|
||||
virtual void write
|
||||
(
|
||||
const fileName& outputDir, // <root>/<case>/surface/TIME
|
||||
const fileName& outputDir, // <case>/surface/TIME
|
||||
const fileName& surfaceName, // name of surface
|
||||
const pointField& points,
|
||||
const faceList& faces,
|
||||
@ -145,7 +145,7 @@ public:
|
||||
// One value per face or vertex (isNodeValues = true)
|
||||
virtual void write
|
||||
(
|
||||
const fileName& outputDir, // <root>/<case>/surface/TIME
|
||||
const fileName& outputDir, // <case>/surface/TIME
|
||||
const fileName& surfaceName, // name of surface
|
||||
const pointField& points,
|
||||
const faceList& faces,
|
||||
@ -159,7 +159,7 @@ public:
|
||||
// One value per face or vertex (isNodeValues = true)
|
||||
virtual void write
|
||||
(
|
||||
const fileName& outputDir, // <root>/<case>/surface/TIME
|
||||
const fileName& outputDir, // <case>/surface/TIME
|
||||
const fileName& surfaceName, // name of surface
|
||||
const pointField& points,
|
||||
const faceList& faces,
|
||||
@ -173,7 +173,7 @@ public:
|
||||
// One value per face or vertex (isNodeValues = true)
|
||||
virtual void write
|
||||
(
|
||||
const fileName& outputDir, // <root>/<case>/surface/TIME
|
||||
const fileName& outputDir, // <case>/surface/TIME
|
||||
const fileName& surfaceName, // name of surface
|
||||
const pointField& points,
|
||||
const faceList& faces,
|
||||
|
||||
@ -107,7 +107,7 @@ public:
|
||||
// One value per face or vertex (isNodeValues = true)
|
||||
virtual void write
|
||||
(
|
||||
const fileName& outputDir, // <root>/<case>/surface/TIME
|
||||
const fileName& outputDir, // <case>/surface/TIME
|
||||
const fileName& surfaceName, // name of surface
|
||||
const pointField& points,
|
||||
const faceList& faces,
|
||||
@ -121,7 +121,7 @@ public:
|
||||
// One value per face or vertex (isNodeValues = true)
|
||||
virtual void write
|
||||
(
|
||||
const fileName& outputDir, // <root>/<case>/surface/TIME
|
||||
const fileName& outputDir, // <case>/surface/TIME
|
||||
const fileName& surfaceName, // name of surface
|
||||
const pointField& points,
|
||||
const faceList& faces,
|
||||
@ -135,7 +135,7 @@ public:
|
||||
// One value per face or vertex (isNodeValues = true)
|
||||
virtual void write
|
||||
(
|
||||
const fileName& outputDir, // <root>/<case>/surface/TIME
|
||||
const fileName& outputDir, // <case>/surface/TIME
|
||||
const fileName& surfaceName, // name of surface
|
||||
const pointField& points,
|
||||
const faceList& faces,
|
||||
@ -149,7 +149,7 @@ public:
|
||||
// One value per face or vertex (isNodeValues = true)
|
||||
virtual void write
|
||||
(
|
||||
const fileName& outputDir, // <root>/<case>/surface/TIME
|
||||
const fileName& outputDir, // <case>/surface/TIME
|
||||
const fileName& surfaceName, // name of surface
|
||||
const pointField& points,
|
||||
const faceList& faces,
|
||||
@ -163,7 +163,7 @@ public:
|
||||
// One value per face or vertex (isNodeValues = true)
|
||||
virtual void write
|
||||
(
|
||||
const fileName& outputDir, // <root>/<case>/surface/TIME
|
||||
const fileName& outputDir, // <case>/surface/TIME
|
||||
const fileName& surfaceName, // name of surface
|
||||
const pointField& points,
|
||||
const faceList& faces,
|
||||
|
||||
@ -128,7 +128,7 @@ public:
|
||||
// One value per face or vertex (isNodeValues = true)
|
||||
virtual void write
|
||||
(
|
||||
const fileName& outputDir, // <root>/<case>/surface/TIME
|
||||
const fileName& outputDir, // <case>/surface/TIME
|
||||
const fileName& surfaceName, // name of surface
|
||||
const pointField& points,
|
||||
const faceList& faces,
|
||||
@ -142,7 +142,7 @@ public:
|
||||
// One value per face or vertex (isNodeValues = true)
|
||||
virtual void write
|
||||
(
|
||||
const fileName& outputDir, // <root>/<case>/surface/TIME
|
||||
const fileName& outputDir, // <case>/surface/TIME
|
||||
const fileName& surfaceName, // name of surface
|
||||
const pointField& points,
|
||||
const faceList& faces,
|
||||
@ -156,7 +156,7 @@ public:
|
||||
// One value per face or vertex (isNodeValues = true)
|
||||
virtual void write
|
||||
(
|
||||
const fileName& outputDir, // <root>/<case>/surface/TIME
|
||||
const fileName& outputDir, // <case>/surface/TIME
|
||||
const fileName& surfaceName, // name of surface
|
||||
const pointField& points,
|
||||
const faceList& faces,
|
||||
@ -170,7 +170,7 @@ public:
|
||||
// One value per face or vertex (isNodeValues = true)
|
||||
virtual void write
|
||||
(
|
||||
const fileName& outputDir, // <root>/<case>/surface/TIME
|
||||
const fileName& outputDir, // <case>/surface/TIME
|
||||
const fileName& surfaceName, // name of surface
|
||||
const pointField& points,
|
||||
const faceList& faces,
|
||||
@ -184,7 +184,7 @@ public:
|
||||
// One value per face or vertex (isNodeValues = true)
|
||||
virtual void write
|
||||
(
|
||||
const fileName& outputDir, // <root>/<case>/surface/TIME
|
||||
const fileName& outputDir, // <case>/surface/TIME
|
||||
const fileName& surfaceName, // name of surface
|
||||
const pointField& points,
|
||||
const faceList& faces,
|
||||
|
||||
@ -129,7 +129,7 @@ public:
|
||||
// One value per face or vertex (isNodeValues = true)
|
||||
virtual void write
|
||||
(
|
||||
const fileName& outputDir, // <root>/<case>/surface/TIME
|
||||
const fileName& outputDir, // <case>/surface/TIME
|
||||
const fileName& surfaceName, // name of surface
|
||||
const pointField& points,
|
||||
const faceList& faces,
|
||||
@ -143,7 +143,7 @@ public:
|
||||
// One value per face or vertex (isNodeValues = true)
|
||||
virtual void write
|
||||
(
|
||||
const fileName& outputDir, // <root>/<case>/surface/TIME
|
||||
const fileName& outputDir, // <case>/surface/TIME
|
||||
const fileName& surfaceName, // name of surface
|
||||
const pointField& points,
|
||||
const faceList& faces,
|
||||
@ -157,7 +157,7 @@ public:
|
||||
// One value per face or vertex (isNodeValues = true)
|
||||
virtual void write
|
||||
(
|
||||
const fileName& outputDir, // <root>/<case>/surface/TIME
|
||||
const fileName& outputDir, // <case>/surface/TIME
|
||||
const fileName& surfaceName, // name of surface
|
||||
const pointField& points,
|
||||
const faceList& faces,
|
||||
|
||||
@ -119,7 +119,7 @@ public:
|
||||
//- Write single surface geometry to file.
|
||||
virtual void write
|
||||
(
|
||||
const fileName& outputDir, // <root>/<case>/surface/TIME
|
||||
const fileName& outputDir, // <case>/surface/TIME
|
||||
const fileName& surfaceName, // name of surface
|
||||
const pointField& points,
|
||||
const faceList& faces,
|
||||
@ -132,7 +132,7 @@ public:
|
||||
// One value per face or vertex (isNodeValues = true)
|
||||
virtual void write
|
||||
(
|
||||
const fileName& outputDir, // <root>/<case>/surface/TIME
|
||||
const fileName& outputDir, // <case>/surface/TIME
|
||||
const fileName& surfaceName, // name of surface
|
||||
const pointField& points,
|
||||
const faceList& faces,
|
||||
@ -147,7 +147,7 @@ public:
|
||||
// One value per face or vertex (isNodeValues = true)
|
||||
virtual void write
|
||||
(
|
||||
const fileName& outputDir, // <root>/<case>/surface/TIME
|
||||
const fileName& outputDir, // <case>/surface/TIME
|
||||
const fileName& surfaceName, // name of surface
|
||||
const pointField& points,
|
||||
const faceList& faces,
|
||||
@ -162,7 +162,7 @@ public:
|
||||
// One value per face or vertex (isNodeValues = true)
|
||||
virtual void write
|
||||
(
|
||||
const fileName& outputDir, // <root>/<case>/surface/TIME
|
||||
const fileName& outputDir, // <case>/surface/TIME
|
||||
const fileName& surfaceName, // name of surface
|
||||
const pointField& points,
|
||||
const faceList& faces,
|
||||
@ -177,7 +177,7 @@ public:
|
||||
// One value per face or vertex (isNodeValues = true)
|
||||
virtual void write
|
||||
(
|
||||
const fileName& outputDir, // <root>/<case>/surface/TIME
|
||||
const fileName& outputDir, // <case>/surface/TIME
|
||||
const fileName& surfaceName, // name of surface
|
||||
const pointField& points,
|
||||
const faceList& faces,
|
||||
@ -192,7 +192,7 @@ public:
|
||||
// One value per face or vertex (isNodeValues = true)
|
||||
virtual void write
|
||||
(
|
||||
const fileName& outputDir, // <root>/<case>/surface/TIME
|
||||
const fileName& outputDir, // <case>/surface/TIME
|
||||
const fileName& surfaceName, // name of surface
|
||||
const pointField& points,
|
||||
const faceList& faces,
|
||||
|
||||
@ -105,7 +105,7 @@ public:
|
||||
// One value per face or vertex (isNodeValues = true)
|
||||
virtual void write
|
||||
(
|
||||
const fileName& outputDir, // <root>/<case>/surface/TIME
|
||||
const fileName& outputDir, // <case>/surface/TIME
|
||||
const fileName& surfaceName, // name of surface
|
||||
const pointField& points,
|
||||
const faceList& faces,
|
||||
@ -119,7 +119,7 @@ public:
|
||||
// One value per face or vertex (isNodeValues = true)
|
||||
virtual void write
|
||||
(
|
||||
const fileName& outputDir, // <root>/<case>/surface/TIME
|
||||
const fileName& outputDir, // <case>/surface/TIME
|
||||
const fileName& surfaceName, // name of surface
|
||||
const pointField& points,
|
||||
const faceList& faces,
|
||||
@ -133,7 +133,7 @@ public:
|
||||
// One value per face or vertex (isNodeValues = true)
|
||||
virtual void write
|
||||
(
|
||||
const fileName& outputDir, // <root>/<case>/surface/TIME
|
||||
const fileName& outputDir, // <case>/surface/TIME
|
||||
const fileName& surfaceName, // name of surface
|
||||
const pointField& points,
|
||||
const faceList& faces,
|
||||
@ -147,7 +147,7 @@ public:
|
||||
// One value per face or vertex (isNodeValues = true)
|
||||
virtual void write
|
||||
(
|
||||
const fileName& outputDir, // <root>/<case>/surface/TIME
|
||||
const fileName& outputDir, // <case>/surface/TIME
|
||||
const fileName& surfaceName, // name of surface
|
||||
const pointField& points,
|
||||
const faceList& faces,
|
||||
@ -161,7 +161,7 @@ public:
|
||||
// One value per face or vertex (isNodeValues = true)
|
||||
virtual void write
|
||||
(
|
||||
const fileName& outputDir, // <root>/<case>/surface/TIME
|
||||
const fileName& outputDir, // <case>/surface/TIME
|
||||
const fileName& surfaceName, // name of surface
|
||||
const pointField& points,
|
||||
const faceList& faces,
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -28,7 +28,7 @@ Description
|
||||
Provide a means of reading/writing the single-file OpenFOAM surface format.
|
||||
|
||||
Note
|
||||
This class provides more methods than the regular surface format interface.x
|
||||
This class provides more methods than the regular surface format interface.
|
||||
|
||||
SourceFiles
|
||||
OFSsurfaceFormat.C
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -36,7 +36,7 @@ License
|
||||
using namespace Foam;
|
||||
|
||||
// Dummy yyFlexLexer::yylex() to keep the linker happy. It is not called
|
||||
//! @cond dummy
|
||||
//! \cond dummy
|
||||
int yyFlexLexer::yylex()
|
||||
{
|
||||
FatalErrorIn("yyFlexLexer::yylex()")
|
||||
@ -44,12 +44,12 @@ int yyFlexLexer::yylex()
|
||||
<< abort(FatalError);
|
||||
return 0;
|
||||
}
|
||||
//! @endcond
|
||||
//! \endcond
|
||||
|
||||
// Dummy yywrap to keep yylex happy at compile time.
|
||||
// It is called by yylex but is not used as the mechanism to change file.
|
||||
// See <<EOF>>
|
||||
//! @cond dummy
|
||||
//! \cond dummy
|
||||
#if YY_FLEX_SUBMINOR_VERSION < 34
|
||||
extern "C" int yywrap()
|
||||
#else
|
||||
@ -58,7 +58,7 @@ int yyFlexLexer::yywrap()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
//! @endcond
|
||||
//! \endcond
|
||||
|
||||
|
||||
//- A lexer for parsing STL ASCII files.
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -38,7 +38,7 @@ License
|
||||
int Foam::chemkinReader::yyBufSize = YY_BUF_SIZE;
|
||||
|
||||
// Dummy yyFlexLexer::yylex() to keep the linker happy. It is not called
|
||||
//! @cond dummy
|
||||
//! \cond dummy
|
||||
int yyFlexLexer::yylex()
|
||||
{
|
||||
FatalErrorIn("yyFlexLexer::yylex()")
|
||||
@ -47,13 +47,13 @@ int yyFlexLexer::yylex()
|
||||
|
||||
return 0;
|
||||
}
|
||||
//! @endcond
|
||||
//! \endcond
|
||||
|
||||
|
||||
// Dummy yywrap to keep yylex happy at compile time.
|
||||
// It is called by yylex but is not used as the mechanism to change file.
|
||||
// See <<EOF>>
|
||||
//! @cond dummy
|
||||
//! \cond dummy
|
||||
#if YY_FLEX_SUBMINOR_VERSION < 34
|
||||
extern "C" int yywrap()
|
||||
#else
|
||||
@ -62,7 +62,7 @@ int yyFlexLexer::yywrap()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
//! @endcond
|
||||
//! \endcond
|
||||
|
||||
|
||||
Foam::string foamSpecieString(const char* YYText)
|
||||
|
||||
@ -45,8 +45,8 @@ Foam::hPolynomialThermo<EquationOfState, PolySize>::hPolynomialThermo
|
||||
Sf_ *= this->W();
|
||||
CpCoeffs_ *= this->W();
|
||||
|
||||
hCoeffs_ = CpCoeffs_.integrate();
|
||||
sCoeffs_ = CpCoeffs_.integrateMinus1();
|
||||
hCoeffs_ = CpCoeffs_.integral();
|
||||
sCoeffs_ = CpCoeffs_.integralMinus1();
|
||||
|
||||
// Offset h poly so that it is relative to the enthalpy at Tstd
|
||||
hCoeffs_[0] += Hf_ - hCoeffs_.value(specie::Tstd);
|
||||
@ -73,8 +73,8 @@ Foam::hPolynomialThermo<EquationOfState, PolySize>::hPolynomialThermo
|
||||
Sf_ *= this->W();
|
||||
CpCoeffs_ *= this->W();
|
||||
|
||||
hCoeffs_ = CpCoeffs_.integrate();
|
||||
sCoeffs_ = CpCoeffs_.integrateMinus1();
|
||||
hCoeffs_ = CpCoeffs_.integral();
|
||||
sCoeffs_ = CpCoeffs_.integralMinus1();
|
||||
|
||||
// Offset h poly so that it is relative to the enthalpy at Tstd
|
||||
hCoeffs_[0] += Hf_ - hCoeffs_.value(specie::Tstd);
|
||||
|
||||
@ -39,7 +39,7 @@ License
|
||||
using namespace Foam;
|
||||
|
||||
// Dummy yyFlexLexer::yylex() to keep the linker happy. It is not called
|
||||
//! @cond dummy
|
||||
//! \cond dummy
|
||||
int yyFlexLexer::yylex()
|
||||
{
|
||||
FatalErrorIn("yyFlexLexer::yylex()")
|
||||
@ -47,12 +47,12 @@ int yyFlexLexer::yylex()
|
||||
<< abort(FatalError);
|
||||
return 0;
|
||||
}
|
||||
//! @endcond
|
||||
//! \endcond
|
||||
|
||||
// Dummy yywrap to keep yylex happy at compile time.
|
||||
// It is called by yylex but is not used as the mechanism to change file.
|
||||
// See <<EOF>>
|
||||
//! @cond dummy
|
||||
//! \cond dummy
|
||||
#if YY_FLEX_SUBMINOR_VERSION < 34
|
||||
extern "C" int yywrap()
|
||||
#else
|
||||
@ -61,7 +61,7 @@ int yyFlexLexer::yywrap()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
//! @endcond
|
||||
//! \endcond
|
||||
|
||||
|
||||
class STLLexer
|
||||
|
||||
Reference in New Issue
Block a user