/* * Construction of initial conditions for a binary star computation. * */ /* * Copyright (c) 2003 Francois Limousin * * This file is part of LORENE. * * LORENE is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * LORENE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with LORENE; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ char init_bin_ncp_C[] = "$Header: /cvsroot/Lorene/Codes/Bin_star_ncp/init_bin_ncp.C,v 1.2 2014/10/06 15:09:43 j_novak Exp $" ; /* * $Header: /cvsroot/Lorene/Codes/Bin_star_ncp/init_bin_ncp.C,v 1.2 2014/10/06 15:09:43 j_novak Exp $ * */ // headers C++ #include "headcpp.h" // headers C #include #include // headers Lorene #include "bin_ns_ncp.h" #include "eos.h" #include "utilitaires.h" #include "graphique.h" #include "nbr_spx.h" #include "metrique.h" //****************************************************************************** int main(){ // Identification of all the subroutines called by the code : // system("ident init_bin") ; //----------------------------------------------------------------------- // Input data for the multi-grid no. 1 //----------------------------------------------------------------------- int nt, np, nz ; char blabla[80] ; ifstream fich("par_grid1.d") ; fich.getline(blabla, 80); fich.getline(blabla, 80); fich >> nz; fich.getline(blabla, 80) ; int nzet1 ; fich >> nzet1; fich.getline(blabla, 80) ; fich >> nt; fich.getline(blabla, 80) ; fich >> np; fich.getline(blabla, 80) ; cout << "total number of domains : nz = " << nz << endl ; cout << "number of points in phi : np = " << np << endl ; cout << "number of points in theta : nt = " << nt << endl ; int* nr = new int[nz]; int* nt_tab = new int[nz]; int* np_tab = new int[nz]; double* bornes = new double[nz+1]; fich.getline(blabla, 80); for (int l=0; l> nr[l]; fich >> bornes[l]; fich.getline(blabla, 80) ; np_tab[l] = np ; nt_tab[l] = nt ; } bornes[nz] = __infinity ; fich.close(); // Type of r sampling : int* type_r = new int[nz]; type_r[0] = RARE ; for (int l=1; l> nz; fich.getline(blabla, 80) ; int nzet2 ; fich >> nzet2; fich.getline(blabla, 80) ; fich >> nt; fich.getline(blabla, 80) ; fich >> np; fich.getline(blabla, 80) ; cout << "total number of domains : nz = " << nz << endl ; cout << "number of points in phi : np = " << np << endl ; cout << "number of points in theta : nt = " << nt << endl ; nr = new int[nz]; nt_tab = new int[nz]; np_tab = new int[nz]; bornes = new double[nz+1]; fich.getline(blabla, 80); for (int l=0; l> nr[l]; fich >> bornes[l]; fich.getline(blabla, 80) ; np_tab[l] = np ; nt_tab[l] = nt ; } bornes[nz] = __infinity ; fich.close(); // Type of r sampling : type_r = new int[nz]; type_r[0] = RARE ; for (int l=1; l> relat_i; fich.getline(blabla, 80) ; bool relat = (relat_i == 1) ; double separ ; fich >> separ; fich.getline(blabla, 80) ; separ *= km ; // translation in machine units int irrot1_i, irrot2_i ; double ent_c1, ent_c2 ; fich >> ent_c1 ; fich.getline(blabla, 80) ; fich >> irrot1_i ; fich.getline(blabla, 80) ; bool irrot1 = (irrot1_i == 1) ; fich >> ent_c2 ; fich.getline(blabla, 80) ; fich >> irrot2_i ; fich.getline(blabla, 80) ; bool irrot2 = (irrot2_i == 1) ; int conf_flat_i ; fich >> conf_flat_i; fich.getline(blabla, 80) ; bool conf_flat = (conf_flat_i == 1) ; fich.close() ; cout << endl << "Requested orbital separation : " << separ / km << " km" << endl ; //----------------------------------------------------------------------- // Construction of a flat metric //----------------------------------------------------------------------- Tenseur_sym plat1(mp1, 2, COV, mp1.get_bvect_cart() ) ; plat1.set_etat_qcq() ; for (int i=0; i<3; i++) { for (int j=0; j