Merge branch 'master' of ssh://noisy/home/noisy3/OpenFOAM/OpenFOAM-dev

This commit is contained in:
andy 2009-08-13 15:52:57 +01:00
commit 276eeedab0
4 changed files with 61 additions and 41 deletions

View File

@ -97,7 +97,7 @@ int main(int argc, char *argv[])
mesh,
IOobject::NO_READ
),
sigma.component(tensor::XX)
sigma.component(symmTensor::XX)
);
sigmaxx.write();
@ -110,7 +110,7 @@ int main(int argc, char *argv[])
mesh,
IOobject::NO_READ
),
sigma.component(tensor::YY)
sigma.component(symmTensor::YY)
);
sigmayy.write();
@ -123,7 +123,7 @@ int main(int argc, char *argv[])
mesh,
IOobject::NO_READ
),
sigma.component(tensor::ZZ)
sigma.component(symmTensor::ZZ)
);
sigmazz.write();
@ -136,7 +136,7 @@ int main(int argc, char *argv[])
mesh,
IOobject::NO_READ
),
sigma.component(tensor::XY)
sigma.component(symmTensor::XY)
);
sigmaxy.write();
@ -149,7 +149,7 @@ int main(int argc, char *argv[])
mesh,
IOobject::NO_READ
),
sigma.component(tensor::XZ)
sigma.component(symmTensor::XZ)
);
sigmaxz.write();
@ -162,7 +162,7 @@ int main(int argc, char *argv[])
mesh,
IOobject::NO_READ
),
sigma.component(tensor::YZ)
sigma.component(symmTensor::YZ)
);
sigmayz.write();
@ -190,7 +190,7 @@ int main(int argc, char *argv[])
mesh,
IOobject::NO_READ
),
0.0*sigma.component(tensor::YZ)
0.0*sigma.component(symmTensor::YZ)
);
forAll(sigmaUn.boundaryField(), patchI)

View File

@ -45,38 +45,44 @@ char Foam::ISstream::nextValid()
// Return if stream is bad - ie, previous get() failed
if (bad() || isspace(c))
{
return 0;
break;
}
// Is this the start of a C/C++ comment?
if (c == '/')
{
// If cannot get another character, return this one
if (!get(c))
{
// cannot get another character - return this one
return '/';
}
if (c == '/')
{
// This is the start of a C++ style one-line comment
// C++ style single-line comment - skip through past end-of-line
while (get(c) && c != '\n')
{}
}
else if (c == '*')
{
// This is the start of a C style comment
// within a C-style comment
while (true)
{
// search for end of C-style comment - '*/'
if (get(c) && c == '*')
{
if (get(c) && c == '/')
if (get(c))
{
break;
}
else
{
putback(c);
if (c == '/')
{
// matched '*/'
break;
}
else if (c == '*')
{
// check again
putback(c);
}
}
}
@ -86,17 +92,21 @@ char Foam::ISstream::nextValid()
}
}
}
else // A lone '/' so return it.
else
{
// The '/' did not start a C/C++ comment - return it
putback(c);
return '/';
}
}
else // c is a valid character so return it
else
{
// a valid character - return it
return c;
}
}
return 0;
}
@ -277,8 +287,8 @@ Foam::Istream& Foam::ISstream::read(token& t)
// }
}
// nothing converted (bad format), or trailing junk
if (endptr == buf || *endptr != '\0')
// not everything converted: bad format or trailing junk
if (*endptr)
{
t.setBad();
}
@ -289,7 +299,7 @@ Foam::Istream& Foam::ISstream::read(token& t)
}
// Should be a word (which can be a single character)
// Should be a word (which can also be a single character)
default:
{
putback(c);

View File

@ -117,6 +117,10 @@ bool Foam::argList::regroupArgv(int& argc, char**& argv)
// get rootPath_ / globalCase_ from one of the following forms
// * [-case dir]
// * cwd
//
// Also export FOAM_CASE and FOAM_CASENAME environment variables
// so they can be used immediately (eg, in decomposeParDict)
//
void Foam::argList::getRootCase()
{
fileName casePath;
@ -151,6 +155,26 @@ void Foam::argList::getRootCase()
rootPath_ = casePath.path();
globalCase_ = casePath.name();
case_ = globalCase_;
// Set the case and case-name as an environment variable
if (rootPath_[0] == '/')
{
// absolute path - use as-is
setEnv("FOAM_CASE", rootPath_/globalCase_, true);
setEnv("FOAM_CASENAME", globalCase_, true);
}
else
{
// qualify relative path
fileName casePath = cwd()/rootPath_/globalCase_;
casePath.clean();
setEnv("FOAM_CASE", casePath, true);
setEnv("FOAM_CASENAME", casePath.name(), true);
}
}
@ -531,24 +555,6 @@ Foam::argList::argList
}
jobInfo.write();
// Set the case and case-name as an environment variable
if (rootPath_[0] == '/')
{
// absolute path - use as-is
setEnv("FOAM_CASE", rootPath_/globalCase_, true);
setEnv("FOAM_CASENAME", globalCase_, true);
}
else
{
// qualify relative path
fileName casePath = cwd()/rootPath_/globalCase_;
casePath.clean();
setEnv("FOAM_CASE", casePath, true);
setEnv("FOAM_CASENAME", casePath.name(), true);
}
// Switch on signal trapping. We have to wait until after Pstream::init
// since this sets up its own ones.
sigFpe_.set(bannerEnabled);

View File

@ -81,7 +81,10 @@ Foam::porousZone::porousZone
{
Info<< "Creating porous zone: " << name_ << endl;
if (cellZoneID_ == -1 && !Pstream::parRun())
bool foundZone = (cellZoneID_ != -1);
reduce(foundZone, orOp<bool>());
if (!foundZone && Pstream::master())
{
FatalErrorIn
(
@ -91,6 +94,7 @@ Foam::porousZone::porousZone
<< exit(FatalError);
}
// porosity
if (dict_.readIfPresent("porosity", porosity_))
{