Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SemiSmoothNewton.jl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
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
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
Stephan Hilb
SemiSmoothNewton.jl
Commits
c4ccd9e8
Commit
c4ccd9e8
authored
3 years ago
by
Stephan Hilb
Browse files
Options
Downloads
Patches
Plain Diff
add vtk export support for DP1
parent
d59124e7
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/function.jl
+6
-1
6 additions, 1 deletion
src/function.jl
src/mesh.jl
+3
-3
3 additions, 3 deletions
src/mesh.jl
src/run.jl
+1
-1
1 addition, 1 deletion
src/run.jl
with
10 additions
and
5 deletions
src/function.jl
+
6
−
1
View file @
c4ccd9e8
...
@@ -186,11 +186,16 @@ end
...
@@ -186,11 +186,16 @@ end
append_data!
(
vtkfile
,
f
::
FeFunction
)
=
append_data!
(
vtkfile
,
f
,
f
.
space
.
element
)
append_data!
(
vtkfile
,
f
::
FeFunction
)
=
append_data!
(
vtkfile
,
f
,
f
.
space
.
element
)
function
append_data!
(
vtkfile
,
f
::
FeFunction
,
::
P1
)
function
append_data!
(
vtkfile
,
f
::
FeFunction
,
::
P1
)
vtk_point_data
(
vtkfile
,
f
.
data
,
f
.
name
)
# separate out data per cell
fd
=
vec
(
f
.
data
[
f
.
space
.
dofmap
])
vtk_point_data
(
vtkfile
,
fd
,
f
.
name
)
end
end
function
append_data!
(
vtkfile
,
f
::
FeFunction
,
::
DP0
)
function
append_data!
(
vtkfile
,
f
::
FeFunction
,
::
DP0
)
vtk_cell_data
(
vtkfile
,
f
.
data
,
f
.
name
)
vtk_cell_data
(
vtkfile
,
f
.
data
,
f
.
name
)
end
end
append_data!
(
vtkfile
,
f
::
FeFunction
,
::
DP1
)
=
append_data!
(
vtkfile
,
f
,
P1
())
This diff is collapsed.
Click to expand it.
src/mesh.jl
+
3
−
3
View file @
c4ccd9e8
...
@@ -47,9 +47,9 @@ save(filename, f::FeFunction, fs::FeFunction...) =
...
@@ -47,9 +47,9 @@ save(filename, f::FeFunction, fs::FeFunction...) =
save
(
filename
,
f
.
space
.
mesh
,
f
,
fs
...
)
save
(
filename
,
f
.
space
.
mesh
,
f
,
fs
...
)
function
save
(
filename
,
mesh
::
Mesh
,
fs
...
)
function
save
(
filename
,
mesh
::
Mesh
,
fs
...
)
cells
=
[
MeshCell
(
VTKCellTypes
.
VTK_TRIANGLE
,
mesh
.
cells
[
:
,
i
]
)
for
i
in
axes
(
mesh
.
cells
,
2
)]
cells
=
[
MeshCell
(
VTKCellTypes
.
VTK_TRIANGLE
,
3
*
(
i
-
1
)
+
1
:
3
*
(
i
-
1
)
+
3
)
for
i
in
axes
(
mesh
.
cells
,
2
)]
#
vertices =
[mesh.vertices[i, j] for i in axes(mesh.vertices, 1), j in axes(mesh.vertices, 2)]
vertices
=
reshape
(
mesh
.
vertices
[
:
,
mesh
.
cells
],
2
,
:
)
vtkfile
=
vtk_grid
(
filename
,
mesh
.
vertices
,
cells
)
vtkfile
=
vtk_grid
(
filename
,
vertices
,
cells
)
for
f
in
fs
for
f
in
fs
f
.
space
.
mesh
==
mesh
||
f
.
space
.
mesh
==
mesh
||
throw
(
ArgumentError
(
"meshes do not match"
))
throw
(
ArgumentError
(
"meshes do not match"
))
...
...
This diff is collapsed.
Click to expand it.
src/run.jl
+
1
−
1
View file @
c4ccd9e8
...
@@ -123,5 +123,5 @@ function myrun()
...
@@ -123,5 +123,5 @@ function myrun()
end
end
end
end
save
(
"test.vtu"
,
g
,
u
,
p1
)
save
(
"test.vtu"
,
g
,
u
,
p1
,
p2
)
end
end
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