From 06650221dc4a1b67c0f5709957c9683c446e00dc Mon Sep 17 00:00:00 2001
From: Alexandru Fikl <alexfikl@gmail.com>
Date: Thu, 23 Apr 2020 23:57:22 -0500
Subject: [PATCH] add docs

---
 doc/conf.py                   |  4 +--
 doc/index.rst                 | 11 ++-----
 doc/symbolic.rst              | 14 +++++++++
 grudge/symbolic/__init__.py   |  3 ++
 grudge/symbolic/operators.py  | 58 +++++++++++++++++++++++++++++++++--
 grudge/symbolic/primitives.py | 26 ++++++++++------
 6 files changed, 94 insertions(+), 22 deletions(-)
 create mode 100644 doc/symbolic.rst

diff --git a/doc/conf.py b/doc/conf.py
index 3becabe6..560efec5 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -320,11 +320,11 @@ texinfo_documents = [
 # Example configuration for intersphinx: refer to the Python standard library.
 intersphinx_mapping = {
     'http://docs.python.org/': None,
-    'http://documen.tician.de/boxtree/': None,
     'http://docs.scipy.org/doc/numpy/': None,
-    'http://documen.tician.de/modepy/': None,
     'http://documen.tician.de/pyopencl/': None,
+    'http://documen.tician.de/modepy/': None,
     'http://documen.tician.de/pymbolic/': None,
+    'http://documen.tician.de/meshmode/': None,
     #'http://documen.tician.de/loopy/': None,
     }
 autoclass_content = "both"
diff --git a/doc/index.rst b/doc/index.rst
index a20ec509..b996c470 100644
--- a/doc/index.rst
+++ b/doc/index.rst
@@ -1,9 +1,4 @@
-.. grudge documentation master file, created by
-   sphinx-quickstart on Sun Sep 27 13:08:30 2015.
-   You can adapt this file completely to your liking, but it should at least
-   contain the root `toctree` directive.
-
-Welcome to grudge's documentation!
+Welcome to grudge's Documentation!
 ==================================
 
 Contents:
@@ -12,10 +7,10 @@ Contents:
     :maxdepth: 2
 
     misc
+    symbolic
 
 
-
-Indices and tables
+Indices and Tables
 ==================
 
 * :ref:`genindex`
diff --git a/doc/symbolic.rst b/doc/symbolic.rst
new file mode 100644
index 00000000..632b1f86
--- /dev/null
+++ b/doc/symbolic.rst
@@ -0,0 +1,14 @@
+Symbolic Operator Representation
+================================
+
+Based on :mod:`pymbolic`.
+
+Basic Objects
+-------------
+
+.. automodule:: grudge.symbolic.primitives
+
+Operators
+---------
+
+.. automodule:: grudge.symbolic.operators
diff --git a/grudge/symbolic/__init__.py b/grudge/symbolic/__init__.py
index b5182aa8..59fa5b26 100644
--- a/grudge/symbolic/__init__.py
+++ b/grudge/symbolic/__init__.py
@@ -26,3 +26,6 @@ THE SOFTWARE.
 
 from grudge.symbolic.primitives import *        # noqa: F401,F403
 from grudge.symbolic.operators import *         # noqa: F401,F403
+from grudge.symbolic.tools import pretty        # noqa: F401
+
+from pymbolic.primitives import If, Comparison  # noqa: F401
diff --git a/grudge/symbolic/operators.py b/grudge/symbolic/operators.py
index 7daea219..20f28e59 100644
--- a/grudge/symbolic/operators.py
+++ b/grudge/symbolic/operators.py
@@ -1,5 +1,3 @@
-"""Building blocks and mappers for operator expression trees."""
-
 from __future__ import division, absolute_import
 
 __copyright__ = "Copyright (C) 2008-2017 Andreas Kloeckner, Bogdan Enache"
@@ -29,6 +27,62 @@ from six.moves import intern
 import numpy as np
 import pymbolic.primitives
 
+__doc__ = """
+
+Building blocks and mappers for operator expression trees.
+
+Basic Operators
+^^^^^^^^^^^^^^^
+
+.. autoclass:: Operator
+.. autoclass:: ElementwiseLinearOperator
+.. autoclass:: InterpolationOperator
+
+.. data:: interp
+
+Reductions
+^^^^^^^^^^
+
+.. autoclass:: ElementwiseMaxOperator
+
+.. autoclass:: NodalReductionOperator
+.. autoclass:: NodalSum
+.. autoclass:: NodalMax
+.. autoclass:: NodalMin
+
+Differentiation
+^^^^^^^^^^^^^^^
+
+.. autoclass:: StrongFormDiffOperatorBase
+.. autoclass:: WeakFormDiffOperatorBase
+.. autoclass:: StiffnessOperator
+.. autoclass:: DiffOperator
+.. autoclass:: StiffnessTOperator
+.. autoclass:: MInvSTOperator
+
+.. autoclass:: RefDiffOperator
+.. autoclass:: RefStiffnessTOperator
+
+.. autofunction:: nabla
+.. autofunction:: minv_stiffness_t
+.. autofunction:: stiffness
+.. autofunction:: stiffness_t
+
+Mass Operators
+^^^^^^^^^^^^^^
+
+.. autoclass:: MassOperatorBase
+
+.. autoclass:: MassOperator
+.. autoclass:: InverseMassOperator
+.. autoclass:: FaceMassOperator
+
+.. autoclass:: RefMassOperator
+.. autoclass:: RefInverseMassOperator
+.. autoclass:: RefFaceMassOperator
+
+"""
+
 
 # {{{ base classes
 
diff --git a/grudge/symbolic/primitives.py b/grudge/symbolic/primitives.py
index c43ca30d..96279055 100644
--- a/grudge/symbolic/primitives.py
+++ b/grudge/symbolic/primitives.py
@@ -55,15 +55,16 @@ class ExpressionBase(prim.Expression):
 
 __doc__ = """
 
-.. currentmodule:: grudge.symbolic.primitives
-
 DOF description
 ^^^^^^^^^^^^^^^
 
 .. autoclass:: DTAG_SCALAR
 .. autoclass:: DTAG_VOLUME_ALL
+.. autoclass:: DTAG_BOUNDARY
 .. autoclass:: QTAG_NONE
+
 .. autoclass:: DOFDesc
+.. autofunction:: as_dofdesc
 
 .. data:: DD_SCALAR
 .. data:: DD_VOLUME
@@ -73,10 +74,11 @@ Symbols
 
 .. autoclass:: Variable
 .. autoclass:: ScalarVariable
-.. autoclass:: make_sym_array
-.. autoclass:: make_sym_mv
 .. autoclass:: FunctionSymbol
 
+.. autofunction:: make_sym_array
+.. autofunction:: make_sym_mv
+
 .. function :: fabs(arg)
 .. function :: sqrt(arg)
 .. function :: exp(arg)
@@ -90,11 +92,11 @@ Helpers
 
 .. autoclass:: OperatorBinding
 .. autoclass:: PrioritizedSubexpression
-.. autoclass:: BoundaryPair
 .. autoclass:: Ones
 
 Geometry data
 ^^^^^^^^^^^^^
+
 .. autoclass:: NodeCoordinateComponent
 .. autofunction:: nodes
 .. autofunction:: mv_nodes
@@ -156,10 +158,14 @@ class DOFDesc(object):
             :class:`DTAG_SCALAR` (or the string ``"scalar"``),
             :class:`DTAG_VOLUME_ALL` (or the string ``"vol"``)
             for the default volume discretization,
-            :class:`FACE_RESTR_ALL` (or the string ``"all_faces"``),
-            or :class:`FACE_RESTR_INTERIOR` (or the string ``"int_faces"``),
-            or one of :class:`BTAG_ALL`, :class:`BTAG_NONE`,
-            :class:`BTAG_REALLY_ALL`, :class:`BTAG_PARTITION`,
+            :class:`~meshmode.discretization.connection.FACE_RESTR_ALL`
+            (or the string ``"all_faces"``), or
+            :class:`~meshmode.discretization.connection.FACE_RESTR_INTERIOR`
+            (or the string ``"int_faces"``), or one of
+            :class:`~meshmode.mesh.BTAG_ALL`,
+            :class:`~meshmode.mesh.BTAG_NONE`,
+            :class:`~meshmode.mesh.BTAG_REALLY_ALL`,
+            :class:`~meshmode.mesh.BTAG_PARTITION`,
             or *None* to indicate that the geometry is not yet known.
 
         :arg quadrature_tag:
@@ -586,7 +592,7 @@ def area_element(ambient_dim, dim=None, dd=None):
 
 
 def mv_normal(dd, ambient_dim, dim=None):
-    """Exterior unit normal as a MultiVector."""
+    """Exterior unit normal as a :class:`~pymbolic.geometric_algebra.MultiVector`."""
 
     dd = as_dofdesc(dd)
 
-- 
GitLab