diff --git a/src/lagrangian/basic/IOPosition/IOPosition.C b/src/lagrangian/basic/IOPosition/IOPosition.C index 035a051ef6..1ee1ec1640 100644 --- a/src/lagrangian/basic/IOPosition/IOPosition.C +++ b/src/lagrangian/basic/IOPosition/IOPosition.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -36,7 +36,6 @@ Foam::IOPosition::IOPosition ) : regIOobject(io), - mesh_(mesh), cloud_(c) {} @@ -55,7 +54,6 @@ Foam::IOPosition::IOPosition(const CloudType& c) IOobject::NO_WRITE ) ), - mesh_(c.pMesh()), cloud_(c) {} @@ -89,6 +87,9 @@ bool Foam::IOPosition::writeData(Ostream& os) const template void Foam::IOPosition::readData(Istream& is, CloudType& c) { + static const char* funcName = + "IOPosition::readData(Istream&, CloudType&)"; + token firstToken(is); if (firstToken.isLabel()) @@ -96,10 +97,7 @@ void Foam::IOPosition::readData(Istream& is, CloudType& c) label s = firstToken.labelToken(); // Read beginning of contents - is.readBeginList - ( - "IOPosition::readData(Istream&, CloudType&)" - ); + is.readBeginList(funcName); for (label i=0; i::readData(Istream& is, CloudType& c) } // Read end of contents - is.readEndList("IOPosition::readData(Istream&, CloudType&)"); + is.readEndList(funcName); } else if (firstToken.isPunctuation()) { if (firstToken.pToken() != token::BEGIN_LIST) { - FatalIOErrorInFunction - ( - is - ) << "incorrect first token, '(', found " + FatalIOErrorInFunction(is) + << "incorrect first token, '(', found " << firstToken.info() << exit(FatalIOError); } @@ -139,18 +135,13 @@ void Foam::IOPosition::readData(Istream& is, CloudType& c) } else { - FatalIOErrorInFunction - ( - is - ) << "incorrect first token, expected or '(', found " + FatalIOErrorInFunction(is) + << "incorrect first token, expected or '(', found " << firstToken.info() << exit(FatalIOError); } // Check state of IOstream - is.check - ( - "void IOPosition::readData(Istream&, CloudType&)" - ); + is.check(funcName); } diff --git a/src/lagrangian/basic/IOPosition/IOPosition.H b/src/lagrangian/basic/IOPosition/IOPosition.H index 5857bc1ff1..521783996b 100644 --- a/src/lagrangian/basic/IOPosition/IOPosition.H +++ b/src/lagrangian/basic/IOPosition/IOPosition.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -62,9 +62,6 @@ class IOPosition // Private Data - //- Reference to the mesh - const polyMesh& mesh_; - //- Reference to the cloud const CloudType& cloud_;