AstroOmegaTest.c

Go to the documentation of this file.
00001 /*
00002 *  Copyright (C) 2007 Jolien Creighton, Tania Regimbau
00003 *
00004 *  This program is free software; you can redistribute it and/or modify
00005 *  it under the terms of the GNU General Public License as published by
00006 *  the Free Software Foundation; either version 2 of the License, or
00007 *  (at your option) any later version.
00008 *
00009 *  This program is distributed in the hope that it will be useful,
00010 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 *  GNU General Public License for more details.
00013 *
00014 *  You should have received a copy of the GNU General Public License
00015 *  along with with program; see the file COPYING. If not, write to the
00016 *  Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
00017 *  MA  02111-1307  USA
00018 */
00019 
00020 
00021 /*<lalVerbatim file="AstroOmegaTestCV">
00022 Author: Regimbau Tania
00023 $Id: AstroOmegaTest.c,v 1.7 2007/06/08 14:41:54 bema Exp $
00024 </lalVerbatim> */
00025 
00026 /* 
00027 <lalLaTeX>
00028 \subsection{Program \texttt{AstroOmegaTest.c}}
00029 This programs verifies that the routine LALAstroOmega() gives the expected results (computed separetly with mathematica) for a set of input parameters.
00030 
00031 \subsubsection*{Exit codes}
00032 returns 0 on success, otherwise returns 1.
00033 
00034 \subsubsection*{Uses}
00035 \begin{verbatim}
00036 lalDebugLevel
00037 LALAstroOmega() 
00038 \end{verbatim}
00039 
00040 \vfill{\footnotesize\input{AstroOmegaTestCV}}
00041 </lalLaTeX> 
00042 */
00043 
00044 #include <stdio.h>
00045 #include <math.h>
00046 #include <lal/LALConfig.h>
00047 #include <lal/LALStdlib.h>
00048 #include <lal/Integrate.h>
00049 #include <lal/AstroOmega.h>
00050 
00051 NRCSID (ASTROOMEGATESTC, "$Id: AstroOmegaTest.c,v 1.7 2007/06/08 14:41:54 bema Exp $");
00052 
00053 static void SDensity (REAL8 *dEgw, REAL8 nu)
00054  {  
00055   *dEgw=9.27E35 * pow(nu,3.);
00056   return;
00057  }
00058 
00059 int lalDebugLevel = 0;
00060 int main ( void )
00061  {
00062   static LALStatus status;
00063   AstroOmegaParams p;
00064   AstroOmegaSourceParams sourcep;
00065   AstroOmegaCosmoParams cosmop;
00066   REAL8 nu, test;
00067 
00068   cosmop.ho = 0.65;
00069   cosmop.density_matter = 0.3;
00070   cosmop.density_vacuum = 0.7;
00071   cosmop.density_k = 0.;
00072   nu = 1100.;
00073   /*source*/
00074   sourcep.lambda = 4.84E-3;
00075   sourcep.numax = 4000.;
00076   sourcep.SDensitySource = SDensity;
00077   p.cosmoparams = cosmop;
00078   p.sourceparams = sourcep;
00079 
00080   
00081   p.extraparams = &nu; 
00082   LALAstroOmega (&status, &test, nu,&p);
00083   if (fabs(test-1.16E-10) > 1.E-12)
00084    {
00085     printf("error! the right value is 1.16E-10 not %.2e\n",test);
00086    }
00087   else printf("omega(%f)= %.2e o.k\n", nu,test);
00088   
00089    /*  
00090   for (nu = 0.;nu < sourcep.numax;nu = nu + 10.)
00091    {
00092     p.extraparams = &nu;
00093     LALAstroOmega (&status, &test, nu, &p);
00094     printf("%f\t %.2e\n", nu,test);}
00095   */
00096   return 0;
00097   }

Generated on Sat Jul 19 03:13:55 2008 for LAL by  doxygen 1.5.2