Commit Graph

291 Commits

Author SHA1 Message Date
Mark Olesen
a42c35f64b ENH: paraview reader module with internal caching of the vtk geometries
- The reader module allows two levels of caching.
  The OpenFOAM fvMesh can be cached in memory, for faster loading of
  fields. Additionally, the translated VTK geometries are held in a
  local cache. The cached VTK geometries should incur no additional
  overhead since they use the VTK reference counting for their storage
  management.
2017-05-24 17:12:49 +02:00
Mark Olesen
96d98cd2de ENH: paraFoam --help => immediate pass-through to paraview --help
ENH: Paraview modules.

- Update props with int, not bool (for more versatility)
- Set properties and tool-tips directly on widgets instead of buttons
2017-05-23 08:02:25 +02:00
Mark Olesen
8a66ec9975 ENH: replace paraview vtk conversion with library utilities
- this allows filling in the VTK structures without intermediate data
  and without sequencial insertion. Should be faster and smaller
  than the previous cell-wise insertion methods.
  Most importantly, it improves code reuse.
2017-05-15 13:01:38 +02:00
Mark Olesen
1f18a0f97f ENH: replace internal meshmaps with foamVtkMeshMaps 2017-05-15 12:57:36 +02:00
Mark Olesen
2f288cfbef ENH: first pv reader version with delayed assembly of output blocks
- this greatly simplifies data management and opens the possibility of
  reusing converted vtk meshes instead of converting each time.
2017-05-15 02:06:53 +02:00
Mark Olesen
cf5ebd82db ENH: improve internal bookkeeping in paraview readers
- has the selected values directly and use these lookup names to store
  directly into a hash. This replaces several parallel lists of
  decomp information etc and makes it easier.
2017-05-14 21:42:59 +02:00
Mark Olesen
09f0cfd5c7 STYLE: reduce number of small methods in paraview reader
- improves the overview of the code
2017-05-14 21:38:15 +02:00
Mark Olesen
48bf71dd26 STYLE: avoid VTK InsertNextPoint if we already know the sizes
- avoids potentially issues if we reusing a vtkPoints array,
  and should be marginally faster without the additional
  range checking.
2017-05-14 21:24:06 +02:00
Mark Olesen
2e0337d024 ENH: use smart pointers for paraview readers
- adds flexiblity and reduces risk of memory leaks as we add/change
  features

