Changes between Version 24 and Version 25 of u/erica/CylindricalGravity


Ignore:
Timestamp:
01/13/15 17:44:15 (10 years ago)
Author:
Erica Kaminski
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • u/erica/CylindricalGravity

    v24 v25  
    109109==== 2.5D Mod ====
    110110
    111 What we then need to add is a modification in these loops for cylindrical. This modification is going to need both the dx of the patch, and the x position of the cell (also patch dependent). Instead of calculating for each iteration of the loop, we can try and save some computation time and put the calculation of x and dx before the loop.
     111What we then need to add is a modification in these loops for cylindrical. As stated above, this modification is going to need both the dx of the patch, and the x position of the cell (also patch dependent - because x(dx)). Instead of calculating for each iteration of the loop, we can try and save some computational power and put the calculation of x and dx before the loop.
    112112
    113113Dx for the patch is easy, that is just,
    114114
    115 ''' levels(Info%level)% dx'''
     115dx = 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))'''
     119Allocate x(Info%mGlobal(1,1): Info%mGlobal(1,2))
    120120
    121 For a page describing patch specific quantities, refer here.
     121(For a refresher page describing patch specific quantities, refer here)
    122122
    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'''
     125Do i = Info%mGlobal(1,1), Info%mGlobal(1,2)[[br]]
     126 x(i) = GxBounds(1,1) + (i - half)*dx[[br]]
     127End Do
    128128
    129 This starts at the lower left hand corner of the mesh (gXbounds(1,1)) and marches over i*dx_patch times (subtracting off the .5dx to get to the cell center).
     129This 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).
    130130
    131131Another way to do this would have been to use the lower x position of the patch itself, say:
    132132
     133
     134Once we have these 2 things calculated, we can then add in the meat and potatoes:
     135
     136If (iCylindrical > 0) Then [[br]]
     137 tempStencilValues(1) = 1-dx/2x(i) [[br]]
     138 tempStencilValues(2) = 1+dx/2x(i) [[br]]
     139End If [[br]]
     140
     141Then set the matrixvalues for the stencil of the ith cell = tempStencilValues