Merge branch 'lagrangianDev' into WBM

This commit is contained in:
andy
2009-05-18 17:13:47 +01:00
383 changed files with 3512 additions and 1684 deletions

View File

@ -50,7 +50,7 @@ void Foam::HashPtrTable<T, Key, Hash>::read(Istream& is, const INew& inewt)
label s = firstToken.labelToken();
// Read beginning of contents
char listDelimiter = is.readBeginList("HashPtrTable<T, Key, Hash>");
char delimiter = is.readBeginList("HashPtrTable<T, Key, Hash>");
if (s)
{
@ -59,7 +59,7 @@ void Foam::HashPtrTable<T, Key, Hash>::read(Istream& is, const INew& inewt)
this->resize(2*s);
}
if (listDelimiter == token::BEGIN_LIST)
if (delimiter == token::BEGIN_LIST)
{
for (label i=0; i<s; i++)
{

View File

@ -28,6 +28,13 @@ Class
Description
An STL-conforming hash table.
Note
Hashing index collisions are handled via chaining using a singly-linked
list with the colliding entry being added to the head of the linked
list. Thus copying the hash table (or indeed even resizing it) will
often result in a different hash order. Use a sorted table-of-contents
when the hash order is important.
SourceFiles
HashTableI.H
HashTable.C

View File

@ -81,7 +81,7 @@ Foam::HashTable<T, Key, Hash>::printInfo(Ostream& os) const
os << "HashTable<T,Key,Hash>"
<< " elements:" << size() << " slots:" << used << "/" << tableSize_
<< " chaining(avg/max):" << (used ? float(avgChain/used) : 0)
<< " chaining(avg/max):" << (used ? (float(avgChain)/used) : 0)
<< "/" << maxChain << endl;
return os;
@ -91,7 +91,11 @@ Foam::HashTable<T, Key, Hash>::printInfo(Ostream& os) const
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
template<class T, class Key, class Hash>
Foam::Istream& Foam::operator>>(Istream& is, HashTable<T, Key, Hash>& L)
Foam::Istream& Foam::operator>>
(
Istream& is,
HashTable<T, Key, Hash>& L
)
{
is.fatalCheck("operator>>(Istream&, HashTable<T, Key, Hash>&)");
@ -113,7 +117,7 @@ Foam::Istream& Foam::operator>>(Istream& is, HashTable<T, Key, Hash>& L)
label s = firstToken.labelToken();
// Read beginning of contents
char listDelimiter = is.readBeginList("HashTable<T, Key, Hash>");
char delimiter = is.readBeginList("HashTable<T, Key, Hash>");
if (s)
{
@ -122,7 +126,7 @@ Foam::Istream& Foam::operator>>(Istream& is, HashTable<T, Key, Hash>& L)
L.resize(2*s);
}
if (listDelimiter == token::BEGIN_LIST)
if (delimiter == token::BEGIN_LIST)
{
for (label i=0; i<s; i++)
{
@ -209,7 +213,11 @@ Foam::Istream& Foam::operator>>(Istream& is, HashTable<T, Key, Hash>& L)
template<class T, class Key, class Hash>
Foam::Ostream& Foam::operator<<(Ostream& os, const HashTable<T, Key, Hash>& L)
Foam::Ostream& Foam::operator<<
(
Ostream& os,
const HashTable<T, Key, Hash>& L
)
{
// Write size and start delimiter
os << nl << L.size() << nl << token::BEGIN_LIST << nl;

View File

@ -117,7 +117,7 @@ Foam::Istream& Foam::operator>>(Istream& is, StaticHashTable<T, Key, Hash>& L)
label s = firstToken.labelToken();
// Read beginning of contents
char listDelimiter = is.readBeginList("StaticHashTable<T, Key, Hash>");
char delimiter = is.readBeginList("StaticHashTable<T, Key, Hash>");
if (s)
{
@ -126,7 +126,7 @@ Foam::Istream& Foam::operator>>(Istream& is, StaticHashTable<T, Key, Hash>& L)
L.resize(2*s);
}
if (listDelimiter == token::BEGIN_LIST)
if (delimiter == token::BEGIN_LIST)
{
for (label i=0; i<s; i++)
{

View File

@ -50,11 +50,11 @@ void Foam::ILList<LListBase, T>::read(Istream& is, const INew& iNew)
label s = firstToken.labelToken();
// Read beginning of contents
char listDelimiter = is.readBeginList("ILList<LListBase, T>");
char delimiter = is.readBeginList("ILList<LListBase, T>");
if (s)
{
if (listDelimiter == token::BEGIN_LIST)
if (delimiter == token::BEGIN_LIST)
{
for (label i=0; i<s; i++)
{

View File

@ -61,11 +61,11 @@ Foam::Istream& Foam::operator>>(Istream& is, LList<LListBase, T>& L)
label s = firstToken.labelToken();
// Read beginning of contents
char listDelimiter = is.readBeginList("LList<LListBase, T>");
char delimiter = is.readBeginList("LList<LListBase, T>");
if (s)
{
if (listDelimiter == token::BEGIN_LIST)
if (delimiter == token::BEGIN_LIST)
{
for (register label i=0; i<s; i++)
{

View File

@ -53,11 +53,11 @@ void Foam::LPtrList<LListBase, T>::read(Istream& is, const INew& iNew)
label s = firstToken.labelToken();
// Read beginning of contents
char listDelimiter = is.readBeginList("LPtrList<LListBase, T>");
char delimiter = is.readBeginList("LPtrList<LListBase, T>");
if (s)
{
if (listDelimiter == token::BEGIN_LIST)
if (delimiter == token::BEGIN_LIST)
{
for (label i=0; i<s; i++)
{

View File

@ -111,8 +111,11 @@ public:
// Also constructs from DynamicList with different sizing parameters.
explicit inline DynamicList(const UList<T>&);
//- Construct from UIndirectList. Size set to UIndirectList size.
explicit inline DynamicList(const UIndirectList<T>&);
//- Construct by transferring the parameter contents
explicit inline DynamicList(const Xfer<List<T> >&);
explicit inline DynamicList(const Xfer< List<T> >&);
//- Construct from Istream. Size set to size of read list.
explicit DynamicList(Istream&);
@ -173,16 +176,19 @@ public:
inline void transfer(DynamicList<T, SizeInc, SizeMult, SizeDiv>&);
//- Transfer contents to the Xfer container as a plain List
inline Xfer<List<T> > xfer();
inline Xfer< List<T> > xfer();
// Member Operators
//- Append an element at the end of the list
inline void append(const T& e);
inline void append(const T&);
//- Append a List at the end of this list
inline void append(const UList<T>&);
//- Append a UIndirectList at the end of this list
inline void append(const UIndirectList<T>&);
//- Remove and return the top element
inline T remove();
@ -198,7 +204,7 @@ public:
const DynamicList<T, SizeInc, SizeMult, SizeDiv>&
);
//- Assignment from List<T>.
//- Assignment from UList
inline void operator=(const UList<T>&);
// IOstream operators

View File

@ -72,6 +72,17 @@ inline Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::DynamicList
{}
template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
inline Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::DynamicList
(
const UIndirectList<T>& lst
)
:
List<T>(lst),
capacity_(lst.size())
{}
template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
inline Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::DynamicList
(
@ -287,10 +298,10 @@ Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::transfer
template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
inline Foam::Xfer<Foam::List<T> >
inline Foam::Xfer< Foam::List<T> >
Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::xfer()
{
return xferMoveTo<List<T> >(*this);
return xferMoveTo< List<T> >(*this);
}
@ -313,8 +324,6 @@ inline void Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::append
const UList<T>& lst
)
{
label nextFree = List<T>::size();
if (this == &lst)
{
FatalErrorIn
@ -324,6 +333,23 @@ inline void Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::append
) << "attempted appending to self" << abort(FatalError);
}
label nextFree = List<T>::size();
setSize(nextFree + lst.size());
forAll(lst, elemI)
{
this->operator[](nextFree++) = lst[elemI];
}
}
template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
inline void Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::append
(
const UIndirectList<T>& lst
)
{
label nextFree = List<T>::size();
setSize(nextFree + lst.size());
forAll(lst, elemI)

View File

@ -82,9 +82,9 @@ Foam::Istream& Foam::operator>>(Foam::Istream& is, FixedList<T, Size>& L)
}
// Read beginning of contents
char listDelimiter = is.readBeginList("FixedList");
char delimiter = is.readBeginList("FixedList");
if (listDelimiter == token::BEGIN_LIST)
if (delimiter == token::BEGIN_LIST)
{
for (register unsigned i=0; i<Size; i++)
{

View File

@ -404,61 +404,6 @@ void Foam::List<T>::clear()
}
template<class T>
void Foam::List<T>::append(const UList<T>& lst)
{
if (this == &lst)
{
FatalErrorIn
(
"List<T>::append(const UList<T>&)"
) << "attempted appending to self" << abort(FatalError);
}
label nextFree = this->size_;
setSize(nextFree + lst.size());
forAll(lst, elemI)
{
this->operator[](nextFree++) = lst[elemI];
}
}
template<class T>
void Foam::List<T>::append(const UIndirectList<T>& lst)
{
label nextFree = this->size_;
setSize(nextFree + lst.size());
forAll(lst, elemI)
{
this->operator[](nextFree++) = lst[elemI];
}
}
template<class T>
void Foam::List<T>::append(const SLList<T>& lst)
{
if (lst.size())
{
label nextFree = this->size_;
setSize(nextFree + lst.size());
for
(
typename SLList<T>::const_iterator iter = lst.begin();
iter != lst.end();
++iter
)
{
this->operator[](nextFree++) = iter();
}
}
}
// Transfer the contents of the argument List into this List
// and anull the argument list
template<class T>

View File

@ -182,24 +182,21 @@ public:
void clear();
//- Append a List at the end of this list
void append(const UList<T>&);
inline void append(const UList<T>&);
//- Append a UIndirectList at the end of this list
void append(const UIndirectList<T>&);
inline void append(const UIndirectList<T>&);
//- Append a SLList at the end of this list
void append(const SLList<T>&);
//- Transfer the contents of the argument List into this List
//- Transfer the contents of the argument List into this list
// and annull the argument list.
void transfer(List<T>&);
//- Transfer the contents of the argument List into this List
//- Transfer the contents of the argument List into this list
// and annull the argument list.
template<unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
void transfer(DynamicList<T, SizeInc, SizeMult, SizeDiv>&);
//- Transfer the contents of the argument List into this List
//- Transfer the contents of the argument List into this list
// and annull the argument list.
void transfer(SortableList<T>&);

View File

@ -88,12 +88,46 @@ inline Foam::label Foam::List<T>::size() const
template<class T>
inline Foam::Xfer<Foam::List<T> > Foam::List<T>::xfer()
inline Foam::Xfer< Foam::List<T> > Foam::List<T>::xfer()
{
return xferMove(*this);
}
template<class T>
inline void Foam::List<T>::append(const UList<T>& lst)
{
if (this == &lst)
{
FatalErrorIn
(
"List<T>::append(const UList<T>&)"
) << "attempted appending to self" << abort(FatalError);
}
label nextFree = this->size();
setSize(nextFree + lst.size());
forAll(lst, elemI)
{
this->operator[](nextFree++) = lst[elemI];
}
}
template<class T>
inline void Foam::List<T>::append(const UIndirectList<T>& lst)
{
label nextFree = this->size();
setSize(nextFree + lst.size());
forAll(lst, elemI)
{
this->operator[](nextFree++) = lst[elemI];
}
}
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
template<class T>

View File

@ -76,11 +76,11 @@ Foam::Istream& Foam::operator>>(Istream& is, List<T>& L)
if (is.format() == IOstream::ASCII || !contiguous<T>())
{
// Read beginning of contents
char listDelimiter = is.readBeginList("List");
char delimiter = is.readBeginList("List");
if (s)
{
if (listDelimiter == token::BEGIN_LIST)
if (delimiter == token::BEGIN_LIST)
{
for (register label i=0; i<s; i++)
{

View File

@ -54,11 +54,11 @@ void Foam::PtrList<T>::read(Istream& is, const INew& inewt)
setSize(s);
// Read beginning of contents
char listDelimiter = is.readBeginList("PtrList");
char delimiter = is.readBeginList("PtrList");
if (s)
{
if (listDelimiter == token::BEGIN_LIST)
if (delimiter == token::BEGIN_LIST)
{
forAll(*this, i)
{

View File

@ -53,7 +53,8 @@ bool Foam::dictionary::findInPatterns
{
if
(
patternMatch ? reLink()->match(Keyword)
patternMatch
? reLink()->match(Keyword)
: wcLink()->keyword() == Keyword
)
{
@ -83,7 +84,8 @@ bool Foam::dictionary::findInPatterns
{
if
(
patternMatch ? reLink()->match(Keyword)
patternMatch
? reLink()->match(Keyword)
: wcLink()->keyword() == Keyword
)
{
@ -158,6 +160,20 @@ Foam::dictionary::dictionary
}
Foam::dictionary::dictionary
(
const dictionary* dictPtr
)
:
parent_(dictionary::null)
{
if (dictPtr)
{
operator=(*dictPtr);
}
}
Foam::dictionary::dictionary
(
const dictionary& parentDict,

View File

@ -168,6 +168,10 @@ public:
//- Construct top-level dictionary as copy
dictionary(const dictionary&);
//- Construct top-level dictionary as copy from pointer to dictionary.
// A null pointer is treated like an empty dictionary.
dictionary(const dictionary*);
//- Construct by transferring parameter contents given parent dictionary
dictionary(const dictionary& parentDict, const Xfer<dictionary>&);

View File

@ -73,7 +73,7 @@ bool Foam::entry::getKeyword(keyType& keyword, Istream& is)
{
cerr<< "--> FOAM Warning : " << std::endl
<< " From function "
<< "entry::getKeyword(keyType& keyword, Istream& is)" << std::endl
<< "entry::getKeyword(keyType&, Istream&)" << std::endl
<< " in file " << __FILE__
<< " at line " << __LINE__ << std::endl
<< " Reading " << is.name().c_str() << std::endl
@ -88,7 +88,7 @@ bool Foam::entry::getKeyword(keyType& keyword, Istream& is)
bool Foam::entry::New(dictionary& parentDict, Istream& is)
{
is.fatalCheck("entry::New(const dictionary& parentDict, Istream& is)");
is.fatalCheck("entry::New(const dictionary& parentDict, Istream&)");
keyType keyword;
@ -97,9 +97,9 @@ bool Foam::entry::New(dictionary& parentDict, Istream& is)
{
return false;
}
else // Keyword starts entry ...
else // Keyword starts entry ...
{
if (keyword[0] == '#') // ... Function entry
if (keyword[0] == '#') // ... Function entry
{
word functionName = keyword(1, keyword.size()-1);
return functionEntry::execute(functionName, parentDict, is);
@ -128,9 +128,14 @@ bool Foam::entry::New(dictionary& parentDict, Istream& is)
false,
false
);
if (existingPtr)
{
if (functionEntries::inputModeEntry::overwrite())
if (functionEntries::inputModeEntry::merge())
{
mergeEntry = true;
}
else if (functionEntries::inputModeEntry::overwrite())
{
// clear dictionary so merge acts like overwrite
if (existingPtr->isDict())
@ -139,9 +144,30 @@ bool Foam::entry::New(dictionary& parentDict, Istream& is)
}
mergeEntry = true;
}
else if (functionEntries::inputModeEntry::merge())
else if (functionEntries::inputModeEntry::protect())
{
mergeEntry = true;
// read and discard the entry
if (nextToken == token::BEGIN_BLOCK)
{
dictionaryEntry dummy(keyword, parentDict, is);
}
else
{
primitiveEntry dummy(keyword, parentDict, is);
}
return true;
}
else if (functionEntries::inputModeEntry::error())
{
FatalIOErrorIn
(
"entry::New(const dictionary& parentDict, Istream&)",
is
)
<< "ERROR! duplicate entry: " << keyword
<< exit(FatalIOError);
return false;
}
}
@ -168,7 +194,7 @@ bool Foam::entry::New(dictionary& parentDict, Istream& is)
Foam::autoPtr<Foam::entry> Foam::entry::New(Istream& is)
{
is.fatalCheck("entry::New(Istream& is)");
is.fatalCheck("entry::New(Istream&)");
keyType keyword;

View File

@ -58,7 +58,7 @@ bool Foam::functionEntry::execute
is.fatalCheck
(
"functionEntry::execute"
"(const word& functionName, dictionary& parentDict, Istream& is)"
"(const word& functionName, dictionary& parentDict, Istream&)"
);
if (!executedictionaryIstreamMemberFunctionTablePtr_)

View File

@ -131,7 +131,7 @@ bool Foam::functionEntries::includeEntry::execute
FatalIOErrorIn
(
"functionEntries::includeEntry::includeEntry"
"(dictionary& parentDict, primitiveEntry& entry, Istream&)",
"(dictionary& parentDict, primitiveEntry&, Istream&)",
is
) << "Cannot open include file " << ifs.name()
<< " while reading dictionary " << parentDict.name()

View File

@ -34,8 +34,8 @@ Description
#include "includeFile"
@endverbatim
The usual expansion of environment variables and other constructs (eg,
the @c ~OpenFOAM/ expansion) is retained.
The usual expansion of environment variables and other constructs
(eg, the @c ~OpenFOAM/ expansion) is retained.
See Also
fileName, string::expand()

View File

@ -72,6 +72,14 @@ void Foam::functionEntries::inputModeEntry::setMode(Istream& is)
{
mode_ = OVERWRITE;
}
else if (mode == "protect")
{
mode_ = PROTECT;
}
else if (mode == "warn")
{
mode_ = WARN;
}
else if (mode == "error")
{
mode_ = ERROR;
@ -79,7 +87,8 @@ void Foam::functionEntries::inputModeEntry::setMode(Istream& is)
else
{
WarningIn("Foam::functionEntries::inputModeEntry::setMode(Istream&)")
<< "unsupported input mode " << mode
<< "unsupported input mode '" << mode
<< "' ... defaulting to 'merge'"
<< endl;
}
}
@ -116,4 +125,15 @@ bool Foam::functionEntries::inputModeEntry::overwrite()
}
bool Foam::functionEntries::inputModeEntry::protect()
{
return mode_ == PROTECT;
}
bool Foam::functionEntries::inputModeEntry::error()
{
return mode_ == ERROR;
}
// ************************************************************************* //

View File

@ -37,8 +37,10 @@ Description
The possible input modes:
@param merge merge sub-dictionaries when possible
@param overwrite keep last entry and silently remove previous ones
@param error flag duplicate entry as an error
@param default currently the same as merge
@param protect keep initial entry and silently ignore subsequent ones
@param warn keep initial entry and warn about subsequent ones
@param error issue a FatalError for duplicate entries
@param default currently identical to merge
SourceFiles
inputModeEntry.C
@ -65,15 +67,17 @@ class inputModeEntry
:
public functionEntry
{
//- input mode options
//- The input mode options
enum inputMode
{
ERROR,
MERGE,
OVERWRITE
OVERWRITE,
PROTECT,
WARN,
ERROR
};
//- current input mode
//- The current input mode
static inputMode mode_;
@ -100,7 +104,7 @@ public:
//- Execute the functionEntry in a sub-dict context
static bool execute(dictionary& parentDict, Istream&);
//- Reset the inputMode to %default
//- Reset the inputMode to %default (ie, %merge)
static void clear();
//- Return true if the inputMode is %merge
@ -109,6 +113,12 @@ public:
//- Return true if the inputMode is %overwrite
static bool overwrite();
//- Return true if the inputMode is %protect
static bool protect();
//- Return true if the inputMode is %error
static bool error();
};

View File

@ -83,7 +83,7 @@ bool Foam::primitiveEntry::expandVariable
// lookup the variable name in the given dictionary....
const entry* ePtr = dict.lookupEntryPtr(varName, true, true);
// ...if defined insert its tokens into this
// ...if defined insert its tokens into this
if (ePtr != NULL)
{
append(ePtr->stream());
@ -91,7 +91,7 @@ bool Foam::primitiveEntry::expandVariable
}
else
{
// if not in the dictionary see if it is an environment
// if not in the dictionary see if it is an environment
// variable
string enVarString = getEnv(varName);
@ -123,7 +123,7 @@ bool Foam::primitiveEntry::read(const dictionary& dict, Istream& is)
{
is.fatalCheck
(
"primitiveEntry::readData(const dictionary& dict, Istream& is)"
"primitiveEntry::readData(const dictionary&, Istream&)"
);
label blockCount = 0;
@ -177,7 +177,7 @@ bool Foam::primitiveEntry::read(const dictionary& dict, Istream& is)
is.fatalCheck
(
"primitiveEntry::readData(const dictionary& dict, Istream& is)"
"primitiveEntry::readData(const dictionary&, Istream&)"
);
if (currToken.good())
@ -205,7 +205,7 @@ void Foam::primitiveEntry::readEntry(const dictionary& dict, Istream& is)
{
FatalIOErrorIn
(
"primitiveEntry::readEntry(const dictionary& dict,Istream& is)",
"primitiveEntry::readEntry(const dictionary&, Istream&)",
is
) << "ill defined primitiveEntry starting at keyword '"
<< keyword() << '\''
@ -266,7 +266,7 @@ void Foam::primitiveEntry::write(Ostream& os) const
os << token::SPACE;
}
}
os << token::END_STATEMENT << endl;
}
@ -297,7 +297,7 @@ Foam::Ostream& Foam::operator<<
{
os << " ...";
}
os << endl;
return os;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -129,7 +129,7 @@ void Foam::processorLduInterface::compressedSend
const UList<Type>& f
) const
{
if (sizeof(scalar) != sizeof(float) && f.size() && Pstream::floatTransfer)
if (sizeof(scalar) != sizeof(float) && Pstream::floatTransfer && f.size())
{
static const label nCmpts = sizeof(Type)/sizeof(scalar);
label nm1 = (f.size() - 1)*nCmpts;
@ -199,7 +199,7 @@ void Foam::processorLduInterface::compressedReceive
UList<Type>& f
) const
{
if (sizeof(scalar) != sizeof(float) && f.size() && Pstream::floatTransfer)
if (sizeof(scalar) != sizeof(float) && Pstream::floatTransfer && f.size())
{
static const label nCmpts = sizeof(Type)/sizeof(scalar);
label nm1 = (f.size() - 1)*nCmpts;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2005 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2005 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -177,7 +177,7 @@ inline Cmpt det(const SphericalTensor<Cmpt>& st)
}
//- Return the inverse of a symmetric tensor
//- Return the inverse of a spherical tensor
template <class Cmpt>
inline SphericalTensor<Cmpt> inv(const SphericalTensor<Cmpt>& st)
{

View File

@ -256,7 +256,7 @@ inline Cmpt magSqr(const SymmTensor<Cmpt>& st)
}
//- Return the strace of a symmetric tensor
//- Return the trace of a symmetric tensor
template <class Cmpt>
inline Cmpt tr(const SymmTensor<Cmpt>& st)
{
@ -280,7 +280,7 @@ inline const SymmTensor<Cmpt>& symm(const SymmTensor<Cmpt>& st)
}
//- Return the stwice the symmetric part of a symmetric tensor
//- Return twice the symmetric part of a symmetric tensor
template <class Cmpt>
inline SymmTensor<Cmpt> twoSymm(const SymmTensor<Cmpt>& st)
{
@ -361,7 +361,7 @@ inline SymmTensor<Cmpt> inv(const SymmTensor<Cmpt>& st)
}
//- Return the 1spt invariant of a symmetric tensor
//- Return the 1st invariant of a symmetric tensor
template <class Cmpt>
inline Cmpt invariantI(const SymmTensor<Cmpt>& st)
{
@ -453,14 +453,9 @@ operator&(const SphericalTensor<Cmpt>& spt1, const SymmTensor<Cmpt>& st2)
{
return SymmTensor<Cmpt>
(
spt1.ii()*st2.xx(),
spt1.ii()*st2.xy(),
spt1.ii()*st2.xz(),
spt1.ii()*st2.yy(),
spt1.ii()*st2.yz(),
spt1.ii()*st2.zz()
spt1.ii()*st2.xx(), spt1.ii()*st2.xy(), spt1.ii()*st2.xz(),
spt1.ii()*st2.yy(), spt1.ii()*st2.yz(),
spt1.ii()*st2.zz()
);
}
@ -472,14 +467,9 @@ operator&(const SymmTensor<Cmpt>& st1, const SphericalTensor<Cmpt>& spt2)
{
return SymmTensor<Cmpt>
(
st1.xx()*spt2.ii(),
st1.xy()*spt2.ii(),
st1.xz()*spt2.ii(),
st1.yy()*spt2.ii(),
st1.yz()*spt2.ii(),
st1.zz()*spt2.ii()
st1.xx()*spt2.ii(), st1.xy()*spt2.ii(), st1.xz()*spt2.ii(),
st1.yy()*spt2.ii(), st1.yz()*spt2.ii(),
st1.zz()*spt2.ii()
);
}

View File

@ -25,7 +25,6 @@ License
\*---------------------------------------------------------------------------*/
#include "symmTensor.H"
#include "mathematicalConstants.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -65,16 +64,16 @@ template<>
const symmTensor symmTensor::max
(
VGREAT, VGREAT, VGREAT,
VGREAT, VGREAT,
VGREAT
VGREAT, VGREAT,
VGREAT
);
template<>
const symmTensor symmTensor::min
(
-VGREAT, -VGREAT, -VGREAT,
-VGREAT, -VGREAT,
-VGREAT
-VGREAT, -VGREAT,
-VGREAT
);

View File

@ -402,7 +402,7 @@ inline SymmTensor<Cmpt> symm(const Tensor<Cmpt>& t)
}
//- Return the twice the symmetric part of a tensor
//- Return twice the symmetric part of a tensor
template <class Cmpt>
inline SymmTensor<Cmpt> twoSymm(const Tensor<Cmpt>& t)
{
@ -609,17 +609,9 @@ operator&(const SphericalTensor<Cmpt>& st1, const Tensor<Cmpt>& t2)
{
return Tensor<Cmpt>
(
st1.ii()*t2.xx(),
st1.ii()*t2.xy(),
st1.ii()*t2.xz(),
st1.ii()*t2.yx(),
st1.ii()*t2.yy(),
st1.ii()*t2.yz(),
st1.ii()*t2.zx(),
st1.ii()*t2.zy(),
st1.ii()*t2.zz()
st1.ii()*t2.xx(), st1.ii()*t2.xy(), st1.ii()*t2.xz(),
st1.ii()*t2.yx(), st1.ii()*t2.yy(), st1.ii()*t2.yz(),
st1.ii()*t2.zx(), st1.ii()*t2.zy(), st1.ii()*t2.zz()
);
}
@ -631,17 +623,9 @@ operator&(const Tensor<Cmpt>& t1, const SphericalTensor<Cmpt>& st2)
{
return Tensor<Cmpt>
(
t1.xx()*st2.ii(),
t1.xy()*st2.ii(),
t1.xz()*st2.ii(),
t1.yx()*st2.ii(),
t1.yy()*st2.ii(),
t1.yz()*st2.ii(),
t1.zx()*st2.ii(),
t1.zy()*st2.ii(),
t1.zz()*st2.ii()
t1.xx()*st2.ii(), t1.xy()*st2.ii(), t1.xz()*st2.ii(),
t1.yx()*st2.ii(), t1.yy()*st2.ii(), t1.yz()*st2.ii(),
t1.zx()*st2.ii(), t1.zy()*st2.ii(), t1.zz()*st2.ii()
);
}

View File

@ -51,13 +51,13 @@ namespace Foam
typedef Tensor<scalar> tensor;
vector eigenValues(const tensor& t);
vector eigenVector(const tensor& t, const scalar lambda);
tensor eigenVectors(const tensor& t);
vector eigenValues(const tensor&);
vector eigenVector(const tensor&, const scalar lambda);
tensor eigenVectors(const tensor&);
vector eigenValues(const symmTensor& t);
vector eigenVector(const symmTensor& t, const scalar lambda);
tensor eigenVectors(const symmTensor& t);
vector eigenValues(const symmTensor&);
vector eigenVector(const symmTensor&, const scalar lambda);
tensor eigenVectors(const symmTensor&);
//- Data associated with tensor type are contiguous
template<>

View File

@ -208,7 +208,7 @@ Foam::label Foam::scotchDecomp::decompose
//SCOTCH_graphMapCompute(&grafdat, &mapdat, &stradat); /* Perform mapping */
//SCOTCH_graphMapExit(&grafdat, &mapdat);
finalDecomp.setSize(xadj.size()-1);
finalDecomp = 0;
check
@ -217,7 +217,7 @@ Foam::label Foam::scotchDecomp::decompose
(
&grafdat,
&archdat,
&stradat, // const SCOTCH_Strat *
&stradat, // const SCOTCH_Strat *
finalDecomp.begin() // parttab
),
"SCOTCH_graphMap"
@ -231,7 +231,7 @@ Foam::label Foam::scotchDecomp::decompose
// (
// &grafdat,
// nProcessors_, // partnbr
// &stradat, // const SCOTCH_Strat *
// &stradat, // const SCOTCH_Strat *
// finalDecomp.begin() // parttab
// ),
// "SCOTCH_graphPart"

View File

@ -189,6 +189,7 @@ $(schemes)/outletStabilised/outletStabilised.C
$(schemes)/reverseLinear/reverseLinear.C
$(schemes)/clippedLinear/clippedLinear.C
$(schemes)/harmonic/harmonic.C
$(schemes)/fixedBlended/fixedBlended.C
$(schemes)/localBlended/localBlended.C
$(schemes)/localMax/localMax.C
$(schemes)/localMin/localMin.C
@ -207,7 +208,7 @@ $(limitedSchemes)/limitedSurfaceInterpolationScheme/limitedSurfaceInterpolationS
$(limitedSchemes)/upwind/upwind.C
$(limitedSchemes)/blended/blended.C
$(limitedSchemes)/linearUpwind/linearUpwind.C
$(limitedSchemes)/linearUpwindV/linearUpwindV.C
$(limitedSchemes)/linearUpwind/linearUpwindV.C
$(limitedSchemes)/Gamma/Gamma.C
$(limitedSchemes)/SFCD/SFCD.C
$(limitedSchemes)/Minmod/Minmod.C

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -34,7 +34,7 @@ void Foam::setRefCell
const dictionary& dict,
label& refCelli,
scalar& refValue,
bool forceReference
const bool forceReference
)
{
if (field.needReference() || forceReference)
@ -119,4 +119,15 @@ void Foam::setRefCell
}
Foam::scalar Foam::getRefCellValue
(
const volScalarField& field,
const label refCelli
)
{
scalar refCellValue = (refCelli >= 0 ? field[refCelli] : 0.0);
return returnReduce<label>(refCellValue, sumOp<scalar>());
}
// ************************************************************************* //

View File

@ -49,11 +49,18 @@ namespace Foam
// but which is not on a cyclic, symmetry or processor patch.
void setRefCell
(
const volScalarField&,
const dictionary&,
label& refCellI,
const volScalarField& field,
const dictionary& dict,
label& refCelli,
scalar& refValue,
bool forceReference = false
const bool forceReference = false
);
//- Return the current value of field in the reference cell
scalar getRefCellValue
(
const volScalarField& field,
const label refCelli
);
}

View File

@ -62,7 +62,7 @@ directMappedVelocityFluxFixedValueFvPatchField
fixedValueFvPatchVectorField(ptf, p, iF, mapper),
phiName_(ptf.phiName_)
{
if (!isType<directMappedPatchBase>(this->patch().patch()))
if (!isA<directMappedPatchBase>(this->patch().patch()))
{
FatalErrorIn
(
@ -95,7 +95,7 @@ directMappedVelocityFluxFixedValueFvPatchField
fixedValueFvPatchVectorField(p, iF, dict),
phiName_(dict.lookup("phi"))
{
if (!isType<directMappedPatchBase>(this->patch().patch()))
if (!isA<directMappedPatchBase>(this->patch().patch()))
{
FatalErrorIn
(
@ -207,7 +207,7 @@ void directMappedVelocityFluxFixedValueFvPatchField::updateCoeffs()
allUValues
);
newUValues = patch().patchSlice(newUValues);
mapDistribute::distribute
(
Pstream::defaultCommsType,

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -27,10 +27,34 @@ License
#include "fvSchemes.H"
#include "Time.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
int Foam::fvSchemes::debug(Foam::debug::debugSwitch("fvSchemes", false));
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
void Foam::fvSchemes::clear()
{
ddtSchemes_.clear();
defaultDdtScheme_.clear();
d2dt2Schemes_.clear();
defaultD2dt2Scheme_.clear();
interpolationSchemes_.clear();
defaultInterpolationScheme_.clear();
divSchemes_.clear(); // optional
defaultDivScheme_.clear();
gradSchemes_.clear(); // optional
defaultGradScheme_.clear();
snGradSchemes_.clear();
defaultSnGradScheme_.clear();
laplacianSchemes_.clear(); // optional
defaultLaplacianScheme_.clear();
fluxRequired_.clear();
defaultFluxRequired_ = false;
cacheFields_.clear();
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::fvSchemes::fvSchemes(const objectRegistry& obr)
@ -48,8 +72,11 @@ Foam::fvSchemes::fvSchemes(const objectRegistry& obr)
),
ddtSchemes_
(
ITstream(objectPath() + "::ddtSchemes",
tokenList())()
ITstream
(
objectPath() + "::ddtSchemes",
tokenList()
)()
),
defaultDdtScheme_
(
@ -58,8 +85,11 @@ Foam::fvSchemes::fvSchemes(const objectRegistry& obr)
),
d2dt2Schemes_
(
ITstream(objectPath() + "::d2dt2Schemes",
tokenList())()
ITstream
(
objectPath() + "::d2dt2Schemes",
tokenList()
)()
),
defaultD2dt2Scheme_
(
@ -68,8 +98,11 @@ Foam::fvSchemes::fvSchemes(const objectRegistry& obr)
),
interpolationSchemes_
(
ITstream(objectPath() + "::interpolationSchemes",
tokenList())()
ITstream
(
objectPath() + "::interpolationSchemes",
tokenList()
)()
),
defaultInterpolationScheme_
(
@ -78,8 +111,11 @@ Foam::fvSchemes::fvSchemes(const objectRegistry& obr)
),
divSchemes_
(
ITstream(objectPath() + "::divSchemes",
tokenList())()
ITstream
(
objectPath() + "::divSchemes",
tokenList()
)()
),
defaultDivScheme_
(
@ -88,8 +124,11 @@ Foam::fvSchemes::fvSchemes(const objectRegistry& obr)
),
gradSchemes_
(
ITstream(objectPath() + "::gradSchemes",
tokenList())()
ITstream
(
objectPath() + "::gradSchemes",
tokenList()
)()
),
defaultGradScheme_
(
@ -98,8 +137,11 @@ Foam::fvSchemes::fvSchemes(const objectRegistry& obr)
),
snGradSchemes_
(
ITstream(objectPath() + "::snGradSchemes",
tokenList())()
ITstream
(
objectPath() + "::snGradSchemes",
tokenList()
)()
),
defaultSnGradScheme_
(
@ -108,8 +150,11 @@ Foam::fvSchemes::fvSchemes(const objectRegistry& obr)
),
laplacianSchemes_
(
ITstream(objectPath() + "::laplacianSchemes",
tokenList())()
ITstream
(
objectPath() + "::laplacianSchemes",
tokenList()
)()
),
defaultLaplacianScheme_
(
@ -118,14 +163,20 @@ Foam::fvSchemes::fvSchemes(const objectRegistry& obr)
),
fluxRequired_
(
ITstream(objectPath() + "::fluxRequired",
tokenList())()
ITstream
(
objectPath() + "::fluxRequired",
tokenList()
)()
),
defaultFluxRequired_(false),
cacheFields_
(
ITstream(objectPath() + "::cacheFields",
tokenList())()
ITstream
(
objectPath() + "::cacheFields",
tokenList()
)()
)
{
read();
@ -140,6 +191,9 @@ bool Foam::fvSchemes::read()
{
const dictionary& dict = schemesDict();
// persistent settings across reads is incorrect
clear();
if (dict.found("ddtSchemes"))
{
ddtSchemes_ = dict.subDict("ddtSchemes");
@ -148,20 +202,23 @@ bool Foam::fvSchemes::read()
{
// For backward compatibility.
// The timeScheme will be deprecated with warning or removed
WarningIn("fvSchemes::read()")
<< "Using deprecated 'timeScheme' instead of 'ddtSchemes'"
<< nl << endl;
word timeSchemeName(dict.lookup("timeScheme"));
word schemeName(dict.lookup("timeScheme"));
if (timeSchemeName == "EulerImplicit")
if (schemeName == "EulerImplicit")
{
timeSchemeName = "Euler";
schemeName = "Euler";
}
else if (timeSchemeName == "BackwardDifferencing")
else if (schemeName == "BackwardDifferencing")
{
timeSchemeName = "backward";
schemeName = "backward";
}
else if (timeSchemeName == "SteadyState")
else if (schemeName == "SteadyState")
{
timeSchemeName = "steadyState";
schemeName = "steadyState";
}
else
{
@ -172,19 +229,14 @@ bool Foam::fvSchemes::read()
<< exit(FatalIOError);
}
if (ddtSchemes_.found("default"))
{
ddtSchemes_.remove("default");
}
ddtSchemes_.add("default", timeSchemeName);
ddtSchemes_.set("default", schemeName);
ddtSchemes_.lookup("default")[0].lineNumber() =
dict.lookup("timeScheme").lineNumber();
}
else
{
ddtSchemes_.add("default", "none");
ddtSchemes_.set("default", "none");
}
if
@ -205,31 +257,29 @@ bool Foam::fvSchemes::read()
{
// For backward compatibility.
// The timeScheme will be deprecated with warning or removed
WarningIn("fvSchemes::read()")
<< "Using deprecated 'timeScheme' instead of 'd2dt2Schemes'"
<< nl << endl;
word timeSchemeName(dict.lookup("timeScheme"));
word schemeName(dict.lookup("timeScheme"));
if (timeSchemeName == "EulerImplicit")
if (schemeName == "EulerImplicit")
{
timeSchemeName = "Euler";
schemeName = "Euler";
}
else if (timeSchemeName == "SteadyState")
else if (schemeName == "SteadyState")
{
timeSchemeName = "steadyState";
schemeName = "steadyState";
}
if (d2dt2Schemes_.found("default"))
{
d2dt2Schemes_.remove("default");
}
d2dt2Schemes_.add("default", timeSchemeName);
d2dt2Schemes_.set("default", schemeName);
d2dt2Schemes_.lookup("default")[0].lineNumber() =
dict.lookup("timeScheme").lineNumber();
}
else
{
d2dt2Schemes_.add("default", "none");
d2dt2Schemes_.set("default", "none");
}
if

View File

@ -84,8 +84,13 @@ class fvSchemes
// Private Member Functions
//- Disallow default bitwise copy construct and assignment
//- Clear the dictionaries and streams before reading
void clear();
//- Disallow default bitwise copy construct
fvSchemes(const fvSchemes&);
//- Disallow default bitwise assignment
void operator=(const fvSchemes&);

View File

@ -91,7 +91,7 @@ public:
FatalIOErrorIn
(
"extendedLeastSquaresGrad"
"(const fvMesh& mesh, Istream& schemeData)",
"(const fvMesh&, Istream& schemeData)",
schemeData
) << "Minimum determinant = " << minDet_
<< " should be >= 0 and <= 8"

View File

@ -67,7 +67,7 @@ class cellLimitedGrad
tmp<fv::gradScheme<Type> > basicGradScheme_;
//- Limiter coefficient
scalar k_;
const scalar k_;
// Private Member Functions
@ -98,7 +98,7 @@ public:
{
FatalIOErrorIn
(
"cellLimitedGrad(const fvMesh& mesh, Istream& schemeData)",
"cellLimitedGrad(const fvMesh&, Istream& schemeData)",
schemeData
) << "coefficient = " << k_
<< " should be >= 0 and <= 1"

View File

@ -21,7 +21,7 @@ License
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#include "cellLimitedGrad.H"
@ -377,7 +377,7 @@ tmp<volTensorField> cellLimitedGrad<vector>::grad
);
}
}
if (fv::debug)
{
Info<< "gradient limiter for: " << vsf.name()

View File

@ -67,7 +67,7 @@ class cellMDLimitedGrad
tmp<fv::gradScheme<Type> > basicGradScheme_;
//- Limiter coefficient
scalar k_;
const scalar k_;
// Private Member Functions
@ -98,8 +98,7 @@ public:
{
FatalIOErrorIn
(
"cellMDLimitedGrad"
"(const fvMesh& mesh, Istream& schemeData)",
"cellMDLimitedGrad(const fvMesh&, Istream& schemeData)",
schemeData
) << "coefficient = " << k_
<< " should be >= 0 and <= 1"

View File

@ -21,7 +21,7 @@ License
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#include "cellMDLimitedGrad.H"

View File

@ -67,7 +67,7 @@ class faceLimitedGrad
tmp<fv::gradScheme<Type> > basicGradScheme_;
//- Limiter coefficient
scalar k_;
const scalar k_;
// Private Member Functions
@ -107,7 +107,7 @@ public:
{
FatalIOErrorIn
(
"faceLimitedGrad(const fvMesh& mesh, Istream& schemeData)",
"faceLimitedGrad(const fvMesh&, Istream& schemeData)",
schemeData
) << "coefficient = " << k_
<< " should be >= 0 and <= 1"

View File

@ -67,7 +67,7 @@ class faceMDLimitedGrad
tmp<fv::gradScheme<Type> > basicGradScheme_;
//- Limiter coefficient
scalar k_;
const scalar k_;
// Private Member Functions
@ -107,7 +107,7 @@ public:
{
FatalIOErrorIn
(
"faceMDLimitedGrad(const fvMesh& mesh, Istream& schemeData)",
"faceMDLimitedGrad(const fvMesh&, Istream& schemeData)",
schemeData
) << "coefficient = " << k_
<< " should be >= 0 and <= 1"

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -472,22 +472,18 @@ void Foam::fvMatrix<Type>::setValues
}
// Set reference level for solution
template<class Type>
void Foam::fvMatrix<Type>::setReference
(
const label cell,
const label celli,
const Type& value,
const bool forceReference
)
{
if (psi_.needReference() || forceReference)
if (celli >= 0 && (psi_.needReference() || forceReference))
{
if (cell >= 0)
{
source()[cell] += diag()[cell]*value;
diag()[cell] += diag()[cell];
}
source()[celli] += diag()[celli]*value;
diag()[celli] += diag()[celli];
}
}

View File

@ -326,7 +326,7 @@ public:
//- Set reference level for solution
void setReference
(
const label cell,
const label celli,
const Type& value,
const bool forceReference = false
);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -41,7 +41,7 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class LimitedLimiter Declaration
Class LimitedLimiter Declaration
\*---------------------------------------------------------------------------*/
template<class LimitedScheme>

View File

@ -41,7 +41,7 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class Limited01Limiter Declaration
Class Limited01Limiter Declaration
\*---------------------------------------------------------------------------*/
template<class LimitedScheme>

View File

@ -79,18 +79,17 @@ public:
{
scalar phiCD = cdWeight*phiP + (1 - cdWeight)*phiN;
scalar phif;
scalar phiU;
scalar phiU, phif;
if (faceFlux > 0)
{
phif = 0.5*(phiCD + phiP + (1 - cdWeight)*(d & gradcP));
phiU = phiP;
phif = 0.5*(phiCD + phiP + (1 - cdWeight)*(d & gradcP));
}
else
{
phif = 0.5*(phiCD + phiN - cdWeight*(d & gradcN));
phiU = phiN;
phif = 0.5*(phiCD + phiN - cdWeight*(d & gradcN));
}
// Calculate the effective limiter for the QUICK interpolation

View File

@ -81,8 +81,7 @@ public:
scalar phiCD = gradfV & (cdWeight*phiP + (1 - cdWeight)*phiN);
scalar phif;
scalar phiU;
scalar phiU, phif;
if (faceFlux > 0)
{
@ -95,7 +94,7 @@ public:
phif = 0.5*(phiCD + phiU - cdWeight*(gradfV & (d & gradcN)));
}
// Calculate the effective limiter for the linearUpwind interpolation
// Calculate the effective limiter for the QUICK interpolation
scalar QLimiter = (phif - phiU)/stabilise(phiCD - phiU, SMALL);
// Limit the limiter between upwind and downwind

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