const volScalarField::DimensionedInternalField& fvMesh::V() const
{
    if (!VPtr_)
    {
        if (debug)
        {
            InfoIn
            (
                "const volScalarField::DimensionedInternalField& "
                "fvMesh::V() const"
            )   << "Calculating cell volumes." << endl;
        }

        VPtr_ = new DimensionedField<scalar, volMesh>
        (
            IOobject
            (
                "V",
                time().timeName(),
                *this,
                IOobject::NO_READ,
                IOobject::NO_WRITE
            ),
            *this,
            dimVolume,
            cellVolumes()
        );
    }

    return *VPtr_;
}
示例#2
0
const Foam::volScalarField::Internal& Foam::fvMesh::V() const
{
    if (!VPtr_)
    {
        if (debug)
        {
            InfoInFunction
                << "Constructing from primitiveMesh::cellVolumes()" << endl;
        }

        VPtr_ = new slicedVolScalarField::Internal
        (
            IOobject
            (
                "V",
                time().timeName(),
                *this,
                IOobject::NO_READ,
                IOobject::NO_WRITE,
                false
            ),
            *this,
            dimVolume,
            cellVolumes()
        );
    }

    return *static_cast<slicedVolScalarField::Internal*>(VPtr_);
}
void testCellVolumes(Pooma::Tester &tester, const Field &f)
{   
  tester.out() << cellVolumes(f) << std::endl;
}