bin_bhns_rotaxis.C

00001 /*
00002  *  Methods of class Bin_bhns to compute the location of the rotation axis
00003  *
00004  *    (see file bin_bhns.h for documentation).
00005  *
00006  */
00007 
00008 /*
00009  *   Copyright (c) 2005-2006 Keisuke Taniguchi
00010  *
00011  *   This file is part of LORENE.
00012  *
00013  *   LORENE is free software; you can redistribute it and/or modify
00014  *   it under the terms of the GNU General Public License version 2
00015  *   as published by the Free Software Foundation.
00016  *
00017  *   LORENE is distributed in the hope that it will be useful,
00018  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00019  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00020  *   GNU General Public License for more details.
00021  *
00022  *   You should have received a copy of the GNU General Public License
00023  *   along with LORENE; if not, write to the Free Software
00024  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00025  *
00026  */
00027 
00028 char bin_bhns_rotaxis_C[] = "$Header: /cvsroot/Lorene/C++/Source/Bin_bhns/bin_bhns_rotaxis.C,v 1.1 2007/06/22 01:10:47 k_taniguchi Exp $" ;
00029 
00030 /*
00031  * $Id: bin_bhns_rotaxis.C,v 1.1 2007/06/22 01:10:47 k_taniguchi Exp $
00032  * $Log: bin_bhns_rotaxis.C,v $
00033  * Revision 1.1  2007/06/22 01:10:47  k_taniguchi
00034  * *** empty log message ***
00035  *
00036  *
00037  * $Header: /cvsroot/Lorene/C++/Source/Bin_bhns/bin_bhns_rotaxis.C,v 1.1 2007/06/22 01:10:47 k_taniguchi Exp $
00038  *
00039  */
00040 
00041 // C++ headers
00042 //#include <>
00043 
00044 // C headers
00045 #include <math.h>
00046 
00047 // Lorene headers
00048 #include "bin_bhns.h"
00049 #include "unites.h"
00050 
00051 void Bin_bhns::rotation_axis_x(double rot_exp_x) {
00052 
00053     using namespace Unites ;
00054 
00055     double momunit = (hole.get_mass_bh()+star.mass_g_bhns())*omega*separ ;
00056 
00057     double error_y = line_mom_bhns()(1) / momunit ;
00058 
00059     if (error_y >= 1.) {
00060       cout << "Bin_bhns::rotation_axis:" << endl ;
00061       cout << "   !!! WARNING : error_y is larger than +1 !!!" << endl ;
00062       error_y *= 0.1 ;
00063     }
00064 
00065     // Sets X_BH and X_NS
00066     // ------------------
00067 
00068     double gg = pow( (2.-error_y)/(2.-2.*error_y), rot_exp_x) ;
00069 
00070     double xbh_old = hole.get_mp().get_ori_x() ;
00071 
00072     cout << "Bin_bhns::rotation_axis:" << endl ;
00073     cout << "   error_y : " << error_y << "   gg : " << gg << endl ;
00074     cout << "   old X_BH : " << hole.get_mp().get_ori_x() / km << " [km]"
00075      << "   old X_NS : " << star.get_mp().get_ori_x() / km << " [km]"
00076      << endl ;
00077 
00078     double xbh_new = xbh_old * gg ;
00079     double xns_new = xbh_new + separ ;
00080 
00081     cout << "   new X_BH : " << xbh_new / km << " [km]"
00082      << "   new X_NS : " << xns_new / km << " [km]"
00083      << endl ;
00084 
00085     double yns_old = star.get_mp().get_ori_y() ;
00086 
00087     (hole.set_mp()).set_ori(xbh_new, 0., 0.) ;
00088     (star.set_mp()).set_ori(xns_new, yns_old, 0.) ;
00089 
00090     set_x_rot() = 0. ;
00091 
00092 }
00093 
00094 void Bin_bhns::rotation_axis_y(double thres_rot, double rot_exp_y,
00095                    double fact) {
00096 
00097     using namespace Unites ;
00098 
00099     double momunit = (hole.get_mass_bh()+star.mass_g_bhns())*omega*separ ;
00100 
00101     double error_x = line_mom_bhns()(0) / momunit ;
00102 
00103     if (error_x <= -1.) {
00104       cout << "Bin_bhns::rotation_axis:" << endl ;
00105       cout << "   !!! WARNING : error_x is smaller than -1 !!!" << endl ;
00106       error_x *= 0.1 ;
00107     }
00108 
00109     // Sets Y_NS
00110     // ---------
00111 
00112     double ff = pow( (2.+error_x)/(2.+2.*error_x), rot_exp_y) ;
00113 
00114     double yns_old = star.get_mp().get_ori_y() ;
00115 
00116     if ( fabs(error_x) < thres_rot ) {
00117         cout << "Bin_bhns::rotation_axis:" << endl ;
00118     cout << "   ff is set to 1 because error_x is smaller than" << endl ;
00119     cout << "   the threshold value (" << thres_rot << ")" << endl ;
00120 
00121         ff = 1. ;
00122     }
00123 
00124     cout << "Local center of mass of NS:" << endl ;
00125     cout << "   X_CM : " << xa_barycenter() / km << " [km]"
00126      << "   Y_CM : " << ya_barycenter() / km << " [km]" << endl ;
00127 
00128     cout << "Bin_bhns::rotation_axis:" << endl ;
00129     cout << "   error_x : " << error_x << "   ff : " << ff << endl ;
00130     cout << "   old Y_BH : " << hole.get_mp().get_ori_y() / km << " [km]"
00131      << "   old Y_NS : " << star.get_mp().get_ori_y() / km << " [km]"
00132      << endl ;
00133 
00134     double aa = fact * separ ;
00135     double yns_new = yns_old + aa * (1. - ff) ;
00136 
00137     cout << "   new Y_BH : " << 0. / km << " [km]"
00138      << "   new Y_NS : " << yns_new / km << " [km]"
00139      << endl ;
00140 
00141     double xbh_old = hole.get_mp().get_ori_x() ;
00142     double xns_old = star.get_mp().get_ori_x() ;
00143 
00144     (hole.set_mp()).set_ori(xbh_old, 0., 0.) ;
00145     (star.set_mp()).set_ori(xns_old, yns_new, 0.) ;
00146 
00147     set_y_rot() = 0. ;
00148 
00149 }

Generated on Tue Feb 7 01:35:14 2012 for LORENE by  doxygen 1.4.6