[Debian-astro-commits] [gyoto] 20/221: Migrating omegaPattern_ and tPattern_ from DynaDisk3D to Disk3D where they belong

Thibaut Jean-Claude Paumard thibaut at moszumanska.debian.org
Fri May 22 20:52:30 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 f1d58b489da853785c2f75f5ec0fd5070f3116f3
Author: Frederic <frederic at MacFrederic.local>
Date:   Fri Sep 26 14:20:40 2014 +0200

    Migrating omegaPattern_ and tPattern_ from DynaDisk3D to Disk3D where they belong
---
 include/GyotoDisk3D.h          |  3 +++
 include/GyotoDynamicalDisk3D.h |  2 --
 lib/Disk3D.C                   | 12 ++++++++++--
 lib/DynamicalDisk3D.C          | 24 ++++++------------------
 lib/PolishDoughnut.C           |  3 +++
 5 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/include/GyotoDisk3D.h b/include/GyotoDisk3D.h
index d44859b..2316ef5 100644
--- a/include/GyotoDisk3D.h
+++ b/include/GyotoDisk3D.h
@@ -102,6 +102,9 @@ class Gyoto::Astrobj::Disk3D : public Gyoto::Astrobj::Generic {
 
   int zsym_; ///< 1 to symmetrize the grid z -> -z (default case)
 
+  double tPattern_; ///< If the disk is being rotated (like a pattern disk) this is the origin of time for this rotation
+  double omegaPattern_; ///< If the disk is being rotated (like a pattern disk) this is the rotation velocity dphi/dt
+
   // Constructors - Destructor
   // -------------------------
  public:
diff --git a/include/GyotoDynamicalDisk3D.h b/include/GyotoDynamicalDisk3D.h
index b18290a..2e633b5 100644
--- a/include/GyotoDynamicalDisk3D.h
+++ b/include/GyotoDynamicalDisk3D.h
@@ -69,8 +69,6 @@ class Gyoto::Astrobj::DynamicalDisk3D : public Astrobj::Disk3D {
   double PLindex_; ///< power law index such that density_elec(E) ∝ E<SUP>-p</SUP>
   int novel_; ///< put to 1 if velocity of emitting particle is not provided
   double floortemperature_; ///< if non-zero, emission and absorption are 0 for temperatures below this floor, emission=blackbody and absorption is infty for temperatures above (this is a kind of fake optically thick case, when the emitting surface is inside the grid, not at the boundary of the grid)
-  double tPattern_; ///< If the disk is being rotated (like a pattern disk) this is the origin of time for this rotation
-  double omegaPattern_; ///< If the disk is being rotated (like a pattern disk) this is the rotation velocity dphi/dt
 
   /**
    * An array of arrays of dimensionality double[nr_][nz_][nphi_][nnu_]. 
diff --git a/lib/Disk3D.C b/lib/Disk3D.C
index 5cbce60..41e35ee 100644
--- a/lib/Disk3D.C
+++ b/lib/Disk3D.C
@@ -49,7 +49,7 @@ Disk3D::Disk3D() :
   dphi_(0.), phimin_(-DBL_MAX), nphi_(0), phimax_(DBL_MAX), repeat_phi_(1),
   dz_(0.), zmin_(-DBL_MAX), nz_(0), zmax_(DBL_MAX),
   dr_(0.), rin_(-DBL_MAX), nr_(0), rout_(DBL_MAX),
-  zsym_(1)
+  zsym_(1), tPattern_(0.), omegaPattern_(0.)
 {
   GYOTO_DEBUG << "Disk3D Construction" << endl;
 }
@@ -62,7 +62,8 @@ Disk3D::Disk3D(const Disk3D& o) :
   nphi_(o.nphi_), phimax_(o.phimax_), repeat_phi_(o.repeat_phi_),
   dz_(o.dz_), zmin_(o.zmin_), nz_(o.nz_), zmax_(o.zmax_),
   dr_(o.dr_), rin_(o.rin_), nr_(o.nr_), rout_(o.rout_),
-  zsym_(o.zsym_)
+  zsym_(o.zsym_), tPattern_(o.tPattern_),
+  omegaPattern_(o.omegaPattern_)
 {
   GYOTO_DEBUG << "Disk3D Copy" << endl;
   size_t ncells = 0;
@@ -588,10 +589,15 @@ void Disk3D::getIndices(size_t i[4], double const co[4], double nu) const {
     phi=zz=rr=0.;
   }
 
+  // Rotating the disk if the Pattern variables are given
+  phi -= omegaPattern_*(co[0]-tPattern_);
+  //  cout << "in indeice" << endl;
   if (dphi_*dz_*dr_==0.)
     throwError("In Disk3D::getIndices: dimensions can't be null!");
   //Phi indice
   while (phi<0) phi += 2.*M_PI;
+  while (phi>2.*M_PI) phi -= 2.*M_PI;
+
   if (phi<phimin_) //Possible: any phi value is in the grid anyway
     i[1]=0;
   else if (phi>phimax_)
@@ -787,6 +793,8 @@ int Disk3D::setParameter(std::string name,
               throwError("This Gyoto has no FITS i/o");
 #endif
   if      (name == "NoZsymmetrizeGrid") zsym_ = 0;
+  else if (name=="tPattern") tPattern_=atof(content.c_str());
+  else if (name=="omegaPattern") omegaPattern_=atof(content.c_str());
   else return Generic::setParameter(name, content, unit);
   return 0;
 }
diff --git a/lib/DynamicalDisk3D.C b/lib/DynamicalDisk3D.C
index 8c86857..554c2ae 100644
--- a/lib/DynamicalDisk3D.C
+++ b/lib/DynamicalDisk3D.C
@@ -48,9 +48,7 @@ DynamicalDisk3D::DynamicalDisk3D() :
   nb_times_(1),
   PLindex_(3),
   novel_(0),
-  floortemperature_(0),
-  tPattern_(0.),
-  omegaPattern_(0.)
+  floortemperature_(0)
 {
   GYOTO_DEBUG << "DynamicalDisk3D Construction" << endl;
   spectrumBB_ = new Spectrum::BlackBody(); 
@@ -66,9 +64,7 @@ DynamicalDisk3D::DynamicalDisk3D(const DynamicalDisk3D& o) :
   nb_times_(o.nb_times_),
   PLindex_(o.PLindex_),
   novel_(o.novel_),
-  floortemperature_(o.floortemperature_),
-  tPattern_(o.tPattern_),
-  omegaPattern_(o.omegaPattern_)
+  floortemperature_(o.floortemperature_)
 {
   GYOTO_DEBUG << "DynamicalDisk3D Copy" << endl;
   if (o.spectrumBB_()) spectrumBB_=o.spectrumBB_->clone();
@@ -220,11 +216,6 @@ double DynamicalDisk3D::emission1date(double nu, double dsem,
   double ph=co[3];
   double tt=co[0];
 
-  // Rotating the disk if the Pattern variables are given
-  co[3] -= omegaPattern_*(tt-tPattern_);
-  while (co[3]<0.) co[3]+=2*M_PI;
-  while (co[3]>2.*M_PI) co[3]-=2*M_PI;
-
   if (rcur*fabs(sin(th)) > rout() || rcur < risco) return 0.;
 
   size_t i[4]; // {i_nu, i_phi, i_z, i_r}
@@ -252,6 +243,7 @@ double DynamicalDisk3D::emission1date(double nu, double dsem,
   }else{//                 // optically thin case
 
     if (temperature_){
+      // cout << "in DD3 Ires= " << rcur << " " << th  << " " << emissq << " " << floortemperature_ << " ";
       if (emissq<floortemperature_){
 	//cout << "return 0 " << emissq << " " << floortemperature_ << endl;
 	//throwwError("test dynad3d");
@@ -302,6 +294,7 @@ double DynamicalDisk3D::emission1date(double nu, double dsem,
 	// Ires=jnu*dsem*dist_unit; // usd e.g. for 3D RWI computation
 	// //cout << "stuff: " << density << " " << fact2 << " " << emissq << " " << dsem << " " << jnu << endl;
       }
+      // cout << Ires << endl; // TEST
     }else{
       //Ires=Iem; // used e.g. for GC blob computation
       double dist_unit = gg_->unitLength()*100.; // unit length in cgs
@@ -310,6 +303,7 @@ double DynamicalDisk3D::emission1date(double nu, double dsem,
     }
 
   }
+
   return Ires;
 
 }
@@ -372,11 +366,6 @@ double DynamicalDisk3D::transmission1date(double nu, double dsem,
 
   if (rcur*fabs(sin(th)) > rout() || rcur < risco) return 0.;
 
-  // Rotating the disk if the Pattern variables are given
-  co[3] -= omegaPattern_*(tt-tPattern_);
-  while (co[3]<0.) co[3]+=2*M_PI;
-  while (co[3]>2.*M_PI) co[3]-=2*M_PI;
-
   size_t i[4]; // {i_nu, i_phi, i_z, i_r}
   getIndices(i,co,nu);
   size_t naxes[4];
@@ -388,6 +377,7 @@ double DynamicalDisk3D::transmission1date(double nu, double dsem,
     double emissq = emiss[i[3]*nphi*nz*nnu+i[2]*nphi*nnu+i[1]*nnu+i[0]];
     //emissq is local temperature in K
 
+    //cout << "in trans DD3: " << rcur << " " << th << " " << emissq << " " << floortemperature_ << endl;
     if (emissq<floortemperature_) return 1.;
     else return 0.;
     
@@ -599,8 +589,6 @@ int DynamicalDisk3D::setParameter(std::string name,
   else if (name=="PLindex") PLindex_=atof(content.c_str());
   else if (name=="NoVelocity") novel_=1;
   else if (name=="FloorTemperature") floortemperature_=atof(content.c_str());
-  else if (name=="tPattern") tPattern_=atof(content.c_str());
-  else if (name=="omegaPattern") omegaPattern_=atof(content.c_str());
   else return Disk3D::setParameter(name, content, unit);
   return 0;
 }
diff --git a/lib/PolishDoughnut.C b/lib/PolishDoughnut.C
index b27b9cb..84d58c8 100644
--- a/lib/PolishDoughnut.C
+++ b/lib/PolishDoughnut.C
@@ -524,6 +524,9 @@ double PolishDoughnut::emissionSynchro_komissarov_PL_direction(
 							       double number_density_PL,double nuem, double nuc,double theta_mag)
   const {
   // From Petrosian & McTiernan 1983, Phys. Fluids 26 (10), eq. 32
+  // Putting g(mu)=1 and using (Y+ + Y_)=2 to get jnu and alphanu.
+  // NB: putting g(mu)=1 or 1/2 is not important, it boils down
+  // to redefining the % amount delta of PL energy wrt THER energy
   double emis_synch =
     sqrt(3.)*M_PI*GYOTO_ELEMENTARY_CHARGE_CGS*GYOTO_ELEMENTARY_CHARGE_CGS
     *nuc*sin(theta_mag)/(2.*GYOTO_C_CGS)

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