Changes between Version 19 and Version 20 of ModulesOnAstroBear


Ignore:
Timestamp:
07/12/11 20:27:14 (14 years ago)
Author:
ehansen
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • ModulesOnAstroBear

    v19 v20  
    121121
    122122{{{
    123     q=>Info%q
    124123
    125124    rmbc=levels(Info%level)%gmbc(levels(Info%level)%step)
    126125
    127     mx=Info%mX(1); dx=Info%dX(1); xlower=Info%Xlower(1)
    128     my=Info%mX(2); dy=Info%dX(2); ylower=Info%Xlower(2)
    129     mz=Info%mX(3); dz=Info%dX(3); zlower=Info%Xlower(3)
     126    mx=Info%mX(1); dx=levels(Info%level)%dX; xlower=Info%xbounds(1,1)
     127    my=Info%mX(2);                           ylower=Info%xbounds(2,1)
     128    mz=Info%mX(3);                           zlower=Info%xbounds(3,1)
    130129
    131130    SELECT CASE(nDim)
     
    141140            DO i=1-rmbc, mx+rmbc
    142141
    143                 x=(xlower + (REAL(i,xPrec)-half) * dx)
    144                 y=(ylower + (REAL(j,xPrec)-half) * dy)
    145                 z=(zlower + (REAL(k,xPrec)-half) * dz)
    146 
    147                 q(i,j,k) = rho(x,y,z)
     142                x=(xlower + (REAL(i)-half) * dx)
     143                y=(ylower + (REAL(j)-half) * dx)
     144                z=(zlower + (REAL(k)-half) * dx)
     145
     146                Info%q(i,j,k,irho) = rho(x,y,z)
    148147            END DO
    149148        END DO
     
    154153
    155154 * '''''mX(3)''''':  The grid's overall size.  Each element {{{mx(n)}}} represents the number of cells along the ''n''th dimension.
    156  * '''''Xlower(3)''''':  The spatial coordinates of the grid's lower bound in each dimension.  These values are ''always'' given in computational units.
    157  * '''''dX(3)''''':  The size of a spatial step in a given dimension.  {{{dX(n)}}} can also be thought of as the size of a cell along dimension ''n''.
    158 
    159 To make this example more readable (and therefore easier to debug), we assigned the various array values more Cartesian-sounding names (ie., {{{Info%dX(2) = dy}}}).
     155 * '''''xbounds(3,2)''''':  The spatial coordinates of the grid's lower and upper bounds in each dimension.  These values are ''always'' given in computational units.
     156 * '''''dX''''':  The size of a spatial step.  {{{dX}}} can also be thought of as the size of a cell.  In AstroBEAR's current form, {{{dX}}} is the same in every dimension and is therefore not actually an array.
     157
     158To make this example more readable (and therefore easier to debug), we assigned the various array values more Cartesian-sounding names.
    160159
    161160Similarly, when calculating the spatial equivalents of an index, we went with {{{x}}}, {{{y}}} and {{{z}}}.  The half-step in the position calculations represents the fact that the spatial position is at the ''center'' of the cell, not the left side.