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:
Mark Olesen
2018-11-23 14:04:07 +01:00
parent 0f48b89185
commit 05353da5f4
3 changed files with 17 additions and 9 deletions

View File

@ -607,19 +607,24 @@ int main(int argc, char *argv[])
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)
{
// VTK/regionName directory in the case
fileName regionDir;
if (regionName != polyMesh::defaultRegion)
{
regionDir = outputDir / regionName;
}
else
{
regionDir = outputDir;
}
if (args.found("overwrite") && isDir(regionDir))
{
Info<< "Deleting old VTK files in "
Info<< "Removing old directory "
<< regionDir.relative(runTime.globalPath())
<< nl << endl;
rmDir(regionDir);

View File

@ -56,7 +56,7 @@ Description
dome
{
action add;
shape sphere;
source sphere;
origin (-0.1 -0.01 -0.1);
radius 0.25;
}
@ -98,7 +98,7 @@ Description
directory | The output directory name | no | postProcessing/NAME
width | Padding width for file name | no | 8
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
\heading Output Selection

View File

@ -157,8 +157,8 @@ bool Foam::functionObjects::vtkWrite::update()
if
(
meshState_ == polyMesh::UNCHANGED
&& !meshSubsets_.empty()
&& !vtuMappings_.empty()
&& (meshes_.size() == meshSubsets_.size())
&& (meshes_.size() == vtuMappings_.size())
)
{
return false;
@ -174,7 +174,7 @@ bool Foam::functionObjects::vtkWrite::update()
if (meshSubsets_.set(regioni))
{
meshSubsets_.clear();
meshSubsets_[regioni].clear();
}
else
{
@ -200,9 +200,12 @@ bool Foam::functionObjects::vtkWrite::update()
++regioni;
}
regioni = 0;
for (auto& subsetter : meshSubsets_)
{
updateSubset(subsetter);
vtuMappings_[regioni].reset(subsetter.mesh());
++regioni;
}
meshState_ = polyMesh::UNCHANGED;