mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' of /home/noisy2/OpenFOAM/OpenFOAM-dev/
This commit is contained in:
@ -77,21 +77,45 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
mesh.readUpdate();
|
mesh.readUpdate();
|
||||||
|
|
||||||
Info<< " Reading field " << fieldName << endl;
|
|
||||||
volScalarField field(fieldHeader, mesh);
|
|
||||||
|
|
||||||
label patchi = mesh.boundaryMesh().findPatchID(patchName);
|
label patchi = mesh.boundaryMesh().findPatchID(patchName);
|
||||||
|
if (patchi < 0)
|
||||||
if (patchi >= 0)
|
|
||||||
{
|
{
|
||||||
|
FatalError
|
||||||
|
<< "Unable to find patch " << patchName << nl
|
||||||
|
<< exit(FatalError);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (fieldHeader.headerClassName() == "volScalarField")
|
||||||
|
{
|
||||||
|
Info<< " Reading volScalarField " << fieldName << endl;
|
||||||
|
volScalarField field(fieldHeader, mesh);
|
||||||
|
|
||||||
|
vector sumField = sum
|
||||||
|
(
|
||||||
|
mesh.Sf().boundaryField()[patchi]
|
||||||
|
*field.boundaryField()[patchi]
|
||||||
|
);
|
||||||
|
|
||||||
Info<< " Integral of " << fieldName << " over patch "
|
Info<< " Integral of " << fieldName << " over patch "
|
||||||
<< patchName << '[' << patchi << ']' << " = "
|
<< patchName << '[' << patchi << ']' << " = "
|
||||||
<< sum
|
<< sumField << nl;
|
||||||
(
|
}
|
||||||
mesh.Sf().boundaryField()[patchi]
|
else if (fieldHeader.headerClassName() == "surfaceScalarField")
|
||||||
*field.boundaryField()[patchi]
|
{
|
||||||
)
|
Info<< " Reading surfaceScalarField " << fieldName << endl;
|
||||||
<< endl;
|
|
||||||
|
surfaceScalarField field(fieldHeader, mesh);
|
||||||
|
scalar sumField = sum(field.boundaryField()[patchi]);
|
||||||
|
|
||||||
|
Info<< " Integral of " << fieldName << " over patch "
|
||||||
|
<< patchName << '[' << patchi << ']' << " = "
|
||||||
|
<< sumField << nl;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
FatalError
|
||||||
|
<< "Only possible to integrate volScalarFields "
|
||||||
|
<< "and surfaceScalarFields" << nl << exit(FatalError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -63,6 +63,17 @@ bool Foam::functionEntry::insert
|
|||||||
"primitiveEntry& entry, Istream& is)"
|
"primitiveEntry& entry, Istream& is)"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (!insertprimitiveEntryIstreamMemberFunctionTablePtr_)
|
||||||
|
{
|
||||||
|
cerr<<"functionEntry::insert"
|
||||||
|
<< "(const word&, dictionary&, primitiveEntry&, Istream&)"
|
||||||
|
<< " not yet initialized, function = "
|
||||||
|
<< functionName.c_str() << std::endl;
|
||||||
|
|
||||||
|
// return true to keep reading anyhow
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
insertprimitiveEntryIstreamMemberFunctionTable::iterator mfIter =
|
insertprimitiveEntryIstreamMemberFunctionTable::iterator mfIter =
|
||||||
insertprimitiveEntryIstreamMemberFunctionTablePtr_->find(functionName);
|
insertprimitiveEntryIstreamMemberFunctionTablePtr_->find(functionName);
|
||||||
|
|
||||||
@ -97,6 +108,17 @@ bool Foam::functionEntry::insert
|
|||||||
"(const word& functionName, dictionary& parentDict, Istream& is)"
|
"(const word& functionName, dictionary& parentDict, Istream& is)"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (!insertdictionaryIstreamMemberFunctionTablePtr_)
|
||||||
|
{
|
||||||
|
cerr<<"functionEntry::insert"
|
||||||
|
<< "(const word&, dictionary&, Istream&)"
|
||||||
|
<< " not yet initialized, function = "
|
||||||
|
<< functionName.c_str() << std::endl;
|
||||||
|
|
||||||
|
// Return true to keep reading
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
insertdictionaryIstreamMemberFunctionTable::iterator mfIter =
|
insertdictionaryIstreamMemberFunctionTable::iterator mfIter =
|
||||||
insertdictionaryIstreamMemberFunctionTablePtr_->find(functionName);
|
insertdictionaryIstreamMemberFunctionTablePtr_->find(functionName);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user