Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
ogs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Yuhao Liu
ogs
Commits
904e6ee6
Commit
904e6ee6
authored
9 years ago
by
Norihiro Watanabe
Committed by
Dmitri Naumov
9 years ago
Browse files
Options
Downloads
Patches
Plain Diff
support quadratic cell types in VtkMappedMesh
parent
9c011063
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
InSituLib/VtkMappedMesh.cpp
+42
-12
42 additions, 12 deletions
InSituLib/VtkMappedMesh.cpp
InSituLib/VtkMappedMesh.h
+40
-10
40 additions, 10 deletions
InSituLib/VtkMappedMesh.h
with
82 additions
and
22 deletions
InSituLib/VtkMappedMesh.cpp
+
42
−
12
View file @
904e6ee6
...
...
@@ -60,31 +60,61 @@ vtkIdType VtkMappedMeshImpl::GetNumberOfCells()
int
VtkMappedMeshImpl
::
GetCellType
(
vtkIdType
cellId
)
{
int
type
=
0
;
switch
((
*
_elements
)[
cellId
]
->
get
Geom
Type
())
switch
((
*
_elements
)[
cellId
]
->
get
Cell
Type
())
{
case
MeshElem
Type
::
INVALID
:
case
Cell
Type
::
INVALID
:
break
;
case
MeshElem
Type
::
LINE
:
case
Cell
Type
::
LINE
2
:
type
=
VTK_LINE
;
break
;
case
MeshElemType
::
TRIANGLE
:
case
CellType
::
LINE3
:
type
=
VTK_QUADRATIC_EDGE
;
break
;
case
CellType
::
TRI3
:
type
=
VTK_TRIANGLE
;
break
;
case
MeshElemType
::
QUAD
:
case
CellType
::
TRI6
:
type
=
VTK_QUADRATIC_TRIANGLE
;
break
;
case
CellType
::
QUAD4
:
type
=
VTK_QUAD
;
break
;
case
MeshElemType
::
HEXAHEDRON
:
case
CellType
::
QUAD8
:
type
=
VTK_QUADRATIC_QUAD
;
break
;
case
CellType
::
QUAD9
:
type
=
VTK_BIQUADRATIC_QUAD
;
break
;
case
CellType
::
HEX8
:
type
=
VTK_HEXAHEDRON
;
break
;
case
MeshElemType
::
TETRAHEDRON
:
case
CellType
::
HEX20
:
type
=
VTK_QUADRATIC_HEXAHEDRON
;
break
;
case
CellType
::
HEX27
:
type
=
VTK_TRIQUADRATIC_HEXAHEDRON
;
break
;
case
CellType
::
TET4
:
type
=
VTK_TETRA
;
break
;
case
MeshElemType
::
PRISM
:
case
CellType
::
TET10
:
type
=
VTK_QUADRATIC_TETRA
;
break
;
case
CellType
::
PRISM6
:
type
=
VTK_WEDGE
;
break
;
case
MeshElemType
::
PYRAMID
:
case
CellType
::
PRISM15
:
type
=
VTK_QUADRATIC_WEDGE
;
break
;
case
CellType
::
PRISM18
:
type
=
VTK_BIQUADRATIC_QUADRATIC_WEDGE
;
break
;
case
CellType
::
PYRAMID5
:
type
=
VTK_PYRAMID
;
break
;
case
CellType
::
PYRAMID13
:
type
=
VTK_QUADRATIC_PYRAMID
;
break
;
}
return
type
;
}
...
...
@@ -133,16 +163,16 @@ void VtkMappedMeshImpl::GetIdsOfCellsOfType(int type, vtkIdTypeArray *array)
for
(
auto
elem
(
_elements
->
begin
());
elem
!=
_elements
->
end
();
++
elem
)
{
if
((
*
elem
)
->
get
Geom
Type
()
==
VtkCellTypeToOGS
(
type
))
if
((
*
elem
)
->
get
Cell
Type
()
==
VtkCellTypeToOGS
(
type
))
array
->
InsertNextValue
((
*
elem
)
->
getID
());
}
}
int
VtkMappedMeshImpl
::
IsHomogeneous
()
{
MeshElem
Type
type
=
(
*
(
_elements
->
begin
()))
->
get
Geom
Type
();
Cell
Type
type
=
(
*
(
_elements
->
begin
()))
->
get
Cell
Type
();
for
(
auto
elem
(
_elements
->
begin
());
elem
!=
_elements
->
end
();
++
elem
)
if
((
*
elem
)
->
get
Geom
Type
()
!=
type
)
if
((
*
elem
)
->
get
Cell
Type
()
!=
type
)
return
0
;
return
1
;
}
...
...
This diff is collapsed.
Click to expand it.
InSituLib/VtkMappedMesh.h
+
40
−
10
View file @
904e6ee6
...
...
@@ -71,34 +71,64 @@ private:
const
std
::
vector
<
MeshLib
::
Element
*>*
_elements
;
vtkIdType
NumberOfCells
;
static
MeshElem
Type
VtkCellTypeToOGS
(
int
type
)
static
Cell
Type
VtkCellTypeToOGS
(
int
type
)
{
MeshElem
Type
ogs
;
Cell
Type
ogs
;
switch
(
type
)
{
case
VTK_LINE
:
ogs
=
MeshElemType
::
LINE
;
ogs
=
CellType
::
LINE2
;
break
;
case
VTK_QUADRATIC_EDGE
:
ogs
=
CellType
::
LINE3
;
break
;
case
VTK_TRIANGLE
:
ogs
=
MeshElemType
::
TRIANGLE
;
ogs
=
CellType
::
TRI3
;
break
;
case
VTK_QUADRATIC_TRIANGLE
:
ogs
=
CellType
::
TRI6
;
break
;
case
VTK_QUAD
:
ogs
=
MeshElemType
::
QUAD
;
ogs
=
CellType
::
QUAD4
;
break
;
case
VTK_QUADRATIC_QUAD
:
ogs
=
CellType
::
QUAD8
;
break
;
case
VTK_BIQUADRATIC_QUAD
:
ogs
=
CellType
::
QUAD9
;
break
;
case
VTK_HEXAHEDRON
:
ogs
=
MeshElemType
::
HEXAHEDRON
;
ogs
=
CellType
::
HEX8
;
break
;
case
VTK_QUADRATIC_HEXAHEDRON
:
ogs
=
CellType
::
HEX20
;
break
;
case
VTK_TRIQUADRATIC_HEXAHEDRON
:
ogs
=
CellType
::
HEX27
;
break
;
case
VTK_TETRA
:
ogs
=
MeshElemType
::
TETRAHEDRON
;
ogs
=
CellType
::
TET4
;
break
;
case
VTK_QUADRATIC_TETRA
:
ogs
=
CellType
::
TET10
;
break
;
case
VTK_WEDGE
:
ogs
=
MeshElemType
::
PRISM
;
ogs
=
CellType
::
PRISM6
;
break
;
case
VTK_QUADRATIC_WEDGE
:
ogs
=
CellType
::
PRISM15
;
break
;
case
VTK_BIQUADRATIC_QUADRATIC_WEDGE
:
ogs
=
CellType
::
PRISM18
;
break
;
case
VTK_PYRAMID
:
ogs
=
MeshElemType
::
PYRAMID
;
ogs
=
CellType
::
PYRAMID5
;
break
;
case
VTK_QUADRATIC_PYRAMID
:
ogs
=
CellType
::
PYRAMID13
;
break
;
default:
ogs
=
MeshElem
Type
::
INVALID
;
ogs
=
Cell
Type
::
INVALID
;
break
;
}
return
ogs
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment