ENH: more consistent use of good() or direct testing instead valid()

This commit is contained in:
Mark Olesen
2023-07-19 13:47:19 +02:00
parent 76efcba4c7
commit 945e3e41b1
72 changed files with 139 additions and 148 deletions

View File

@ -17,7 +17,7 @@ tmp<GeometricField<Type, fvsPatchField, surfaceMesh>> interpolate
vf,
dir,
"reconstruct("
+ (reconFieldName != word::null ? reconFieldName : vf.name())
+ (reconFieldName.empty() ? vf.name() : reconFieldName)
+ ')'
)
);

View File

@ -61,7 +61,7 @@ void basicTests(const coordinateSystem& cs)
if (const auto* cartptr = isA<coordSystem::cartesian>(cs))
{
if (!cartptr->valid())
if (!cartptr->good())
{
Info<< "invalid cartesian = " << (*cartptr)
<< " with: " << (*cartptr).R() << nl;

View File

@ -221,7 +221,7 @@ int main(int argc, char *argv[])
blockMesh blocks(meshDict, regionName, strategy, args.verbose());
if (!blocks.valid())
if (!blocks.good())
{
// Could/should be Fatal?

View File

@ -979,7 +979,7 @@ int main(int argc, char *argv[])
// Change the front and back patch types as required
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
word frontBackType(word::null);
word frontBackType;
if (isType<extrudeModels::wedge>(model()))
{

View File

@ -947,7 +947,7 @@ void addZoneSidePatches
forAll(zoneSidePatch, zoneI)
{
if (oneDPolyPatchType != word::null)
if (!oneDPolyPatchType.empty())
{
// Reuse single empty patch.
word patchName;

View File

@ -47,7 +47,7 @@ void Foam::DelaunayMesh<Triangulation>::timeCheck
<< time().elapsedCpuTime() << " s, "
<< "delta " << time().cpuTimeIncrement()<< " s";
if (description != word::null)
if (!description.empty())
{
Info<< ", " << description << " ";
}

View File

@ -33,7 +33,7 @@ template<class KeyType, class DataType>
Foam::PrintTable<KeyType, DataType>::PrintTable()
:
table_(),
title_(string::null)
title_()
{}

View File

@ -65,7 +65,7 @@ void Foam::conformalVoronoiMesh::timeCheck
<< runTime.elapsedCpuTime() << " s, "
<< "delta " << runTime.cpuTimeIncrement()<< " s";
if (description != word::null)
if (!description.empty())
{
Info<< ", " << description << " ";
}

View File

@ -92,8 +92,8 @@ void Foam::helpTypes::helpBoundary::execute
{
setEnv("FOAM_ABORT", "", true);
word condition(word::null);
word fieldName(word::null);
word condition;
word fieldName;
if (args.readIfPresent("browse", condition))
{

View File

@ -72,7 +72,7 @@ void Foam::helpTypes::helpFunctionObject::execute
const fvMesh& mesh
)
{
word function(word::null);
word function;
if (args.readIfPresent("browse", function))
{

View File

@ -80,7 +80,7 @@ void Foam::helpTypes::helpSolver::execute
const fvMesh& mesh
)
{
word solver(word::null);
word solver;
if (args.readIfPresent("browse", solver))
{