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
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
Andreas Klöckner
grudge
Commits
0b7d1cd6
Commit
0b7d1cd6
authored
3 years ago
by
Thomas Gibson
Browse files
Options
Downloads
Patches
Plain Diff
Update docs
parent
91eb554a
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
doc/index.rst
+1
-0
1 addition, 0 deletions
doc/index.rst
doc/misc.rst
+1
-1
1 addition, 1 deletion
doc/misc.rst
doc/utils.rst
+7
-0
7 additions, 0 deletions
doc/utils.rst
grudge/dt_utils.py
+24
-12
24 additions, 12 deletions
grudge/dt_utils.py
with
33 additions
and
13 deletions
doc/index.rst
+
1
−
0
View file @
0b7d1cd6
...
@@ -10,6 +10,7 @@ Contents:
...
@@ -10,6 +10,7 @@ Contents:
dof_desc
dof_desc
geometry
geometry
operators
operators
utils
misc
misc
🚀 Github <https://github.com/inducer/grudge>
🚀 Github <https://github.com/inducer/grudge>
💾 Download Releases <https://pypi.org/project/grudge>
💾 Download Releases <https://pypi.org/project/grudge>
...
...
This diff is collapsed.
Click to expand it.
doc/misc.rst
+
1
−
1
View file @
0b7d1cd6
...
@@ -104,7 +104,7 @@ Licensing
...
@@ -104,7 +104,7 @@ Licensing
:mod:`grudge` is licensed to you under the MIT/X Consortium license:
:mod:`grudge` is licensed to you under the MIT/X Consortium license:
Copyright (c) 2014-1
6
Andreas Klöckner and Contributors.
Copyright (c) 2014-
2
1 Andreas Klöckner and Contributors.
Permission is hereby granted, free of charge, to any person
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
obtaining a copy of this software and associated documentation
...
...
This diff is collapsed.
Click to expand it.
doc/utils.rst
0 → 100644
+
7
−
0
View file @
0b7d1cd6
Helper functions
================
Estimating stable time-steps
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. automodule:: grudge.dt_utils
This diff is collapsed.
Click to expand it.
grudge/dt_utils.py
+
24
−
12
View file @
0b7d1cd6
"""
Helper functions for estimating stable time steps for RKDG methods.
"""
Helper functions for estimating stable time steps for RKDG methods.
.. autofunction:: dt_non_geometric_factor
.. autofunction:: dt_non_geometric_factor
.. autofunction:: symmetric_eigenvalues
.. autofunction:: dt_geometric_factor
"""
"""
__copyright__
=
"""
__copyright__
=
"""
...
@@ -30,12 +32,12 @@ THE SOFTWARE.
...
@@ -30,12 +32,12 @@ THE SOFTWARE.
import
numpy
as
np
import
numpy
as
np
from
arraycontext
import
rec_map_array_container
from
arraycontext
import
ArrayContext
,
rec_map_array_container
from
functools
import
reduce
from
functools
import
reduce
from
grudge.dof_desc
import
DD_VOLUME
from
grudge.dof_desc
import
DD_VOLUME
from
grudge.geometry
import
f
orward_metric_derivative_mat
from
grudge.geometry
import
f
irst_fundamental_form
from
grudge.discretization
import
DiscretizationCollection
from
grudge.discretization
import
DiscretizationCollection
from
pytools
import
memoize_on_first_arg
from
pytools
import
memoize_on_first_arg
...
@@ -85,9 +87,17 @@ def dt_non_geometric_factor(dcoll: DiscretizationCollection, dd=None) -> float:
...
@@ -85,9 +87,17 @@ def dt_non_geometric_factor(dcoll: DiscretizationCollection, dd=None) -> float:
return
min
(
min_delta_rs
)
return
min
(
min_delta_rs
)
def
symmetric_eigenvalues
(
actx
,
amat
):
def
symmetric_eigenvalues
(
actx
:
ArrayContext
,
amat
):
"""
*amat* must be complex-valued, or ``actx.np.sqrt`` must automatically
"""
Analytically computes the eigenvalues of a self-adjoint matrix, up
up-cast to complex data.
to matrices of size 3 by 3.
:arg amat: a square array-like object.
:returns: a :class:`list` of the eigenvalues of *amat*.
.. note::
*amat* must be complex-valued, or ``actx.np.sqrt`` must automatically
up-cast to complex data.
"""
"""
# https://gist.github.com/inducer/75ede170638c389c387e72e0ef1f0ef4
# https://gist.github.com/inducer/75ede170638c389c387e72e0ef1f0ef4
...
@@ -122,11 +132,11 @@ def symmetric_eigenvalues(actx, amat):
...
@@ -122,11 +132,11 @@ def symmetric_eigenvalues(actx, amat):
x12
=
d
*
f
x12
=
d
*
f
x13
=
(
-
9
*
a
-
9
*
d
-
9
*
f
)
*
(
x0
+
x11
+
x12
-
x3
-
x5
-
x7
)
x13
=
(
-
9
*
a
-
9
*
d
-
9
*
f
)
*
(
x0
+
x11
+
x12
-
x3
-
x5
-
x7
)
x14
=
-
3
*
x0
-
3
*
x11
-
3
*
x12
+
3
*
x3
+
3
*
x5
+
3
*
x7
+
x9
**
2
x14
=
-
3
*
x0
-
3
*
x11
-
3
*
x12
+
3
*
x3
+
3
*
x5
+
3
*
x7
+
x9
**
2
x15_0
=
(
-
4
*
x14
**
3
+
(
-
27
*
x1
+
2
*
x10
-
x13
-
54
*
x2
+
27
*
x4
+
27
*
x6
x15_0
=
(
-
4
*
x14
**
3
+
27
*
x8
)
**
2
)
+
(
-
27
*
x1
+
2
*
x10
-
x13
-
54
*
x2
+
27
*
x4
+
27
*
x6
+
27
*
x8
)
**
2
)
x15_1
=
sqrt
(
x15_0
)
x15_1
=
sqrt
(
x15_0
)
x15_2
=
(
-
27
*
x1
/
2
+
x10
-
x13
/
2
-
27
*
x2
+
27
*
x4
/
2
+
27
*
x6
/
2
+
27
*
x8
/
2
x15_2
=
(
-
27
*
x1
/
2
+
x10
-
x13
/
2
-
27
*
x2
+
27
*
x4
/
2
+
27
*
x6
/
2
+
27
*
x8
/
2
+
x15_1
/
2
)
+
x15_1
/
2
)
x15
=
x15_2
**
(
1
/
3
)
x15
=
x15_2
**
(
1
/
3
)
x16
=
x15
/
3
x16
=
x15
/
3
x17
=
x14
/
(
3
*
x15
)
x17
=
x14
/
(
3
*
x15
)
...
@@ -146,7 +156,10 @@ def symmetric_eigenvalues(actx, amat):
...
@@ -146,7 +156,10 @@ def symmetric_eigenvalues(actx, amat):
@memoize_on_first_arg
@memoize_on_first_arg
def
dt_geometric_factor
(
dcoll
:
DiscretizationCollection
,
dd
=
None
)
->
float
:
def
dt_geometric_factor
(
dcoll
:
DiscretizationCollection
,
dd
=
None
)
->
float
:
"""
"""
Computes a geometric scaling factor, determined by taking the minimum
singular value of the coordinate transformation from reference to physical
cells.
:arg dd: a :class:`~grudge.dof_desc.DOFDesc`, or a value convertible to one.
:arg dd: a :class:`~grudge.dof_desc.DOFDesc`, or a value convertible to one.
Defaults to the base volume discretization if not provided.
Defaults to the base volume discretization if not provided.
:returns: a :class:`float` denoting the geometric scaling factor.
:returns: a :class:`float` denoting the geometric scaling factor.
...
@@ -155,8 +168,7 @@ def dt_geometric_factor(dcoll: DiscretizationCollection, dd=None) -> float:
...
@@ -155,8 +168,7 @@ def dt_geometric_factor(dcoll: DiscretizationCollection, dd=None) -> float:
dd
=
DD_VOLUME
dd
=
DD_VOLUME
actx
=
dcoll
.
_setup_actx
actx
=
dcoll
.
_setup_actx
fmd
=
forward_metric_derivative_mat
(
actx
,
dcoll
,
dd
=
dd
)
ata
=
first_fundamental_form
(
actx
,
dcoll
,
dd
=
dd
)
ata
=
fmd
@
fmd
.
T
complex_dtype
=
dcoll
.
discr_from_dd
(
dd
).
complex_dtype
complex_dtype
=
dcoll
.
discr_from_dd
(
dd
).
complex_dtype
...
...
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