[Debian-astro-commits] [gyoto] 80/221: yorick: expose Metric::coordKind()

Thibaut Jean-Claude Paumard thibaut at moszumanska.debian.org
Fri May 22 20:52:35 UTC 2015


This is an automated email from the git hooks/post-receive script.

thibaut pushed a commit to branch master
in repository gyoto.

commit eb6b70cec3421fdb47bafcc6ddd83f7a3027070e
Author: Thibaut Paumard <paumard at users.sourceforge.net>
Date:   Sat Nov 1 17:56:55 2014 +0100

    yorick: expose Metric::coordKind()
---
 yorick/gyoto.i           | 4 ++++
 yorick/gyoto_Metric.C    | 7 +++++++
 yorick/gyoto_namespace.i | 4 +++-
 yorick/ygyoto.h          | 4 ++--
 4 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/yorick/gyoto.i b/yorick/gyoto.i
index c924126..1ba747a 100644
--- a/yorick/gyoto.i
+++ b/yorick/gyoto.i
@@ -940,6 +940,10 @@ extern gyoto_Metric;
      The kind of the metric (e.g. "KerrBL") can be queried:
         kind_string = gg(kind=)
 
+     The coordinate kind of this metric can be compared with members
+     of the oxy group gyoto.coordkind:
+        if (gg.coordkind() == gyoto.coordkind.cartesian) ...;
+
      The minimum and maximum value of the adaptive step in
      the integrator can be set using respectively deltamin and
      deltamax.
diff --git a/yorick/gyoto_Metric.C b/yorick/gyoto_Metric.C
index 49d69ca..7f85d53 100644
--- a/yorick/gyoto_Metric.C
+++ b/yorick/gyoto_Metric.C
@@ -137,6 +137,13 @@ void ygyoto_Metric_generic_eval(SmartPointer<Metric::Generic>*OBJ,
     *kind = p_strcpy((*OBJ)->kind().c_str());
   }
 
+  // coordkind
+  if ((iarg=kiargs[++k])>=0) {
+    if ((*rvset)++) y_error(rmsg);
+    if (!yarg_nil(iarg)) y_error("COORDKIND is readonly");
+    ypush_long((*OBJ)->coordKind());
+  }
+
   YGYOTO_WORKER_SETPARAMETER;
 
   // ScalarProd
diff --git a/yorick/gyoto_namespace.i b/yorick/gyoto_namespace.i
index d0e37bb..4e1dbe0 100644
--- a/yorick/gyoto_namespace.i
+++ b/yorick/gyoto_namespace.i
@@ -44,7 +44,9 @@ gyoto=save(
            G_OVER_C_SQUARE=GYOTO_G_OVER_C_SQUARE,
            SUN_MASS=GYOTO_SUN_MASS,
            SUN_RADIUS=GYOTO_SUN_RADIUS,
-           KPC=GYOTO_KPC
+           KPC=GYOTO_KPC,
+
+           coordkind=save(unspecified=0, cartesian=1, spherical=2)
            
            );
   
diff --git a/yorick/ygyoto.h b/yorick/ygyoto.h
index 9a37a3a..46c500f 100644
--- a/yorick/ygyoto.h
+++ b/yorick/ygyoto.h
@@ -133,12 +133,12 @@ void ygyoto_Spectrometer_generic_eval
 */
 // Keywords processed by ygyoto_Metric_generic_eval
 #define YGYOTO_METRIC_GENERIC_KW "prime2tdot",				\
-    "nullifycoord", "kind", "setparameter", "scalarprod",		\
+    "nullifycoord", "kind", "coordkind", "setparameter", "scalarprod",	\
     "mass", "deltamin", "deltamax", "keplerian",					\
     "unitlength", "circularvelocity",					\
     "christoffel", "xmlwrite", "clone"
 // Number of those keywords
-#define YGYOTO_METRIC_GENERIC_KW_N 14
+#define YGYOTO_METRIC_GENERIC_KW_N 15
 
 // Keywords processed by ygyoto_Astrobj_generic_eval
 #define YGYOTO_ASTROBJ_GENERIC_KW "metric", "rmax", "opticallythin",	\

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-astro/packages/gyoto.git



More information about the Debian-astro-commits mailing list