Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
c812b274
Commit
c812b274
authored
Apr 05, 2013
by
andy
Browse files
ENH: Added PV readers for version 3.98.1
parent
5a62444c
Changes
59
Expand all
Hide whitespace changes
Inline
Side-by-side
applications/utilities/postProcessing/graphics/PV398Readers/Allwclean
0 → 100755
View file @
c812b274
#!/bin/sh
cd
${
0
%/*
}
||
exit
1
# run from this directory
set
-x
wclean libso vtkPV398Readers
PV398blockMeshReader/Allwclean
PV398FoamReader/Allwclean
# ----------------------------------------------------------------- end-of-file
applications/utilities/postProcessing/graphics/PV398Readers/Allwmake
0 → 100755
View file @
c812b274
#!/bin/sh
cd
${
0
%/*
}
||
exit
1
# run from this directory
#set -x
if
[
-d
"
$ParaView_DIR
"
-a
-r
"
$ParaView_DIR
"
]
then
[
-n
"
$PV_PLUGIN_PATH
"
]
||
{
echo
"
$0
: PV_PLUGIN_PATH not valid - it is unset"
exit
1
}
# ensure CMake gets the correct C++ compiler
[
-n
"
$WM_CXX
"
]
&&
export
CXX
=
"
$WM_CXX
"
wmake libso vtkPV398Readers
PV398blockMeshReader/Allwmake
PV398FoamReader/Allwmake
else
echo
"ERROR: ParaView not found in
$ParaView_DIR
"
fi
# ----------------------------------------------------------------- end-of-file
applications/utilities/postProcessing/graphics/PV398Readers/PV398FoamReader/Allwclean
0 → 100755
View file @
c812b274
#!/bin/sh
cd
${
0
%/*
}
||
exit
1
# run from this directory
set
-x
# deal with client/server vs combined plugins
rm
-f
$FOAM_LIBBIN
/libPV398FoamReader
*
2>/dev/null
rm
-rf
PV398FoamReader/Make
wclean libso vtkPV398Foam
# ----------------------------------------------------------------- end-of-file
applications/utilities/postProcessing/graphics/PV398Readers/PV398FoamReader/Allwmake
0 → 100755
View file @
c812b274
#!/bin/sh
cd
${
0
%/*
}
||
exit
1
# run from this directory
set
-x
if
[
-d
"
$ParaView_DIR
"
-a
-r
"
$ParaView_DIR
"
]
then
wmake libso vtkPV398Foam
(
cd
PV398FoamReader
mkdir
-p
Make/
$WM_OPTIONS
>
/dev/null 2>&1
cd
Make/
$WM_OPTIONS
cmake ../..
make
)
fi
# ----------------------------------------------------------------- end-of-file
applications/utilities/postProcessing/graphics/PV398Readers/PV398FoamReader/PV398FoamReader/CMakeLists.txt
0 → 100644
View file @
c812b274
# create a plugin that adds a reader to the ParaView GUI
# it is added in the file dialog when doing opens/saves.
# The qrc file is processed by Qt's resource compiler (rcc)
# the qrc file must have a resource prefix of "/ParaViewResources"
# and ParaView will read anything contained under that prefix
# the pqReader.xml file contains xml defining readers with their
# file extensions and descriptions.
CMAKE_MINIMUM_REQUIRED
(
VERSION 2.8
)
FIND_PACKAGE
(
ParaView REQUIRED
)
INCLUDE
(
${
PARAVIEW_USE_FILE
}
)
LINK_DIRECTORIES
(
$ENV{FOAM_LIBBIN}
$ENV{FOAM_EXT_LIBBIN}
)
INCLUDE_DIRECTORIES
(
$ENV{WM_PROJECT_DIR}/src/OpenFOAM/lnInclude
$ENV{WM_PROJECT_DIR}/src/OSspecific/$ENV{WM_OSTYPE}/lnInclude
$ENV{WM_PROJECT_DIR}/src/finiteVolume/lnInclude
${
PROJECT_SOURCE_DIR
}
/../vtkPV398Foam
)
ADD_DEFINITIONS
(
-DWM_$ENV{WM_PRECISION_OPTION}
)
# Set output library destination to plugin folder
SET
(
LIBRARY_OUTPUT_PATH $ENV{PV_PLUGIN_PATH}
CACHE INTERNAL
"Single output directory for building all libraries."
)
#
# Defined combined plugin
#
# Extend the auto-generated panel
QT4_WRAP_CPP
(
MOC_SRCS pqPV398FoamReaderPanel.h
)
ADD_PARAVIEW_OBJECT_PANEL
(
IFACES IFACE_SRCS
CLASS_NAME pqPV398FoamReaderPanel
XML_NAME PV398FoamReader
# name of SourceProxy in *SM.xml
XML_GROUP sources
)
ADD_PARAVIEW_PLUGIN
(
PV398FoamReader_SM
"1.0"
SERVER_MANAGER_XML PV398FoamReader_SM.xml
SERVER_MANAGER_SOURCES vtkPV398FoamReader.cxx
GUI_INTERFACES
${
IFACES
}
GUI_SOURCES pqPV398FoamReaderPanel.cxx
${
MOC_SRCS
}
${
UI_SRCS
}
${
IFACE_SRCS
}
GUI_RESOURCE_FILES PV398FoamReader.xml
)
# #
# # Define the server-side portion of the reader plugin
# #
# ADD_PARAVIEW_PLUGIN(
# PV398FoamReader_SM "1.0"
# SERVER_MANAGER_XML PV398FoamReader_SM.xml
# SERVER_MANAGER_SOURCES vtkPV398FoamReader.cxx
# )
# #
# # Define the client-side portion of the reader plugin
# #
# ADD_PARAVIEW_PLUGIN(
# PV398FoamReader "1.0"
# GUI_RESOURCES PV3FoamReader.qrc
# )
#
TARGET_LINK_LIBRARIES
(
PV398FoamReader_SM
OpenFOAM
finiteVolume
vtkPV398Foam
)
#-----------------------------------------------------------------------------
applications/utilities/postProcessing/graphics/PV398Readers/PV398FoamReader/PV398FoamReader/PV398FoamReader.qrc
0 → 100644
View file @
c812b274
<RCC>
<qresource prefix="/ParaViewResources" >
<file>PV398FoamReader.xml</file>
</qresource>
</RCC>
applications/utilities/postProcessing/graphics/PV398Readers/PV398FoamReader/PV398FoamReader/PV398FoamReader.xml
0 → 100644
View file @
c812b274
<ParaViewReaders>
<Reader
name=
"PV398FoamReader"
extensions=
"OpenFOAM"
file_description=
"OpenFOAM Reader"
>
</Reader>
</ParaViewReaders>
applications/utilities/postProcessing/graphics/PV398Readers/PV398FoamReader/PV398FoamReader/PV398FoamReader_SM.xml
0 → 100644
View file @
c812b274
<ServerManagerConfiguration>
<ProxyGroup
name=
"sources"
>
<SourceProxy
name=
"PV398FoamReader"
class=
"vtkPV398FoamReader"
>
<!-- File name - compulsory -->
<StringVectorProperty
name=
"FileName"
command=
"SetFileName"
number_of_elements=
"1"
animateable=
"0"
>
<FileListDomain
name=
"files"
/>
<Documentation>
Specifies the filename for the OpenFOAM Reader.
</Documentation>
</StringVectorProperty>
<!-- Send discrete time info to the animation panel -->
<DoubleVectorProperty
name=
"TimestepValues"
repeatable=
"1"
information_only=
"1"
>
<TimeStepsInformationHelper/>
<Documentation>
Available timestep values.
</Documentation>
</DoubleVectorProperty>
<!-- Cache Mesh check-box -->
<IntVectorProperty
name=
"UiCacheMesh"
command=
"SetCacheMesh"
number_of_elements=
"1"
is_internal=
"1"
default_values=
"1"
animateable=
"0"
>
<BooleanDomain
name=
"bool"
/>
<Documentation>
Cache the fvMesh in memory.
</Documentation>
</IntVectorProperty>
<!-- Refresh button -->
<IntVectorProperty
name=
"UiRefresh"
command=
"SetRefresh"
number_of_elements=
"1"
is_internal=
"0"
default_values=
"0"
animateable=
"0"
>
<BooleanDomain
name=
"bool"
/>
<Documentation>
Rescan for updated timesteps/fields.
</Documentation>
</IntVectorProperty>
<!-- Skip Zero Time check-box -->
<IntVectorProperty
name=
"UiZeroTime"
command=
"SetSkipZeroTime"
number_of_elements=
"1"
is_internal=
"1"
default_values=
"0"
animateable=
"0"
>
<BooleanDomain
name=
"bool"
/>
<Documentation>
Skip including the 0/ time directory
</Documentation>
</IntVectorProperty>
<!-- Interpolate Fields check-box -->
<IntVectorProperty
name=
"UiInterpolateVolFields"
command=
"SetInterpolateVolFields"
number_of_elements=
"1"
is_internal=
"1"
default_values=
"1"
animateable=
"0"
>
<BooleanDomain
name=
"bool"
/>
<Documentation>
Interpolate volume fields into point fields
</Documentation>
</IntVectorProperty>
<!-- Extrapolate Patches check-box -->
<IntVectorProperty
name=
"UiExtrapolatePatches"
command=
"SetExtrapolatePatches"
number_of_elements=
"1"
is_internal=
"1"
default_values=
"0"
animateable=
"0"
>
<BooleanDomain
name=
"bool"
/>
<Documentation>
Extrapolate internalField to non-constraint patches
</Documentation>
</IntVectorProperty>
<!-- Use VTK Polyhedron check-box -->
<IntVectorProperty
name=
"UseVTKPolyhedron"
command=
"SetUseVTKPolyhedron"
number_of_elements=
"1"
default_values=
"0"
animateable=
"0"
>
<BooleanDomain
name=
"bool"
/>
<Documentation>
Use vtkPolyhedron instead of decomposing polyhedra.
</Documentation>
</IntVectorProperty>
<!-- Include Sets check-box -->
<IntVectorProperty
name=
"UiIncludeSets"
command=
"SetIncludeSets"
number_of_elements=
"1"
is_internal=
"1"
default_values=
"0"
animateable=
"0"
>
<Documentation>
Search the polyMesh/sets/ directory
</Documentation>
<BooleanDomain
name=
"bool"
/>
</IntVectorProperty>
<!-- Include Zones check-box -->
<IntVectorProperty
name=
"UiIncludeZones"
command=
"SetIncludeZones"
number_of_elements=
"1"
is_internal=
"1"
default_values=
"0"
animateable=
"0"
>
<Documentation>
ZoneMesh information is used to find {cell,face,point}Zones.
The polyMesh/ directory is only checked on startup.
</Documentation>
<BooleanDomain
name=
"bool"
/>
</IntVectorProperty>
<!-- Show Patch Names check-box -->
<IntVectorProperty
name=
"UiShowPatchNames"
command=
"SetShowPatchNames"
number_of_elements=
"1"
default_values=
"0"
is_internal=
"1"
animateable=
"0"
>
<BooleanDomain
name=
"bool"
/>
<Documentation>
Show patch names in render window
</Documentation>
</IntVectorProperty>
<!-- Show Groups Only check-box -->
<IntVectorProperty
name=
"UiShowGroupsOnly"
command=
"SetShowGroupsOnly"
number_of_elements=
"1"
default_values=
"0"
is_internal=
"1"
animateable=
"0"
>
<BooleanDomain
name=
"bool"
/>
<Documentation>
Show groups only
</Documentation>
</IntVectorProperty>
<!-- Force GUI update check box -->
<IntVectorProperty
name=
"UpdateGUI"
command=
"SetUpdateGUI"
number_of_elements=
"1"
default_values=
"0"
animateable=
"0"
>
<BooleanDomain
name=
"bool"
/>
<Documentation>
A simple way to cause a reader GUI modification.
</Documentation>
</IntVectorProperty>
<!--
| Selections
-->
<!-- Available Parts (volume, patches, lagrangian) array -->
<StringVectorProperty
name=
"PartArrayStatus"
information_only=
"1"
>
<ArraySelectionInformationHelper
attribute_name=
"Part"
/>
</StringVectorProperty>
<StringVectorProperty
name=
"PartStatus"
label=
"Mesh Parts"
command=
"SetPartArrayStatus"
number_of_elements=
"0"
repeat_command=
"1"
number_of_elements_per_command=
"2"
element_types=
"2 0"
information_property=
"PartArrayStatus"
animateable=
"0"
>
<ArraySelectionDomain
name=
"array_list"
>
<RequiredProperties>
<Property
name=
"PartArrayStatus"
function=
"ArrayList"
/>
</RequiredProperties>
</ArraySelectionDomain>
<Documentation>
This property contains a list of the mesh parts
(patches, groups, sets, zones).
</Documentation>
</StringVectorProperty>
<!-- Available volFields array -->
<StringVectorProperty
name=
"VolFieldArrayStatus"
information_only=
"1"
>
<ArraySelectionInformationHelper
attribute_name=
"VolField"
/>
</StringVectorProperty>
<StringVectorProperty
name=
"VolFieldStatus"
label=
"Volume Fields"
command=
"SetVolFieldArrayStatus"
number_of_elements=
"0"
repeat_command=
"1"
number_of_elements_per_command=
"2"
element_types=
"2 0"
information_property=
"VolFieldArrayStatus"
animateable=
"0"
>
<ArraySelectionDomain
name=
"array_list"
>
<RequiredProperties>
<Property
name=
"VolFieldArrayStatus"
function=
"ArrayList"
/>
</RequiredProperties>
</ArraySelectionDomain>
<Documentation>
This property contains a list of the volume fields
</Documentation>
</StringVectorProperty>
<!-- Available Lagrangian fields array -->
<StringVectorProperty
name=
"LagrangianFieldArrayStatus"
information_only=
"1"
>
<ArraySelectionInformationHelper
attribute_name=
"LagrangianField"
/>
</StringVectorProperty>
<StringVectorProperty
name=
"LagrangianFieldStatus"
label=
"Lagrangian Fields"
command=
"SetLagrangianFieldArrayStatus"
number_of_elements=
"0"
repeat_command=
"1"
number_of_elements_per_command=
"2"
element_types=
"2 0"
information_property=
"LagrangianFieldArrayStatus"
animateable=
"0"
>
<ArraySelectionDomain
name=
"array_list"
>
<RequiredProperties>
<Property
name=
"LagrangianFieldArrayStatus"
function=
"ArrayList"
/>
</RequiredProperties>
</ArraySelectionDomain>
<Documentation>
This property contains a list of the lagrangian fields
</Documentation>
</StringVectorProperty>
<!-- Available pointFields array -->
<StringVectorProperty
name=
"PointFieldArrayStatus"
information_only=
"1"
>
<ArraySelectionInformationHelper
attribute_name=
"PointField"
/>
</StringVectorProperty>
<StringVectorProperty
name=
"PointFieldStatus"
label=
"Point Fields"
command=
"SetPointFieldArrayStatus"
number_of_elements=
"0"
repeat_command=
"1"
number_of_elements_per_command=
"2"
element_types=
"2 0"
information_property=
"PointFieldArrayStatus"
animateable=
"0"
>
<ArraySelectionDomain
name=
"array_list"
>
<RequiredProperties>
<Property
name=
"PointFieldArrayStatus"
function=
"ArrayList"
/>
</RequiredProperties>
</ArraySelectionDomain>
<Documentation>
This property contains a list of the point fields
</Documentation>
</StringVectorProperty>
<Hints>
<Property
name=
"FileName"
show=
"0"
/>
<Property
name=
"UiCacheMesh"
show=
"0"
/>
<Property
name=
"UiZeroTime"
show=
"0"
/>
<Property
name=
"UiRefresh"
show=
"0"
/>
<Property
name=
"UiShowPatchNames"
show=
"0"
/>
<Property
name=
"UiShowGroupsOnly"
show=
"0"
/>
<Property
name=
"UiIncludeSets"
show=
"0"
/>
<Property
name=
"UiIncludeZones"
show=
"0"
/>
</Hints>
</SourceProxy>
</ProxyGroup>
</ServerManagerConfiguration>
applications/utilities/postProcessing/graphics/PV398Readers/PV398FoamReader/PV398FoamReader/pqPV398FoamReaderPanel.cxx
0 → 100644
View file @
c812b274
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include
"pqPV398FoamReaderPanel.h"
// QT
#include
<QGridLayout>
#include
<QCheckBox>
#include
<QLabel>
#include
<QLayout>
#include
<QString>
#include
<QPushButton>
#include
<QtDebug>
// Paraview <-> QT UI
#include
"pqAnimationScene.h"
#include
"pqApplicationCore.h"
#include
"pqPipelineRepresentation.h"
#include
"pqServerManagerModel.h"
#include
"pqView.h"
// Paraview Server Manager
#include
"vtkSMDoubleVectorProperty.h"
#include
"vtkSMIntVectorProperty.h"
#include
"vtkSMProperty.h"
#include
"vtkSMSourceProxy.h"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
pqPV398FoamReaderPanel
::
pqPV398FoamReaderPanel
(
pqProxy
*
proxy
,
QWidget
*
p
)
:
pqAutoGeneratedObjectPanel
(
proxy
,
p
)
{
// create first sublayout (at top of the panel)
QGridLayout
*
form
=
new
QGridLayout
();
this
->
PanelLayout
->
addLayout
(
form
,
0
,
0
,
1
,
-
1
);
// ROW 0
// ~~~~~
vtkSMProperty
*
prop
=
0
;
// refresh button for updating times/fields
if
((
prop
=
this
->
proxy
()
->
GetProperty
(
"UiRefresh"
))
!=
0
)
{
prop
->
SetImmediateUpdate
(
1
);
QPushButton
*
refresh
=
new
QPushButton
(
"Refresh Times"
);
refresh
->
setToolTip
(
"Rescan for updated times/fields."
);
form
->
addWidget
(
refresh
,
0
,
0
,
Qt
::
AlignLeft
);
QObject
::
connect
(
refresh
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
RefreshPressed
())
);
}
// checkbox for skip zeroTime
if
((
prop
=
this
->
proxy
()
->
GetProperty
(
"UiZeroTime"
))
!=
0
)
{
// immediate update on the Server Manager side
prop
->
SetImmediateUpdate
(
true
);
ZeroTime_
=
new
QCheckBox
(
"Skip Zero Time"
);
ZeroTime_
->
setChecked
(
vtkSMIntVectorProperty
::
SafeDownCast
(
prop
)
->
GetElement
(
0
)
);
ZeroTime_
->
setToolTip