Changes between Version 35 and Version 36 of u/erica/CylindricalGravity


Ignore:
Timestamp:
01/15/15 14:06:41 (10 years ago)
Author:
Erica Kaminski
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • u/erica/CylindricalGravity

    v35 v36  
    105105The routine begins by allocating an array to hold all of the coefficients for all of the stencil's cells for each of the cells in the patch. This array is aptly called 'matrixvalues' and is mx*my*mz*num_stencil_values long (where mx,y,z are the number of cells in each direction of the patch, and num_stencil_values is self explanatory).
    106106
    107 The main body of the routine loops through all of the cells in the patch, starting with each z, y, and then x. Since we are only concerned with modifying the 2D geometry for cylindrical, we really are looping through y first and then x. This means that for each y value (can think of it as a 'row' in the 2D mesh), we loop through each cell in x on that row, and calculate any modifications to the stencil that need to happen. After these mods are made, the 5 (in this special case) stencil values are fed into the 5 matrix values slots for that particular cell of the grid. And the loops continues. These values are then sent off to Hypre for solution.
     107The main body of the routine loops through all of the cells in the patch, starting with each z, y, and then x. Since we are only concerned with modifying the 2D geometry for cylindrical, we really are looping through y first and then x. This means that for each y value (can think of it as a 'row' in a 2D matrix), we loop through each cell in x on that row, and calculate any modifications to the stencil that need to happen. After these mods are made, the 5 (in the case of 2D) stencil values are fed into the 5 matrix value slots for that particular cell of the grid. And the loops continues. These values are sent off to Hypre for solution.
    108108
    109109==== 2.5D Mod ====
     
    115115[[latex($dx = levels(Info\%level)\% dx$)]]
    116116
    117 To 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,
     117To get all of the x positions 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
    119119[[latex($Allocate ~x(Info\%mGlobal(1,1): Info\%mGlobal(1,2))$)]]
     
    132132
    133133
    134 Once we have these 2 things calculated, we can then add in the meat and potatoes:
     134Once we have these parameters calculated, we can then add in the fix for 2.5D:
    135135
    136136[[latex($If ~(iCylindrical > 0)~Then$)]]
     
    143143[[latex($matrixvalues(m:m+4) = tempStencilValues(1:5)$)]]
    144144
    145 where m increases by 5 for each cell in the mesh. For example,
     145Note, for 2/2.5D, m increases by 5 for each cell in the mesh.
     146
     147For example,
    146148
    147149[[latex($matrixvalues(:)=(-4,1,1,1,1, -4, 1, 1, 1, 1, -4, 1, 1, 1, 1, ...., -4, 1, 1, 1, 1)$)]]
    148150
    149 for regular 2D Cartesian geometry.
    150 
    151 This means that matrixvalues(1) is the center cell stencil coefficient of the 1st cell in the mesh, matrix(6) is the center cell stencil coefficient of the 2nd cell in the mesh, and so on.
     151for regular 2D Cartesian geometry. This means that matrixvalues(1) is the center cell stencil coefficient of the 1st cell in the mesh, matrix(6) is the center cell stencil coefficient of the 2nd cell in the mesh, and so on.
    152152
    153153