Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DG1d.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
Model registry
Operate
Environments
Monitor
Incidents
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
DG
DG1d.jl
Commits
950657fd
Commit
950657fd
authored
2 years ago
by
Florian Atteneder
Browse files
Options
Downloads
Patches
Plain Diff
wip: add hybrid mesh
parent
839a6a95
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/dg1d.jl
+1
-0
1 addition, 0 deletions
src/dg1d.jl
src/dg_rhs.jl
+36
-2
36 additions, 2 deletions
src/dg_rhs.jl
src/hybridmesh.jl
+18
-0
18 additions, 0 deletions
src/hybridmesh.jl
with
55 additions
and
2 deletions
src/dg1d.jl
+
1
−
0
View file @
950657fd
...
@@ -43,6 +43,7 @@ module dg1d
...
@@ -43,6 +43,7 @@ module dg1d
include
(
"spectralelement.jl"
)
include
(
"spectralelement.jl"
)
include
(
"subvolumeelement.jl"
)
include
(
"subvolumeelement.jl"
)
include
(
"mesh.jl"
)
include
(
"mesh.jl"
)
include
(
"hybridmesh.jl"
)
# custom evolution
# custom evolution
include
(
"evolve.jl"
)
include
(
"evolve.jl"
)
...
...
This diff is collapsed.
Click to expand it.
src/dg_rhs.jl
+
36
−
2
View file @
950657fd
export
compute_rhs_weak_form!
,
export
compute_rhs_weak_form!
,
compute_rhs_strong_form!
compute_rhs_strong_form!
,
compute_rhs_fv_form!
"""
"""
...
@@ -55,3 +56,36 @@ function compute_rhs_strong_form!(rhs, f, s, nf_lhs, nf_rhs, mesh::AbstractMesh)
...
@@ -55,3 +56,36 @@ function compute_rhs_strong_form!(rhs, f, s, nf_lhs, nf_rhs, mesh::AbstractMesh)
rhs
.+=
s
rhs
.+=
s
return
return
end
end
"""
compute_rhs_weak_form!(rhs, sv_flag, f, mesh::HybridMesh)
compute_rhs_weak_form!(rhs, sv_flag, f, s, mesh::HybridMesh)
"""
function
compute_rhs_fv_form!
(
rhs
,
sv_flag
,
f
,
hybridmesh
::
HybridMesh
)
@unpack
mesh
,
sv_element
=
hybridmesh
@unpack
invjac
=
mesh
shape
=
layout
(
mesh
)
mat_rhs
=
reshape
(
view
(
rhs
,
:
),
shape
)
mat_f
=
reshape
(
view
(
f
,
:
),
shape
)
Npts
,
K
=
shape
for
(
k
#=cell nr=#
,
flag
)
in
enumerate
(
sv_flag
)
flag
==
0
&&
continue
for
i
=
1
:
Npts
-
1
mat_rhs
[
i
,
k
]
=
-
(
mat_f
[
i
+
1
,
k
]
-
mat_f
[
i
,
k
])
/
sv_element
.
w
[
i
]
*
invjac
[
k
]
end
end
return
end
function
compute_rhs_fv_form!
(
rhs
,
sv_flag
,
f
,
s
,
hybridmesh
::
HybridMesh
)
compute_rhs_weak_form!
(
rhs
,
tci_flag
,
f
,
hybridmesh
)
shape
=
layout
(
mesh
)
mat_rhs
=
reshape
(
view
(
rhs
,
:
),
shape
)
mat_s
=
reshape
(
view
(
s
,
:
),
shape
)
for
(
k
#=cell nr=#
,
flag
)
in
enumerate
(
sv_flag
)
flag
==
0
&&
continue
mat_rhs
[
:
,
k
]
.+=
mat_s
[
:
,
k
]
end
rhs
.+=
s
return
end
This diff is collapsed.
Click to expand it.
src/hybridmesh.jl
0 → 100644
+
18
−
0
View file @
950657fd
struct
HybridMesh
<:
AbstractMesh
mesh
::
Mesh
sv_element
::
SubVolumeElement
function
HybridMesh
(
mesh
::
Mesh
)
sv_element
=
SubVolumeElement
(
mesh
.
element
)
return
new
(
mesh
,
sv_element
)
end
end
function
Base.getproperty
(
hmesh
::
HybridMesh
,
p
::
Symbol
)
if
p
in
propertynames
(
hmesh
.
mesh
)
return
getproperty
(
hmesh
.
mesh
,
p
)
else
getfield
(
hmesh
.
mesh
,
p
)
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