/* * Reads a file containing a binary configuration (class Bin_ns_ncp) and * performs various plots. * */ /* * 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 lit_bin_ncp_C[] = "$Header: /cvsroot/Lorene/Codes/Bin_star_ncp/lit_bin_ncp.C,v 1.3 2014/10/13 08:53:54 j_novak Exp $" ; /* * $Header: /cvsroot/Lorene/Codes/Bin_star_ncp/lit_bin_ncp.C,v 1.3 2014/10/13 08:53:54 j_novak Exp $ * */ // headers C #include #include #include // headers Lorene #include "bin_ns_ncp.h" #include "eos.h" #include "utilitaires.h" #include "graphique.h" // Local prototype Cmp raccord_c1(const Cmp& uu, int l1) ; //****************************************************************************** using namespace Lorene ; int main(int argc, char** argv){ // Identification of all the subroutines called by the code : // system("ident lit_bin") ; if (argc < 2) { cout << "lit_bin_ncp : the name of a file containing a binary configuration" << endl << " must be given in argument !" << endl ; abort() ; } char* nomresu = argv[1] ; cout << "Name of the file to be read : " << nomresu << endl ; cout << endl << "Do you want to draw the boundaries of the various domains (y/n) ? [y]" << endl ; char rep ; cin.get(rep) ; bool draw_bound = !(rep == 'n') ; #include "unites.h" // To avoid some compilation warnings if (nomresu == 0x0) { cout << qpig << f_unit << mevpfm3 << endl ; } FILE* fich = fopen(nomresu, "r") ; int mer ; fread(&mer, sizeof(int), 1, fich) ; // mer Mg3d mg1(fich) ; Map_et mp1(mg1, fich) ; Eos* peos1 = Eos::eos_from_file(fich) ; Mg3d mg2(fich) ; Map_et mp2(mg2, fich) ; Eos* peos2 = Eos::eos_from_file(fich) ; 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 ydes_max2) ? ydes_max1 : ydes_max2 ; double zdes_min1 = - 4. * star(1).ray_pole() ; double zdes_min2 = - 4. * star(2).ray_pole() ; double zdes_min = (zdes_min1 < zdes_min2) ? zdes_min1 : zdes_min2 ; double zdes_max1 = 4. * star(1).ray_pole() ; double zdes_max2 = 4. * star(2).ray_pole() ; double zdes_max = (zdes_max1 > zdes_max2) ? zdes_max1 : zdes_max2 ; Cmp surf1 = star(1).get_ent()() ; Cmp surf1_ext(mp1) ; surf1_ext = - 0.2 * surf1(0, 0, 0, 0) ; surf1_ext.annule(0, star(1).get_nzet()-1) ; surf1.annule(star(1).get_nzet(), mg1.get_nzone()-1) ; surf1 = surf1 + surf1_ext ; surf1 = raccord_c1(surf1, star(1).get_nzet()) ; Cmp surf2 = star(2).get_ent()() ; Cmp surf2_ext(mp2) ; surf2_ext = - 0.2 * surf2(0, 0, 0, 0) ; surf2_ext.annule(0, star(2).get_nzet()-1) ; surf2.annule(star(2).get_nzet(), mg2.get_nzone()-1) ; surf2 = surf2 + surf2_ext ; surf2 = raccord_c1(surf2, star(2).get_nzet()) ; char title[80] ; char bslash[2] = {92, '\0'} ; // 92 is the ASCII code for backslash ofstream fent("enthalpy.d") ; fent << "Enthalpy field at the boundary of last inner domain of star 1 : " << endl ; int lzet = star(1).get_nzet() - 1 ; for (int k=0; k