mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
BUG: errors found in feature-vtm merge !213
- vtkWrite with moving mesh was not updated the subsets properly, which caused it to crash. - foamToVTK -overwrite ignored for single region cases, was working for multi-region cases - minor documentation changes
This commit is contained in:
@ -607,19 +607,24 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
if (Pstream::master())
|
if (Pstream::master())
|
||||||
{
|
{
|
||||||
|
// Overwrite or create the VTK/regionName directories.
|
||||||
|
// For the default region, this is simply "VTK/"
|
||||||
|
|
||||||
|
fileName regionDir;
|
||||||
for (const word& regionName : regionNames)
|
for (const word& regionName : regionNames)
|
||||||
{
|
{
|
||||||
// VTK/regionName directory in the case
|
|
||||||
|
|
||||||
fileName regionDir;
|
|
||||||
if (regionName != polyMesh::defaultRegion)
|
if (regionName != polyMesh::defaultRegion)
|
||||||
{
|
{
|
||||||
regionDir = outputDir / regionName;
|
regionDir = outputDir / regionName;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
regionDir = outputDir;
|
||||||
|
}
|
||||||
|
|
||||||
if (args.found("overwrite") && isDir(regionDir))
|
if (args.found("overwrite") && isDir(regionDir))
|
||||||
{
|
{
|
||||||
Info<< "Deleting old VTK files in "
|
Info<< "Removing old directory "
|
||||||
<< regionDir.relative(runTime.globalPath())
|
<< regionDir.relative(runTime.globalPath())
|
||||||
<< nl << endl;
|
<< nl << endl;
|
||||||
rmDir(regionDir);
|
rmDir(regionDir);
|
||||||
|
|||||||
@ -56,7 +56,7 @@ Description
|
|||||||
dome
|
dome
|
||||||
{
|
{
|
||||||
action add;
|
action add;
|
||||||
shape sphere;
|
source sphere;
|
||||||
origin (-0.1 -0.01 -0.1);
|
origin (-0.1 -0.01 -0.1);
|
||||||
radius 0.25;
|
radius 0.25;
|
||||||
}
|
}
|
||||||
@ -98,7 +98,7 @@ Description
|
|||||||
directory | The output directory name | no | postProcessing/NAME
|
directory | The output directory name | no | postProcessing/NAME
|
||||||
width | Padding width for file name | no | 8
|
width | Padding width for file name | no | 8
|
||||||
decompose | Decompose polyhedral cells | no | false
|
decompose | Decompose polyhedral cells | no | false
|
||||||
writeIds | Write cell/patch ids as field | no | true
|
writeIds | Write cell/patch ids as field | no | false
|
||||||
\endtable
|
\endtable
|
||||||
|
|
||||||
\heading Output Selection
|
\heading Output Selection
|
||||||
|
|||||||
@ -157,8 +157,8 @@ bool Foam::functionObjects::vtkWrite::update()
|
|||||||
if
|
if
|
||||||
(
|
(
|
||||||
meshState_ == polyMesh::UNCHANGED
|
meshState_ == polyMesh::UNCHANGED
|
||||||
&& !meshSubsets_.empty()
|
&& (meshes_.size() == meshSubsets_.size())
|
||||||
&& !vtuMappings_.empty()
|
&& (meshes_.size() == vtuMappings_.size())
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
@ -174,7 +174,7 @@ bool Foam::functionObjects::vtkWrite::update()
|
|||||||
|
|
||||||
if (meshSubsets_.set(regioni))
|
if (meshSubsets_.set(regioni))
|
||||||
{
|
{
|
||||||
meshSubsets_.clear();
|
meshSubsets_[regioni].clear();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -200,9 +200,12 @@ bool Foam::functionObjects::vtkWrite::update()
|
|||||||
++regioni;
|
++regioni;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
regioni = 0;
|
||||||
for (auto& subsetter : meshSubsets_)
|
for (auto& subsetter : meshSubsets_)
|
||||||
{
|
{
|
||||||
updateSubset(subsetter);
|
updateSubset(subsetter);
|
||||||
|
vtuMappings_[regioni].reset(subsetter.mesh());
|
||||||
|
++regioni;
|
||||||
}
|
}
|
||||||
|
|
||||||
meshState_ = polyMesh::UNCHANGED;
|
meshState_ = polyMesh::UNCHANGED;
|
||||||
|
|||||||
Reference in New Issue
Block a user