PISM, A Parallel Ice Sheet Model 2.3.0-79cae578d committed by Constantine Khrulev on 2026-03-22
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
pism::array::Scalar1 Class Reference

#include <Scalar.hh>

+ Inheritance diagram for pism::array::Scalar1:

Public Member Functions

 Scalar1 (std::shared_ptr< const Grid > grid, const std::string &name)
 
stencils::Star< intstar_int (int i, int j) const
 
stencils::Box< intbox_int (int i, int j) const
 
- Public Member Functions inherited from pism::array::Scalar
 Scalar (std::shared_ptr< const Grid > grid, const std::string &name)
 
std::shared_ptr< Scalarduplicate () const
 
int as_int (int i, int j) const
 
- Public Member Functions inherited from pism::array::Array2D< double >
 Array2D (std::shared_ptr< const Grid > grid, const std::string &short_name, Kind ghostedp, unsigned int stencil_width=1)
 
double ** array ()
 
double const *const * array () const
 
doubleoperator() (int i, int j)
 
const doubleoperator() (int i, int j) const
 
const doubleN (int i, int j) const
 
const doubleE (int i, int j) const
 
const doubleS (int i, int j) const
 
const doubleW (int i, int j) const
 
void add (double alpha, const Array2D< double > &x)
 
void add (double alpha, const Array2D< double > &x, Array2D< double > &result) const
 
void copy_from (const Array2D< double > &source)
 
- Public Member Functions inherited from pism::array::Array
virtual ~Array ()
 
std::shared_ptr< const Gridgrid () const
 
unsigned int ndims () const
 Returns the number of spatial dimensions.
 
std::vector< intshape () const
 
unsigned int ndof () const
 Returns the number of degrees of freedom per grid point.
 
unsigned int stencil_width () const
 Get the stencil width of the current Array. Returns 0 if ghosts are not available.
 
const std::vector< double > & levels () const
 
std::vector< doublenorm (int n) const
 Computes the norm of all the components of an Array.
 
void add (double alpha, const Array &x)
 Result: v <- v + alpha * x. Calls VecAXPY.
 
void shift (double alpha)
 Result: v[j] <- v[j] + alpha for all j. Calls VecShift.
 
void scale (double alpha)
 Result: v <- v * alpha. Calls VecScale.
 
petsc::Vecvec () const
 
std::shared_ptr< petsc::DMdm () const
 
void set_name (const std::string &name)
 Sets the variable name to name.
 
const std::string & get_name () const
 Get the name of an Array object.
 
void read (const std::string &filename, unsigned int time)
 
void read (const File &file, unsigned int time)
 
void write (const OutputFile &file) const
 
void regrid (const std::string &filename, io::Default default_value)
 
void regrid (const File &file, io::Default default_value)
 
virtual void begin_access () const
 Checks if an Array is allocated and calls DAVecGetArray.
 
virtual void end_access () const
 Checks if an Array is allocated and calls DAVecRestoreArray.
 
void update_ghosts ()
 Updates ghost points.
 
std::shared_ptr< petsc::Vecallocate_proc0_copy () const
 
void put_on_proc0 (petsc::Vec &onp0) const
 Puts a local array::Scalar on processor 0.
 
void get_from_proc0 (petsc::Vec &onp0)
 Gets a local Array2 from processor 0.
 
void set (double c)
 Result: v[j] <- c for all j.
 
VariableMetadatametadata (unsigned int N=0)
 Returns a reference to the VariableMetadata object containing metadata for the compoment N.
 
const VariableMetadatametadata (unsigned int N=0) const
 
std::vector< VariableMetadataall_metadata () const
 
int state_counter () const
 Get the object state counter.
 
void inc_state_counter ()
 Increment the object state counter.
 
void set_interpolation_type (InterpolationType type)
 
void view (std::vector< std::shared_ptr< petsc::Viewer > > viewers) const
 View a 2D vector field using existing PETSc viewers.
 
void dump (const char filename[]) const
 Dumps a variable to a file, overwriting this file's contents (for debugging).
 
uint64_t fletcher64_serial () const
 
uint64_t fletcher64 () const
 
std::string checksum (bool serial) const
 
void print_checksum (const char *prefix="", bool serial=false) const
 
- Public Member Functions inherited from pism::PetscAccessible
virtual ~PetscAccessible ()=default
 

Protected Member Functions

 Scalar1 (std::shared_ptr< const Grid > grid, const std::string &name, int width)
 
- Protected Member Functions inherited from pism::array::Scalar
stencils::Star< intstar_int (int i, int j) const
 
stencils::Box< intbox_int (int i, int j) const
 
 Scalar (std::shared_ptr< const Grid > grid, const std::string &name, int width)
 
- Protected Member Functions inherited from pism::array::Array2D< double >
stencils::Star< doublestar (int i, int j) const
 
stencils::Box< doublebox (int i, int j) const
 
- Protected Member Functions inherited from pism::array::Array
 Array (std::shared_ptr< const Grid > grid, const std::string &name, Kind ghostedp, size_t dof, size_t stencil_width, const std::vector< double > &zlevels)
 
void set_begin_access_use_dof (bool flag)
 
void read_impl (const File &file, unsigned int time)
 Reads appropriate NetCDF variable(s) into an Array.
 
virtual void regrid_impl (const File &file, io::Default default_value)
 Gets an Array from a file file, interpolating onto the current grid.
 
void write_impl (const OutputFile &file) const
 Writes an Array to a NetCDF file.
 
void checkCompatibility (const char *function, const Array &other) const
 Checks if two Arrays have compatible sizes, dimensions and numbers of degrees of freedom.
 
void check_array_indices (int i, int j, unsigned int k) const
 Check array indices and warn if they are out of range.
 
void copy_to_vec (std::shared_ptr< petsc::DM > destination_da, petsc::Vec &destination) const
 Copies v to a global vector 'destination'. Ghost points are discarded.
 
void get_dof (std::shared_ptr< petsc::DM > da_result, petsc::Vec &result, unsigned int start, unsigned int count=1) const
 
void set_dof (std::shared_ptr< petsc::DM > da_source, petsc::Vec &source, unsigned int start, unsigned int count=1)
 
void put_on_proc0 (petsc::Vec &parallel, petsc::Vec &onp0) const
 
void get_from_proc0 (petsc::Vec &onp0, petsc::Vec &parallel) const
 

Additional Inherited Members

- Public Types inherited from pism::array::Array2D< double >
using value_type = double
 
- Protected Attributes inherited from pism::array::Array
Implm_impl
 
void * m_array
 

Detailed Description

Scalar 2D array supporting width=1 stencil computations

Definition at line 53 of file Scalar.hh.


The documentation for this class was generated from the following files: