mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
cosmetics
This commit is contained in:
@ -35,17 +35,17 @@ Foam::label Foam::interpolationLookUpTable <Type>::index
|
|||||||
const bool lastDim
|
const bool lastDim
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
label totalindex = 0;
|
label totalIndex = 0;
|
||||||
|
|
||||||
for (int i = 0; i < dim_.size() - 1; i++)
|
forAll(dim_, i)
|
||||||
{
|
{
|
||||||
label dim = 1;
|
label dim = 1;
|
||||||
for (int j = i + 1; j < dim_.size(); j++)
|
for (int j = i + 1; j < dim_.size(); j++)
|
||||||
{
|
{
|
||||||
dim *=(dim_[j]+1);
|
dim *= dim_[j] + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
totalindex +=
|
totalIndex +=
|
||||||
dim
|
dim
|
||||||
*min
|
*min
|
||||||
(
|
(
|
||||||
@ -57,7 +57,7 @@ Foam::label Foam::interpolationLookUpTable <Type>::index
|
|||||||
if (lastDim)
|
if (lastDim)
|
||||||
{
|
{
|
||||||
label iLastdim = dim_.size() - 1;
|
label iLastdim = dim_.size() - 1;
|
||||||
totalindex += Foam::min
|
totalIndex += Foam::min
|
||||||
(
|
(
|
||||||
max
|
max
|
||||||
(
|
(
|
||||||
@ -68,7 +68,7 @@ Foam::label Foam::interpolationLookUpTable <Type>::index
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return totalindex;
|
return totalIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -171,7 +171,7 @@ void Foam::interpolationLookUpTable<Type>::dimensionTable()
|
|||||||
max_[i] = readScalar(entries_[i].lookup("max"));
|
max_[i] = readScalar(entries_[i].lookup("max"));
|
||||||
min_[i] = readScalar(entries_[i].lookup("min"));
|
min_[i] = readScalar(entries_[i].lookup("min"));
|
||||||
delta_[i] = (max_[i] - min_[i])/dim_[i];
|
delta_[i] = (max_[i] - min_[i])/dim_[i];
|
||||||
tableDim *= (dim_[i] + 1);
|
tableDim *= dim_[i] + 1;
|
||||||
fieldIndices_.insert(entries_[i].lookup("name"), index);
|
fieldIndices_.insert(entries_[i].lookup("name"), index);
|
||||||
entryIndices_[i] = index;
|
entryIndices_[i] = index;
|
||||||
index++;
|
index++;
|
||||||
@ -229,8 +229,7 @@ void Foam::interpolationLookUpTable<Type>::readTable
|
|||||||
FatalErrorIn
|
FatalErrorIn
|
||||||
(
|
(
|
||||||
"Foam::interpolationLookUpTable<Type>::readTable()"
|
"Foam::interpolationLookUpTable<Type>::readTable()"
|
||||||
) << "table is empty" << nl
|
) << "table is empty" << nl << exit(FatalError);
|
||||||
<< exit(FatalError);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -316,12 +315,11 @@ template<class Type>
|
|||||||
void Foam::interpolationLookUpTable<Type>::check() const
|
void Foam::interpolationLookUpTable<Type>::check() const
|
||||||
{
|
{
|
||||||
// check order in the first dimension.
|
// check order in the first dimension.
|
||||||
|
|
||||||
scalar prevValue = List<scalarField>::operator[](0).operator[](0);
|
scalar prevValue = List<scalarField>::operator[](0).operator[](0);
|
||||||
label dim = 1;
|
label dim = 1;
|
||||||
for (int j = 1; j < dim_.size(); j++)
|
for (int j = 1; j < dim_.size(); j++)
|
||||||
{
|
{
|
||||||
dim *=(dim_[j]+1);
|
dim *= dim_[j] + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (label i = 1; i < dim_[0]; i++)
|
for (label i = 1; i < dim_[0]; i++)
|
||||||
@ -336,9 +334,8 @@ void Foam::interpolationLookUpTable<Type>::check() const
|
|||||||
FatalErrorIn
|
FatalErrorIn
|
||||||
(
|
(
|
||||||
"Foam::interpolationLookUpTable<Type>::checkOrder() const"
|
"Foam::interpolationLookUpTable<Type>::checkOrder() const"
|
||||||
) << "out-of-order value: "
|
) << "out-of-order value: " << currValue
|
||||||
<< currValue << " at index " << index << nl
|
<< " at index " << index << nl << exit(FatalError);
|
||||||
<< exit(FatalError);
|
|
||||||
}
|
}
|
||||||
prevValue = currValue;
|
prevValue = currValue;
|
||||||
}
|
}
|
||||||
@ -379,8 +376,7 @@ void Foam::interpolationLookUpTable<Type>::write
|
|||||||
FatalErrorIn
|
FatalErrorIn
|
||||||
(
|
(
|
||||||
"Foam::interpolationTable<Type>::write()"
|
"Foam::interpolationTable<Type>::write()"
|
||||||
) << "table is empty" << nl
|
) << "table is empty" << nl << exit(FatalError);
|
||||||
<< exit(FatalError);
|
|
||||||
}
|
}
|
||||||
os.writeKeyword("values");
|
os.writeKeyword("values");
|
||||||
os << *this << token::END_STATEMENT << nl;
|
os << *this << token::END_STATEMENT << nl;
|
||||||
@ -400,28 +396,22 @@ Foam::interpolationLookUpTable<Type>::operator[](const label i)
|
|||||||
{
|
{
|
||||||
FatalErrorIn
|
FatalErrorIn
|
||||||
(
|
(
|
||||||
"Foam::interpolationLookUpTable<Type>::operator[]"
|
"Foam::interpolationLookUpTable<Type>::operator[](const label)"
|
||||||
"(const label) const"
|
) << "table has (" << n << ") columns" << nl << exit(FatalError);
|
||||||
) << "table has (" << n << ") columns" << nl
|
|
||||||
<< exit(FatalError);
|
|
||||||
}
|
}
|
||||||
else if (ii < 0)
|
else if (ii < 0)
|
||||||
{
|
{
|
||||||
FatalErrorIn
|
FatalErrorIn
|
||||||
(
|
(
|
||||||
"Foam::interpolationLookUpTable<Type>::operator[]"
|
"Foam::interpolationLookUpTable<Type>::operator[](const label)"
|
||||||
"(const label) const"
|
) << "index (" << ii << ") underflow" << nl << exit(FatalError);
|
||||||
) << "index (" << ii << ") underflow" << nl
|
|
||||||
<< exit(FatalError);
|
|
||||||
}
|
}
|
||||||
else if (ii > n)
|
else if (ii > n)
|
||||||
{
|
{
|
||||||
FatalErrorIn
|
FatalErrorIn
|
||||||
(
|
(
|
||||||
"Foam::interpolationLookUpTable<Type>::operator[]"
|
"Foam::interpolationLookUpTable<Type>::operator[](const label)"
|
||||||
"(const label) const"
|
) << "index (" << ii << ") overflow" << nl << exit(FatalError);
|
||||||
) << "index (" << ii << ") overflow" << nl
|
|
||||||
<< exit(FatalError);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return List<scalarField>::operator[](ii);
|
return List<scalarField>::operator[](ii);
|
||||||
@ -441,8 +431,7 @@ Foam::interpolationLookUpTable<Type>::operator[](const label i) const
|
|||||||
(
|
(
|
||||||
"Foam::interpolationLookUpTable<Type>::operator[]"
|
"Foam::interpolationLookUpTable<Type>::operator[]"
|
||||||
"(const label) const"
|
"(const label) const"
|
||||||
) << "table has (" << n << ") columns" << nl
|
) << "table has (" << n << ") columns" << nl << exit(FatalError);
|
||||||
<< exit(FatalError);
|
|
||||||
}
|
}
|
||||||
else if (ii < 0)
|
else if (ii < 0)
|
||||||
{
|
{
|
||||||
@ -450,8 +439,7 @@ Foam::interpolationLookUpTable<Type>::operator[](const label i) const
|
|||||||
(
|
(
|
||||||
"Foam::interpolationLookUpTable<Type>::operator[]"
|
"Foam::interpolationLookUpTable<Type>::operator[]"
|
||||||
"(const label) const"
|
"(const label) const"
|
||||||
) << "index (" << ii << ") underflow" << nl
|
) << "index (" << ii << ") underflow" << nl << exit(FatalError);
|
||||||
<< exit(FatalError);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (ii > n)
|
else if (ii > n)
|
||||||
|
|||||||
@ -64,7 +64,7 @@ class interpolationLookUpTable
|
|||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
|
||||||
// Private data
|
// Privsate data
|
||||||
|
|
||||||
//- File name
|
//- File name
|
||||||
fileName fileName_;
|
fileName fileName_;
|
||||||
|
|||||||
@ -100,7 +100,7 @@ namespace radiation
|
|||||||
{
|
{
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class constantAbsorptionEmission Declaration
|
Class greyMeanAbsorptionEmission Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
class greyMeanAbsorptionEmission
|
class greyMeanAbsorptionEmission
|
||||||
|
|||||||
Reference in New Issue
Block a user