Commit a4ab3f61 authored by Henry Weller's avatar Henry Weller
Browse files

src/OpenFOAM: Update ...ErrorIn -> ...ErrorInFunction

Avoids the clutter and maintenance effort associated with providing the
function signature string.
parent 4b0c0a52
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -208,7 +208,7 @@ Foam::dynamicIndexedOctree<Type>::divide
|| bb.min()[2] >= bb.max()[2]
)
{
FatalErrorIn("dynamicIndexedOctree<Type>::divide(..)")
FatalErrorInFunction
<< "Badly formed bounding box:" << bb
<< abort(FatalError);
}
......@@ -436,11 +436,8 @@ Foam::volumeType Foam::dynamicIndexedOctree<Type>::getVolumeType
{
// Empty node. Cannot have 'mixed' as its type since not divided
// up and has no items inside it.
FatalErrorIn
(
"dynamicIndexedOctree<Type>::getVolumeType"
"(const label, const point&)"
) << "Sample:" << sample << " node:" << nodeI
FatalErrorInFunction
<< "Sample:" << sample << " node:" << nodeI
<< " with bb:" << nodes_[nodeI].bb_ << nl
<< "Empty subnode has invalid volume type MIXED."
<< abort(FatalError);
......@@ -450,11 +447,8 @@ Foam::volumeType Foam::dynamicIndexedOctree<Type>::getVolumeType
}
else
{
FatalErrorIn
(
"dynamicIndexedOctree<Type>::getVolumeType"
"(const label, const point&)"
) << "Sample:" << sample << " at node:" << nodeI
FatalErrorInFunction
<< "Sample:" << sample << " at node:" << nodeI
<< " octant:" << octant
<< " with bb:" << nod.bb_.subBbox(octant) << nl
<< "Node has invalid volume type " << octantType
......@@ -708,7 +702,7 @@ Foam::point Foam::dynamicIndexedOctree<Type>::pushPoint
{
if (pushInside != bb.contains(perturbedPt))
{
FatalErrorIn("dynamicIndexedOctree<Type>::pushPoint(..)")
FatalErrorInFunction
<< "pushed point:" << pt
<< " to:" << perturbedPt
<< " wanted side:" << pushInside
......@@ -743,7 +737,7 @@ Foam::point Foam::dynamicIndexedOctree<Type>::pushPoint
if (faceID == 0)
{
FatalErrorIn("dynamicIndexedOctree<Type>::pushPoint(..)")
FatalErrorInFunction
<< abort(FatalError);
}
......@@ -820,7 +814,7 @@ Foam::point Foam::dynamicIndexedOctree<Type>::pushPoint
{
if (pushInside != bb.contains(perturbedPt))
{
FatalErrorIn("dynamicIndexedOctree<Type>::pushPoint(..)")
FatalErrorInFunction
<< "pushed point:" << pt << " on face:" << faceString(faceID)
<< " to:" << perturbedPt
<< " wanted side:" << pushInside
......@@ -849,7 +843,7 @@ Foam::point Foam::dynamicIndexedOctree<Type>::pushPointIntoFace
{
if (bb.posBits(pt) != 0)
{
FatalErrorIn("dynamicIndexedOctree<Type>::pushPointIntoFace(..)")
FatalErrorInFunction
<< " bb:" << bb << endl
<< "does not contain point " << pt << abort(FatalError);
}
......@@ -971,7 +965,7 @@ Foam::point Foam::dynamicIndexedOctree<Type>::pushPointIntoFace
{
if (faceID != bb.faceBits(facePoint))
{
FatalErrorIn("dynamicIndexedOctree<Type>::pushPointIntoFace(..)")
FatalErrorInFunction
<< "Pushed point from " << pt
<< " on face:" << ptFaceID << " of bb:" << bb << endl
<< "onto " << facePoint
......@@ -982,7 +976,7 @@ Foam::point Foam::dynamicIndexedOctree<Type>::pushPointIntoFace
}
if (bb.posBits(facePoint) != 0)
{
FatalErrorIn("dynamicIndexedOctree<Type>::pushPointIntoFace(..)")
FatalErrorInFunction
<< " bb:" << bb << endl
<< "does not contain perturbed point "
<< facePoint << abort(FatalError);
......@@ -1086,7 +1080,7 @@ Foam::point Foam::dynamicIndexedOctree<Type>::pushPointIntoFace
//
// if (nFaces == 0 || nFaces == 1 || nFaces > 3)
// {
// FatalErrorIn("dynamicIndexedOctree<Type>::checkMultipleFaces(..)")
// FatalErrorInFunction
// << "Problem : nFaces:" << nFaces << abort(FatalError);
// }
//
......@@ -1119,7 +1113,7 @@ Foam::point Foam::dynamicIndexedOctree<Type>::pushPointIntoFace
//
// if (maxIndex == -1)
// {
// FatalErrorIn("dynamicIndexedOctree<Type>::checkMultipleFaces(..)")
// FatalErrorInFunction
// << "Problem maxIndex:" << maxIndex << " inproducts:" << inproducts
// << abort(FatalError);
// }
......@@ -1179,7 +1173,7 @@ Foam::point Foam::dynamicIndexedOctree<Type>::pushPointIntoFace
// {
// if (faceID != bb.faceBits(faceHitInfo.rawPoint()))
// {
// FatalErrorIn("dynamicIndexedOctree<Type>::checkMultipleFaces(..)")
// FatalErrorInFunction
// << "Pushed point from " << oldPoint
// << " on face:" << oldFaceID << " of bb:" << bb << endl
// << "onto " << faceHitInfo.rawPoint()
......@@ -1229,7 +1223,7 @@ bool Foam::dynamicIndexedOctree<Type>::walkToParent
if (parentOctant == 255)
{
FatalErrorIn("walkToParent(..)")
FatalErrorInFunction
<< "Problem: no parent found for octant:" << octant
<< " node:" << nodeI
<< abort(FatalError);
......@@ -1426,7 +1420,7 @@ bool Foam::dynamicIndexedOctree<Type>::walkToNeighbour
if (!subBb.contains(facePoint))
{
FatalErrorIn("dynamicIndexedOctree<Type>::walkToNeighbour(..)")
FatalErrorInFunction
<< "When searching for " << facePoint
<< " ended up in node:" << nodeI
<< " octant:" << octant
......@@ -1455,7 +1449,7 @@ bool Foam::dynamicIndexedOctree<Type>::walkToNeighbour
if (nodeI == oldNodeI && octant == oldOctant)
{
FatalErrorIn("dynamicIndexedOctree<Type>::walkToNeighbour(..)")
FatalErrorInFunction
<< "Did not go to neighbour when searching for " << facePoint
<< endl
<< " starting from face:" << faceString(faceID)
......@@ -1467,7 +1461,7 @@ bool Foam::dynamicIndexedOctree<Type>::walkToNeighbour
if (!subBb.contains(facePoint))
{
FatalErrorIn("dynamicIndexedOctree<Type>::walkToNeighbour(..)")
FatalErrorInFunction
<< "When searching for " << facePoint
<< " ended up in node:" << nodeI
<< " octant:" << octant
......@@ -1555,7 +1549,7 @@ void Foam::dynamicIndexedOctree<Type>::traverseNode
if (octantBb.posBits(start) != 0)
{
FatalErrorIn("dynamicIndexedOctree<Type>::traverseNode(..)")
FatalErrorInFunction
<< "Node:" << nodeI << " octant:" << octant
<< " bb:" << octantBb << endl
<< "does not contain point " << start << abort(FatalError);
......@@ -1863,7 +1857,7 @@ Foam::pointIndexHit Foam::dynamicIndexedOctree<Type>::findLine
}
if (debug)
{
FatalErrorIn("dynamicIndexedOctree<Type>::findLine(..)")
FatalErrorInFunction
<< "Got stuck in loop raytracing from:" << treeStart
<< " to:" << treeEnd << endl
<< "inside top box:" << subBbox(startNodeI, startOctant)
......@@ -1871,7 +1865,7 @@ Foam::pointIndexHit Foam::dynamicIndexedOctree<Type>::findLine
}
else
{
WarningIn("dynamicIndexedOctree<Type>::findLine(..)")
WarningInFunction
<< "Got stuck in loop raytracing from:" << treeStart
<< " to:" << treeEnd << endl
<< "inside top box:" << subBbox(startNodeI, startOctant)
......@@ -2493,7 +2487,7 @@ Foam::labelBits Foam::dynamicIndexedOctree<Type>::findNode
{
if (!nod.bb_.contains(sample))
{
FatalErrorIn("findNode(..)")
FatalErrorInFunction
<< "Cannot find " << sample << " in node " << nodeI
<< abort(FatalError);
}
......@@ -2627,7 +2621,7 @@ Foam::volumeType Foam::dynamicIndexedOctree<Type>::getVolumeType
}
else
{
FatalErrorIn("getVolumeType") << abort(FatalError);
FatalErrorInFunction << abort(FatalError);
}
}
......
......@@ -472,7 +472,7 @@ public:
{
if (nodes_.empty())
{
FatalErrorIn("dynamicIndexedOctree<Type>::bb() const")
FatalErrorInFunction
<< "Tree is empty" << abort(FatalError);
}
return nodes_[0].bb_;
......@@ -500,7 +500,7 @@ public:
{
if (!isContent(i))
{
FatalErrorIn("getContent(const label)")
FatalErrorInFunction
<< abort(FatalError);
}
return -i.val()-1;
......@@ -510,7 +510,7 @@ public:
{
if (!isNode(i))
{
FatalErrorIn("getNode(const label)")
FatalErrorInFunction
<< abort(FatalError);
}
return i.val() - 1;
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -182,7 +182,7 @@ Foam::indexedOctree<Type>::divide
|| bb.min()[2] >= bb.max()[2]
)
{
FatalErrorIn("indexedOctree<Type>::divide(..)")
FatalErrorInFunction
<< "Badly formed bounding box:" << bb
<< abort(FatalError);
}
......@@ -456,11 +456,8 @@ Foam::volumeType Foam::indexedOctree<Type>::getVolumeType
{
// Empty node. Cannot have 'mixed' as its type since not divided
// up and has no items inside it.
FatalErrorIn
(
"indexedOctree<Type>::getVolumeType"
"(const label, const point&)"
) << "Sample:" << sample << " node:" << nodeI
FatalErrorInFunction
<< "Sample:" << sample << " node:" << nodeI
<< " with bb:" << nodes_[nodeI].bb_ << nl
<< "Empty subnode has invalid volume type MIXED."
<< abort(FatalError);
......@@ -470,11 +467,8 @@ Foam::volumeType Foam::indexedOctree<Type>::getVolumeType
}
else
{
FatalErrorIn
(
"indexedOctree<Type>::getVolumeType"
"(const label, const point&)"
) << "Sample:" << sample << " at node:" << nodeI
FatalErrorInFunction
<< "Sample:" << sample << " at node:" << nodeI
<< " octant:" << octant
<< " with bb:" << nod.bb_.subBbox(octant) << nl
<< "Node has invalid volume type " << octantType
......@@ -739,7 +733,7 @@ Foam::point Foam::indexedOctree<Type>::pushPoint
{
if (pushInside != bb.contains(perturbedPt))
{
FatalErrorIn("indexedOctree<Type>::pushPoint(..)")
FatalErrorInFunction
<< "pushed point:" << pt
<< " to:" << perturbedPt
<< " wanted side:" << pushInside
......@@ -774,7 +768,7 @@ Foam::point Foam::indexedOctree<Type>::pushPoint
if (faceID == 0)
{
FatalErrorIn("indexedOctree<Type>::pushPoint(..)")
FatalErrorInFunction
<< abort(FatalError);
}
......@@ -851,7 +845,7 @@ Foam::point Foam::indexedOctree<Type>::pushPoint
{
if (pushInside != bb.contains(perturbedPt))
{
FatalErrorIn("indexedOctree<Type>::pushPoint(..)")
FatalErrorInFunction
<< "pushed point:" << pt << " on face:" << faceString(faceID)
<< " to:" << perturbedPt
<< " wanted side:" << pushInside
......@@ -880,7 +874,7 @@ Foam::point Foam::indexedOctree<Type>::pushPointIntoFace
{
if (bb.posBits(pt) != 0)
{
FatalErrorIn("indexedOctree<Type>::pushPointIntoFace(..)")
FatalErrorInFunction
<< " bb:" << bb << endl
<< "does not contain point " << pt << abort(FatalError);
}
......@@ -1002,7 +996,7 @@ Foam::point Foam::indexedOctree<Type>::pushPointIntoFace
{
if (faceID != bb.faceBits(facePoint))
{
FatalErrorIn("indexedOctree<Type>::pushPointIntoFace(..)")
FatalErrorInFunction
<< "Pushed point from " << pt
<< " on face:" << ptFaceID << " of bb:" << bb << endl
<< "onto " << facePoint
......@@ -1013,7 +1007,7 @@ Foam::point Foam::indexedOctree<Type>::pushPointIntoFace
}
if (bb.posBits(facePoint) != 0)
{
FatalErrorIn("indexedOctree<Type>::pushPointIntoFace(..)")
FatalErrorInFunction
<< " bb:" << bb << endl
<< "does not contain perturbed point "
<< facePoint << abort(FatalError);
......@@ -1117,7 +1111,7 @@ Foam::point Foam::indexedOctree<Type>::pushPointIntoFace
//
// if (nFaces == 0 || nFaces == 1 || nFaces > 3)
// {
// FatalErrorIn("indexedOctree<Type>::checkMultipleFaces(..)")
// FatalErrorInFunction
// << "Problem : nFaces:" << nFaces << abort(FatalError);
// }
//
......@@ -1150,7 +1144,7 @@ Foam::point Foam::indexedOctree<Type>::pushPointIntoFace
//
// if (maxIndex == -1)
// {
// FatalErrorIn("indexedOctree<Type>::checkMultipleFaces(..)")
// FatalErrorInFunction
// << "Problem maxIndex:" << maxIndex << " inproducts:" << inproducts
// << abort(FatalError);
// }
......@@ -1210,7 +1204,7 @@ Foam::point Foam::indexedOctree<Type>::pushPointIntoFace
// {
// if (faceID != bb.faceBits(faceHitInfo.rawPoint()))
// {
// FatalErrorIn("indexedOctree<Type>::checkMultipleFaces(..)")
// FatalErrorInFunction
// << "Pushed point from " << oldPoint
// << " on face:" << oldFaceID << " of bb:" << bb << endl
// << "onto " << faceHitInfo.rawPoint()
......@@ -1260,7 +1254,7 @@ bool Foam::indexedOctree<Type>::walkToParent
if (parentOctant == 255)
{
FatalErrorIn("walkToParent(..)")
FatalErrorInFunction
<< "Problem: no parent found for octant:" << octant
<< " node:" << nodeI
<< abort(FatalError);
......@@ -1457,7 +1451,7 @@ bool Foam::indexedOctree<Type>::walkToNeighbour
if (!subBb.contains(facePoint))
{
FatalErrorIn("indexedOctree<Type>::walkToNeighbour(..)")
FatalErrorInFunction
<< "When searching for " << facePoint
<< " ended up in node:" << nodeI
<< " octant:" << octant
......@@ -1486,7 +1480,7 @@ bool Foam::indexedOctree<Type>::walkToNeighbour
if (nodeI == oldNodeI && octant == oldOctant)
{
FatalErrorIn("indexedOctree<Type>::walkToNeighbour(..)")
FatalErrorInFunction
<< "Did not go to neighbour when searching for " << facePoint
<< endl
<< " starting from face:" << faceString(faceID)
......@@ -1498,7 +1492,7 @@ bool Foam::indexedOctree<Type>::walkToNeighbour
if (!subBb.contains(facePoint))
{
FatalErrorIn("indexedOctree<Type>::walkToNeighbour(..)")
FatalErrorInFunction
<< "When searching for " << facePoint
<< " ended up in node:" << nodeI
<< " octant:" << octant
......@@ -1589,7 +1583,7 @@ void Foam::indexedOctree<Type>::traverseNode
if (octantBb.posBits(start) != 0)
{
FatalErrorIn("indexedOctree<Type>::traverseNode(..)")
FatalErrorInFunction
<< "Node:" << nodeI << " octant:" << octant
<< " bb:" << octantBb << endl
<< "does not contain point " << start << abort(FatalError);
......@@ -1897,7 +1891,7 @@ Foam::pointIndexHit Foam::indexedOctree<Type>::findLine
}
if (debug)
{
FatalErrorIn("indexedOctree<Type>::findLine(..)")
FatalErrorInFunction
<< "Got stuck in loop raytracing from:" << treeStart
<< " to:" << treeEnd << endl
<< "inside top box:" << subBbox(startNodeI, startOctant)
......@@ -1905,7 +1899,7 @@ Foam::pointIndexHit Foam::indexedOctree<Type>::findLine
}
else
{
WarningIn("indexedOctree<Type>::findLine(..)")
WarningInFunction
<< "Got stuck in loop raytracing from:" << treeStart
<< " to:" << treeEnd << endl
<< "inside top box:" << subBbox(startNodeI, startOctant)
......@@ -2799,7 +2793,7 @@ Foam::labelBits Foam::indexedOctree<Type>::findNode
{
if (!nod.bb_.contains(sample))
{
FatalErrorIn("findNode(..)")
FatalErrorInFunction
<< "Cannot find " << sample << " in node " << nodeI
<< abort(FatalError);
}
......@@ -2937,7 +2931,7 @@ Foam::volumeType Foam::indexedOctree<Type>::getVolumeType
}
else
{
FatalErrorIn("getVolumeType") << abort(FatalError);
FatalErrorInFunction << abort(FatalError);
}
}
......
......@@ -470,7 +470,7 @@ public:
{
if (nodes_.empty())
{
FatalErrorIn("indexedOctree<Type>::bb() const")
FatalErrorInFunction
<< "Tree is empty" << abort(FatalError);
}
return nodes_[0].bb_;
......@@ -498,7 +498,7 @@ public:
{
if (!isContent(i))
{
FatalErrorIn("getContent(const label)")
FatalErrorInFunction
<< abort(FatalError);
}
return -i.val()-1;
......@@ -508,7 +508,7 @@ public:
{
if (!isNode(i))
{
FatalErrorIn("getNode(const label)")
FatalErrorInFunction
<< abort(FatalError);
}
return i.val() - 1;
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -60,10 +60,8 @@ class labelBits
# ifdef FULLDEBUG
if (bits > 7 || (((val<<3)>>3) != val))
{
FatalErrorIn
(
"labelBits::pack(const label, const direction)"
) << "Direction " << bits << " outside range 0..7"
FatalErrorInFunction
<< "Direction " << bits << " outside range 0..7"
<< " or value " << val << " negative or larger than "
<< label(8*sizeof(label)-3) << " bit representation"
<< abort(FatalError);
......
......@@ -171,11 +171,8 @@ void Foam::Circulator<ContainerType>::operator=
// Check for assignment to self
if (this == &rhs)
{
FatalErrorIn
(
"Foam::Circulator<ContainerType>::operator="
"(const Foam::Circulator<ContainerType>&)"
) << "Attempted assignment to self"
FatalErrorInFunction
<< "Attempted assignment to self"
<< abort(FatalError);
}
......
......@@ -174,11 +174,8 @@ void Foam::ConstCirculator<ContainerType>::operator=
// Check for assignment to self
if (this == &rhs)
{
FatalErrorIn
(
"Foam::ConstCirculator<ContainerType>::operator="
"(const Foam::ConstCirculator<ContainerType>&)"
) << "Attempted assignment to self"
FatalErrorInFunction
<< "Attempted assignment to self"
<< abort(FatalError);
}
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -141,10 +141,8 @@ const T* Foam::DictionaryBase<IDLListType, T>::lookup(const word& keyword) const
if (iter == hashedTs_.end())
{
FatalErrorIn
(
"DictionaryBase<IDLListType, T>::lookup(const word&) const"
) << keyword << " is undefined"
FatalErrorInFunction
<< keyword << " is undefined"
<< exit(FatalError);
}
......@@ -160,10 +158,8 @@ T* Foam::DictionaryBase<IDLListType, T>::lookup(const word& keyword)
if (iter == hashedTs_.end())
{
FatalErrorIn
(
"DictionaryBase<IDLListType, T>::lookup(const word&)"
) << keyword << " is undefined"
FatalErrorInFunction
<< keyword << " is undefined"
<< exit(FatalError);
}
......@@ -260,7 +256,7 @@ void Foam::DictionaryBase<IDLListType, T>::operator=
// Check for assignment to self
if (this == &dict)
{
FatalErrorIn("DictionaryBase::operator=(const DictionaryBase&)")
FatalErrorInFunction
<< "attempted assignment to self"
<< abort(FatalError);
}
......
......@@ -70,10 +70,8 @@ inline Foam::autoPtr<T> Foam::PtrListDictionary<T>::set
{
if (!DictionaryBase<PtrList<T>, T>::hashedTs_.insert(key, ptr))
{
FatalErrorIn
(
"PtrListDictionary<T>::set(const label i, const word& key, T* ptr)"
) << "Cannot insert with key '" << key << "' into hash-table"
FatalErrorInFunction
<< "Cannot insert with key '" << key << "' into hash-table"
<< abort(FatalError);
}
return PtrList<T>::set(i, ptr);
......@@ -91,11 +89,8 @@ inline Foam::autoPtr<T> Foam::PtrListDictionary<T>::set
T* ptr = aptr.ptr();
if (!DictionaryBase<PtrList<T>, T>::hashedTs_.insert(key, ptr))
{
FatalErrorIn
(
"PtrListDictionary<T>::"
"set(const label i, const word& key, autoPtr<T>& aptr)"
) << "Cannot insert with key '" << key << "' into hash-table"
FatalErrorInFunction
<< "Cannot insert with key '" << key << "' into hash-table"
<< abort(FatalError);
}
return PtrList<T>::set(i, ptr);
......@@ -113,11 +108,8 @@ inline Foam::autoPtr<T> Foam::PtrListDictionary<T>::set
T* ptr = t.ptr();
if (!DictionaryBase<PtrList<T>, T>::hashedTs_.insert(key, ptr))
{
FatalErrorIn
(
"PtrListDictionary<T>::"
"set(const label i, const word& key, tmp<T>& t)"
) << "Cannot insert with key '" << key << "' into hash-table"
FatalErrorInFunction
<< "Cannot insert with key '" << key << "' into hash-table"
<< abort(FatalError);
}
return PtrList<T>::set(i, ptr);
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -121,11 +121,8 @@ void Foam::HashPtrTable<T, Key, Hash>::operator=
// Check for assignment to self
if (this == &rhs)
{
FatalErrorIn
(
"HashPtrTable<T, Key, Hash>::operator="
"(const HashPtrTable<T, Key, Hash>&)"
) << "attempted assignment to self"
FatalErrorInFunction
<< "attempted assignment to self"
<< abort(FatalError);
}
......