mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: Only read set and surface sampling fields if specified
This commit is contained in:
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -231,6 +231,10 @@ void Foam::sampledSets::write()
|
|||||||
void Foam::sampledSets::read(const dictionary& dict)
|
void Foam::sampledSets::read(const dictionary& dict)
|
||||||
{
|
{
|
||||||
dict_ = dict;
|
dict_ = dict;
|
||||||
|
|
||||||
|
bool setsFound = dict_.found("sets");
|
||||||
|
if (setsFound)
|
||||||
|
{
|
||||||
dict_.lookup("fields") >> fieldSelection_;
|
dict_.lookup("fields") >> fieldSelection_;
|
||||||
clearFieldGroups();
|
clearFieldGroups();
|
||||||
|
|
||||||
@ -245,14 +249,25 @@ void Foam::sampledSets::read(const dictionary& dict)
|
|||||||
transfer(newList);
|
transfer(newList);
|
||||||
combineSampledSets(masterSampledSets_, indexSets_);
|
combineSampledSets(masterSampledSets_, indexSets_);
|
||||||
|
|
||||||
|
if (this->size())
|
||||||
|
{
|
||||||
|
Info<< "Reading set description:" << nl;
|
||||||
|
forAll(*this, setI)
|
||||||
|
{
|
||||||
|
Info<< " " << operator[](setI).name() << nl;
|
||||||
|
}
|
||||||
|
Info<< endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (Pstream::master() && debug)
|
if (Pstream::master() && debug)
|
||||||
{
|
{
|
||||||
Pout<< "sample fields:" << fieldSelection_ << nl
|
Pout<< "sample fields:" << fieldSelection_ << nl
|
||||||
<< "sample sets:" << nl << "(" << nl;
|
<< "sample sets:" << nl << "(" << nl;
|
||||||
|
|
||||||
forAll(*this, si)
|
forAll(*this, setI)
|
||||||
{
|
{
|
||||||
Pout<< " " << operator[](si) << endl;
|
Pout<< " " << operator[](setI) << endl;
|
||||||
}
|
}
|
||||||
Pout<< ")" << endl;
|
Pout<< ")" << endl;
|
||||||
}
|
}
|
||||||
@ -260,6 +275,9 @@ void Foam::sampledSets::read(const dictionary& dict)
|
|||||||
|
|
||||||
|
|
||||||
void Foam::sampledSets::correct()
|
void Foam::sampledSets::correct()
|
||||||
|
{
|
||||||
|
bool setsFound = dict_.found("sets");
|
||||||
|
if (setsFound)
|
||||||
{
|
{
|
||||||
// reset interpolation
|
// reset interpolation
|
||||||
pointMesh::Delete(mesh_);
|
pointMesh::Delete(mesh_);
|
||||||
@ -275,6 +293,7 @@ void Foam::sampledSets::correct()
|
|||||||
transfer(newList);
|
transfer(newList);
|
||||||
combineSampledSets(masterSampledSets_, indexSets_);
|
combineSampledSets(masterSampledSets_, indexSets_);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::sampledSets::updateMesh(const mapPolyMesh&)
|
void Foam::sampledSets::updateMesh(const mapPolyMesh&)
|
||||||
|
|||||||
@ -215,6 +215,10 @@ void Foam::sampledSurfaces::write()
|
|||||||
|
|
||||||
|
|
||||||
void Foam::sampledSurfaces::read(const dictionary& dict)
|
void Foam::sampledSurfaces::read(const dictionary& dict)
|
||||||
|
{
|
||||||
|
bool surfacesFound = dict.found("surfaces");
|
||||||
|
|
||||||
|
if (surfacesFound)
|
||||||
{
|
{
|
||||||
dict.lookup("fields") >> fieldSelection_;
|
dict.lookup("fields") >> fieldSelection_;
|
||||||
clearFieldGroups();
|
clearFieldGroups();
|
||||||
@ -245,6 +249,17 @@ void Foam::sampledSurfaces::read(const dictionary& dict)
|
|||||||
// ensure all surfaces and merge information are expired
|
// ensure all surfaces and merge information are expired
|
||||||
expire();
|
expire();
|
||||||
|
|
||||||
|
if (this->size())
|
||||||
|
{
|
||||||
|
Info<< "Reading surface description:" << nl;
|
||||||
|
forAll(*this, surfI)
|
||||||
|
{
|
||||||
|
Info<< " " << operator[](surfI).name() << nl;
|
||||||
|
}
|
||||||
|
Info<< endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (Pstream::master() && debug)
|
if (Pstream::master() && debug)
|
||||||
{
|
{
|
||||||
Pout<< "sample fields:" << fieldSelection_ << nl
|
Pout<< "sample fields:" << fieldSelection_ << nl
|
||||||
|
|||||||
Reference in New Issue
Block a user