mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: use objectRegistry/IOobjectList sorted instead of lookupClass
- in most cases a parallel-consistent order is required. Even when the order is not important, it will generally require fewer allocations to create a UPtrList of entries instead of a HashTable or even a wordList.
This commit is contained in:
@ -52,7 +52,9 @@ namespace Foam
|
||||
const Foam::volScalarField&
|
||||
Foam::radiation::localDensityAbsorptionEmission::alpha(word alphaName) const
|
||||
{
|
||||
if (!mesh_.foundObject<volScalarField>(alphaName))
|
||||
const volScalarField* ptr = mesh_.cfindObject<volScalarField>(alphaName);
|
||||
|
||||
if (!ptr)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Unable to retrieve density field " << alphaName << " from "
|
||||
@ -60,7 +62,7 @@ Foam::radiation::localDensityAbsorptionEmission::alpha(word alphaName) const
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
return mesh_.lookupObject<volScalarField>(alphaName);
|
||||
return *ptr;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user