Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
OpenFOAM-plus
Commits
b9841df8
Commit
b9841df8
authored
Apr 03, 2018
by
Mark Olesen
Browse files
Merge branch 'feature-catalyst' into 'develop'
Feature catalyst See merge request
!195
parents
c2cdc2cc
b54f2dc1
Changes
17
Hide whitespace changes
Inline
Side-by-side
.gitmodules
View file @
b9841df8
...
...
@@ -4,3 +4,6 @@
[submodule "avalanche"]
path = modules/avalanche
url = https://develop.openfoam.com/Community/avalanche.git
[submodule "modules/catalyst"]
path = modules/catalyst
url = https://develop.openfoam.com/Community/catalyst.git
applications/utilities/postProcessing/graphics/PVReaders/foamPv/Make/options
View file @
b9841df8
...
...
@@ -2,6 +2,7 @@ sinclude $(GENERAL_RULES)/paraview
EXE_INC = \
${c++LESSWARN} \
-I$(LIB_SRC)/conversion/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(ParaView_INCLUDE_DIR) \
-I$(ParaView_INCLUDE_DIR)/vtkkwiml
...
...
applications/utilities/postProcessing/graphics/PVReaders/foamPv/foamPvCore.C
View file @
b9841df8
...
...
@@ -34,16 +34,6 @@ License
#include "vtkInformation.h"
#include "vtkSmartPointer.h"
#include "foamVtkAdaptors.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace
Foam
{
defineTypeNameAndDebug
(
foamPvCore
,
0
);
}
// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
Foam
::
Ostream
&
Foam
::
foamPvCore
::
printDataArraySelection
...
...
@@ -103,13 +93,14 @@ void Foam::foamPvCore::addToBlock
output
->
SetBlock
(
blockNo
,
block
);
}
if
(
debug
)
#
if
def FULLDEBUG
{
Info
<<
"block["
<<
blockNo
<<
"] has "
<<
block
->
GetNumberOfBlocks
()
<<
" datasets prior to adding set "
<<
datasetNo
<<
" with name: "
<<
datasetName
<<
endl
;
}
#endif
block
->
SetBlock
(
datasetNo
,
dataset
);
...
...
@@ -192,9 +183,8 @@ Foam::foamPvCore::getSelectedArraySet
}
}
if
(
debug
>
1
)
#
if
def FULLDEBUG
{
const
int
n
=
select
->
GetNumberOfArrays
();
Info
<<
"available("
;
for
(
int
i
=
0
;
i
<
n
;
++
i
)
{
...
...
@@ -208,6 +198,7 @@ Foam::foamPvCore::getSelectedArraySet
}
Info
<<
" )
\n
"
;
}
#endif
return
enabled
;
}
...
...
@@ -238,7 +229,7 @@ Foam::word Foam::foamPvCore::getFoamName(const std::string& str)
{
if
(
str
.
size
())
{
std
::
string
::
size_type
beg
=
str
.
rfind
(
'/'
);
auto
beg
=
str
.
rfind
(
'/'
);
if
(
beg
==
std
::
string
::
npos
)
{
beg
=
0
;
...
...
@@ -248,7 +239,7 @@ Foam::word Foam::foamPvCore::getFoamName(const std::string& str)
++
beg
;
}
std
::
string
::
size_type
end
=
beg
;
auto
end
=
beg
;
while
(
str
[
end
]
&&
word
::
valid
(
str
[
end
]))
{
...
...
@@ -274,29 +265,4 @@ void Foam::foamPvCore::printMemory()
}
vtkSmartPointer
<
vtkCellArray
>
Foam
::
foamPvCore
::
identityVertices
(
const
label
size
)
{
// VTK_VERTEX
auto
cells
=
vtkSmartPointer
<
vtkCellArray
>::
New
();
UList
<
vtkIdType
>
cellsUL
=
vtkUList
(
cells
,
size
,
2
*
size
);
// Cell connectivity for vertex
// [size, ids.., size, ids...]
// which means
// [1, id, 1, id, ...]
label
idx
=
0
;
for
(
label
id
=
0
;
id
<
size
;
++
id
)
{
cellsUL
[
idx
++
]
=
1
;
cellsUL
[
idx
++
]
=
id
;
}
return
cells
;
}
// ************************************************************************* //
applications/utilities/postProcessing/graphics/PVReaders/foamPv/foamPvCore.H
View file @
b9841df8
...
...
@@ -26,13 +26,13 @@ Description
SourceFiles
foamPvCore.C
foamPvCoreTemplates.C
\*---------------------------------------------------------------------------*/
#ifndef foamPvCore_H
#define foamPvCore_H
#include "className.H"
#include "fileName.H"
#include "stringList.H"
#include "boolList.H"
...
...
@@ -167,25 +167,10 @@ public:
};
// End class arrayRange
private:
// Private Member Functions
//- Disallow default bitwise copy construct
foamPvCore
(
const
foamPvCore
&
)
=
delete
;
//- Disallow default bitwise assignment
void
operator
=
(
const
foamPvCore
&
)
=
delete
;
public:
//- Static data members
ClassName
(
"foamPvCore"
);
//- Construct null
foamPvCore
()
=
default
;
constexpr
foamPvCore
()
noexcept
{}
//- Print information about vtkDataArraySelection
...
...
@@ -308,13 +293,6 @@ public:
static
void
printMemory
();
//- Return an identity list of VTK_VERTEX
static
vtkSmartPointer
<
vtkCellArray
>
identityVertices
(
const
label
size
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
};
// End class foamPvCore
...
...
applications/utilities/postProcessing/graphics/PVReaders/foamPv/foamVtkAdaptors.H
deleted
100644 → 0
View file @
c2cdc2cc
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2017 OpenCFD Ltd.
\\/ 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/>.
\*---------------------------------------------------------------------------*/
#ifndef foamVtkAdaptors_H
#define foamVtkAdaptors_H
// OpenFOAM includes
#include "labelList.H"
// VTK includes
#include "vtkCellArray.h"
#include "vtkIdTypeArray.h"
#include "vtkSmartPointer.h"
#include "vtkUnsignedCharArray.h"
#include "vtkAOSDataArrayTemplate.h"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace
Foam
{
//- Attach a smart pointer, or generate a non-null one.
template
<
class
T
>
inline
vtkSmartPointer
<
T
>
nonNullSmartPointer
(
T
*
ptr
)
{
return
vtkSmartPointer
<
T
>
(
ptr
?
ptr
:
T
::
New
());
}
//- Helper to wrap vtkUnsignedCharArray as a UList
inline
UList
<
uint8_t
>
vtkUList
(
vtkUnsignedCharArray
*
array
,
const
label
size
)
{
array
->
SetNumberOfComponents
(
1
);
array
->
SetNumberOfTuples
(
size
);
UList
<
uint8_t
>
list
(
array
->
WritePointer
(
0
,
size
),
size
);
return
list
;
}
//- Helper to wrap vtkIdTypeArray as a UList
inline
UList
<
vtkIdType
>
vtkUList
(
vtkIdTypeArray
*
array
,
const
label
size
)
{
array
->
SetNumberOfComponents
(
1
);
array
->
SetNumberOfTuples
(
size
);
UList
<
vtkIdType
>
list
(
array
->
WritePointer
(
0
,
size
),
size
);
return
list
;
}
//- Special helper to wrap vtkCellArray as a UList
inline
UList
<
vtkIdType
>
vtkUList
(
vtkCellArray
*
cells
,
const
label
nCells
,
const
label
size
)
{
cells
->
GetData
()
->
SetNumberOfTuples
(
size
);
UList
<
vtkIdType
>
list
(
cells
->
WritePointer
(
nCells
,
size
),
size
);
return
list
;
}
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //
applications/utilities/postProcessing/graphics/PVReaders/vtkPVFoam/vtkPVFoam.H
View file @
b9841df8
...
...
@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2017
-2018
OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
...
...
@@ -72,6 +72,7 @@ SourceFiles
#include "PrimitivePatchInterpolation.H"
#include "volPointInterpolation.H"
#include "foamPvCore.H"
#include "foamVtkTools.H"
#include "foamVtkMeshMaps.H"
#include "vtkPoints.h"
...
...
@@ -115,112 +116,53 @@ template<class Type> class List;
class
vtkPVFoam
:
private
foamPvCore
private
foamPvCore
,
protected
vtk
::
Tools
{
// Convenience typedefs
typedef
PrimitivePatchInterpolation
<
primitivePatch
>
patchInterpolator
;
// Private classes
//- Bookkeeping for internal caching.
// Retain an original copy of the geometry as well as a shallow copy
// with the output fields.
// The original copy is reused for different timestep
template
<
class
DataType
>
struct
foamVtkCaching
{
typedef
DataType
dataType
;
//- The geometry, without any cell/point data
vtkSmartPointer
<
dataType
>
vtkgeom
;
//- The shallow-copy of geometry, plus additional data
vtkSmartPointer
<
dataType
>
dataset
;
//- Number of points associated with geometry
inline
uint64_t
nPoints
()
const
{
return
vtkgeom
?
vtkgeom
->
GetNumberOfPoints
()
:
0
;
}
//- Clear geometry and dataset
void
clearGeom
()
{
vtkgeom
=
nullptr
;
dataset
=
nullptr
;
}
//- Return a shallow copy of vtkgeom for manipulation
vtkSmartPointer
<
dataType
>
getCopy
()
const
{
auto
copy
=
vtkSmartPointer
<
dataType
>::
New
();
if
(
vtkgeom
)
{
copy
->
ShallowCopy
(
vtkgeom
);
}
return
copy
;
}
//- Make a shallow copy of vtkgeom into dataset
void
reuse
()
{
dataset
=
vtkSmartPointer
<
dataType
>::
New
();
if
(
vtkgeom
)
{
dataset
->
ShallowCopy
(
vtkgeom
);
}
}
//- Set the geometry and make a shallow copy to dataset
void
set
(
vtkSmartPointer
<
dataType
>
geom
)
{
vtkgeom
=
geom
;
reuse
();
}
//- Report basic information to output
void
PrintSelf
(
std
::
ostream
&
os
)
const
{
os
<<
"geom"
<<
nl
;
if
(
vtkgeom
)
{
vtkgeom
->
PrintSelf
(
std
::
cout
,
vtkIndent
(
2
));
}
else
{
os
<<
"nullptr"
;
}
os
<<
nl
;
os
<<
"copy"
<<
nl
;
if
(
dataset
)
{
dataset
->
PrintSelf
(
std
::
cout
,
vtkIndent
(
2
));
}
else
{
os
<<
"nullptr"
;
}
os
<<
nl
;
}
};
//- Bookkeeping for vtkPolyData
struct
foamVtpData
:
public
foamVtk
Caching
<
vtkPolyData
>
,
public
vtk
::
Caching
<
vtkPolyData
>
,
public
foamVtkMeshMaps
{};
//- Bookkeeping for vtkUnstructuredGrid
struct
foamVtuData
:
public
foamVtk
Caching
<
vtkUnstructuredGrid
>
,
public
vtk
::
Caching
<
vtkUnstructuredGrid
>
,
public
foamVtkMeshMaps
{};
{
//- The vtk points for the mesh (and decomposition)
vtkSmartPointer
<
vtkPoints
>
points
(
const
fvMesh
&
mesh
)
const
;
//- The vtk points for the mesh (and decomposition),
//- using the provided pointMap
vtkSmartPointer
<
vtkPoints
>
points
(
const
fvMesh
&
mesh
,
const
labelUList
&
pointMap
)
const
;
//- Internal mesh as vtkUnstructuredGrid
vtkSmartPointer
<
vtkUnstructuredGrid
>
internal
(
const
fvMesh
&
mesh
,
const
bool
decompPoly
);
//- Subsetted mesh as vtkUnstructuredGrid
vtkSmartPointer
<
vtkUnstructuredGrid
>
subset
(
const
fvMeshSubset
&
subsetter
,
const
bool
decompPoly
);
};
// Private Data
...
...
@@ -294,7 +236,7 @@ class vtkPVFoam
//- Reset data counters
void
resetCounters
();
// Update information helper functions
// Update information helper functions
//- Internal mesh info
void
updateInfoInternalMesh
(
vtkDataArraySelection
*
select
);
...
...
@@ -347,7 +289,7 @@ class vtkPVFoam
void
updateInfoLagrangianFields
(
vtkDataArraySelection
*
select
);
// Mesh conversion functions
// Mesh conversion functions
//- Convert internalMesh
void
convertMeshVolume
();
...
...
@@ -385,53 +327,7 @@ class vtkPVFoam
void
convertMeshPointSets
();
// Add mesh functions
//- Generate vtk points for the current mesh points/decomposition
static
vtkSmartPointer
<
vtkPoints
>
movePoints
(
const
fvMesh
&
mesh
,
const
foamVtuData
&
vtuData
);
//- Generate vtk points for the current mesh points/decomposition,
// using the provided pointMap
static
vtkSmartPointer
<
vtkPoints
>
movePoints
(
const
fvMesh
&
mesh
,
const
foamVtuData
&
vtuData
,
const
labelUList
&
pointMap
);
//- Volume mesh as vtkUnstructuredGrid
static
vtkSmartPointer
<
vtkUnstructuredGrid
>
volumeVTKMesh
(
const
fvMesh
&
mesh
,
foamVtuData
&
vtuData
,
const
bool
decompPoly
);
//- Subsetted mesh as vtkUnstructuredGrid
static
vtkSmartPointer
<
vtkUnstructuredGrid
>
volumeVTKSubsetMesh
(
const
fvMeshSubset
&
subsetter
,
foamVtuData
&
vtuData
,
const
bool
decompPoly
);
//- Volume mesh as vtkUnstructuredGrid
vtkSmartPointer
<
vtkUnstructuredGrid
>
volumeVTKMesh
(
const
fvMesh
&
mesh
,
foamVtuData
&
vtuData
)
const
;
//- Subsetted mesh as vtkUnstructuredGrid
vtkSmartPointer
<
vtkUnstructuredGrid
>
volumeVTKSubsetMesh
(
const
fvMeshSubset
&
subsetter
,
foamVtuData
&
vtuData
)
const
;
// Add mesh functions
//- Lagrangian positions as vtkPolyData
vtkSmartPointer
<
vtkPolyData
>
lagrangianVTKMesh
...
...
@@ -440,55 +336,8 @@ class vtkPVFoam
const
word
&
cloudName
)
const
;
//- Patch points
template
<
class
PatchType
>
static
vtkSmartPointer
<
vtkPoints
>
movePatchPoints
(
const
PatchType
&
p
);
//- Patch faces as vtk-cells
template
<
class
PatchType
>
static
vtkSmartPointer
<
vtkCellArray
>
patchFacesVTKCells
(
const
PatchType
&
p
);
//- Patches (mesh or primitive) as vtkPolyData
template
<
class
PatchType
>
static
vtkSmartPointer
<
vtkPolyData
>
patchVTKMesh
(
const
PatchType
&
p
);
// Field conversion functions
//- Copy list to pre-allocated vtk array.
// \return number of input items copied
template
<
class
Type
>
static
label
transcribeFloatData
(
vtkFloatArray
*
array
,
const
UList
<
Type
>&
input
,
const
label
start
=
0
);
//- Create named field initialized to zero
template
<
class
Type
>
static
vtkSmartPointer
<
vtkFloatArray
>
zeroVTKField
(
const
word
&
name
,
const
label
size
);
//- Convert float data to VTK field
template
<
class
Type
>
vtkSmartPointer
<
vtkFloatArray
>
convertFieldToVTK
(
const
word
&
name
,
const
UList
<
Type
>&
fld
)
const
;
// Field conversion functions
//- Face set/zone field
template
<
class
Type
>
...
...
@@ -520,7 +369,7 @@ class vtkPVFoam
void
convertLagrangianFields
();
// Convert OpenFOAM fields
// Convert OpenFOAM fields
//- Volume field - all types
template
<
class
Type
>
...
...
@@ -599,7 +448,7 @@ class vtkPVFoam
);
// GUI selection helper functions
// GUI selection helper functions
//- Get the first word from the reader 'parts' selection
word
getReaderPartName
(
const
int
partId
)
const
;
...
...
@@ -607,10 +456,10 @@ class vtkPVFoam
// Constructors
//-
Disallow default bitwise
copy construct
//-
No
copy construct