IceModelVec2V Class Reference

Class for storing and accessing 2D vector fields used in IceModel. More...

#include <iceModelVec.hh>

Inheritance diagram for IceModelVec2V:
Inheritance graph
[legend]

List of all members.

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 PISMVector2operator() (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

Detailed Description

Class for storing and accessing 2D vector fields used in IceModel.

Definition at line 204 of file iceModelVec.hh.


Constructor & Destructor Documentation

IceModelVec2V (  ) 
IceModelVec2V ( const IceModelVec2V original  ) 
~IceModelVec2V (  ) 

Definition at line 30 of file iceModelVec2V.cc.

References destroy(), and IceModelVec.shallow_copy.


Member Function Documentation

PetscErrorCode create ( IceGrid my_grid,
const char  my_short_name[],
bool  local,
int  stencil_width = 1 
) [virtual]
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]
PetscErrorCode get_component ( int  n,
IceModelVec2S result 
) [virtual]
bool is_valid ( PetscScalar  u,
PetscScalar  v 
) [virtual]

Definition at line 212 of file iceModelVec2V.cc.

References IceModelVec.vars.

PetscErrorCode magnitude ( IceModelVec2S result  )  [virtual]
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]
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.

Referenced by read(), and regrid().

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]

Member Data Documentation

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().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Defines
Generated by  doxygen 1.6.2-20100124