From 9b5682ac8729a61aaae12b003116540eaf21c687 Mon Sep 17 00:00:00 2001 From: Thomas Gibson <gibsonthomas1120@hotmail.com> Date: Tue, 11 May 2021 21:44:38 -0500 Subject: [PATCH] Update normal computation and export functions --- grudge/geometry/__init__.py | 4 ++++ grudge/geometry/metrics.py | 12 ++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/grudge/geometry/__init__.py b/grudge/geometry/__init__.py index 4106888f..8613f99c 100644 --- a/grudge/geometry/__init__.py +++ b/grudge/geometry/__init__.py @@ -27,7 +27,9 @@ from grudge.geometry.metrics import ( forward_metric_derivative_mat, inverse_metric_derivative_mat, inverse_surface_metric_derivative, + pseudoscalar, area_element, + surface_normal, normal ) @@ -35,6 +37,8 @@ __all__ = ( "forward_metric_derivative_mat", "inverse_metric_derivative_mat", "inverse_surface_metric_derivative", + "pseudoscalar", "area_element", + "surface_normal", "normal" ) diff --git a/grudge/geometry/metrics.py b/grudge/geometry/metrics.py index 90a17eec..188c8895 100644 --- a/grudge/geometry/metrics.py +++ b/grudge/geometry/metrics.py @@ -322,10 +322,14 @@ def mv_normal(actx, dcoll, dd): from grudge.op import project import grudge.dof_desc as dof_desc - volm_normal = project(dcoll, dof_desc.DD_VOLUME, dd, - surface_normal(actx, dcoll, - dim=dim + 1, - dd=dof_desc.DD_VOLUME)) + volm_normal = MultiVector( + project(dcoll, dof_desc.DD_VOLUME, dd, + surface_normal( + actx, dcoll, + dim=dim + 1, + dd=dof_desc.DD_VOLUME + ).as_vector(dtype=object)) + ) pder = pseudoscalar(actx, dcoll, dd=dd) mv = -(volm_normal ^ pder) << volm_normal.I.inv() -- GitLab