Hello Peter,
I think that most everyone would agree that the most general
approach would be have the code itself be independent of units,
but there are a couple of reasons that we have CGS.
First, in astrophysics, particularly the problems we are going
after, there are no "natural" units. We deal with numbers that
will go through many orders of magnitude even if they are scaled.
Next, many of the physics modules we include rely on rates
that are measured in some set of units. Reaction rates, for
example, correspond to measured quantities in some set of
units. Also, tabular equations of state typically return results in
a particular set of units. CGS units are the common theme
in these modules.
Our approach has been to stick with CGS as that is what most
of the modules in the code were written for. To change units
would mean going through and wrapping many of the routines
that read tables, which would present many challenges. Unfortunately,
cosmological problems are the one for which the situation is
acute, and Paul noted earlier.
Regards,
Alan
Alan C. Calder
University of Chicago
ASCI Flash Center
5640 South Ellis Ave.
Chicago, IL 60637
email: calder@flash.uchicago.edu
phone: (773) 834-3904
fax: (773) 834-3230
web: http://flash.uchicago.edu/~calder/
On Tue, 25 Feb 2003, Peter Teuben wrote:
>
> Perhaps i'm missing something, but why on earth would one want to
> scale numbers to fit a problem *inside* the code. Anyone should
> be able to scale the numbers after you're done with the code. It's
> just a scaling factor. Adding more complexity to the code / user
> interface can only increase the number of errors you can make
> with the code. I could be more frank and claim if someone doesn't
> know how to scale the numbers, they shouldn't be using the code.
>
> Granted, there is *some* advantage if you add units to your numbers.
> In fact, in languages like C++ you can attach units to your numbers,
> and detect usage problems if you do "a = b + c" if they don't
> fit properly in their attached units, but i don't see why a high
> performance scientific computing code should need this kind
> of baggage.
>
> - peter
>
>
> On Tue, 25 Feb 2003, JB Gallagher wrote:
>
> > >
> > >
> > > Claudio,
> > >
> > > Currently there is no mechanism to change the code units (this is
> > > under discussion at present). So you need to set things in CGS.
> > > One gotcha to be aware of is that you will need to set the "small"
> > > quantities (smlrho, smallp, smallu, etc.) to appropriate values.
> > > The defaults are suitable for stellar problems, but are generally
> > > inappropriate for cosmological problems. With this caveat, and
> > > given the fact that everything is done in double precision,
> > > generally I don't have any trouble doing things in CGS.
> > >
> > > By the way, it is possible to get physical constants from the
> > > physical constants database in any set of units you wish by using
> > > the optional arguments to the database access routines. This in
> > > fact is the basis for the expected future implementation of
> > > code-wide systems of units.
> > >
> > > Best regards,
> > > Paul
> > >
> > > --
> > > ---------------------------------------------------------------------
> > > Paul M. Ricker Department of Astronomy
> > > Assistant Professor National Center for Supercomputing Applications
> > > pmricker@uiuc.edu University of Illinois at Urbana-Champaign
> > > http://www.astro.uiuc.edu/~pmricker Urbana IL 61801-3074
> > > ---------------------------------------------------------------------
> > >
> > > >
> > > >
> > > > Hi,
> > > >
> > > > I am just wondering if anybody know a quick way to set up
> > > units for
> > > > cosmological simulations (len_unit = kpc or Mpc, time_unit = age of
> > > the
> > > > Universe and so on).
> > > >
> > > > Thanks,
> > > > Claudio.
> > > >
> > > > --
> > > >
> > > ***********************************************************************
> > > > Claudio Dalla Vecchia e-mail:
> > > Claudio.Dalla-Vecchia@durham.ac.uk
> > > > Institute for Computational web: http://web.tiscali.it/caiusweb/
> > > > Cosmology, South Road tel: +44 (0191) 374.8287 linux
> > > user
> > > > Durham DH1 3LE - UK fax: +44 (0191) 374.3749
> > > #275369
> > > >
> > > -----------------------------------------------------------------------
> > > > "Politicians hide themeselves away / They only started the war
> > > > Why should they go out to fight / They leave that all to the poor"
> > > > ("War Pigs" - Black Sabbath)
> > > >
> > > ***********************************************************************
> >
>
Received on Tue Feb 25 16:33:31 2003
This archive was generated by hypermail 2.1.8 : Thu Aug 31 2006 - 21:20:48 CDT