ENH: improvements for vtkWrite function object (issue #926)

- parallel output.

  The output is now postProcessing/<name> for similar reasoning as
  mentioned in #866 - better alignment with other function objects, no
  collision with foamToVTK output.

- align the input parameters with those of vtkCloud so that we can
  specify the ASCII precision and the padding width for the output
  file names as well.

- emit TimeValue field, support file series generation

- support internal or boundary meshes, combining the result into a vtm
  file.

- can restrict conversion based on zone names, enclosing volumes,
  bounding box
This commit is contained in:
Mark Olesen
2018-10-09 15:52:52 +02:00
parent 3e75a3736b
commit 42bb497084
8 changed files with 1358 additions and 176 deletions

View File

@ -52,4 +52,9 @@ maxDi 10.0;
adjustTimeStep yes;
functions
{
#include "vtkWrite"
}
// ************************************************************************* //

View File

@ -0,0 +1,62 @@
// -*- C++ -*-
// Use the vtkWrite function object
vtkWrite
{
type vtkWrite;
libs ("libutilityFunctionObjects.so");
log true;
writeControl writeTime;
writeInterval 1;
// Fields to output (words or regex)
regions (".*");
internal true;
boundary true;
single false;
interpolate true;
// Fields to output (words or regex)
fields (".*");
//- Output format (ascii | binary) - Default=binary
// format binary;
//- Use legacy output format - Default=false
// legacy false;
//- Output directory name - Default="postProcessing/<name>"
// directory "VTK";
//- Write cell ids as field - Default=true
writeIds false;
}
// Solid walls only
walls
{
type vtkWrite;
libs ("libutilityFunctionObjects.so");
log true;
writeControl writeTime;
writeInterval 1;
internal false;
// single true;
regions ( heater "(?i).*solid" );
patches ( "(?i).*solid_to.*" "heater.*(Air|Water)" );
fields (T);
}
// ************************************************************************* //

View File

@ -15,15 +15,69 @@ vtkWrite
//- Use legacy output format - Default=false
// legacy false;
//- Output directory name - Default="VTK"
//- Output directory name - Default="postProcessing/<name>"
// directory "VTK";
//- Write cell ids as field - Default=true
writeIds false;
writeIds false;
//- Write more frequent than fields
writeControl timeStep;
writeInterval 25;
}
subset
{
type vtkWrite;
libs ("libutilityFunctionObjects.so");
log true;
// boundary false;
interpolate true;
// Fields to output (words or regex)
fields (U p);
//- Write cell ids as field - Default=true
writeIds false;
//- Write more frequent than fields
writeControl timeStep;
writeInterval 25;
// Region of interest
selection
{
dome
{
action add;
source sphere;
origin (125 100 0);
radius 100;
}
cylinder
{
action subtract;
source cylinder;
p1 (125 100 0);
p2 (125 100 100);
radius 20;
}
outlet
{
action add;
source box;
box (300 -100 -100) (330 250 100);
}
clipping
{
action subset;
source box;
box (-1000 -1000 -1000) (1000 1000 50);
}
}
}
// ************************************************************************* //