Changes between Version 26 and Version 27 of u/erica/CylindricalGravity


Ignore:
Timestamp:
01/15/15 12:22:32 (10 years ago)
Author:
Erica Kaminski
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • u/erica/CylindricalGravity

    v26 v27  
    113113Dx for the patch is easy, that is just,
    114114
    115 dx = levels(Info%level)% dx
     115[[latex($dx = levels(Info\%level)\% dx$)]]
    116116
    117117To get all of the x_i's of the cells in the patch we can allocate an array 'x_i' that has length = number of cells along x axis of patch,
    118118
    119 Allocate x(Info%mGlobal(1,1): Info%mGlobal(1,2))
     119[[latex($Allocate ~x(Info\%mGlobal(1,1): Info\%mGlobal(1,2))$)]]
    120120
    121121(For a refresher page describing patch specific quantities, refer here)
     
    123123Now to populate this array, we loop through:
    124124
    125 Do i = Info%mGlobal(1,1), Info%mGlobal(1,2)[[br]]
    126  x(i) = GxBounds(1,1) + (i - half)*dx[[br]]
    127 End Do
     125[[latex($Do ~i = Info\%mGlobal(1,1), Info\%mGlobal(1,2)$)]]
     126 [[latex($~x(i) = GxBounds(1,1) + (i - half)*dx$)]]
     127[[latex($End ~Do$)]]
    128128
    129129This starts at the  ''global'' lower left hand corner of the entire box (gXbounds(1,1)) and marches over i*dx_patch spaces (subtracting off the .5dx to get to the cell center).
     
    134134Once we have these 2 things calculated, we can then add in the meat and potatoes:
    135135
    136 If (iCylindrical > 0) Then [[br]]
    137  tempStencilValues(1) = 1-dx/2x(i) [[br]]
    138  tempStencilValues(2) = 1+dx/2x(i) [[br]]
    139 End If [[br]]
     136[[latex($If ~(iCylindrical > 0)~Then$)]]
     137 [[latex($~tempStencilValues(1) = 1-dx/2x(i)$)]] [[br]]
     138 [[latex($tempStencilValues(2) = 1+dx/2x(i)$)]]
     139[[latex($End~ If$)]][[br]]
    140140
    141141Then set the matrixvalues for the stencil of the ith cell, by doing
    142142
    143 matrixvalues(m:m+4) = tempStencilValues(1:5)
     143[[latex($matrixvalues(m:m+4) = tempStencilValues(1:5)$)]]
    144144
    145145where m increases by 5 for each cell in the mesh. For example,
    146146
    147 matrixvalues(:)=(-4,1,1,1,1, -4, 1, 1, 1, 1, -4, 1, 1, 1, 1, ...., -4, 1, 1, 1, 1)
     147[[latex($matrixvalues(:)=(-4,1,1,1,1, -4, 1, 1, 1, 1, -4, 1, 1, 1, 1, ...., -4, 1, 1, 1, 1)$)]]
    148148
    149149for regular 2D Cartesian geometry.