STYLE: adjust naming for paraview internal polyDecomp
2017-05-14 21:04:11 +02:00
Mark Olesen
71710e0798 ENH: use prefix when displaying group,patch names for paraview selection
- easier to detect the implicit grouping
2017-05-12 15:37:04 +02:00
Mark Olesen
e5cdee5dd9 STYLE: use labelRange and range-based-for in paraview readers
- also use updated forAll* macros
2017-05-12 15:36:44 +02:00
Andrew Heather
db5348880e MRG: resolved merge conflicts from merge from develop branch 2017-05-19 16:29:54 +01:00
Mark Olesen
15d0a918c5 COMP: use VTK_OVERRIDE on paraview methods
COMP: avoid undefined-var-template warning in runTimePostProcessing
2017-05-18 13:21:48 +02:00
Mark Olesen
3814762785 ENH: relocate triSurface classes into surfMesh library (issue #294)
- simplifies organization, includes, linkage etc.
2017-05-18 10:42:05 +02:00
Andrew Heather
2e9bead519 MRG: merged develop line back into integration branch 2017-05-18 11:11:12 +01:00
Mark Olesen
8728e8353f STYLE: avoid explicit use of 'word' as HashTable template parameter
- less clutter and typing to use the default template parameter when
  the key is 'word' anyhow.

- use EdgeMap instead of the longhand HashTable version where
  appropriate
2017-05-10 13:44:27 +02:00
Andrew Heather
436ec1cf1f MRG: Integrated Foundation code to commit ba4dbed 2017-03-23 12:11:49 +00:00
Mark Olesen
5fc6c3ca34 ENH: provide FOAM_EXECUTABLE as environment variable in argList
- can be used directly from within an application or function-object.
  Makes it available for dictionaries.
2017-02-24 17:48:13 +01:00
Mark Olesen
1bdb57985f COMP: drop FOAM_EXT_LIBBIN dependency for VTK-related items
- they don't use scotch/metis anyhow, which are the only things
  placed in FOAM_EXT_LIBBIN
2017-04-04 16:22:12 +02:00
Mark Olesen
c1ca2f4a38 BUG: missing chdir in Allwclean for wallFunctionTable
STYLE: improve consistency in Allwclean scripts
2017-02-23 01:07:10 +01:00
Mark Olesen
3d02c8a530 ENH: improve isolation of shell variables in wmake scripts
- reduces unexpected interactions between various make elements
2017-02-10 16:13:54 +01:00
Henry Weller
5dd24f4968 Removed unhelpful clutter 2017-01-26 17:47:24 +00:00
Mark Olesen
9d63cc5ca8 ENH: add versioning for VTK library to runTimePostProcessing (issue #370)
Eg,
    librunTimePostProcessing.so
    librunTimePostProcessing.so.7 -> librunTimePostProcessing.so.7.1.0
    librunTimePostProcessing.so.7.1.0

- centralize handling of paraview/vtk versioning into wmake/cmakeFunctions
2017-01-23 13:37:42 +01:00
Henry Weller
8632583934 Removed trailing blank lines
Resolves bug-report https://bugs.openfoam.org/view.php?id=2438
2017-01-19 20:17:47 +00:00
Mark Olesen
f47e8513d7 ENH: avoid deprecated paraview method SetImmediateUpdate()
- add support for patch names in block mesh reader.
2017-01-12 11:41:15 +01:00
Mark Olesen
ecb80a2ee8 ENH: refactor paraview readers code to avoid duplication
- as originally intended years ago, but never actually done.

- use 'foamPvCore' instead of 'vtkPVReaders' to avoid potential name
  collisions with any 'vtk*' files and since we may reuse these
  functions in other foam-paraview modules (not just readers).

STYLE: use same font size/colour for patch-names as for point-numbers

BUG: repair issue with single time-step

- paraview time-selector returns '0' as the requested time if there is
  only one time step. However, if we have skipped the 0/ directory,
  this single time step is likely a non-zero value.
2017-01-12 06:40:58 +01:00
Mark Olesen
7a90f5e6fb ENH: add versioning to paraview plugin support libraries (issue #370)
- use "-pvMAJ.MIN" suffix for similarity with the paraview convention

- use sentinel file to ensure clean change of intermediate targets

- ensure all library files are being properly removed
2017-01-05 16:22:07 +01:00
Mark Olesen
2c96ec7550 ENH: update QT interface code for ParaView reader (issue #337)
- remove old (ParaView-3) files

- Works in 4.4.0, 5.0.1, 5.2.0 etc

STYLE:
- slots now use SM properties directly without a second lookup.
  This reduces exposure of the QT elements and simplifies the coding.

- avoid focus borders on the Qt elements

- place the "use Polyhedron" checkbox into a column

- move "Cache Mesh" down in the GUI (an advanced feature and thus
  should be less prominent)

- obtain button labels/tooltip directly from the XML content
2017-01-05 11:31:11 +01:00
Mark Olesen
4eb679614c ENH: update blockMesh reader (issue #337)
- use property group customization instead of individual pqPropertyWidget
2017-01-04 12:27:36 +01:00
Mark Olesen
71ea6bec62 ENH: update blockMesh reader for paraview 5.2 (issue #337)
- although this is not the final desired form, since it uses
  individual pqPropertyWidget customizations (ie, ugly layout, too
  many bits of code), but is an interesting intermediate solution
  that may be useful in other contexts.
2017-01-04 10:48:13 +01:00
Mark Olesen
608bb5d83b COMP: update lnInclude directories when building (issue #364)
- Could be related to interrupted builds.
  So if there are any parts of the build that rely on an explicit
  'wmakeLnInclude', make sure that the contents are properly updated.

--

ENH: improved feedback from top-level Allwmake

- Report which section (libraries, applications) is being built.

- Provide final summary of date, version, etc, which can be helpful
  for later diagnosis or record keeping.

- The -log=XXX option for Allwmake now accepts a directory name
  and automatically appends an appropriate log name.
  Eg,
      ./Allwmake -log=logs/  ->> logs/log.linux64GccDPInt32Opt

  The default name is built from the value of WM_OPTIONS.

--

BUG: shell not exiting properly in combination with -log option

- the use of 'tee' causes the shell to hang around.
  Added an explicit exit to catch this.

--

- Detecting the '-k' (-non-stop) option at the top-level Allwmake, which
  may improve robustness.

- Explicit continue-on-error for foamyMesh (as optional component)

- unify format of script messages for better readability

COMP: reduce warnings when building Pstream (old-style casts in openmpi)
2016-12-22 11:26:29 +01:00
Andrew Heather
c0f44ac4f3 MRG: Integrated foundation code 2016-12-12 12:10:29 +00:00
Henry Weller
3d08651324 PVReaders: Update link order to avoid problems on Ubuntu
Resolves bug-report http://bugs.openfoam.org/view.php?id=2372
2016-12-06 10:57:35 +00:00
Mark Olesen
a2bba390f2 COMP: improve robustness of cmake (vtk) builds when directories have moved 2016-11-28 23:28:21 +01:00
Mark Olesen
b69ab6c895 COMP: reduce compile noise for paraview modules
- vtkkwiml headers use old-style casts, so reduce compile-time warnings
2016-11-28 22:34:38 +01:00
Henry Weller
80db302666 Allwmake: Remove 'set -x' which generates a lot of noise
'set -x' should be used for debugging.

Added command printing into wmake and Allwmake as a replacement for
'set -x' to log current target.
2016-11-13 18:08:22 +00:00
Mark Olesen
8e30111b44 DEFEATURE: drop reader module support for paraview 3.x (issue #295)
- Cannot test if these older reader modules actually build,
  owning largely to build issues since with paraview 3.14 (Feb 2012)
  and paraview 3.98 (Dec 2012) themselves.
2016-11-11 13:30:30 +01:00
Henry Weller
23795a7fb5 PVblockMeshReader: Removed unnecessary 'UpdateGUI' button
The 'Refresh' button updates the blockMesh and the GUI.
2016-11-11 12:17:53 +00:00
Henry Weller
74cfb6bf34 PVblockMeshReader: Remove old vertex labels on refresh 2016-11-05 21:41:32 +00:00
Henry Weller
a21c3d6332 PVblockMeshReader: Added "Refresh" button to update the blockMesh
Reconstructs the blockMesh and updates the display from the current
blockMeshDict so that any changes can viewed without exiting
paraFoam -block
2016-11-04 20:50:13 +00:00
Henry Weller
3ab919d407 paraFoam -block: Added support for vertex and block names
Patch contributed by Mattijs Janssens
2016-11-04 17:29:02 +00:00
Mark Olesen
d2fc2c9edc ENH: improved infrastructure for writing VTK content
Note: classes are prefixed with 'foamVtk' instead of 'vtk' to avoid potential
conflicts with VTK itself.

foamVtkCore
~~~~~~~~~~~
- General very low-level functionality.

foamVtkPTraits
~~~~~~~~~~~~~~
- Traits type of functionality for VTK

foamVtkOutputOptions
~~~~~~~~~~~~~~~~~~~~
- The various format output options as a class that can be passed to
  formatters etc.

foamVtkCells
~~~~~~~~~~~~
- Intended for unifying vtkTopo and PV-Reader code in the future.
- Handles polyhedron decompose internally etc

foamVtkOutput, foamVtkFormatter
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Output helpers.
- Selector for individual formatters.
  Currently write all scalar data a 'float' (not 'double'). Can
  revisit this in the future.
2016-11-03 14:24:00 +01:00
Henry Weller
009203188f blockMesh: New experimental support for projecting block face point to geometric surfaces
For example, to mesh a sphere with a single block the geometry is defined in the
blockMeshDict as a searchableSurface:

    geometry
    {
        sphere
        {
            type searchableSphere;
            centre (0 0 0);
            radius 1;
        }
    }

The vertices, block topology and curved edges are defined in the usual
way, for example

    v 0.5773502;
    mv -0.5773502;

    a 0.7071067;
    ma -0.7071067;

    vertices
    (
        ($mv $mv $mv)
        ( $v $mv $mv)
        ( $v  $v $mv)
        ($mv  $v $mv)
        ($mv $mv  $v)
        ( $v $mv  $v)
        ( $v  $v  $v)
        ($mv  $v  $v)
    );

    blocks
    (
        hex (0 1 2 3 4 5 6 7) (10 10 10) simpleGrading (1 1 1)
    );

    edges
    (
        arc 0 1 (0 $ma $ma)
        arc 2 3 (0 $a $ma)
        arc 6 7 (0 $a $a)
        arc 4 5 (0 $ma $a)

        arc 0 3 ($ma 0 $ma)
        arc 1 2 ($a 0 $ma)
        arc 5 6 ($a 0 $a)
        arc 4 7 ($ma 0 $a)

        arc 0 4 ($ma $ma 0)
        arc 1 5 ($a $ma 0)
        arc 2 6 ($a $a 0)
        arc 3 7 ($ma $a 0)
    );

which will produce a mesh in which the block edges conform to the sphere
but the faces of the block lie somewhere between the original cube and
the spherical surface which is a consequence of the edge-based
transfinite interpolation.

Now the projection of the block faces to the geometry specified above
can also be specified:

    faces
    (
        project (0 4 7 3) sphere
        project (2 6 5 1) sphere
        project (1 5 4 0) sphere
        project (3 7 6 2) sphere
        project (0 3 2 1) sphere
        project (4 5 6 7) sphere
    );

which produces a mesh that actually conforms to the sphere.

See OpenFOAM-dev/tutorials/mesh/blockMesh/sphere

This functionality is experimental and will undergo further development
and generalization in the future to support more complex surfaces,
feature edge specification and extraction etc.  Please get involved if
you would like to see blockMesh become a more flexible block-structured
mesher.

Henry G. Weller, CFD Direct.
2016-10-13 15:05:24 +01:00
Henry Weller
8dd18cc077 vtkPVblockMeshConvert: Updated to use the new blockDescriptor::edgesPointsWeights 2016-10-09 17:52:52 +01:00
Henry Weller
50b549f368 blockMesh: rationalizing class and member names 2016-10-08 19:48:39 +01:00
Henry Weller
9e1e9011a5 decomposePar: Corrected construction of cloud for processors
Resolves bug-report http://bugs.openfoam.org/view.php?id=2239
2016-09-21 17:19:58 +01:00
Henry Weller
49bce39429 PV*Readers/Allwmake: set CXX and CC if required
Patch contributed by Bruno Santos
Resolves bug-report http://bugs.openfoam.org/view.php?id=2233
2016-09-04 21:05:20 +01:00
Henry Weller
bf9c6b6d17 foamToVTK, PVFoamReader: Resolve problems converting VTK_WEDGE
- There will be triangles rendered inside the mesh (when
    surface-rendering), because one of the cell's triangles is defined
    as a quadrangle in VTK_WEDGE.

  - Therefore, this VTK_WEDGE representation is only used when
    decomposing the mesh, otherwise the correct representation is done
    by VTK_POLYHEDRON.

  - Furthermore, using VTK_PYRAMID gave worse result, because it renders
    2 triangles inside the mesh for the collapsed quadrangle, likely due
    to mismatch with the adjacent cell's face.

  - Using VTK_HEXAHEDRON was not tested in this iteration, given that it
    should give even worse results, when compared to using VTK_PYRAMID.

Patch contributed by Bruno Santos
Resolves bug-report http://bugs.openfoam.org/view.php?id=2099
2016-08-24 22:08:10 +01:00
Henry Weller
72bd9fd6cd ParaView: GUI resource files in plugins are no longer supported
Patch contributed by Bruno Santos
Resolves bug-report http://bugs.openfoam.org/view.php?id=2192
2016-08-16 08:46:39 +01:00
Henry Weller
58f905ff70 C++11: Replaced the C NULL with the safer C++11 nullptr
Requires gcc version 4.7 or higher
2016-08-05 17:19:38 +01:00