Class for storing and accessing 2D vector fields used in IceModel. More...
#include <iceModelVec.hh>

Public Member Functions | |
| IceModelVec2V () | |
| IceModelVec2V (const IceModelVec2V &original) | |
| ~IceModelVec2V () | |
| virtual PetscErrorCode | create (IceGrid &my_grid, const char my_short_name[], bool local, int stencil_width=1) |
| virtual PetscErrorCode | write (const char filename[], nc_type nctype) |
| Writes an IceModelVec to a NetCDF file. | |
| virtual PetscErrorCode | read (const char filename[], const unsigned int time) |
| Reads appropriate NetCDF variable(s) into an IceModelVec. | |
| virtual PetscErrorCode | regrid (const char filename[], LocalInterpCtx &lic, bool critical) |
Gets an IceModelVec from a file filename, interpolating onto the current grid. | |
| virtual PetscErrorCode | regrid (const char filename[], LocalInterpCtx &lic, PetscScalar default_value) |
Gets an IceModelVec from a file filename, interpolating onto the current grid. | |
| virtual PetscErrorCode | get_array (PISMVector2 **&a) |
| virtual PetscErrorCode | magnitude (IceModelVec2S &result) |
| virtual PISMVector2 & | operator() (int i, int j) |
| virtual PetscErrorCode | view (PetscInt viewer_size) |
| View a 2D vector field. Allocates and de-allocates g2, the temporary global vector; performance should not matter here. | |
| virtual PetscErrorCode | get_component (int n, IceModelVec2S &result) |
| virtual PetscErrorCode | set_component (int n, IceModelVec2S &source) |
| virtual bool | is_valid (PetscScalar u, PetscScalar v) |
Protected Member Functions | |
| PetscErrorCode | destroy () |
Protected Attributes | |
| DA | component_da |
same as da, but for one component only | |
Class for storing and accessing 2D vector fields used in IceModel.
Definition at line 204 of file iceModelVec.hh.
| IceModelVec2V | ( | ) |
Definition at line 22 of file iceModelVec2V.cc.
References component_da, IceModelVec.dof, IceModelVec.reset_attrs(), and IceModelVec.vars.
| IceModelVec2V | ( | const IceModelVec2V & | original | ) |
| ~IceModelVec2V | ( | ) |
Definition at line 30 of file iceModelVec2V.cc.
References destroy(), and IceModelVec.shallow_copy.
| PetscErrorCode create | ( | IceGrid & | my_grid, | |
| const char | my_short_name[], | |||
| bool | local, | |||
| int | stencil_width = 1 | |||
| ) | [virtual] |
Definition at line 47 of file iceModelVec2V.cc.
References IceGrid.com, component_da, IceGrid.da2, IceModelVec.dof, IceModelVec.grid, GRID_2D, IceGrid.Mx, IceGrid.My, IceModelVec.name, IceGrid.Nx, IceGrid.Ny, and IceModelVec.vars.
Referenced by IceModel.allocate_internal_objects(), IceModel.createVecs(), IceModel.readShelfStreamBCFromFile(), IceUnitModel.test_dof2comm(), and IceUnitModel.test_IceModelVec2V().
| PetscErrorCode destroy | ( | ) | [protected, virtual] |
Reimplemented from IceModelVec.
Definition at line 36 of file iceModelVec2V.cc.
References component_da.
Referenced by ~IceModelVec2V().
| PetscErrorCode get_array | ( | PISMVector2 **& | a | ) | [virtual] |
Definition at line 74 of file iceModelVec2V.cc.
References IceModelVec.array, and IceModelVec.begin_access().
Referenced by IceModel.assembleSSAMatrix(), IceModel.basalSlidingHeatingSIA(), IceModel.broadcastSSAVelocity(), IceCompModel.computeBasalVelocityErrors(), IceModel.computeEffectiveViscosity(), IceModel.computeMax2DSlidingSpeed(), IceModel.correctBasalFrictionalHeating(), IceModel.correctSigma(), IceCompModel.fillSolnTestE(), magnitude(), IceExactSSAModel.setInitStateM(), and IceModel.velocities2DSIAToRegular().
| PetscErrorCode get_component | ( | int | n, | |
| IceModelVec2S & | result | |||
| ) | [virtual] |
Definition at line 217 of file iceModelVec2V.cc.
References IceModelVec.v.
Referenced by IceMISMIPModel.getMISMIPStats(), IceUnitModel.test_IceModelVec2V(), view(), and write().
| bool is_valid | ( | PetscScalar | u, | |
| PetscScalar | v | |||
| ) | [virtual] |
Definition at line 212 of file iceModelVec2V.cc.
References IceModelVec.vars.
| PetscErrorCode magnitude | ( | IceModelVec2S & | result | ) | [virtual] |
Definition at line 139 of file iceModelVec2V.cc.
References IceModelVec.end_access(), get_array(), IceModelVec2S.get_array(), IceModelVec.grid, IceModelVec.v, IceGrid.xm, IceGrid.xs, IceGrid.ym, and IceGrid.ys.
Referenced by IceModel.compute_cbar(), and IceUnitModel.test_IceModelVec2V().
| PISMVector2 & operator() | ( | int | i, | |
| int | j | |||
| ) | [virtual] |
Definition at line 82 of file iceModelVec2V.cc.
References IceModelVec.array.
| PetscErrorCode read | ( | const char | filename[], | |
| const unsigned int | time | |||
| ) | [virtual] |
Reads appropriate NetCDF variable(s) into an IceModelVec.
Reimplemented from IceModelVec.
Definition at line 87 of file iceModelVec2V.cc.
References IceModelVec.beginGhostComm(), IceModelVec.checkAllocated(), component_da, IceGrid.da2, IceModelVec.dof, IceModelVec.endGhostComm(), IceModelVec.grid, IceModelVec.localp, set_component(), and IceModelVec.vars.
Referenced by IceModel.initFromFile(), and IceUnitModel.test_IceModelVec2V().
| PetscErrorCode regrid | ( | const char | filename[], | |
| LocalInterpCtx & | lic, | |||
| PetscScalar | default_value | |||
| ) | [virtual] |
Gets an IceModelVec from a file filename, interpolating onto the current grid.
Sets all the values to default_value if the variable was not found.
Reimplemented from IceModelVec.
Definition at line 185 of file iceModelVec2V.cc.
References IceModelVec.beginGhostComm(), component_da, IceModelVec.dof, IceModelVec.endGhostComm(), IceModelVec.interpolation_mask, IceModelVec.localp, set_component(), IceModelVec.use_interpolation_mask, and IceModelVec.vars.
| PetscErrorCode regrid | ( | const char | filename[], | |
| LocalInterpCtx & | lic, | |||
| bool | critical | |||
| ) | [virtual] |
Gets an IceModelVec from a file filename, interpolating onto the current grid.
Stops if the variable was not found and critical == true.
Reimplemented from IceModelVec.
Definition at line 158 of file iceModelVec2V.cc.
References IceModelVec.beginGhostComm(), component_da, IceModelVec.dof, IceModelVec.endGhostComm(), IceModelVec.interpolation_mask, IceModelVec.localp, set_component(), IceModelVec.use_interpolation_mask, and IceModelVec.vars.
Referenced by IceModel.readShelfStreamBCFromFile().
| PetscErrorCode set_component | ( | int | n, | |
| IceModelVec2S & | source | |||
| ) | [virtual] |
Definition at line 225 of file iceModelVec2V.cc.
References IceModelVec.v.
| PetscErrorCode view | ( | PetscInt | viewer_size | ) | [virtual] |
View a 2D vector field. Allocates and de-allocates g2, the temporary global vector; performance should not matter here.
Reimplemented from IceModelVec2.
Definition at line 235 of file iceModelVec2V.cc.
References IceModelVec.create_viewer(), IceGrid.da2, IceModelVec.dof, get_component(), IceModelVec.grid, IceModelVec.map_viewers, IceModelVec.name, IceModelVec.string_attr(), and IceModelVec.vars.
| PetscErrorCode write | ( | const char | filename[], | |
| nc_type | nctype | |||
| ) | [virtual] |
Writes an IceModelVec to a NetCDF file.
Reimplemented from IceModelVec.
Definition at line 116 of file iceModelVec2V.cc.
References IceModelVec.checkAllocated(), component_da, IceGrid.da2, IceModelVec.dof, get_component(), IceModelVec.grid, IceModelVec.time_independent, IceModelVec.vars, and IceModelVec.write_in_glaciological_units.
Referenced by IceUnitModel.test_IceModelVec2V().
DA component_da [protected] |
same as da, but for one component only
Definition at line 230 of file iceModelVec.hh.
Referenced by create(), destroy(), IceModelVec2V(), read(), regrid(), and write().
1.6.2-20100124