From 11f3a2871af755f92481529ba5909de2f898ddd1 Mon Sep 17 00:00:00 2001 From: Ben Sepanski Date: Mon, 25 May 2020 11:12:46 -0500 Subject: [PATCH] Set up basic interface for object conversion --- doc/conf.py | 3 +- meshmode/interop/__init__.py | 57 ++++++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 meshmode/interop/__init__.py diff --git a/doc/conf.py b/doc/conf.py index 86665362..8ff4e0bb 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -280,5 +280,6 @@ intersphinx_mapping = { 'https://documen.tician.de/pyopencl': None, 'https://documen.tician.de/meshpy': None, 'https://documen.tician.de/modepy': None, - 'https://documen.tician.de/loopy': None + 'https://documen.tician.de/loopy': None, + 'https://firedrakeproject.org/' : None } diff --git a/meshmode/interop/__init__.py b/meshmode/interop/__init__.py new file mode 100644 index 00000000..e3ca48fc --- /dev/null +++ b/meshmode/interop/__init__.py @@ -0,0 +1,57 @@ +__copyright__ = "Copyright (C) 2014 Andreas Kloeckner" + +__license__ = """ +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +""" + +from abc import ABC + +__doc__ = """ +Development Interface +--------------------- +.. autoclass:: Interoperator +""" + + +class Interoperator(ABC): + """ + An object which handles the interoperation of an external + object with its closest meshmode representation + """ + + def __init__(self): + pass + + def as_meshmode(self): + pass + + def as_external(self): + pass + + def __hash__(self): + pass + + def __eq__(self, other): + pass + + def __neq__(self, other): + return not self.__eq__(other) + + +# vim: fdm=marker -- GitLab