Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
grudge
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
Matt Wala
grudge
Commits
255f2659
Commit
255f2659
authored
7 years ago
by
Bogdan Enache
Browse files
Options
Downloads
Patches
Plain Diff
Did variable coefficient upwind flux the right way, maybe?
parent
a6da4eab
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
contrib/maxima/wave.mac
+2
-2
2 additions, 2 deletions
contrib/maxima/wave.mac
grudge/models/wave.py
+6
-24
6 additions, 24 deletions
grudge/models/wave.py
with
8 additions
and
26 deletions
contrib/maxima/wave.mac
+
2
−
2
View file @
255f2659
...
...
@@ -79,11 +79,11 @@ print("Wave equation flux in terms of characteristic variables:");
print(wave_sflux);
print("Wave equation flux in terms of physical variables:");
print(wave_wflux);
print("Weak flux divided by (-c), as implemented in StrongWaveOperator:");
print(hypsimp(ev(wave_wflux, cp=c, cm=c)/(-c)));
*/
print("Wave equation weak flux in terms of physical variables:");
print(wave_wflux);
print("Strong-form wave equation flux in terms of physical variables:");
/*print(wave_strongwflux);*/
...
...
This diff is collapsed.
Click to expand it.
grudge/models/wave.py
+
6
−
24
View file @
255f2659
...
...
@@ -368,32 +368,15 @@ class VariableCoefficientWeakWaveOperator(HyperbolicOperator):
v
=
w
[
2
:]
normal
=
sym
.
normal
(
w
.
dd
,
self
.
ambient_dim
)
flux_weak
=
join_fields
(
if
self
.
flux_type
==
"
central
"
:
return
join_fields
(
np
.
dot
(
v
.
int
*
c
.
int
+
v
.
ext
*
c
.
ext
,
normal
),
(
u
.
int
*
c
.
int
+
u
.
ext
*
c
.
ext
)
*
normal
)
*
-
0.5
flux
=
sym
.
interp
(
"
vol
"
,
u
.
dd
)(
self
.
sign
)
*
join_fields
(
c
.
ext
*
np
.
dot
(
v
.
ext
,
normal
)
-
c
.
int
*
np
.
dot
(
v
.
int
,
normal
),
normal
*
(
c
.
ext
*
u
.
ext
-
c
.
int
*
u
.
int
))
*
-
0.5
flux_strong
=
join_fields
(
np
.
dot
(
v
.
int
,
normal
),
u
.
int
*
normal
)
*
-
c
.
int
if
self
.
flux_type
==
"
central
"
:
return
flux_strong
-
flux
elif
self
.
flux_type
==
"
upwind
"
:
flux
+=
join_fields
(
c
.
ext
*
u
.
ext
-
c
.
int
*
u
.
int
,
c
.
ext
*
normal
*
np
.
dot
(
normal
,
v
.
ext
)
-
c
.
int
*
normal
*
np
.
dot
(
normal
,
v
.
int
)
)
return
flux_strong
-
flux
return
(
flux_weak
+
join_fields
(
c
.
ext
*
u
.
ext
-
c
.
int
*
u
.
int
,
c
.
ext
*
normal
*
np
.
dot
(
normal
,
v
.
ext
)
-
c
.
int
*
normal
*
np
.
dot
(
normal
,
v
.
int
)
))
return
join_fields
(
np
.
dot
(
normal
,
c
.
ext
*
v
.
ext
+
c
.
int
*
v
.
int
)
+
c
.
ext
*
u
.
ext
-
c
.
int
*
u
.
int
,
normal
*
(
np
.
dot
(
normal
,
c
.
ext
*
v
.
ext
-
c
.
int
*
v
.
int
)
+
c
.
ext
*
u
.
ext
+
c
.
int
*
u
.
int
)
)
*
-
0.5
else
:
raise
ValueError
(
"
invalid flux type
'
%s
'"
%
self
.
flux_type
)
...
...
@@ -474,8 +457,7 @@ class VariableCoefficientWeakWaveOperator(HyperbolicOperator):
self
.
radiation_tag
])
def
max_eigenvalue
(
self
,
t
,
fields
=
None
,
discr
=
None
):
return
abs
(
self
.
c
)
return
sym
.
NodalMax
()(
sym
.
CFunction
(
"
fabs
"
)(
self
.
c
))
# }}}
...
...
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