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
52c7318c
Commit
52c7318c
authored
3 years ago
by
Thomas Gibson
Browse files
Options
Downloads
Patches
Plain Diff
Add various documentation updates
parent
2d74faaf
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
grudge/discretization.py
+15
-13
15 additions, 13 deletions
grudge/discretization.py
grudge/geometry/metrics.py
+7
-1
7 additions, 1 deletion
grudge/geometry/metrics.py
grudge/op.py
+1
-1
1 addition, 1 deletion
grudge/op.py
grudge/trace_pair.py
+4
-4
4 additions, 4 deletions
grudge/trace_pair.py
with
27 additions
and
19 deletions
grudge/discretization.py
+
15
−
13
View file @
52c7318c
...
...
@@ -45,13 +45,14 @@ from meshmode.discretization.connection import (
FACE_RESTR_ALL
,
make_face_restriction
)
from
meshmode.mesh
import
BTAG_PARTITION
from
meshmode.mesh
import
Mesh
,
BTAG_PARTITION
from
warnings
import
warn
class
DiscretizationCollection
:
"""
A collection of discretizations on various mesh entities
"""
A collection of discretizations, defined on the same underlying
:class:`~meshmode.mesh.Mesh`, corresponding to various mesh entities
(volume, interior facets, boundaries) and associated element
groups.
...
...
@@ -70,14 +71,12 @@ class DiscretizationCollection:
.. automethod:: zeros
"""
def
__init__
(
self
,
array_context
,
mesh
,
order
=
None
,
discr_tag_to_group_factory
=
None
,
mpi_communicator
=
None
,
# FIXME: `quad_tag_to_group_factory` is deprecated
quad_tag_to_group_factory
=
None
):
"""
Constructor for the :class:`DiscretizationCollection` object.
:arg actx: an :class:`~arraycontext.context.ArrayContext`.
:arg mesh: a :class:`~meshmode.mesh.Mesh` object.
def
__init__
(
self
,
array_context
:
ArrayContext
,
mesh
:
Mesh
,
order
=
None
,
discr_tag_to_group_factory
=
None
,
mpi_communicator
=
None
,
# FIXME: `quad_tag_to_group_factory` is deprecated
quad_tag_to_group_factory
=
None
):
"""
:arg discr_tag_to_group_factory: A mapping from discretization tags
(typically one of: :class:`grudge.dof_desc.DISCR_TAG_BASE`,
:class:`grudge.dof_desc.DISCR_TAG_MODAL`, or
...
...
@@ -145,6 +144,7 @@ class DiscretizationCollection:
self
.
group_factory_for_discretization_tag
(
DISCR_TAG_BASE
)
)
# NOTE: Can be removed when symbolics are completely removed
# {{{ management of discretization-scoped common subexpressions
from
pytools
import
UniqueNameGenerator
...
...
@@ -553,13 +553,14 @@ class DiscretizationCollection:
@property
def
mesh
(
self
):
"""
Return
a
:class:`meshmode.mesh.Mesh` over which the discretization
"""
Return
the
:class:`meshmode.mesh.Mesh` over which the discretization
collection is built.
"""
return
self
.
_volume_discr
.
mesh
def
empty
(
self
,
array_context
:
ArrayContext
,
dtype
=
None
):
"""
Return an empty :class:`~meshmode.dof_array.DOFArray`.
"""
Return an empty :class:`~meshmode.dof_array.DOFArray` defined at
the volume nodes: :class:`grudge.dof_desc.DD_VOLUME`.
:arg array_context: an :class:`~arraycontext.context.ArrayContext`.
:arg dtype: type special value
'
c
'
will result in a
...
...
@@ -569,7 +570,8 @@ class DiscretizationCollection:
return
self
.
_volume_discr
.
empty
(
array_context
,
dtype
)
def
zeros
(
self
,
array_context
:
ArrayContext
,
dtype
=
None
):
"""
Return a zero-initialized :class:`~meshmode.dof_array.DOFArray`.
"""
Return a zero-initialized :class:`~meshmode.dof_array.DOFArray`
defined at the volume nodes, :class:`grudge.dof_desc.DD_VOLUME`.
:arg array_context: an :class:`~arraycontext.context.ArrayContext`.
:arg dtype: type special value
'
c
'
will result in a
...
...
This diff is collapsed.
Click to expand it.
grudge/geometry/metrics.py
+
7
−
1
View file @
52c7318c
...
...
@@ -542,6 +542,12 @@ def surface_normal(
def
_compute_mv_normal
(
actx
:
ArrayContext
,
dcoll
:
DiscretizationCollection
,
dd
)
->
MultiVector
:
"""
Exterior unit normal as a :class:`~pymbolic.geometric_algebra.MultiVector`.
:arg dd: a :class:`~grudge.dof_desc.DOFDesc` as the surface discretization.
:returns: a :class:`~pymbolic.geometric_algebra.MultiVector`
containing the unit normals.
"""
import
grudge.dof_desc
as
dof_desc
dd
=
dof_desc
.
as_dofdesc
(
dd
)
...
...
@@ -681,7 +687,7 @@ def summed_curvature(actx: ArrayContext, dcoll: DiscretizationCollection,
.. math::
\kappa = \
mathrm
{Trace}(C(x))
\kappa = \
operatorname
{Trace}(C(x))
where :math:`x(u, v)` defines a parameterized surface, :math:`u,v` are
coordinates on the parameterized surface, and :math:`C(x)` is the shape
...
...
This diff is collapsed.
Click to expand it.
grudge/op.py
+
1
−
1
View file @
52c7318c
...
...
@@ -187,7 +187,7 @@ def nodes(dcoll: DiscretizationCollection, dd=None) -> np.ndarray:
@memoize_on_first_arg
def
normal
(
dcoll
:
DiscretizationCollection
,
dd
):
def
normal
(
dcoll
:
DiscretizationCollection
,
dd
)
->
np
.
ndarray
:
r
"""
Get the unit normal to the specified surface discretization, *dd*.
:arg dd: a :class:`~grudge.dof_desc.DOFDesc` as the surface discretization.
...
...
This diff is collapsed.
Click to expand it.
grudge/trace_pair.py
+
4
−
4
View file @
52c7318c
...
...
@@ -108,16 +108,16 @@ class TracePair:
object
.
__setattr__
(
self
,
"
exterior
"
,
exterior
)
def
__getattr__
(
self
,
name
):
"""
Return a :class:`TracePair`
associated with the
attribute
s
of the array containers defining
:attr:`int` and :attr:`ext`.
"""
Return a
new
:class:`TracePair`
resulting from executing
attribute
lookup with *name* on
:attr:`int` and :attr:`ext`.
"""
return
TracePair
(
self
.
dd
,
interior
=
getattr
(
self
.
interior
,
name
),
exterior
=
getattr
(
self
.
exterior
,
name
))
def
__getitem__
(
self
,
index
):
"""
Return a :class:`TracePair`
associated with the subarrays
of
:attr:`int` and :attr:`ext`
, denoted by `index`
.
"""
Return a
new
:class:`TracePair`
resulting from executing
subscripting with *index* on
:attr:`int` and :attr:`ext`.
"""
return
TracePair
(
self
.
dd
,
interior
=
self
.
interior
[
index
],
...
...
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