diff --git a/applications/test/error/Test-error.C b/applications/test/error/Test-error.C index 892c1356e5..b9be1924a5 100644 --- a/applications/test/error/Test-error.C +++ b/applications/test/error/Test-error.C @@ -45,7 +45,7 @@ int main(int argc, char *argv[]) dictionary dict; - IOWarningIn("main", dict) << "warning 3" << endl; + IOWarningInFunction(dict) << "warning 3" << endl; FatalErrorInFunction << "error 1" << endl; FatalErrorInFunction << "error 2" << exit(FatalError); diff --git a/doc/codingStyleGuide.org b/doc/codingStyleGuide.org index e61a00d7d2..29eb59145c 100644 --- a/doc/codingStyleGuide.org +++ b/doc/codingStyleGuide.org @@ -28,12 +28,12 @@ #+END_SRC so #+BEGIN_SRC C++ - WarningIn("className::functionName()") + WarningInFunction << "Warning message" #+END_SRC *not* #+BEGIN_SRC C++ - WarningIn("className::functionName()") + WarningInFunction << "Warning message" #+END_SRC diff --git a/etc/codeTemplates/source/_Template.C b/etc/codeTemplates/source/_Template.C index 36464dc5f5..a7005f5a20 100644 --- a/etc/codeTemplates/source/_Template.C +++ b/etc/codeTemplates/source/_Template.C @@ -87,7 +87,7 @@ void Foam::CLASSNAME::operator=(const CLASSNAME& rhs) // Check for assignment to self if (this == &rhs) { - FatalErrorIn("Foam::CLASSNAME::operator=(const Foam::CLASSNAME&)") + FatalErrorInFunction << "Attempted assignment to self" << abort(FatalError); } diff --git a/etc/codeTemplates/template/_TemplateTemplate.C b/etc/codeTemplates/template/_TemplateTemplate.C index 0cd8a3fbc9..41469f7b13 100644 --- a/etc/codeTemplates/template/_TemplateTemplate.C +++ b/etc/codeTemplates/template/_TemplateTemplate.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -103,11 +103,8 @@ void Foam::CLASSNAME::operator= // Check for assignment to self if (this == &rhs) { - FatalErrorIn - ( - "Foam::CLASSNAME::operator=" - "(const Foam::CLASSNAME&)" - ) << "Attempted assignment to self" + FatalErrorInFunction + << "Attempted assignment to self" << abort(FatalError); } } diff --git a/src/ODE/ODESolvers/ODESolver/ODESolver.C b/src/ODE/ODESolvers/ODESolver/ODESolver.C index 39f38323df..823f159097 100644 --- a/src/ODE/ODESolvers/ODESolver/ODESolver.C +++ b/src/ODE/ODESolvers/ODESolver/ODESolver.C @@ -145,12 +145,8 @@ void Foam::ODESolver::solve } } - FatalErrorIn - ( - "ODESolver::solve" - "(const scalar xStart, const scalar xEnd," - "scalarField& y, scalar& dxTry) const" - ) << "Integration steps greater than maximum " << maxSteps_ + FatalErrorInFunction + << "Integration steps greater than maximum " << maxSteps_ << "xStart = " << xStart << ", xEnd = " << xEnd << ", x = " << x << ", dxDid = " << step.dxDid << exit(FatalError); diff --git a/src/ODE/ODESolvers/ODESolver/ODESolverNew.C b/src/ODE/ODESolvers/ODESolver/ODESolverNew.C index ef0d6e3454..0774ac7de0 100644 --- a/src/ODE/ODESolvers/ODESolver/ODESolverNew.C +++ b/src/ODE/ODESolvers/ODESolver/ODESolverNew.C @@ -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 @@ -41,11 +41,8 @@ Foam::autoPtr Foam::ODESolver::New if (cstrIter == dictionaryConstructorTablePtr_->end()) { - FatalErrorIn - ( - "ODESolver::New" - "(const dictionary& dict, const ODESystem& odes)" - ) << "Unknown ODESolver type " + FatalErrorInFunction + << "Unknown ODESolver type " << ODESolverTypeName << nl << nl << "Valid ODESolvers are : " << endl << dictionaryConstructorTablePtr_->sortedToc() diff --git a/src/ODE/ODESolvers/SIBS/SIBS.C b/src/ODE/ODESolvers/SIBS/SIBS.C index dd7d26c9e6..36acb8a6b1 100644 --- a/src/ODE/ODESolvers/SIBS/SIBS.C +++ b/src/ODE/ODESolvers/SIBS/SIBS.C @@ -145,7 +145,7 @@ void Foam::SIBS::solve if (xNew_ == x) { - FatalErrorIn("ODES::SIBS") + FatalErrorInFunction << "step size underflow" << exit(FatalError); } diff --git a/src/ODE/ODESolvers/adaptiveSolver/adaptiveSolver.C b/src/ODE/ODESolvers/adaptiveSolver/adaptiveSolver.C index ee49a70d88..f868e921d0 100644 --- a/src/ODE/ODESolvers/adaptiveSolver/adaptiveSolver.C +++ b/src/ODE/ODESolvers/adaptiveSolver/adaptiveSolver.C @@ -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 @@ -74,7 +74,7 @@ void Foam::adaptiveSolver::solve if (dx < VSMALL) { - FatalErrorIn("adaptiveSolver::solve") + FatalErrorInFunction << "stepsize underflow" << exit(FatalError); } diff --git a/src/ODE/ODESolvers/seulex/seulex.C b/src/ODE/ODESolvers/seulex/seulex.C index cf82d31b02..51389d0779 100644 --- a/src/ODE/ODESolvers/seulex/seulex.C +++ b/src/ODE/ODESolvers/seulex/seulex.C @@ -252,7 +252,7 @@ void Foam::seulex::solve if (mag(dx) <= mag(x)*sqr(SMALL)) { - WarningIn("seulex::solve(scalar& x, scalarField& y, stepState&") + WarningInFunction << "step size underflow :" << dx << endl; } diff --git a/src/OSspecific/POSIX/POSIX.C b/src/OSspecific/POSIX/POSIX.C index 5374c0b615..44ee3c7088 100644 --- a/src/OSspecific/POSIX/POSIX.C +++ b/src/OSspecific/POSIX/POSIX.C @@ -253,7 +253,7 @@ Foam::fileName Foam::cwd() } else { - FatalErrorIn("Foam::cwd()") + FatalErrorInFunction << "Couldn't get the current working directory" << exit(FatalError); @@ -437,7 +437,7 @@ bool Foam::mkDir(const fileName& pathName, mode_t mode) { case EPERM: { - FatalErrorIn("Foam::mkDir(const fileName&, mode_t)") + FatalErrorInFunction << "The filesystem containing " << pathName << " does not support the creation of directories." << exit(FatalError); @@ -453,7 +453,7 @@ bool Foam::mkDir(const fileName& pathName, mode_t mode) case EFAULT: { - FatalErrorIn("Foam::mkDir(const fileName&, mode_t)") + FatalErrorInFunction << "" << pathName << " points outside your accessible address space." << exit(FatalError); @@ -463,7 +463,7 @@ bool Foam::mkDir(const fileName& pathName, mode_t mode) case EACCES: { - FatalErrorIn("Foam::mkDir(const fileName&, mode_t)") + FatalErrorInFunction << "The parent directory does not allow write " "permission to the process,"<< nl << "or one of the directories in " << pathName @@ -475,7 +475,7 @@ bool Foam::mkDir(const fileName& pathName, mode_t mode) case ENAMETOOLONG: { - FatalErrorIn("Foam::mkDir(const fileName&, mode_t)") + FatalErrorInFunction << "" << pathName << " is too long." << exit(FatalError); @@ -491,7 +491,7 @@ bool Foam::mkDir(const fileName& pathName, mode_t mode) } else { - FatalErrorIn("Foam::mkDir(const fileName&, mode_t)") + FatalErrorInFunction << "Couldn't create directory " << pathName << exit(FatalError); @@ -501,7 +501,7 @@ bool Foam::mkDir(const fileName& pathName, mode_t mode) case ENOTDIR: { - FatalErrorIn("Foam::mkDir(const fileName&, mode_t)") + FatalErrorInFunction << "A component used as a directory in " << pathName << " is not, in fact, a directory." << exit(FatalError); @@ -511,7 +511,7 @@ bool Foam::mkDir(const fileName& pathName, mode_t mode) case ENOMEM: { - FatalErrorIn("Foam::mkDir(const fileName&, mode_t)") + FatalErrorInFunction << "Insufficient kernel memory was available to make " "directory " << pathName << '.' << exit(FatalError); @@ -521,7 +521,7 @@ bool Foam::mkDir(const fileName& pathName, mode_t mode) case EROFS: { - FatalErrorIn("Foam::mkDir(const fileName&, mode_t)") + FatalErrorInFunction << "" << pathName << " refers to a file on a read-only filesystem." << exit(FatalError); @@ -531,7 +531,7 @@ bool Foam::mkDir(const fileName& pathName, mode_t mode) case ELOOP: { - FatalErrorIn("Foam::mkDir(const fileName&, mode_t)") + FatalErrorInFunction << "Too many symbolic links were encountered in resolving " << pathName << '.' << exit(FatalError); @@ -541,7 +541,7 @@ bool Foam::mkDir(const fileName& pathName, mode_t mode) case ENOSPC: { - FatalErrorIn("Foam::mkDir(const fileName&, mode_t)") + FatalErrorInFunction << "The device containing " << pathName << " has no room for the new directory or " << "the user's disk quota is exhausted." @@ -552,7 +552,7 @@ bool Foam::mkDir(const fileName& pathName, mode_t mode) default: { - FatalErrorIn("Foam::mkDir(const fileName&, mode_t)") + FatalErrorInFunction << "Couldn't create directory " << pathName << exit(FatalError); @@ -862,7 +862,7 @@ bool Foam::ln(const fileName& src, const fileName& dst) if (exists(dst)) { - WarningIn("ln(const fileName&, const fileName&)") + WarningInFunction << "destination " << dst << " already exists. Not linking." << endl; return false; @@ -870,7 +870,7 @@ bool Foam::ln(const fileName& src, const fileName& dst) if (src.isAbsolute() && !exists(src)) { - WarningIn("ln(const fileName&, const fileName&)") + WarningInFunction << "source " << src << " does not exist." << endl; return false; } @@ -881,7 +881,7 @@ bool Foam::ln(const fileName& src, const fileName& dst) } else { - WarningIn("ln(const fileName&, const fileName&)") + WarningInFunction << "symlink from " << src << " to " << dst << " failed." << endl; return false; } @@ -987,7 +987,7 @@ bool Foam::rmDir(const fileName& directory) // Attempt to open directory and set the structure pointer if ((source = ::opendir(directory.c_str())) == NULL) { - WarningIn("rmDir(const fileName&)") + WarningInFunction << "cannot open directory " << directory << endl; return false; @@ -1007,7 +1007,7 @@ bool Foam::rmDir(const fileName& directory) { if (!rmDir(path)) { - WarningIn("rmDir(const fileName&)") + WarningInFunction << "failed to remove directory " << fName << " while removing directory " << directory << endl; @@ -1021,7 +1021,7 @@ bool Foam::rmDir(const fileName& directory) { if (!rm(path)) { - WarningIn("rmDir(const fileName&)") + WarningInFunction << "failed to remove file " << fName << " while removing directory " << directory << endl; @@ -1037,7 +1037,7 @@ bool Foam::rmDir(const fileName& directory) if (!rm(directory)) { - WarningIn("rmDir(const fileName&)") + WarningInFunction << "failed to remove directory " << directory << endl; ::closedir(source); @@ -1062,10 +1062,8 @@ void Foam::fdClose(const int fd) { if (close(fd) != 0) { - FatalErrorIn - ( - "fdClose(const int fd)" - ) << "close error on " << fd << endl + FatalErrorInFunction + << "close error on " << fd << endl << abort(FatalError); } } @@ -1085,10 +1083,8 @@ bool Foam::ping if ((hostPtr = ::gethostbyname(destName.c_str())) == NULL) { - FatalErrorIn - ( - "Foam::ping(const string&, ...)" - ) << "gethostbyname error " << h_errno << " for host " << destName + FatalErrorInFunction + << "gethostbyname error " << h_errno << " for host " << destName << abort(FatalError); } @@ -1099,10 +1095,8 @@ bool Foam::ping sockfd = ::socket(AF_INET, SOCK_STREAM, 0); if (sockfd < 0) { - FatalErrorIn - ( - "Foam::ping(const string&, const label)" - ) << "socket error" + FatalErrorInFunction + << "socket error" << abort(FatalError); } @@ -1176,7 +1170,7 @@ void* Foam::dlOpen(const fileName& lib, const bool check) if (!handle && check) { - WarningIn("dlOpen(const fileName&, const bool)") + WarningInFunction << "dlopen error : " << ::dlerror() << endl; } @@ -1224,7 +1218,7 @@ void* Foam::dlSym(void* handle, const std::string& symbol) if (error) { - WarningIn("dlSym(void*, const std::string&)") + WarningInFunction << "Cannot lookup symbol " << symbol << " : " << error << endl; } diff --git a/src/OSspecific/POSIX/fileMonitor.C b/src/OSspecific/POSIX/fileMonitor.C index d15fab273d..e3bddbc78f 100644 --- a/src/OSspecific/POSIX/fileMonitor.C +++ b/src/OSspecific/POSIX/fileMonitor.C @@ -149,7 +149,7 @@ namespace Foam if (!hasWarned) { hasWarned = true; - WarningIn("fileMonitorWatcher(const bool, const label)") + WarningInFunction << "Failed allocating an inotify descriptor : " << string(strerror(errno)) << endl << " Please increase the number of allowable " @@ -166,7 +166,7 @@ namespace Foam } } #else - FatalErrorIn("fileMonitorWatcher(const bool, const label)") + FatalErrorInFunction << "You selected inotify but this file was compiled" << " without FOAM_USE_INOTIFY" << " Please select another fileModification test method" @@ -191,7 +191,7 @@ namespace Foam { if (inotify_rm_watch(inotifyFd_, int(dirWatches_[i]))) { - WarningIn("fileMonitor::~fileMonitor()") + WarningInFunction << "Failed deleting directory watch " << dirWatches_[i] << endl; } @@ -229,7 +229,7 @@ namespace Foam if (dirWatchID < 0) { - FatalErrorIn("addWatch(const label, const fileName&)") + FatalErrorInFunction << "Failed adding watch " << watchFd << " to directory " << fName << " due to " << string(strerror(errno)) @@ -240,7 +240,7 @@ namespace Foam if (watchFd < dirWatches_.size() && dirWatches_[watchFd] != -1) { // Reuse of watchFd : should have dir watchID set to -1. - FatalErrorIn("addWatch(const label, const fileName&)") + FatalErrorInFunction << "Problem adding watch " << watchFd << " to file " << fName << abort(FatalError); @@ -255,7 +255,7 @@ namespace Foam if (watchFd < lastMod_.size() && lastMod_[watchFd] != 0) { // Reuse of watchFd : should have lastMod set to 0. - FatalErrorIn("addWatch(const label, const fileName&)") + FatalErrorInFunction << "Problem adding watch " << watchFd << " to file " << fName << abort(FatalError); @@ -320,7 +320,7 @@ void Foam::fileMonitor::checkFiles() const if (ready < 0) { - FatalErrorIn("fileMonitor::checkFiles()") + FatalErrorInFunction << "Problem in issuing select." << abort(FatalError); } @@ -336,7 +336,7 @@ void Foam::fileMonitor::checkFiles() const if (nBytes < 0) { - FatalErrorIn("fileMonitor::checkFiles()") + FatalErrorInFunction << "read of " << watcher_->inotifyFd_ << " failed with " << label(nBytes) << abort(FatalError); @@ -473,7 +473,7 @@ Foam::label Foam::fileMonitor::addWatch(const fileName& fName) if (watchFd < 0) { - WarningIn("fileMonitor::addWatch(const fileName&)") + WarningInFunction << "could not add watch for file " << fName << endl; } else @@ -593,11 +593,8 @@ void Foam::fileMonitor::updateStates << endl; } - WarningIn - ( - "fileMonitor::updateStates" - "(const bool, const bool) const" - ) << "Delaying reading " << watchFile_[watchFd] + WarningInFunction + << "Delaying reading " << watchFile_[watchFd] << " due to inconsistent " "file time-stamps between processors" << endl; } diff --git a/src/OSspecific/POSIX/regExp.C b/src/OSspecific/POSIX/regExp.C index 0bd52fc5d8..a7177dc048 100644 --- a/src/OSspecific/POSIX/regExp.C +++ b/src/OSspecific/POSIX/regExp.C @@ -151,10 +151,8 @@ void Foam::regExp::set(const char* pattern, const bool ignoreCase) const char errbuf[200]; regerror(err, preg_, errbuf, sizeof(errbuf)); - FatalErrorIn - ( - "regExp::set(const char*, const bool ignoreCase)" - ) << "Failed to compile regular expression '" << pattern << "'" + FatalErrorInFunction + << "Failed to compile regular expression '" << pattern << "'" << nl << errbuf << exit(FatalError); } diff --git a/src/OSspecific/POSIX/signals/sigFpe.C b/src/OSspecific/POSIX/signals/sigFpe.C index 5488f2e526..0e3ab8acd6 100644 --- a/src/OSspecific/POSIX/signals/sigFpe.C +++ b/src/OSspecific/POSIX/signals/sigFpe.C @@ -92,10 +92,8 @@ void Foam::sigFpe::sigHandler(int) // Reset old handling if (sigaction(SIGFPE, &oldAction_, NULL) < 0) { - FatalErrorIn - ( - "Foam::sigSegv::sigHandler()" - ) << "Cannot reset SIGFPE trapping" + FatalErrorInFunction + << "Cannot reset SIGFPE trapping" << abort(FatalError); } @@ -128,10 +126,8 @@ Foam::sigFpe::~sigFpe() // Reset signal if (oldAction_.sa_handler && sigaction(SIGFPE, &oldAction_, NULL) < 0) { - FatalErrorIn - ( - "Foam::sigFpe::~sigFpe()" - ) << "Cannot reset SIGFPE trapping" + FatalErrorInFunction + << "Cannot reset SIGFPE trapping" << abort(FatalError); } #endif @@ -153,10 +149,8 @@ void Foam::sigFpe::set(const bool verbose) { if (oldAction_.sa_handler) { - FatalErrorIn - ( - "Foam::sigFpe::set()" - ) << "Cannot call sigFpe::set() more than once" + FatalErrorInFunction + << "Cannot call sigFpe::set() more than once" << abort(FatalError); } @@ -180,10 +174,8 @@ void Foam::sigFpe::set(const bool verbose) sigemptyset(&newAction.sa_mask); if (sigaction(SIGFPE, &newAction, &oldAction_) < 0) { - FatalErrorIn - ( - "Foam::sigFpe::set()" - ) << "Cannot set SIGFPE trapping" + FatalErrorInFunction + << "Cannot set SIGFPE trapping" << abort(FatalError); } diff --git a/src/OSspecific/POSIX/signals/sigInt.C b/src/OSspecific/POSIX/signals/sigInt.C index 29c71f5ba7..fee8d60887 100644 --- a/src/OSspecific/POSIX/signals/sigInt.C +++ b/src/OSspecific/POSIX/signals/sigInt.C @@ -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 @@ -40,10 +40,8 @@ void Foam::sigInt::sigHandler(int) // Reset old handling if (sigaction(SIGINT, &oldAction_, NULL) < 0) { - FatalErrorIn - ( - "Foam::sigInt::sigHandler()" - ) << "Cannot reset SIGINT trapping" + FatalErrorInFunction + << "Cannot reset SIGINT trapping" << abort(FatalError); } @@ -70,10 +68,8 @@ Foam::sigInt::~sigInt() // Reset old handling if (sigaction(SIGINT, &oldAction_, NULL) < 0) { - FatalErrorIn - ( - "Foam::sigInt::~sigInt()" - ) << "Cannot reset SIGINT trapping" + FatalErrorInFunction + << "Cannot reset SIGINT trapping" << abort(FatalError); } } @@ -85,10 +81,8 @@ void Foam::sigInt::set(const bool) { if (oldAction_.sa_handler) { - FatalErrorIn - ( - "Foam::sigInt::set()" - ) << "Cannot call sigInt::set() more than once" + FatalErrorInFunction + << "Cannot call sigInt::set() more than once" << abort(FatalError); } @@ -98,10 +92,8 @@ void Foam::sigInt::set(const bool) sigemptyset(&newAction.sa_mask); if (sigaction(SIGINT, &newAction, &oldAction_) < 0) { - FatalErrorIn - ( - "Foam::sigInt::set()" - ) << "Cannot set SIGINT trapping" + FatalErrorInFunction + << "Cannot set SIGINT trapping" << abort(FatalError); } } diff --git a/src/OSspecific/POSIX/signals/sigQuit.C b/src/OSspecific/POSIX/signals/sigQuit.C index 9c16d3d33d..f6ba64a827 100644 --- a/src/OSspecific/POSIX/signals/sigQuit.C +++ b/src/OSspecific/POSIX/signals/sigQuit.C @@ -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 @@ -40,10 +40,8 @@ void Foam::sigQuit::sigHandler(int) // Reset old handling if (sigaction(SIGQUIT, &oldAction_, NULL) < 0) { - FatalErrorIn - ( - "Foam::sigQuit::sigHandler()" - ) << "Cannot reset SIGQUIT trapping" + FatalErrorInFunction + << "Cannot reset SIGQUIT trapping" << abort(FatalError); } @@ -72,10 +70,8 @@ Foam::sigQuit::~sigQuit() // Reset old handling if (oldAction_.sa_handler && sigaction(SIGQUIT, &oldAction_, NULL) < 0) { - FatalErrorIn - ( - "Foam::sigQuit::~sigQuit()" - ) << "Cannot reset SIGQUIT trapping" + FatalErrorInFunction + << "Cannot reset SIGQUIT trapping" << abort(FatalError); } } @@ -87,10 +83,8 @@ void Foam::sigQuit::set(const bool verbose) { if (oldAction_.sa_handler) { - FatalErrorIn - ( - "Foam::sigQuit::set()" - ) << "Cannot call sigQuit::set() more than once" + FatalErrorInFunction + << "Cannot call sigQuit::set() more than once" << abort(FatalError); } @@ -100,10 +94,8 @@ void Foam::sigQuit::set(const bool verbose) sigemptyset(&newAction.sa_mask); if (sigaction(SIGQUIT, &newAction, &oldAction_) < 0) { - FatalErrorIn - ( - "Foam::sigQuit::set()" - ) << "Cannot set SIGQUIT trapping" + FatalErrorInFunction + << "Cannot set SIGQUIT trapping" << abort(FatalError); } } diff --git a/src/OSspecific/POSIX/signals/sigSegv.C b/src/OSspecific/POSIX/signals/sigSegv.C index 11a3069976..3c0fc0fef5 100644 --- a/src/OSspecific/POSIX/signals/sigSegv.C +++ b/src/OSspecific/POSIX/signals/sigSegv.C @@ -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 @@ -40,10 +40,8 @@ void Foam::sigSegv::sigHandler(int) // Reset old handling if (sigaction(SIGSEGV, &oldAction_, NULL) < 0) { - FatalErrorIn - ( - "Foam::sigSegv::sigHandler()" - ) << "Cannot reset SIGSEGV trapping" + FatalErrorInFunction + << "Cannot reset SIGSEGV trapping" << abort(FatalError); } @@ -72,10 +70,8 @@ Foam::sigSegv::~sigSegv() // Reset old handling if (sigaction(SIGSEGV, &oldAction_, NULL) < 0) { - FatalErrorIn - ( - "Foam::sigSegv::~sigSegv()" - ) << "Cannot reset SIGSEGV trapping" + FatalErrorInFunction + << "Cannot reset SIGSEGV trapping" << abort(FatalError); } } @@ -87,10 +83,8 @@ void Foam::sigSegv::set(const bool) { if (oldAction_.sa_handler) { - FatalErrorIn - ( - "Foam::sigSegv::set()" - ) << "Cannot call sigSegv::set() more than once" + FatalErrorInFunction + << "Cannot call sigSegv::set() more than once" << abort(FatalError); } @@ -100,10 +94,8 @@ void Foam::sigSegv::set(const bool) sigemptyset(&newAction.sa_mask); if (sigaction(SIGSEGV, &newAction, &oldAction_) < 0) { - FatalErrorIn - ( - "Foam::sigSegv::set()" - ) << "Cannot set SIGSEGV trapping" + FatalErrorInFunction + << "Cannot set SIGSEGV trapping" << abort(FatalError); } } diff --git a/src/OSspecific/POSIX/signals/sigStopAtWriteNow.C b/src/OSspecific/POSIX/signals/sigStopAtWriteNow.C index 94759bfe33..3696eca38b 100644 --- a/src/OSspecific/POSIX/signals/sigStopAtWriteNow.C +++ b/src/OSspecific/POSIX/signals/sigStopAtWriteNow.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -80,10 +80,8 @@ void Foam::sigStopAtWriteNow::sigHandler(int) // Reset old handling if (sigaction(signal_, &oldAction_, NULL) < 0) { - FatalErrorIn - ( - "Foam::sigStopAtWriteNow::sigHandler(int)" - ) << "Cannot reset " << signal_ << " trapping" + FatalErrorInFunction + << "Cannot reset " << signal_ << " trapping" << abort(FatalError); } @@ -127,10 +125,8 @@ Foam::sigStopAtWriteNow::~sigStopAtWriteNow() { if (sigaction(signal_, &oldAction_, NULL) < 0) { - FatalErrorIn - ( - "Foam::sigStopAtWriteNow::~sigStopAtWriteNow()" - ) << "Cannot reset " << signal_ << " trapping" + FatalErrorInFunction + << "Cannot reset " << signal_ << " trapping" << abort(FatalError); } } @@ -146,11 +142,8 @@ void Foam::sigStopAtWriteNow::set(const bool verbose) // Check that the signal is different from the writeNowSignal if (sigWriteNow::signal_ == signal_) { - FatalErrorIn - ( - "Foam::sigStopAtWriteNow::sigStopAtWriteNow" - "(const bool, const Time&)" - ) << "stopAtWriteNowSignal : " << signal_ + FatalErrorInFunction + << "stopAtWriteNowSignal : " << signal_ << " cannot be the same as the writeNowSignal." << " Please change this in the controlDict (" << findEtcFile("controlDict", false) << ")." @@ -164,11 +157,8 @@ void Foam::sigStopAtWriteNow::set(const bool verbose) sigemptyset(&newAction.sa_mask); if (sigaction(signal_, &newAction, &oldAction_) < 0) { - FatalErrorIn - ( - "Foam::sigStopAtWriteNow::sigStopAtWriteNow" - "(const bool, const Time&)" - ) << "Cannot set " << signal_ << " trapping" + FatalErrorInFunction + << "Cannot set " << signal_ << " trapping" << abort(FatalError); } diff --git a/src/OSspecific/POSIX/signals/sigWriteNow.C b/src/OSspecific/POSIX/signals/sigWriteNow.C index 29381368a2..2439b3feed 100644 --- a/src/OSspecific/POSIX/signals/sigWriteNow.C +++ b/src/OSspecific/POSIX/signals/sigWriteNow.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -108,10 +108,8 @@ Foam::sigWriteNow::~sigWriteNow() { if (sigaction(signal_, &oldAction_, NULL) < 0) { - FatalErrorIn - ( - "Foam::sigWriteNow::~sigWriteNow()" - ) << "Cannot reset " << signal_ << " trapping" + FatalErrorInFunction + << "Cannot reset " << signal_ << " trapping" << abort(FatalError); } } @@ -130,10 +128,8 @@ void Foam::sigWriteNow::set(const bool verbose) sigemptyset(&newAction.sa_mask); if (sigaction(signal_, &newAction, &oldAction_) < 0) { - FatalErrorIn - ( - "Foam::sigWriteNow::sigWriteNow(const bool, const Time&)" - ) << "Cannot set " << signal_ << " trapping" + FatalErrorInFunction + << "Cannot set " << signal_ << " trapping" << abort(FatalError); } diff --git a/src/OSspecific/POSIX/timer.C b/src/OSspecific/POSIX/timer.C index 8b175332d8..7e1f5886d3 100644 --- a/src/OSspecific/POSIX/timer.C +++ b/src/OSspecific/POSIX/timer.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -67,10 +67,8 @@ Foam::timer::timer(const unsigned int newTimeOut) // Is singleton since handler is static function if (oldTimeOut_ != 0) { - FatalErrorIn - ( - "Foam::timer::timer(const unsigned int)" - ) << "timer already used." + FatalErrorInFunction + << "timer already used." << abort(FatalError); } @@ -84,10 +82,8 @@ Foam::timer::timer(const unsigned int newTimeOut) if (sigaction(SIGALRM, &newAction, &oldAction_) < 0) { - FatalErrorIn - ( - "Foam::timer::timer(const unsigned int)" - ) << "sigaction(SIGALRM) error" + FatalErrorInFunction + << "sigaction(SIGALRM) error" << abort(FatalError); } @@ -125,11 +121,8 @@ Foam::timer::~timer() // Restore signal handler if (sigaction(SIGALRM, &oldAction_, NULL) < 0) { - FatalErrorIn - ( - "Foam::timer::~timer(const struct sigaction&" - "const struct sigaction&)" - ) << "sigaction(SIGALRM) error" + FatalErrorInFunction + << "sigaction(SIGALRM) error" << abort(FatalError); } } diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomeration.C b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomeration.C index 076bca07df..6092a56a67 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomeration.C +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomeration.C @@ -638,7 +638,7 @@ bool Foam::GAMGAgglomeration::checkRestriction if (nNewCoarse > nCoarse) { - //WarningIn("GAMGAgglomeration::checkRestriction(..)") + //WarningInFunction // << "Have " << nCoarse // << " agglomerated cells but " << nNewCoarse // << " disconnected regions" << endl; diff --git a/src/Pstream/dummy/UPstream.C b/src/Pstream/dummy/UPstream.C index c3d430c53f..cd3bc60f39 100644 --- a/src/Pstream/dummy/UPstream.C +++ b/src/Pstream/dummy/UPstream.C @@ -34,7 +34,7 @@ void Foam::UPstream::addValidParOptions(HashTable& validParOptions) bool Foam::UPstream::init(int& argc, char**& argv) { - FatalErrorIn("UPstream::init(int& argc, char**& argv)") + FatalErrorInFunction << "Trying to use the dummy Pstream library." << nl << "This dummy library cannot be used in parallel mode" << Foam::exit(FatalError); diff --git a/src/Pstream/mpi/PstreamGlobals.C b/src/Pstream/mpi/PstreamGlobals.C index cdafa043d7..1acbe583f3 100644 --- a/src/Pstream/mpi/PstreamGlobals.C +++ b/src/Pstream/mpi/PstreamGlobals.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -76,10 +76,8 @@ void PstreamGlobals::checkCommunicator || comm >= PstreamGlobals::MPICommunicators_.size() ) { - FatalErrorIn - ( - "PstreamGlobals::checkCommunicator(const label, const label)" - ) << "otherProcNo:" << otherProcNo << " : illegal communicator " + FatalErrorInFunction + << "otherProcNo:" << otherProcNo << " : illegal communicator " << comm << endl << "Communicator should be within range 0.." << PstreamGlobals::MPICommunicators_.size()-1 << abort(FatalError); diff --git a/src/Pstream/mpi/UIPread.C b/src/Pstream/mpi/UIPread.C index 4570c6d6de..524f09dcea 100644 --- a/src/Pstream/mpi/UIPread.C +++ b/src/Pstream/mpi/UIPread.C @@ -137,7 +137,7 @@ Foam::UIPstream::UIPstream(const int fromProcNo, PstreamBuffers& buffers) { if (commsType() != UPstream::scheduled && !buffers.finishedSendsCalled_) { - FatalErrorIn("UIPstream::UIPstream(const int, PstreamBuffers&)") + FatalErrorInFunction << "PstreamBuffers::finishedSends() never called." << endl << "Please call PstreamBuffers::finishedSends() after doing" << " all your sends (using UOPstream) and before doing any" @@ -269,11 +269,8 @@ Foam::label Foam::UIPstream::read ) ) { - FatalErrorIn - ( - "UIPstream::read" - "(const int fromProcNo, char* buf, std::streamsize bufSize)" - ) << "MPI_Recv cannot receive incomming message" + FatalErrorInFunction + << "MPI_Recv cannot receive incomming message" << Foam::abort(FatalError); return 0; @@ -295,11 +292,8 @@ Foam::label Foam::UIPstream::read if (messageSize > bufSize) { - FatalErrorIn - ( - "UIPstream::read" - "(const int fromProcNo, char* buf, std::streamsize bufSize)" - ) << "buffer (" << label(bufSize) + FatalErrorInFunction + << "buffer (" << label(bufSize) << ") not large enough for incomming message (" << messageSize << ')' << Foam::abort(FatalError); @@ -325,11 +319,8 @@ Foam::label Foam::UIPstream::read ) ) { - FatalErrorIn - ( - "UIPstream::read" - "(const int fromProcNo, char* buf, std::streamsize bufSize)" - ) << "MPI_Recv cannot start non-blocking receive" + FatalErrorInFunction + << "MPI_Recv cannot start non-blocking receive" << Foam::abort(FatalError); return 0; @@ -351,11 +342,8 @@ Foam::label Foam::UIPstream::read } else { - FatalErrorIn - ( - "UIPstream::read" - "(const int fromProcNo, char* buf, std::streamsize bufSize)" - ) << "Unsupported communications type " + FatalErrorInFunction + << "Unsupported communications type " << commsType << Foam::abort(FatalError); diff --git a/src/Pstream/mpi/UOPwrite.C b/src/Pstream/mpi/UOPwrite.C index 7d84d3f837..b3188f0009 100644 --- a/src/Pstream/mpi/UOPwrite.C +++ b/src/Pstream/mpi/UOPwrite.C @@ -136,12 +136,8 @@ bool Foam::UOPstream::write } else { - FatalErrorIn - ( - "UOPstream::write" - "(const int fromProcNo, char* buf, std::streamsize bufSize" - ", const int)" - ) << "Unsupported communications type " + FatalErrorInFunction + << "Unsupported communications type " << UPstream::commsTypeNames[commsType] << Foam::abort(FatalError); } diff --git a/src/Pstream/mpi/UPstream.C b/src/Pstream/mpi/UPstream.C index 74edc518b2..f035c989c3 100644 --- a/src/Pstream/mpi/UPstream.C +++ b/src/Pstream/mpi/UPstream.C @@ -76,7 +76,7 @@ bool Foam::UPstream::init(int& argc, char**& argv) if (numprocs <= 1) { - FatalErrorIn("UPstream::init(int& argc, char**& argv)") + FatalErrorInFunction << "bool IPstream::init(int& argc, char**& argv) : " "attempt to run parallel on 1 processor" << Foam::abort(FatalError); @@ -100,7 +100,7 @@ bool Foam::UPstream::init(int& argc, char**& argv) } else { - FatalErrorIn("UPstream::init(int& argc, char**& argv)") + FatalErrorInFunction << "UPstream::init(int& argc, char**& argv) : " << "environment variable MPI_BUFFER_SIZE not defined" << Foam::abort(FatalError); @@ -137,7 +137,7 @@ void Foam::UPstream::exit(int errnum) label n = PstreamGlobals::outstandingRequests_.size(); PstreamGlobals::outstandingRequests_.clear(); - WarningIn("UPstream::exit(int)") + WarningInFunction << "There are still " << n << " outstanding MPI_Requests." << endl << "This means that your code exited before doing a" << " UPstream::waitRequests()." << endl @@ -311,14 +311,8 @@ void Foam::UPstream::allocatePstreamCommunicator } else if (index > PstreamGlobals::MPIGroups_.size()) { - FatalErrorIn - ( - "UPstream::allocatePstreamCommunicator\n" - "(\n" - " const label parentIndex,\n" - " const labelList& subRanks\n" - ")\n" - ) << "PstreamGlobals out of sync with UPstream data. Problem." + FatalErrorInFunction + << "PstreamGlobals out of sync with UPstream data. Problem." << Foam::exit(FatalError); } @@ -329,14 +323,8 @@ void Foam::UPstream::allocatePstreamCommunicator if (index != UPstream::worldComm) { - FatalErrorIn - ( - "UPstream::allocateCommunicator\n" - "(\n" - " const label parentIndex,\n" - " const labelList& subRanks\n" - ")\n" - ) << "world communicator should always be index " + FatalErrorInFunction + << "world communicator should always be index " << UPstream::worldComm << Foam::exit(FatalError); } @@ -393,14 +381,8 @@ void Foam::UPstream::allocatePstreamCommunicator ) ) { - FatalErrorIn - ( - "UPstream::allocatePstreamCommunicator\n" - "(\n" - " const label,\n" - " const labelList&\n" - ")\n" - ) << "Problem :" + FatalErrorInFunction + << "Problem :" << " when allocating communicator at " << index << " from ranks " << procIDs_[index] << " of parent " << parentIndex @@ -473,10 +455,8 @@ void Foam::UPstream::waitRequests(const label start) ) ) { - FatalErrorIn - ( - "UPstream::waitRequests()" - ) << "MPI_Waitall returned with error" << Foam::endl; + FatalErrorInFunction + << "MPI_Waitall returned with error" << Foam::endl; } resetRequests(start); @@ -499,10 +479,8 @@ void Foam::UPstream::waitRequest(const label i) if (i >= PstreamGlobals::outstandingRequests_.size()) { - FatalErrorIn - ( - "UPstream::waitRequest(const label)" - ) << "There are " << PstreamGlobals::outstandingRequests_.size() + FatalErrorInFunction + << "There are " << PstreamGlobals::outstandingRequests_.size() << " outstanding send requests and you are asking for i=" << i << nl << "Maybe you are mixing blocking/non-blocking comms?" @@ -518,10 +496,8 @@ void Foam::UPstream::waitRequest(const label i) ) ) { - FatalErrorIn - ( - "UPstream::waitRequest()" - ) << "MPI_Wait returned with error" << Foam::endl; + FatalErrorInFunction + << "MPI_Wait returned with error" << Foam::endl; } if (debug) @@ -542,10 +518,8 @@ bool Foam::UPstream::finishedRequest(const label i) if (i >= PstreamGlobals::outstandingRequests_.size()) { - FatalErrorIn - ( - "UPstream::finishedRequest(const label)" - ) << "There are " << PstreamGlobals::outstandingRequests_.size() + FatalErrorInFunction + << "There are " << PstreamGlobals::outstandingRequests_.size() << " outstanding send requests and you are asking for i=" << i << nl << "Maybe you are mixing blocking/non-blocking comms?" diff --git a/src/Pstream/mpi/allReduceTemplates.C b/src/Pstream/mpi/allReduceTemplates.C index 7a07698a77..ec735f7814 100644 --- a/src/Pstream/mpi/allReduceTemplates.C +++ b/src/Pstream/mpi/allReduceTemplates.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012-2014 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -71,18 +71,8 @@ void Foam::allReduce ) ) { - FatalErrorIn - ( - "void Foam::allReduce\n" - "(\n" - " Type&,\n" - " int,\n" - " MPI_Datatype,\n" - " MPI_Op,\n" - " const BinaryOp&,\n" - " const int\n" - ")\n" - ) << "MPI_Recv failed" + FatalErrorInFunction + << "MPI_Recv failed" << Foam::abort(FatalError); } @@ -104,18 +94,8 @@ void Foam::allReduce ) ) { - FatalErrorIn - ( - "void Foam::allReduce\n" - "(\n" - " Type&,\n" - " int,\n" - " MPI_Datatype,\n" - " MPI_Op,\n" - " const BinaryOp&,\n" - " const int\n" - ")\n" - ) << "MPI_Send failed" + FatalErrorInFunction + << "MPI_Send failed" << Foam::abort(FatalError); } } @@ -143,18 +123,8 @@ void Foam::allReduce ) ) { - FatalErrorIn - ( - "void Foam::allReduce\n" - "(\n" - " Type&,\n" - " int,\n" - " MPI_Datatype,\n" - " MPI_Op,\n" - " const BinaryOp&,\n" - " const int\n" - ")\n" - ) << "MPI_Send failed" + FatalErrorInFunction + << "MPI_Send failed" << Foam::abort(FatalError); } } @@ -175,18 +145,8 @@ void Foam::allReduce ) ) { - FatalErrorIn - ( - "void Foam::allReduce\n" - "(\n" - " Type&,\n" - " int,\n" - " MPI_Datatype,\n" - " MPI_Op,\n" - " const BinaryOp&,\n" - " const int\n" - ")\n" - ) << "MPI_Recv failed" + FatalErrorInFunction + << "MPI_Recv failed" << Foam::abort(FatalError); } } diff --git a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/externalCoupledTemperatureMixed/externalCoupledTemperatureMixedFvPatchScalarField.C b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/externalCoupledTemperatureMixed/externalCoupledTemperatureMixedFvPatchScalarField.C index 9791087190..84404f7625 100644 --- a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/externalCoupledTemperatureMixed/externalCoupledTemperatureMixedFvPatchScalarField.C +++ b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/externalCoupledTemperatureMixed/externalCoupledTemperatureMixedFvPatchScalarField.C @@ -160,14 +160,8 @@ void Foam::externalCoupledTemperatureMixedFvPatchScalarField::transferData } else { - FatalErrorIn - ( - "void Foam::externalCoupledTemperatureMixedFvPatchScalarField::" - "transferData" - "(" - "OFstream&" - ") const" - ) << "Condition requires either compressible turbulence and/or " + FatalErrorInFunction + << "Condition requires either compressible turbulence and/or " << "thermo model to be available" << exit(FatalError); } diff --git a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.C b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.C index b4346d59c2..2a02d01cac 100644 --- a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.C +++ b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.C @@ -143,16 +143,8 @@ externalWallHeatFluxTemperatureFvPatchScalarField } else { - FatalErrorIn - ( - "externalWallHeatFluxTemperatureFvPatchScalarField::" - "externalWallHeatFluxTemperatureFvPatchScalarField\n" - "(\n" - " const fvPatch& p,\n" - " const DimensionedField& iF,\n" - " const dictionary& dict\n" - ")\n" - ) << "\n patch type '" << p.type() + FatalErrorInFunction + << "\n patch type '" << p.type() << "' either q or h and Ta were not found '" << "\n for patch " << p.name() << " of field " << dimensionedInternalField().name() @@ -311,11 +303,8 @@ void Foam::externalWallHeatFluxTemperatureFvPatchScalarField::updateCoeffs() } default: { - FatalErrorIn - ( - "externalWallHeatFluxTemperatureFvPatchScalarField" - "::updateCoeffs()" - ) << "Illegal heat flux mode " << operationModeNames[mode_] + FatalErrorInFunction + << "Illegal heat flux mode " << operationModeNames[mode_] << exit(FatalError); } } @@ -370,13 +359,8 @@ void Foam::externalWallHeatFluxTemperatureFvPatchScalarField::write } default: { - FatalErrorIn - ( - "void externalWallHeatFluxTemperatureFvPatchScalarField::write" - "(" - "Ostream& os" - ") const" - ) << "Illegal heat flux mode " << operationModeNames[mode_] + FatalErrorInFunction + << "Illegal heat flux mode " << operationModeNames[mode_] << abort(FatalError); } } diff --git a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/temperatureCoupledBase/temperatureCoupledBase.C b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/temperatureCoupledBase/temperatureCoupledBase.C index 52aabee0b3..9ed2dd3648 100644 --- a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/temperatureCoupledBase/temperatureCoupledBase.C +++ b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/temperatureCoupledBase/temperatureCoupledBase.C @@ -132,10 +132,7 @@ Foam::tmp Foam::temperatureCoupledBase::kappa } else { - FatalErrorIn - ( - "temperatureCoupledBase::kappa(const scalarField&) const" - ) + FatalErrorInFunction << "Kappa defined to employ " << KMethodTypeNames_[method_] << " method, but thermo package not available" << exit(FatalError); @@ -196,10 +193,7 @@ Foam::tmp Foam::temperatureCoupledBase::kappa } else { - FatalErrorIn - ( - "temperatureCoupledBase::kappa(const scalarField&) const" - ) + FatalErrorInFunction << "Did not find field " << kappaName_ << " on mesh " << mesh.name() << " patch " << patch_.name() << nl @@ -215,10 +209,7 @@ Foam::tmp Foam::temperatureCoupledBase::kappa default: { - FatalErrorIn - ( - "temperatureCoupledBase::kappa(const scalarField&) const" - ) + FatalErrorInFunction << "Unimplemented method " << KMethodTypeNames_[method_] << nl << "Please set 'kappa' to one of " << KMethodTypeNames_.toc() << " and 'kappaName' to the name of the volScalar" diff --git a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/thermalBaffle1D/thermalBaffle1DFvPatchScalarField.C b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/thermalBaffle1D/thermalBaffle1DFvPatchScalarField.C index fe8fb58808..7612f746e7 100644 --- a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/thermalBaffle1D/thermalBaffle1DFvPatchScalarField.C +++ b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/thermalBaffle1D/thermalBaffle1DFvPatchScalarField.C @@ -231,11 +231,8 @@ baffleThickness() const { if (thickness_.size() != patch().size()) { - FatalIOErrorIn + FatalIOErrorInFunction ( - " template" - " tmp thermalBaffle1DFvPatchScalarField" - " baffleThickness() const", solidDict_ )<< " Field thickness has not been specified " << " for patch " << this->patch().name() diff --git a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.C b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.C index fa137f34b5..786ceae3e9 100644 --- a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.C +++ b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.C @@ -219,10 +219,8 @@ void turbulentHeatFluxTemperatureFvPatchScalarField::updateCoeffs() } default: { - FatalErrorIn - ( - "turbulentHeatFluxTemperatureFvPatchScalarField::updateCoeffs()" - ) << "Unknown heat source type. Valid types are: " + FatalErrorInFunction + << "Unknown heat source type. Valid types are: " << heatSourceTypeNames_ << nl << exit(FatalError); } } diff --git a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.C b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.C index d304e598ee..903c50b164 100644 --- a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.C +++ b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.C @@ -93,16 +93,7 @@ turbulentTemperatureCoupledBaffleMixedFvPatchScalarField { if (!isA(this->patch().patch())) { - FatalErrorIn - ( - "turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::" - "turbulentTemperatureCoupledBaffleMixedFvPatchScalarField\n" - "(\n" - " const fvPatch& p,\n" - " const DimensionedField& iF,\n" - " const dictionary& dict\n" - ")\n" - ) << "\n patch type '" << p.type() + FatalErrorInFunction << "' not type '" << mappedPatchBase::typeName << "'" << "\n for patch " << p.name() << " of field " << dimensionedInternalField().name() diff --git a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/turbulentTemperatureRadCoupledMixed/turbulentTemperatureRadCoupledMixedFvPatchScalarField.C b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/turbulentTemperatureRadCoupledMixed/turbulentTemperatureRadCoupledMixedFvPatchScalarField.C index e610afc80e..8d563bac65 100644 --- a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/turbulentTemperatureRadCoupledMixed/turbulentTemperatureRadCoupledMixedFvPatchScalarField.C +++ b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/turbulentTemperatureRadCoupledMixed/turbulentTemperatureRadCoupledMixedFvPatchScalarField.C @@ -99,16 +99,7 @@ turbulentTemperatureRadCoupledMixedFvPatchScalarField { if (!isA(this->patch().patch())) { - FatalErrorIn - ( - "turbulentTemperatureRadCoupledMixedFvPatchScalarField::" - "turbulentTemperatureRadCoupledMixedFvPatchScalarField\n" - "(\n" - " const fvPatch& p,\n" - " const DimensionedField& iF,\n" - " const dictionary& dict\n" - ")\n" - ) << "\n patch type '" << p.type() + FatalErrorInFunction << "' not type '" << mappedPatchBase::typeName << "'" << "\n for patch " << p.name() << " of field " << dimensionedInternalField().name() diff --git a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.C b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.C index 7a9983fc20..4b337af073 100644 --- a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.C +++ b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.C @@ -49,10 +49,7 @@ void alphatJayatillekeWallFunctionFvPatchScalarField::checkType() { if (!isA(patch())) { - FatalErrorIn - ( - "alphatJayatillekeWallFunctionFvPatchScalarField::checkType()" - ) + FatalErrorInFunction << "Patch type for patch " << patch().name() << " must be wall\n" << "Current patch type is " << patch().type() << nl << exit(FatalError); diff --git a/src/TurbulenceModels/incompressible/turbulentTransportModels/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.C b/src/TurbulenceModels/incompressible/turbulentTransportModels/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.C index 46a3eb55a7..02ff42ecc3 100644 --- a/src/TurbulenceModels/incompressible/turbulentTransportModels/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.C +++ b/src/TurbulenceModels/incompressible/turbulentTransportModels/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.C @@ -48,10 +48,8 @@ void alphatJayatillekeWallFunctionFvPatchScalarField::checkType() { if (!isA(patch())) { - FatalErrorIn - ( - "alphatJayatillekeWallFunctionFvPatchScalarField::checkType()" - ) << "Invalid wall function specification" << nl + FatalErrorInFunction + << "Invalid wall function specification" << nl << " Patch type for patch " << patch().name() << " must be wall" << nl << " Current patch type is " << patch().type() << nl << endl diff --git a/src/TurbulenceModels/turbulenceModels/LES/LESModel/LESModel.C b/src/TurbulenceModels/turbulenceModels/LES/LESModel/LESModel.C index 9955478f41..afb9719c34 100644 --- a/src/TurbulenceModels/turbulenceModels/LES/LESModel/LESModel.C +++ b/src/TurbulenceModels/turbulenceModels/LES/LESModel/LESModel.C @@ -136,17 +136,8 @@ Foam::LESModel::New if (cstrIter == dictionaryConstructorTablePtr_->end()) { - FatalErrorIn - ( - "LESModel::New" - "(" - "const volScalarField&, " - "const volVectorField&, " - "const surfaceScalarField&, " - "transportModel&, " - "const word&" - ")" - ) << "Unknown LESModel type " + FatalErrorInFunction + << "Unknown LESModel type " << modelType << nl << nl << "Valid LESModel types:" << endl << dictionaryConstructorTablePtr_->sortedToc() diff --git a/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/IDDESDelta/IDDESDelta.C b/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/IDDESDelta/IDDESDelta.C index 301638dd5f..38517e5bc5 100644 --- a/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/IDDESDelta/IDDESDelta.C +++ b/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/IDDESDelta/IDDESDelta.C @@ -103,13 +103,13 @@ void Foam::LESModels::IDDESDelta::calcDelta() if (nD == 2) { - WarningIn("IDDESDelta::calcDelta()") + WarningInFunction << "Case is 2D, LES is not strictly applicable" << nl << endl; } else if (nD != 3) { - FatalErrorIn("IDDESDelta::calcDelta()") + FatalErrorInFunction << "Case must be either 2D or 3D" << exit(FatalError); } diff --git a/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/LESdelta/LESdelta.C b/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/LESdelta/LESdelta.C index a685bd5e53..b799237a36 100644 --- a/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/LESdelta/LESdelta.C +++ b/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/LESdelta/LESdelta.C @@ -78,10 +78,8 @@ Foam::autoPtr Foam::LESdelta::New if (cstrIter == dictionaryConstructorTablePtr_->end()) { - FatalErrorIn - ( - "LESdelta::New(const word& name, const turbulenceModel& turbulence)" - ) << "Unknown LESdelta type " + FatalErrorInFunction + << "Unknown LESdelta type " << deltaType << nl << nl << "Valid LESdelta types are :" << endl << dictionaryConstructorTablePtr_->sortedToc() @@ -119,12 +117,8 @@ Foam::autoPtr Foam::LESdelta::New if (cstrIter == dictionaryConstructorTablePtr_->end()) { - FatalErrorIn - ( - "LESdelta::New(const word& name, " - "const turbulenceModel& turbulence, " - "const dictionaryConstructorTable&)" - ) << "Unknown LESdelta type " + FatalErrorInFunction + << "Unknown LESdelta type " << deltaType << nl << nl << "Valid LESdelta types are :" << endl << additionalConstructors.sortedToc() diff --git a/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/cubeRootVolDelta/cubeRootVolDelta.C b/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/cubeRootVolDelta/cubeRootVolDelta.C index 4767c400ce..9829fed3c5 100644 --- a/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/cubeRootVolDelta/cubeRootVolDelta.C +++ b/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/cubeRootVolDelta/cubeRootVolDelta.C @@ -52,7 +52,7 @@ void Foam::LESModels::cubeRootVolDelta::calcDelta() } else if (nD == 2) { - WarningIn("cubeRootVolDelta::calcDelta()") + WarningInFunction << "Case is 2D, LES is not strictly applicable\n" << endl; @@ -72,7 +72,7 @@ void Foam::LESModels::cubeRootVolDelta::calcDelta() } else { - FatalErrorIn("cubeRootVolDelta::calcDelta()") + FatalErrorInFunction << "Case is not 3D or 2D, LES is not applicable" << exit(FatalError); } diff --git a/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/maxDeltaxyz/maxDeltaxyz.C b/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/maxDeltaxyz/maxDeltaxyz.C index 6c277bf7eb..701bab6da3 100644 --- a/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/maxDeltaxyz/maxDeltaxyz.C +++ b/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/maxDeltaxyz/maxDeltaxyz.C @@ -90,7 +90,7 @@ void Foam::LESModels::maxDeltaxyz::calcDelta() } else if (nD == 2) { - WarningIn("maxDeltaxyz::calcDelta()") + WarningInFunction << "Case is 2D, LES is not strictly applicable\n" << endl; @@ -98,7 +98,7 @@ void Foam::LESModels::maxDeltaxyz::calcDelta() } else { - FatalErrorIn("maxDeltaxyz::calcDelta()") + FatalErrorInFunction << "Case is not 3D or 2D, LES is not applicable" << exit(FatalError); } diff --git a/src/TurbulenceModels/turbulenceModels/LES/LESfilters/LESfilter/LESfilter.C b/src/TurbulenceModels/turbulenceModels/LES/LESfilters/LESfilter/LESfilter.C index 0dc3e9b493..6f614f0d91 100644 --- a/src/TurbulenceModels/turbulenceModels/LES/LESfilters/LESfilter/LESfilter.C +++ b/src/TurbulenceModels/turbulenceModels/LES/LESfilters/LESfilter/LESfilter.C @@ -51,10 +51,8 @@ Foam::autoPtr Foam::LESfilter::New if (cstrIter == dictionaryConstructorTablePtr_->end()) { - FatalErrorIn - ( - "LESfilter::New(const fvMesh&, const dictionary&)" - ) << "Unknown LESfilter type " + FatalErrorInFunction + << "Unknown LESfilter type " << filterType << nl << nl << "Valid LESfilter types are :" << endl << dictionaryConstructorTablePtr_->sortedToc() diff --git a/src/TurbulenceModels/turbulenceModels/RAS/RASModel/RASModel.C b/src/TurbulenceModels/turbulenceModels/RAS/RASModel/RASModel.C index 240c0870df..e55e79f4d4 100644 --- a/src/TurbulenceModels/turbulenceModels/RAS/RASModel/RASModel.C +++ b/src/TurbulenceModels/turbulenceModels/RAS/RASModel/RASModel.C @@ -148,17 +148,8 @@ Foam::RASModel::New if (cstrIter == dictionaryConstructorTablePtr_->end()) { - FatalErrorIn - ( - "RASModel::New" - "(" - "const volScalarField&, " - "const volVectorField&, " - "const surfaceScalarField&, " - "transportModel&, " - "const word&" - ")" - ) << "Unknown RASModel type " + FatalErrorInFunction + << "Unknown RASModel type " << modelType << nl << nl << "Valid RASModel types:" << endl << dictionaryConstructorTablePtr_->sortedToc() diff --git a/src/TurbulenceModels/turbulenceModels/RAS/SpalartAllmaras/SpalartAllmaras.C b/src/TurbulenceModels/turbulenceModels/RAS/SpalartAllmaras/SpalartAllmaras.C index 520accaed5..8c5e5b2da5 100644 --- a/src/TurbulenceModels/turbulenceModels/RAS/SpalartAllmaras/SpalartAllmaras.C +++ b/src/TurbulenceModels/turbulenceModels/RAS/SpalartAllmaras/SpalartAllmaras.C @@ -321,7 +321,7 @@ tmp SpalartAllmaras::k() const template tmp SpalartAllmaras::epsilon() const { - WarningIn("tmp SpalartAllmaras::epsilon() const") + WarningInFunction << "Turbulence kinetic energy dissipation rate not defined for " << "Spalart-Allmaras model. Returning zero field" << endl; diff --git a/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/atmBoundaryLayer/atmBoundaryLayer.C b/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/atmBoundaryLayer/atmBoundaryLayer.C index 5cd044eb34..2679132d78 100644 --- a/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/atmBoundaryLayer/atmBoundaryLayer.C +++ b/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/atmBoundaryLayer/atmBoundaryLayer.C @@ -60,10 +60,8 @@ atmBoundaryLayer::atmBoundaryLayer(const vectorField& p, const dictionary& dict) { if (mag(flowDir_) < SMALL || mag(zDir_) < SMALL) { - FatalErrorIn - ( - "atmBoundaryLayer(const dictionary&)" - ) << "magnitude of n or z must be greater than zero" + FatalErrorInFunction + << "magnitude of n or z must be greater than zero" << abort(FatalError); } diff --git a/src/TurbulenceModels/turbulenceModels/ReynoldsStress/ReynoldsStress.C b/src/TurbulenceModels/turbulenceModels/ReynoldsStress/ReynoldsStress.C index 3d148f063d..63dc8d581e 100644 --- a/src/TurbulenceModels/turbulenceModels/ReynoldsStress/ReynoldsStress.C +++ b/src/TurbulenceModels/turbulenceModels/ReynoldsStress/ReynoldsStress.C @@ -168,10 +168,8 @@ Foam::ReynoldsStress::ReynoldsStress { if (couplingFactor_.value() < 0.0 || couplingFactor_.value() > 1.0) { - FatalErrorIn - ( - "ReynoldsStress::ReynoldsStress" - ) << "couplingFactor = " << couplingFactor_ + FatalErrorInFunction + << "couplingFactor = " << couplingFactor_ << " is not in range 0 - 1" << nl << exit(FatalError); } diff --git a/src/TurbulenceModels/turbulenceModels/TurbulenceModel/TurbulenceModel.C b/src/TurbulenceModels/turbulenceModels/TurbulenceModel/TurbulenceModel.C index ec5bf4a31d..30d4d31921 100644 --- a/src/TurbulenceModels/turbulenceModels/TurbulenceModel/TurbulenceModel.C +++ b/src/TurbulenceModels/turbulenceModels/TurbulenceModel/TurbulenceModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -110,13 +110,8 @@ Foam::TurbulenceModel::New if (cstrIter == dictionaryConstructorTablePtr_->end()) { - FatalErrorIn - ( - "TurbulenceModel::New" - "(const alphaField&, const rhoField&, " - "const volVectorField&, const surfaceScalarField&, " - "transportModel&, const word&)" - ) << "Unknown TurbulenceModel type " + FatalErrorInFunction + << "Unknown TurbulenceModel type " << modelType << nl << nl << "Valid TurbulenceModel types:" << endl << dictionaryConstructorTablePtr_->sortedToc() diff --git a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C index 9361279373..048b3437e4 100644 --- a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C +++ b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C @@ -41,7 +41,7 @@ void Foam::epsilonWallFunctionFvPatchScalarField::checkType() { if (!isA(patch())) { - FatalErrorIn("epsilonWallFunctionFvPatchScalarField::checkType()") + FatalErrorInFunction << "Invalid wall function specification" << nl << " Patch type for patch " << patch().name() << " must be wall" << nl diff --git a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/fWallFunctions/fWallFunction/fWallFunctionFvPatchScalarField.C b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/fWallFunctions/fWallFunction/fWallFunctionFvPatchScalarField.C index 9b1aff3b6a..0b61bfa3f5 100644 --- a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/fWallFunctions/fWallFunction/fWallFunctionFvPatchScalarField.C +++ b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/fWallFunctions/fWallFunction/fWallFunctionFvPatchScalarField.C @@ -43,7 +43,7 @@ void fWallFunctionFvPatchScalarField::checkType() { if (!isA(patch())) { - FatalErrorIn("fWallFunctionFvPatchScalarField::checkType()") + FatalErrorInFunction << "Invalid wall function specification" << nl << " Patch type for patch " << patch().name() << " must be wall" << nl diff --git a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kLowReWallFunction/kLowReWallFunctionFvPatchScalarField.C b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kLowReWallFunction/kLowReWallFunctionFvPatchScalarField.C index 29a6f0e2b4..30308b2926 100644 --- a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kLowReWallFunction/kLowReWallFunctionFvPatchScalarField.C +++ b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kLowReWallFunction/kLowReWallFunctionFvPatchScalarField.C @@ -41,7 +41,7 @@ void kLowReWallFunctionFvPatchScalarField::checkType() { if (!isA(patch())) { - FatalErrorIn("kLowReWallFunctionFvPatchScalarField::checkType()") + FatalErrorInFunction << "Invalid wall function specification" << nl << " Patch type for patch " << patch().name() << " must be wall" << nl diff --git a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kqRWallFunction/kqRWallFunctionFvPatchField.C b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kqRWallFunction/kqRWallFunctionFvPatchField.C index 1bcc7cd834..6afabdcc6c 100644 --- a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kqRWallFunction/kqRWallFunctionFvPatchField.C +++ b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kqRWallFunction/kqRWallFunctionFvPatchField.C @@ -40,7 +40,7 @@ void kqRWallFunctionFvPatchField::checkType() { if (!isA(this->patch())) { - FatalErrorIn("kqRWallFunctionFvPatchField::checkType()") + FatalErrorInFunction << "Invalid wall function specification" << nl << " Patch type for patch " << this->patch().name() << " must be wall" << nl diff --git a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField.C b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField.C index 54e31372fc..86cb3b473c 100644 --- a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField.C +++ b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField.C @@ -45,7 +45,7 @@ void nutWallFunctionFvPatchScalarField::checkType() { if (!isA(patch())) { - FatalErrorIn("nutWallFunctionFvPatchScalarField::checkType()") + FatalErrorInFunction << "Invalid wall function specification" << nl << " Patch type for patch " << patch().name() << " must be wall" << nl diff --git a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C index da6130662a..105822e97a 100644 --- a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C +++ b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C @@ -47,7 +47,7 @@ void omegaWallFunctionFvPatchScalarField::checkType() { if (!isA(patch())) { - FatalErrorIn("omegaWallFunctionFvPatchScalarField::checkType()") + FatalErrorInFunction << "Invalid wall function specification" << nl << " Patch type for patch " << patch().name() << " must be wall" << nl diff --git a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/v2WallFunctions/v2WallFunction/v2WallFunctionFvPatchScalarField.C b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/v2WallFunctions/v2WallFunction/v2WallFunctionFvPatchScalarField.C index 5351ea669a..2c24a2688e 100644 --- a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/v2WallFunctions/v2WallFunction/v2WallFunctionFvPatchScalarField.C +++ b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/v2WallFunctions/v2WallFunction/v2WallFunctionFvPatchScalarField.C @@ -43,7 +43,7 @@ void v2WallFunctionFvPatchScalarField::checkType() { if (!isA(patch())) { - FatalErrorIn("v2WallFunctionFvPatchScalarField::checkType()") + FatalErrorInFunction << "Invalid wall function specification" << nl << " Patch type for patch " << patch().name() << " must be wall" << nl diff --git a/src/combustionModels/FSD/reactionRateFlameAreaModels/reactionRateFlameArea/reactionRateFlameAreaNew.C b/src/combustionModels/FSD/reactionRateFlameAreaModels/reactionRateFlameArea/reactionRateFlameAreaNew.C index 0d18abb27f..8b5905ca4a 100644 --- a/src/combustionModels/FSD/reactionRateFlameAreaModels/reactionRateFlameArea/reactionRateFlameAreaNew.C +++ b/src/combustionModels/FSD/reactionRateFlameAreaModels/reactionRateFlameArea/reactionRateFlameAreaNew.C @@ -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 @@ -47,9 +47,8 @@ Foam::autoPtr Foam::reactionRateFlameArea::New if (cstrIter == dictionaryConstructorTablePtr_->end()) { - FatalIOErrorIn + FatalIOErrorInFunction ( - "reactionRateFlameArea::New(const psiReactionThermo&)", dict ) << "Unknown reactionRateFlameArea type " << reactionRateFlameAreaType << endl << endl diff --git a/src/combustionModels/combustionModel/combustionModelI.H b/src/combustionModels/combustionModel/combustionModelI.H index 6553155682..e095c5f7e0 100644 --- a/src/combustionModels/combustionModel/combustionModelI.H +++ b/src/combustionModels/combustionModel/combustionModelI.H @@ -39,11 +39,8 @@ inline const Foam::surfaceScalarField& Foam::combustionModel::phi() const } else { - FatalErrorIn - ( - "const Foam::compressibleTurbulenceModel& " - "Foam::combustionModel::turbulence() const " - ) << "turbulencePtr_ is empty. Please use " + FatalErrorInFunction + << "turbulencePtr_ is empty. Please use " << "combustionModel::setTurbulence " << "(compressibleTurbulenceModel& )" << abort(FatalError); @@ -62,11 +59,8 @@ Foam::combustionModel::turbulence() const } else { - FatalErrorIn - ( - "const Foam::compressibleTurbulenceModel& " - "Foam::combustionModel::turbulence() const " - ) << "turbulencePtr_ is empty. Please use " + FatalErrorInFunction + << "turbulencePtr_ is empty. Please use " << "combustionModel::setTurbulence " << "(compressibleTurbulenceModel& )" << abort(FatalError); diff --git a/src/combustionModels/psiCombustionModel/psiCombustionModel/psiCombustionModelNew.C b/src/combustionModels/psiCombustionModel/psiCombustionModel/psiCombustionModelNew.C index 42a000e187..59789b4841 100644 --- a/src/combustionModels/psiCombustionModel/psiCombustionModel/psiCombustionModelNew.C +++ b/src/combustionModels/psiCombustionModel/psiCombustionModel/psiCombustionModelNew.C @@ -57,10 +57,8 @@ Foam::combustionModels::psiCombustionModel::New if (cstrIter == dictionaryConstructorTablePtr_->end()) { - FatalErrorIn - ( - "psiCombustionModel::New" - ) << "Unknown psiCombustionModel type " + FatalErrorInFunction + << "Unknown psiCombustionModel type " << combModelName << endl << endl << "Valid combustionModels are : " << endl << dictionaryConstructorTablePtr_->toc() diff --git a/src/combustionModels/rhoCombustionModel/rhoCombustionModel/rhoCombustionModelNew.C b/src/combustionModels/rhoCombustionModel/rhoCombustionModel/rhoCombustionModelNew.C index 2c94b39931..4a23b500d5 100644 --- a/src/combustionModels/rhoCombustionModel/rhoCombustionModel/rhoCombustionModelNew.C +++ b/src/combustionModels/rhoCombustionModel/rhoCombustionModel/rhoCombustionModelNew.C @@ -57,10 +57,8 @@ Foam::combustionModels::rhoCombustionModel::New if (cstrIter == dictionaryConstructorTablePtr_->end()) { - FatalErrorIn - ( - "rhoCombustionModel::New" - ) << "Unknown rhoCombustionModel type " + FatalErrorInFunction + << "Unknown rhoCombustionModel type " << combTypeName << endl << endl << "Valid combustionModels are : " << endl << dictionaryConstructorTablePtr_->toc() diff --git a/src/combustionModels/singleStepCombustion/singleStepCombustion.C b/src/combustionModels/singleStepCombustion/singleStepCombustion.C index 65a41fcada..0f6dd8adc5 100644 --- a/src/combustionModels/singleStepCombustion/singleStepCombustion.C +++ b/src/combustionModels/singleStepCombustion/singleStepCombustion.C @@ -68,16 +68,7 @@ singleStepCombustion::singleStepCombustion } else { - FatalErrorIn - ( - "singleStepCombustion::" - "singleStepCombustion" - "(" - "const word&, " - "const fvMesh& " - "const word&" - ")" - ) + FatalErrorInFunction << "Inconsistent thermo package for " << this->type() << " model:\n" << " " << this->thermo().type() << nl << nl << "Please select a thermo package based on " diff --git a/src/conversion/ensight/part/ensightPart.C b/src/conversion/ensight/part/ensightPart.C index fa89a8cafe..a8a02535d0 100644 --- a/src/conversion/ensight/part/ensightPart.C +++ b/src/conversion/ensight/part/ensightPart.C @@ -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 @@ -136,9 +136,8 @@ Foam::autoPtr Foam::ensightPart::New(Istream& is) if (cstrIter == istreamConstructorTablePtr_->end()) { - FatalIOErrorIn + FatalIOErrorInFunction ( - "ensightPart::New(Istream&)", is ) << "unknown ensightPart type " << partType << nl << nl diff --git a/src/conversion/meshReader/calcPointCells.C b/src/conversion/meshReader/calcPointCells.C index 4da904faa7..fab62003b6 100644 --- a/src/conversion/meshReader/calcPointCells.C +++ b/src/conversion/meshReader/calcPointCells.C @@ -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 @@ -37,7 +37,7 @@ void Foam::meshReader::calcPointCells() const if (pointCellsPtr_) { - FatalErrorIn("meshReader::calcPointCells() const") + FatalErrorInFunction << "pointCells already calculated" << abort(FatalError); } diff --git a/src/conversion/meshReader/createPolyCells.C b/src/conversion/meshReader/createPolyCells.C index 028313ce9e..deebfc12aa 100644 --- a/src/conversion/meshReader/createPolyCells.C +++ b/src/conversion/meshReader/createPolyCells.C @@ -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 @@ -310,7 +310,7 @@ void Foam::meshReader::createPolyCells() } else { - FatalErrorIn("meshReader::createPolyCells()") + FatalErrorInFunction << "Error in internal face insertion" << abort(FatalError); } diff --git a/src/conversion/meshReader/starcd/STARCDMeshReader.C b/src/conversion/meshReader/starcd/STARCDMeshReader.C index 3e3e94383b..5ba8c7abc9 100644 --- a/src/conversion/meshReader/starcd/STARCDMeshReader.C +++ b/src/conversion/meshReader/starcd/STARCDMeshReader.C @@ -69,8 +69,7 @@ bool Foam::meshReaders::STARCD::readHeader(IFstream& is, word fileSignature) { if (!is.good()) { - FatalErrorIn("meshReaders::STARCD::readHeader()") - << "cannot read " << fileSignature << " " << is.name() + FatalErrorInFunction << abort(FatalError); } @@ -194,7 +193,7 @@ void Foam::meshReaders::STARCD::readPoints } else { - FatalErrorIn("meshReaders::STARCD::readPoints()") + FatalErrorInFunction << "no points in file " << inputName << abort(FatalError); } @@ -366,7 +365,7 @@ void Foam::meshReaders::STARCD::readCells(const fileName& inputName) // construct cellFaces_ and possibly cellShapes_ if (nCells <= 0) { - FatalErrorIn("meshReaders::STARCD::readCells()") + FatalErrorInFunction << "no cells in file " << inputName << abort(FatalError); } @@ -533,7 +532,7 @@ void Foam::meshReaders::STARCD::readCells(const fileName& inputName) if (nFaces < 4) { - FatalErrorIn("meshReaders::STARCD::readCells()") + FatalErrorInFunction << "star cell " << starCellId << " has " << nFaces << abort(FatalError); } @@ -597,7 +596,7 @@ void Foam::meshReaders::STARCD::readCells(const fileName& inputName) if (unknownVertices) { - FatalErrorIn("meshReaders::STARCD::readCells()") + FatalErrorInFunction << "cells with unknown vertices" << abort(FatalError); } diff --git a/src/conversion/meshWriter/starcd/STARCDMeshWriter.C b/src/conversion/meshWriter/starcd/STARCDMeshWriter.C index 08383060e1..a308dfbc54 100644 --- a/src/conversion/meshWriter/starcd/STARCDMeshWriter.C +++ b/src/conversion/meshWriter/starcd/STARCDMeshWriter.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -98,7 +98,7 @@ void Foam::meshWriters::STARCD::getCellTable() } else { - WarningIn("STARCD::getCellTable()") + WarningInFunction << ioList.objectPath() << " has incorrect number of cells " << " - use cellZone information" << endl; diff --git a/src/conversion/polyDualMesh/polyDualMesh.C b/src/conversion/polyDualMesh/polyDualMesh.C index 9ed6be4c8f..ed76d92d72 100644 --- a/src/conversion/polyDualMesh/polyDualMesh.C +++ b/src/conversion/polyDualMesh/polyDualMesh.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -125,11 +125,8 @@ Foam::labelList Foam::polyDualMesh::getFaceOrder { if (oldToNew[faceI] == -1) { - FatalErrorIn - ( - "polyDualMesh::getFaceOrder" - "(const labelList&, const labelList&, const label) const" - ) << "Did not determine new position" + FatalErrorInFunction + << "Did not determine new position" << " for face " << faceI << abort(FatalError); } @@ -205,7 +202,7 @@ void Foam::polyDualMesh::getPointEdges } } - FatalErrorIn("getPointEdges") << "Cannot find two edges on face:" << faceI + FatalErrorInFunction << " vertices:" << patch.localFaces()[faceI] << " that uses point:" << pointI << abort(FatalError); @@ -247,7 +244,7 @@ Foam::labelList Foam::polyDualMesh::collectPatchSideFace // Store dual vertex for starting edge. if (edgeToDualPoint[patch.meshEdges()[edgeI]] < 0) { - FatalErrorIn("polyDualMesh::collectPatchSideFace") << edgeI + FatalErrorInFunction << abort(FatalError); } @@ -761,11 +758,8 @@ void Foam::polyDualMesh::calcDual { nonManifoldPoints.write(); - FatalErrorIn - ( - "polyDualMesh::calcDual(const polyMesh&, const labelList&" - ", const labelList&)" - ) << "There are " << nonManifoldPoints.size() << " points where" + FatalErrorInFunction + << "There are " << nonManifoldPoints.size() << " points where" << " the outside of the mesh is non-manifold." << nl << "Such a mesh cannot be converted to a dual." << nl << "Writing points at non-manifold sites to pointSet " @@ -918,7 +912,7 @@ void Foam::polyDualMesh::calcDual if (patchFaces.size() != 2) { - FatalErrorIn("polyDualMesh::calcDual") + FatalErrorInFunction << "Cannot handle edges with " << patchFaces.size() << " connected boundary faces." << abort(FatalError); @@ -1018,7 +1012,7 @@ void Foam::polyDualMesh::calcDual vector n = f.normal(dualPoints); if (((mesh.points()[owner] - dualPoints[f[0]]) & n) > 0) { - WarningIn("calcDual") << "Incorrect orientation" + WarningInFunction << " on boundary edge:" << edgeI << mesh.points()[mesh.edges()[edgeI][0]] << mesh.points()[mesh.edges()[edgeI][1]] @@ -1133,7 +1127,7 @@ void Foam::polyDualMesh::calcDual vector n = f.normal(dualPoints); if (((mesh.points()[owner] - dualPoints[f[0]]) & n) > 0) { - WarningIn("calcDual") << "Incorrect orientation" + WarningInFunction << " on internal edge:" << edgeI << mesh.points()[mesh.edges()[edgeI][0]] << mesh.points()[mesh.edges()[edgeI][1]] @@ -1537,7 +1531,7 @@ void Foam::polyDualMesh::calcFeatures // Non-manifold. Problem? const edge& e = allBoundary.edges()[edgeI]; - WarningIn("polyDualMesh::calcFeatures") << "Edge " + WarningInFunction << meshPoints[e[0]] << ' ' << meshPoints[e[1]] << " coords:" << mesh.points()[meshPoints[e[0]]] << mesh.points()[meshPoints[e[1]]] diff --git a/src/dummyThirdParty/MGridGen/dummyMGridGen.C b/src/dummyThirdParty/MGridGen/dummyMGridGen.C index 566c64d997..fe1cca6828 100644 --- a/src/dummyThirdParty/MGridGen/dummyMGridGen.C +++ b/src/dummyThirdParty/MGridGen/dummyMGridGen.C @@ -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 @@ -49,7 +49,7 @@ extern "C" void MGridGen(int, idxtype *, realtype *, realtype *, idxtype *, realtype *, int, int, int *, int *, int *, idxtype *) { - FatalErrorIn("MGridGen(..)") + FatalErrorInFunction << notImplementedMessage << Foam::exit(Foam::FatalError); } diff --git a/src/dummyThirdParty/metisDecomp/dummyMetisDecomp.C b/src/dummyThirdParty/metisDecomp/dummyMetisDecomp.C index 438e158df9..ffe80489d7 100644 --- a/src/dummyThirdParty/metisDecomp/dummyMetisDecomp.C +++ b/src/dummyThirdParty/metisDecomp/dummyMetisDecomp.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -63,16 +63,8 @@ Foam::label Foam::metisDecomp::decompose List