[Debian-astro-commits] [gyoto] 100/221: remove KerrBL gg_ from PolishDoughnut

Thibaut Jean-Claude Paumard thibaut at moszumanska.debian.org
Fri May 22 20:52:37 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 2b88bd410a3cde049512099854c270123675e2bd
Author: Thibaut Paumard <paumard at users.sourceforge.net>
Date:   Thu Nov 20 21:36:31 2014 +0100

    remove KerrBL gg_ from PolishDoughnut
---
 include/GyotoPolishDoughnut.h | 13 +------------
 lib/PolishDoughnut.C          | 17 +++--------------
 2 files changed, 4 insertions(+), 26 deletions(-)

diff --git a/include/GyotoPolishDoughnut.h b/include/GyotoPolishDoughnut.h
index 075c45f..0f12401 100644
--- a/include/GyotoPolishDoughnut.h
+++ b/include/GyotoPolishDoughnut.h
@@ -36,7 +36,6 @@ namespace Gyoto{
  class FactoryMessenger;
 }
 
-#include <GyotoKerrBL.h>
 #include <GyotoStandardAstrobj.h>
 #include <GyotoFunctors.h>
 #include <GyotoHooks.h>
@@ -60,15 +59,6 @@ class Gyoto::Astrobj::PolishDoughnut
  // Data : 
  // -----
 protected:
-  /**
-   * \brief KerrBL metric
-   *
-   * This Astrobj::Generic subclass only works (so far?) in KerrBL
-   * metric.  We store a copy of the Astrobj::Generic::gg_
-   * SmartPointer appropriately cast. The two pointers point to the
-   * same instance.
-   */
- SmartPointer<Gyoto::Metric::KerrBL> gg_; 
  SmartPointer<Spectrum::BlackBody> spectrumBB_;
  double l0_; ///< Angular momentum. Tied to PolishDoughnut::lambda_.
  double lambda_; ///< Adimentionned angular momentum
@@ -103,7 +93,6 @@ protected:
  // -------------------------
 public:
  PolishDoughnut() ; ///< Default constructor
- //PolishDoughnut(SmartPointer<Metric::KerrBL> gg, double lambda) ; ///< Standard constructor
  PolishDoughnut(const PolishDoughnut& ) ;                ///< Copy constructor
  virtual  PolishDoughnut* clone() const;
  virtual ~PolishDoughnut() ;                        ///< Destructor
@@ -147,7 +136,7 @@ public:
  double getRcusp() const; ///< Get PolishDoughnut::r_cusp_
  double getRcentre() const; ///< Get PolishDoughnut::r_centre_
 
- virtual Gyoto::SmartPointer<Gyoto::Metric::Generic> metric() const;
+ using Standard::metric;
  virtual void metric(Gyoto::SmartPointer<Gyoto::Metric::Generic>);
 
  // ASTROBJ API
diff --git a/lib/PolishDoughnut.C b/lib/PolishDoughnut.C
index c773a09..195d771 100644
--- a/lib/PolishDoughnut.C
+++ b/lib/PolishDoughnut.C
@@ -38,7 +38,6 @@ using namespace Gyoto::Astrobj;
 #define nstep_angint 10 // for angle-averaging integration
 PolishDoughnut::PolishDoughnut() :
   Standard("PolishDoughnut"),
-  gg_(NULL),
   spectrumBB_(NULL),
   l0_(0.),
   lambda_(0.5),
@@ -71,7 +70,6 @@ PolishDoughnut::PolishDoughnut() :
 }
 PolishDoughnut::PolishDoughnut(const PolishDoughnut& orig) :
   Standard(orig),
-  gg_(NULL),
   spectrumBB_(NULL),
   l0_(orig.l0_),
   lambda_(orig.lambda_),
@@ -97,10 +95,7 @@ PolishDoughnut::PolishDoughnut(const PolishDoughnut& orig) :
 		 changecusp_(orig.changecusp_)
 {
   intersection.papa=this;
-  if (orig.gg_()) {
-    gg_=orig.gg_->clone();
-    Standard::gg_ = gg_;
-  }
+  if (gg_) gg_ -> hook(this);
   if (orig.spectrumBB_()) spectrumBB_=orig.spectrumBB_->clone();
 }
 PolishDoughnut* PolishDoughnut::clone() const
@@ -230,16 +225,11 @@ PolishDoughnut::~PolishDoughnut() {
   GYOTO_DEBUG << "PolishDoughnut Destruction" << endl;
   if (gg_) gg_ -> unhook(this);
 }
-Gyoto::SmartPointer<Gyoto::Metric::Generic> PolishDoughnut::metric() const {
-  return SmartPointer<Metric::Generic>(gg_);
-}
+
 void PolishDoughnut::metric(Gyoto::SmartPointer<Gyoto::Metric::Generic> met)
 {
-  if (met->kind() != "KerrBL")
-    throwError("PolishDoughnut::metric(): only KerrBL, please");
   if (gg_) gg_ -> unhook(this);
-  gg_ = SmartPointer<Metric::KerrBL>(met);
-  Generic::gg_ = gg_;
+  Standard::metric(met);
   if (gg_) gg_ -> hook(this);
   GYOTO_DEBUG << "Metric set, calling lambda\n";
   lambda(lambda_); // setLambda_ initializes other members
@@ -1443,7 +1433,6 @@ int PolishDoughnut::setParameter(string name, string content, string unit) {
 }
 #ifdef GYOTO_USE_XERCES
 void PolishDoughnut::fillElement(FactoryMessenger *fmp) const {
-  fmp->metric(gg_);
   fmp->setParameter("Lambda", lambda_);
   fmp->setParameter("CentralDensity", central_density_);
   fmp->setParameter("CentralTempOverVirial", centraltemp_over_virial_);

-- 
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