From 6cefe10d16feb311efd8286ad62b7f2cbe8cb785 Mon Sep 17 00:00:00 2001 From: Thomas Gibson Date: Thu, 29 Apr 2021 22:02:14 -0500 Subject: [PATCH] Update geometry module --- grudge/geometry/__init__.py | 31 ++++++++++++++++++++++++++++++- grudge/geometry/metrics.py | 28 +++++++++++++++++++++++++--- 2 files changed, 55 insertions(+), 4 deletions(-) diff --git a/grudge/geometry/__init__.py b/grudge/geometry/__init__.py index f5d058ad..c5a83ba5 100644 --- a/grudge/geometry/__init__.py +++ b/grudge/geometry/__init__.py @@ -1,2 +1,31 @@ +__copyright__ = """ +Copyright (C) 2021 University of Illinois Board of Trustees +""" -from grudge.geometry.metrics import * +__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 grudge.geometry.metrics import ( + forward_metric_derivative_mat, + inverse_metric_derivative_mat, + inverse_surface_metric_derivative, + area_element +) diff --git a/grudge/geometry/metrics.py b/grudge/geometry/metrics.py index 4e7b07ff..c4f66da2 100644 --- a/grudge/geometry/metrics.py +++ b/grudge/geometry/metrics.py @@ -1,3 +1,27 @@ +__copyright__ = """ +Copyright (C) 2021 University of Illinois Board of Trustees +""" + +__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. +""" + import numpy as np @@ -168,9 +192,7 @@ def inverse_metric_derivative(actx, dcoll, rst_axis, xyz_axis, dd): for rst_axis in range(dim) ).inv() - # NOTE: this always produces a DOFArray of shape (1,). - # the thing we want is actually inside - result, = (outprod_with_unit(xyz_axis, rst_axis) + result = (outprod_with_unit(xyz_axis, rst_axis) * volume_pseudoscalar_inv).as_scalar() return result -- GitLab