Class for a 3d DA-based Vec for ice scalar quantities in IceModel. More...
#include <iceModelVec.hh>

Public Member Functions | |
| IceModelVec3 () | |
| IceModelVec3 (const IceModelVec3 &other) | |
| virtual | ~IceModelVec3 () |
| virtual PetscErrorCode | create (IceGrid &mygrid, const char my_short_name[], bool local, int stencil_width=1) |
| Allocate a DA and a Vec from information in IceGrid. | |
| virtual PetscErrorCode | beginGhostCommTransfer (IceModelVec3 &imv3_source) |
| virtual PetscErrorCode | endGhostCommTransfer (IceModelVec3 &imv3_source) |
| PetscErrorCode | setValColumnPL (PetscInt i, PetscInt j, PetscScalar *valsIN) |
| Set values of an ice scalar quantity by linear interpolation from given values in a given column. | |
| PetscErrorCode | setColumn (PetscInt i, PetscInt j, PetscScalar c) |
| Set all values of scalar quantity to given a single value in a particular column. | |
| PetscErrorCode | setInternalColumn (PetscInt i, PetscInt j, PetscScalar *valsIN) |
| PetscScalar | getValZ (PetscInt i, PetscInt j, PetscScalar z) |
| Return value of scalar quantity at level z (m) above base of ice (by linear interpolation). | |
| PetscErrorCode | getPlaneStarZ (PetscInt i, PetscInt j, PetscScalar z, planeStar *star) |
| Return values on planar star stencil of scalar quantity at level z (by linear interpolation). | |
| PetscErrorCode | getPlaneStar_fine (PetscInt i, PetscInt j, PetscInt k, planeStar *star) |
| Gets a map-plane star stencil on the fine vertical grid. | |
| PetscErrorCode | getPlaneStar (PetscInt i, PetscInt j, PetscInt k, planeStar *star) |
| Gets a map-plane star stencil directly from the storage grid. | |
| PetscErrorCode | getValColumnPL (PetscInt i, PetscInt j, PetscInt ks, PetscScalar *valsOUT) |
| Return values of ice scalar quantity at given levels (m) above base of ice, using piecewise linear interpolation. | |
| PetscErrorCode | getValColumnQUAD (PetscInt i, PetscInt j, PetscInt ks, PetscScalar *valsOUT) |
| Return values of ice scalar quantity on the fine computational grid, using local quadratic interpolation. | |
| PetscErrorCode | getValColumn (PetscInt i, PetscInt j, PetscInt ks, PetscScalar *valsOUT) |
| If the grid is equally spaced in the ice then use PL, otherwise use QUAD. | |
| PetscErrorCode | getInternalColumn (PetscInt i, PetscInt j, PetscScalar **valsPTR) |
| PetscErrorCode | getHorSlice (Vec &gslice, PetscScalar z) |
| Copies a horizontal slice at level z of an IceModelVec3 into a Vec gslice. | |
| PetscErrorCode | getHorSlice (IceModelVec2S &gslice, PetscScalar z) |
| Copies a horizontal slice at level z of an IceModelVec3 into an IceModelVec2S gslice. | |
| PetscErrorCode | getSurfaceValues (Vec &gsurf, IceModelVec2S &myH) |
| Copies the values of an IceModelVec3 at the ice surface (specified by the level myH) to a Vec gsurf. | |
| PetscErrorCode | getSurfaceValues (IceModelVec2S &gsurf, IceModelVec2S &myH) |
| Copies the values of an IceModelVec3 at the ice surface (specified by the level myH) to an IceModelVec2S gsurf. | |
| PetscErrorCode | getSurfaceValues (IceModelVec2S &gsurf, PetscScalar **H) |
| PetscErrorCode | extend_vertically (int old_Mz, PetscScalar fill_value) |
Extends an IceModelVec3 and fills all the new grid points with fill_value. | |
| PetscErrorCode | extend_vertically (int old_Mz, IceModelVec2S &fill_values) |
Extends an IceModelVec3 and fills the new grid points with corresponding fill_values values. | |
| PetscErrorCode | view_surface (IceModelVec2S &thickness, PetscInt viewer_size) |
| PetscErrorCode | view_horizontal_slice (PetscScalar level, PetscInt viewer_size) |
| PetscErrorCode | view_sounding (int i, int j, PetscInt viewer_size) |
| virtual PetscErrorCode | has_nan () |
| Checks if the current IceModelVec has NANs and stops if it does. | |
Protected Member Functions | |
| virtual PetscErrorCode | destroy () |
| PetscErrorCode | isLegalLevel (PetscScalar z) |
| virtual PetscErrorCode | extend_vertically_private (int old_Mz) |
| Handles the memory allocation/deallocation and copying. Does not fill the values of the new layer. | |
| virtual PetscErrorCode | create_da (DA &result, PetscInt Mz) |
Protected Attributes | |
| map< string, PetscViewer > * | slice_viewers |
| map< string, PetscViewer > * | sounding_viewers |
| Vec | sounding_buffer |
Class for a 3d DA-based Vec for ice scalar quantities in IceModel.
Definition at line 258 of file iceModelVec.hh.
| IceModelVec3 | ( | ) |
Definition at line 32 of file iceModelVec3.cc.
References slice_viewers, sounding_buffer, and sounding_viewers.
| IceModelVec3 | ( | const IceModelVec3 & | other | ) |
Definition at line 45 of file iceModelVec3.cc.
References IceModelVec.shallow_copy, slice_viewers, sounding_buffer, and sounding_viewers.
| ~IceModelVec3 | ( | ) | [virtual] |
Definition at line 38 of file iceModelVec3.cc.
References IceModelVec.shallow_copy, slice_viewers, and sounding_viewers.
| PetscErrorCode beginGhostCommTransfer | ( | IceModelVec3 & | imv3_source | ) | [virtual] |
Definition at line 143 of file iceModelVec3.cc.
References IceModelVec.checkAllocated(), IceModelVec.da, IceModelVec.localp, IceModelVec.name, and IceModelVec.v.
Referenced by IceModel.ageStep(), and IceModel.energyStep().
| PetscErrorCode create | ( | IceGrid & | mygrid, | |
| const char | my_short_name[], | |||
| bool | local, | |||
| int | stencil_width = 1 | |||
| ) | [virtual] |
Allocate a DA and a Vec from information in IceGrid.
Definition at line 74 of file iceModelVec3.cc.
References create_da(), IceModelVec.da, IceModelVec.dims, IceModelVec.grid, GRID_3D, IceModelVec.localp, IceGrid.Mz, IceModelVec.name, IceModelVec.s_width, IceModelVec.v, and IceModelVec.vars.
Referenced by IceModel.allocate_internal_objects(), IceCompModel.createVecs(), and IceModel.createVecs().
| PetscErrorCode create_da | ( | DA & | result, | |
| PetscInt | Mz | |||
| ) | [protected, virtual] |
Definition at line 53 of file iceModelVec3.cc.
References IceGrid.com, IceGrid.da2, IceModelVec.grid, IceGrid.Mx, IceGrid.My, IceGrid.Nx, IceGrid.Ny, and IceModelVec.s_width.
Referenced by create(), and extend_vertically_private().
| PetscErrorCode destroy | ( | ) | [protected, virtual] |
Reimplemented from IceModelVec.
Definition at line 107 of file iceModelVec3.cc.
References slice_viewers, sounding_buffer, and sounding_viewers.
| PetscErrorCode endGhostCommTransfer | ( | IceModelVec3 & | imv3_source | ) | [virtual] |
Definition at line 160 of file iceModelVec3.cc.
References IceModelVec.checkAllocated(), IceModelVec.da, IceModelVec.localp, IceModelVec.name, and IceModelVec.v.
Referenced by IceModel.ageStep(), and IceModel.energyStep().
| PetscErrorCode extend_vertically | ( | int | old_Mz, | |
| IceModelVec2S & | fill_values | |||
| ) |
Extends an IceModelVec3 and fills the new grid points with corresponding fill_values values.
Definition at line 822 of file iceModelVec3.cc.
References IceModelVec.beginGhostComm(), IceModelVec.da, IceModelVec.end_access(), IceModelVec.endGhostComm(), extend_vertically_private(), IceModelVec2S.get_array(), IceModelVec.grid, IceModelVec.localp, IceGrid.Mz, IceModelVec.v, IceGrid.xm, IceGrid.xs, IceGrid.ym, and IceGrid.ys.
| PetscErrorCode extend_vertically | ( | int | old_Mz, | |
| PetscScalar | fill_value | |||
| ) |
Extends an IceModelVec3 and fills all the new grid points with fill_value.
Definition at line 793 of file iceModelVec3.cc.
References IceModelVec.beginGhostComm(), IceModelVec.da, IceModelVec.endGhostComm(), extend_vertically_private(), IceModelVec.grid, IceModelVec.localp, IceGrid.Mz, IceModelVec.v, IceGrid.xm, IceGrid.xs, IceGrid.ym, and IceGrid.ys.
Referenced by IceModel.check_maximum_thickness().
| PetscErrorCode extend_vertically_private | ( | int | old_Mz | ) | [protected, virtual] |
Handles the memory allocation/deallocation and copying. Does not fill the values of the new layer.
Definition at line 852 of file iceModelVec3.cc.
References create_da(), IceModelVec.da, IceModelVec.grid, IceModelVec.localp, IceGrid.Mz, IceModelVec.v, IceGrid.xm, IceGrid.xs, IceGrid.ym, and IceGrid.ys.
Referenced by extend_vertically().
| PetscErrorCode getHorSlice | ( | IceModelVec2S & | gslice, | |
| PetscScalar | z | |||
| ) |
Copies a horizontal slice at level z of an IceModelVec3 into an IceModelVec2S gslice.
Definition at line 488 of file iceModelVec3.cc.
References IceModelVec.begin_access(), IceModelVec.end_access(), IceModelVec2S.get_array(), getValZ(), IceModelVec.grid, IceGrid.xm, IceGrid.xs, IceGrid.ym, and IceGrid.ys.
| PetscErrorCode getHorSlice | ( | Vec & | gslice, | |
| PetscScalar | z | |||
| ) |
Copies a horizontal slice at level z of an IceModelVec3 into a Vec gslice.
Definition at line 470 of file iceModelVec3.cc.
References IceModelVec.begin_access(), IceGrid.da2, IceModelVec.end_access(), getValZ(), IceModelVec.grid, IceGrid.xm, IceGrid.xs, IceGrid.ym, and IceGrid.ys.
Referenced by IceModel.compute_cbase(), IceModel.compute_enthalpybase(), IceModel.compute_tempbase(), IceModel.compute_temppabase(), IceModel.compute_uvelbase(), IceModel.compute_vvelbase(), IceModel.compute_wvelbase(), IceModel.energyStats(), and view_horizontal_slice().
| PetscErrorCode getInternalColumn | ( | PetscInt | i, | |
| PetscInt | j, | |||
| PetscScalar ** | valsPTR | |||
| ) |
Definition at line 556 of file iceModelVec3.cc.
References IceModelVec.array.
Referenced by IceModel.ageStats(), IceModel.broadcastSSAVelocity(), IceModel.compute_hardav(), IceModel.compute_ice_enthalpy(), IceModel.compute_temp(), IceModel.compute_temp_pa(), IceModel.computeEffectiveViscosity(), IceCompModel.computeIceBedrockTemperatureErrors(), IceModel.computeMax3DVelocities(), IceCompModel.computeSigmaErrors(), IceCompModel.computeTemperatureErrors(), IceModel.correctSigma(), IceModel.countCFLViolations(), has_nan(), IceModel.horizontalVelocitySIARegular(), IceModel.setCTSFromEnthalpy(), IceModel.setEnth3FromT3_ColdIce(), IceModel.setEnth3FromT3AndLiqfrac3(), IceModel.setLiquidFracFromEnthalpy(), IceModel.SigmaSIAToRegular(), IceModel.velocitySIAStaggered(), IceModel.vertVelocityFromIncompressibility(), and view_sounding().
| PetscErrorCode getPlaneStar | ( | PetscInt | i, | |
| PetscInt | j, | |||
| PetscInt | k, | |||
| planeStar * | star | |||
| ) |
Gets a map-plane star stencil directly from the storage grid.
Definition at line 326 of file iceModelVec3.cc.
References IceModelVec.array, planeStar.ij, planeStar.im1, planeStar.ip1, planeStar.jm1, and planeStar.jp1.
Referenced by IceModel.enthalpyAndDrainageStep(), getPlaneStar_fine(), and tempSystemCtx.solveThisColumn().
| PetscErrorCode getPlaneStar_fine | ( | PetscInt | i, | |
| PetscInt | j, | |||
| PetscInt | k, | |||
| planeStar * | star | |||
| ) |
Gets a map-plane star stencil on the fine vertical grid.
Definition at line 340 of file iceModelVec3.cc.
References IceModelVec.array, getPlaneStar(), IceModelVec.grid, IceGrid.ice_storage2fine, planeStar.ij, planeStar.im1, planeStar.ip1, planeStar.jm1, planeStar.jp1, vfnow.levels, IceGrid.zlevels, and IceGrid.zlevels_fine.
Referenced by iceenthOnlySystemCtx.solveThisColumn(), combinedSystemCtx.solveThisColumn(), tempSystemCtx.solveThisColumn(), and ageSystemCtx.solveThisColumn().
| PetscErrorCode getPlaneStarZ | ( | PetscInt | i, | |
| PetscInt | j, | |||
| PetscScalar | z, | |||
| planeStar * | star | |||
| ) |
Return values on planar star stencil of scalar quantity at level z (by linear interpolation).
Definition at line 276 of file iceModelVec3.cc.
References IceModelVec.array, IceModelVec.checkHaveArray(), IceModelVec.grid, planeStar.ij, planeStar.im1, planeStar.ip1, isLegalLevel(), planeStar.jm1, planeStar.jp1, vfnow.levels, IceModelVec.localp, IceGrid.Lz, IceGrid.Mz, IceModelVec.name, and IceGrid.zlevels.
| PetscErrorCode getSurfaceValues | ( | IceModelVec2S & | gsurf, | |
| PetscScalar ** | H | |||
| ) |
Definition at line 538 of file iceModelVec3.cc.
References IceModelVec.begin_access(), IceModelVec.end_access(), IceModelVec2S.get_array(), getValZ(), IceModelVec.grid, IceGrid.xm, IceGrid.xs, IceGrid.ym, and IceGrid.ys.
| PetscErrorCode getSurfaceValues | ( | IceModelVec2S & | gsurf, | |
| IceModelVec2S & | myH | |||
| ) |
Copies the values of an IceModelVec3 at the ice surface (specified by the level myH) to an IceModelVec2S gsurf.
Definition at line 507 of file iceModelVec3.cc.
References IceModelVec.end_access(), IceModelVec2S.get_array(), and getSurfaceValues().
| PetscErrorCode getSurfaceValues | ( | Vec & | gsurf, | |
| IceModelVec2S & | myH | |||
| ) |
Copies the values of an IceModelVec3 at the ice surface (specified by the level myH) to a Vec gsurf.
This version is used in iMviewers.cc
Definition at line 520 of file iceModelVec3.cc.
References IceModelVec.begin_access(), IceGrid.da2, IceModelVec.end_access(), IceModelVec2S.get_array(), getValZ(), IceModelVec.grid, IceGrid.xm, IceGrid.xs, IceGrid.ym, and IceGrid.ys.
Referenced by IceModel.compute_csurf(), IceModel.compute_enthalpysurf(), IceModel.compute_tempsurf(), IceModel.compute_uvelsurf(), IceModel.compute_vvelsurf(), IceModel.compute_wvelsurf(), getSurfaceValues(), and view_surface().
| PetscErrorCode getValColumn | ( | PetscInt | i, | |
| PetscInt | j, | |||
| PetscInt | ks, | |||
| PetscScalar * | valsOUT | |||
| ) |
If the grid is equally spaced in the ice then use PL, otherwise use QUAD.
Definition at line 459 of file iceModelVec3.cc.
References EQUAL, getValColumnPL(), getValColumnQUAD(), IceModelVec.grid, and IceGrid.ice_vertical_spacing.
Referenced by IceModel.ageStep(), IceModel.enthalpyAndDrainageStep(), and IceModel.temperatureStep().
| PetscErrorCode getValColumnPL | ( | PetscInt | i, | |
| PetscInt | j, | |||
| PetscInt | ks, | |||
| PetscScalar * | result | |||
| ) |
Return values of ice scalar quantity at given levels (m) above base of ice, using piecewise linear interpolation.
Input array levelsIN must be an allocated array of nlevels scalars (PetscScalar).
levelsIN must be strictly increasing and positive. Exceeding Lz is allowed, extrapolation (by the value at the top-most level) is performed in this case.
Return array valsOUT must be an allocated array of nlevels scalars (PetscScalar).
Upon return, valsOUT will be filled with values of scalar quantity at the
values in levelsIN.
Definition at line 375 of file iceModelVec3.cc.
References IceModelVec.array, IceModelVec.checkAllocated(), IceModelVec.grid, IceGrid.ice_storage2fine, vfnow.levels, IceGrid.Mz, IceGrid.Mz_fine, IceGrid.zlevels, and IceGrid.zlevels_fine.
Referenced by getValColumn(), and IceUnitModel.test_IceModelVec3().
| PetscErrorCode getValColumnQUAD | ( | PetscInt | i, | |
| PetscInt | j, | |||
| PetscInt | ks, | |||
| PetscScalar * | result | |||
| ) |
Return values of ice scalar quantity on the fine computational grid, using local quadratic interpolation.
Return array valsOUT must be an allocated array of grid.Mz_fine scalars (PetscScalar).
Definition at line 414 of file iceModelVec3.cc.
References IceModelVec.array, IceModelVec.grid, IceGrid.ice_storage2fine, vfnow.levels, IceGrid.Mz, IceGrid.Mz_fine, z0, IceGrid.zlevels, and IceGrid.zlevels_fine.
Referenced by getValColumn(), and IceUnitModel.test_IceModelVec3().
| PetscScalar getValZ | ( | PetscInt | i, | |
| PetscInt | j, | |||
| PetscScalar | z | |||
| ) |
Return value of scalar quantity at level z (m) above base of ice (by linear interpolation).
Definition at line 244 of file iceModelVec3.cc.
References IceModelVec.array, IceModelVec.checkHaveArray(), IceModelVec.grid, isLegalLevel(), vfnow.levels, IceGrid.Lz, IceGrid.Mz, IceModelVec.name, and IceGrid.zlevels.
Referenced by IceModel.basalSlidingHeatingSIA(), IceCompModel.computeBasalTemperatureErrors(), IceCompModel.computeSurfaceVelocityErrors(), getHorSlice(), getSurfaceValues(), and IceUnitModel.test_IceModelVec3().
| PetscErrorCode has_nan | ( | ) | [virtual] |
Checks if the current IceModelVec has NANs and stops if it does.
Reimplemented from IceModelVec.
Definition at line 1020 of file iceModelVec3.cc.
References IceModelVec.begin_access(), IceGrid.com, IceModelVec.end_access(), getInternalColumn(), IceModelVec.grid, IceGrid.Mz, IceModelVec.name, IceGrid.xm, IceGrid.xs, IceGrid.ym, and IceGrid.ys.
| PetscErrorCode isLegalLevel | ( | PetscScalar | z | ) | [protected] |
Definition at line 178 of file iceModelVec3.cc.
References e, IceModelVec.grid, IceGrid.Lz, and IceModelVec.name.
Referenced by getPlaneStarZ(), and getValZ().
| PetscErrorCode setColumn | ( | PetscInt | i, | |
| PetscInt | j, | |||
| PetscScalar | c | |||
| ) |
Set all values of scalar quantity to given a single value in a particular column.
Definition at line 230 of file iceModelVec3.cc.
References IceModelVec.array, IceModelVec.checkHaveArray(), IceModelVec.grid, and IceGrid.Mz.
Referenced by IceModel.ageStep(), IceModel.enthalpyAndDrainageStep(), IceExactSSAModel.fillFromExactSolution(), IceROSSModel.fillinTemps(), IceCompModel.fillSolnTestFG(), IceCompModel.getCompSourcesTestFG(), IceExactSSAModel.setInitStateJ(), IceExactSSAModel.setInitStateM(), IceModel.SigmaSIAToRegular(), and IceModel.velocitySIAStaggered().
| PetscErrorCode setInternalColumn | ( | PetscInt | i, | |
| PetscInt | j, | |||
| PetscScalar * | valsIN | |||
| ) |
Definition at line 564 of file iceModelVec3.cc.
References IceModelVec.array, IceModelVec.grid, and IceGrid.Mz.
Referenced by IceCompModel.fillSolnTestFG(), IceCompModel.fillSolnTestK(), IceCompModel.getCompSourcesTestFG(), IceModel.horizontalVelocitySIARegular(), IceCompModel.initTestFG(), IceModel.putTempAtDepth(), and IceModel.velocitySIAStaggered().
| PetscErrorCode setValColumnPL | ( | PetscInt | i, | |
| PetscInt | j, | |||
| PetscScalar * | source | |||
| ) |
Set values of an ice scalar quantity by linear interpolation from given values in a given column.
Input arrays levelsIN and valsIN must be allocated arrays of nlevels scalars (PetscScalar). Upon completion, internal storage will hold values derived from linearly interpolating the input values.
levelsIN must be strictly increasing.
Piecewise linear interpolation is used and the input values must span a sufficient range of
values so that all stored values, at heights in zlevels, can be determined by interpolation; extrapolation is not allowed. Therefore (levelsIN[0] <= 0.0) and (levelsIN[nlevels-1] >= Lz) must both be true.
Definition at line 206 of file iceModelVec3.cc.
References IceModelVec.array, IceModelVec.checkAllocated(), IceModelVec.grid, IceGrid.ice_fine2storage, vfnow.levels, IceGrid.Mz, IceGrid.zlevels, and IceGrid.zlevels_fine.
Referenced by IceModel.ageStep(), IceModel.enthalpyAndDrainageStep(), IceModel.temperatureStep(), and IceUnitModel.test_IceModelVec3().
| PetscErrorCode view_horizontal_slice | ( | PetscScalar | level, | |
| PetscInt | viewer_size | |||
| ) |
Definition at line 915 of file iceModelVec3.cc.
References IceModelVec.create_viewer(), IceGrid.da2, getHorSlice(), IceModelVec.grid, IceModelVec.name, slice_viewers, IceModelVec.string_attr(), and IceModelVec.vars.
Referenced by IceModel.update_viewers().
| PetscErrorCode view_sounding | ( | int | i, | |
| int | j, | |||
| PetscInt | viewer_size | |||
| ) |
Definition at line 940 of file iceModelVec3.cc.
References IceModelVec.begin_access(), IceGrid.com, IceModelVec.create_viewer(), IceModelVec.end_access(), getInternalColumn(), IceModelVec.grid, IceGrid.Mz, IceModelVec.name, sounding_buffer, sounding_viewers, IceModelVec.string_attr(), IceModelVec.vars, IceGrid.xm, IceGrid.xs, IceGrid.ym, and IceGrid.ys.
Referenced by IceModel.update_viewers().
| PetscErrorCode view_surface | ( | IceModelVec2S & | thickness, | |
| PetscInt | viewer_size | |||
| ) |
Definition at line 891 of file iceModelVec3.cc.
References IceModelVec.create_viewer(), IceGrid.da2, getSurfaceValues(), IceModelVec.grid, IceModelVec.map_viewers, IceModelVec.name, IceModelVec.string_attr(), and IceModelVec.vars.
Referenced by IceModel.update_viewers().
map<string,PetscViewer>* slice_viewers [protected] |
Definition at line 313 of file iceModelVec.hh.
Referenced by destroy(), IceModelVec3(), view_horizontal_slice(), and ~IceModelVec3().
Vec sounding_buffer [protected] |
Definition at line 314 of file iceModelVec.hh.
Referenced by destroy(), IceModelVec3(), and view_sounding().
map<string,PetscViewer> * sounding_viewers [protected] |
Definition at line 313 of file iceModelVec.hh.
Referenced by destroy(), IceModelVec3(), view_sounding(), and ~IceModelVec3().
1.6.2-20100124