00001 /* 00002 * Member functions of the Cmp class for the computation of integrals. 00003 */ 00004 00005 /* 00006 * Copyright (c) 1999-2001 Eric Gourgoulhon 00007 * 00008 * This file is part of LORENE. 00009 * 00010 * LORENE is free software; you can redistribute it and/or modify 00011 * it under the terms of the GNU General Public License as published by 00012 * the Free Software Foundation; either version 2 of the License, or 00013 * (at your option) any later version. 00014 * 00015 * LORENE is distributed in the hope that it will be useful, 00016 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00018 * GNU General Public License for more details. 00019 * 00020 * You should have received a copy of the GNU General Public License 00021 * along with LORENE; if not, write to the Free Software 00022 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00023 * 00024 */ 00025 00026 00027 char cmp_integ_C[] = "$Header: /cvsroot/Lorene/C++/Source/Cmp/cmp_integ.C,v 1.1.1.1 2001/11/20 15:19:27 e_gourgoulhon Exp $" ; 00028 00029 /* 00030 * $Id: cmp_integ.C,v 1.1.1.1 2001/11/20 15:19:27 e_gourgoulhon Exp $ 00031 * $Log: cmp_integ.C,v $ 00032 * Revision 1.1.1.1 2001/11/20 15:19:27 e_gourgoulhon 00033 * LORENE 00034 * 00035 * Revision 1.1 1999/12/09 10:50:21 eric 00036 * Initial revision 00037 * 00038 * 00039 * $Header: /cvsroot/Lorene/C++/Source/Cmp/cmp_integ.C,v 1.1.1.1 2001/11/20 15:19:27 e_gourgoulhon Exp $ 00040 * 00041 */ 00042 00043 // Headers Lorene 00044 #include "map.h" 00045 #include "cmp.h" 00046 00047 //-----------------------------------// 00048 // Integral over all space // 00049 //-----------------------------------// 00050 00051 double Cmp::integrale() const { 00052 00053 const Tbl& integ = integrale_domains() ; 00054 00055 int nz = mp->get_mg()->get_nzone() ; 00056 00057 double resu = integ(0) ; 00058 for (int l=1; l<nz; l++) { 00059 resu += integ(l) ; 00060 } 00061 00062 return resu ; 00063 } 00064 00065 //-----------------------------------// 00066 // Integrals in each domain // 00067 //-----------------------------------// 00068 00069 const Tbl& Cmp::integrale_domains() const { 00070 00071 // Protection 00072 assert(etat != ETATNONDEF) ; 00073 00074 // If the integrals have not been previously computed, the 00075 // computation must be done by the appropriate routine of the mapping : 00076 00077 if (p_integ == 0x0) { 00078 p_integ = mp->integrale(*this) ; 00079 } 00080 00081 return *p_integ ; 00082 00083 } 00084
1.4.6