Ice Sheet System Model  4.18
Code documentation
Public Member Functions | Data Fields
IssmVec< doubletype > Class Template Reference

#include <IssmVec.h>

Public Member Functions

 IssmVec ()
 
 IssmVec (int M)
 
 IssmVec (int m, int M)
 
 IssmVec (int M, bool fromlocalsize)
 
 IssmVec (doubletype *buffer, int M)
 
 ~IssmVec ()
 
void Echo (void)
 
void Assemble (void)
 
void SetValues (int ssize, int *list, doubletype *values, InsMode mode)
 
void SetValue (int dof, doubletype value, InsMode mode)
 
void GetValue (doubletype *pvalue, int dof)
 
void GetSize (int *pM)
 
void GetLocalSize (int *pM)
 
void GetLocalVector (doubletype **pvector, int **pindices)
 
IssmVec< doubletype > * Duplicate (void)
 
void Set (doubletype value)
 
void AXPY (IssmVec *X, doubletype a)
 
void AYPX (IssmVec *X, doubletype a)
 
doubletype * ToMPISerial (void)
 
doubletype * ToMPISerial0 (void)
 
void Shift (doubletype shift)
 
void Copy (IssmVec *to)
 
doubletype Norm (NormMode mode)
 
void Scale (doubletype scale_factor)
 
doubletype Dot (IssmVec *input)
 
void PointwiseDivide (IssmVec *x, IssmVec *y)
 

Data Fields

IssmAbsVec< doubletype > * vector
 

Detailed Description

template<class doubletype>
class IssmVec< doubletype >

Definition at line 34 of file IssmVec.h.

Constructor & Destructor Documentation

◆ IssmVec() [1/5]

template<class doubletype >
IssmVec< doubletype >::IssmVec ( )
inline

Definition at line 41 of file IssmVec.h.

41  { /*{{{*/
42  this->vector=NULL;
43  }

◆ IssmVec() [2/5]

template<class doubletype >
IssmVec< doubletype >::IssmVec ( int  M)
inline

Definition at line 45 of file IssmVec.h.

45  {/*{{{*/
46 
48 
49  case SeqEnum:
50  this->vector=new IssmSeqVec<doubletype>(M);
51  break;
52  case MpiEnum:
53  #ifdef _HAVE_MPI_
54  this->vector=new IssmMpiVec<doubletype>(M);
55  #else
56  _error_("Mpi vector requires compilation of MPI!");
57  #endif
58  break;
59  default:
60  _error_("vector type not supported yet!");
61  }
62  }

◆ IssmVec() [3/5]

template<class doubletype >
IssmVec< doubletype >::IssmVec ( int  m,
int  M 
)
inline

Definition at line 64 of file IssmVec.h.

64  {/*{{{*/
65 
67 
68  case SeqEnum:
69  this->vector=new IssmSeqVec<doubletype>(m,M);
70  break;
71  case MpiEnum:
72  #ifdef _HAVE_MPI_
73  this->vector=new IssmMpiVec<doubletype>(m,M);
74  #else
75  _error_("Mpi vector requires compilation of MPI!");
76  #endif
77  break;
78  default:
79  _error_("vector type not supported yet!");
80  }
81  }

◆ IssmVec() [4/5]

template<class doubletype >
IssmVec< doubletype >::IssmVec ( int  M,
bool  fromlocalsize 
)
inline

Definition at line 83 of file IssmVec.h.

83  {/*{{{*/
84 
86 
87  case SeqEnum:
88  this->vector=new IssmSeqVec<doubletype>(M,fromlocalsize);
89  break;
90  case MpiEnum:
91  #ifdef _HAVE_MPI_
92  this->vector=new IssmMpiVec<doubletype>(M,fromlocalsize);
93  #else
94  _error_("Mpi vector requires compilation of MPI!");
95  #endif
96  break;
97  default:
98  _error_("vector type not supported yet!");
99  }
100  }

◆ IssmVec() [5/5]

template<class doubletype >
IssmVec< doubletype >::IssmVec ( doubletype *  buffer,
int  M 
)
inline

Definition at line 102 of file IssmVec.h.

102  {/*{{{*/
103 
105 
106  case SeqEnum:
107  this->vector=new IssmSeqVec<doubletype>(buffer,M);
108  break;
109  case MpiEnum:
110  #ifdef _HAVE_MPI_
111  this->vector=new IssmMpiVec<doubletype>(buffer,M);
112  #else
113  _error_("Mpi vector requires compilation of MPI!");
114  #endif
115  break;
116  default:
117  _error_("vector type not supported yet!");
118  }
119  }

◆ ~IssmVec()

template<class doubletype >
IssmVec< doubletype >::~IssmVec ( )
inline

Definition at line 121 of file IssmVec.h.

121  {/*{{{*/
122  delete this->vector;
123  }

Member Function Documentation

◆ Echo()

template<class doubletype >
void IssmVec< doubletype >::Echo ( void  )
inline

Definition at line 127 of file IssmVec.h.

127  {/*{{{*/
128  vector->Echo();
129  }

◆ Assemble()

template<class doubletype >
void IssmVec< doubletype >::Assemble ( void  )
inline

Definition at line 131 of file IssmVec.h.

131  {/*{{{*/
132  vector->Assemble();
133  }

◆ SetValues()

template<class doubletype >
void IssmVec< doubletype >::SetValues ( int  ssize,
int *  list,
doubletype *  values,
InsMode  mode 
)
inline

Definition at line 135 of file IssmVec.h.

135  {/*{{{*/
136  vector->SetValues(ssize,list,values,mode);
137  }

◆ SetValue()

template<class doubletype >
void IssmVec< doubletype >::SetValue ( int  dof,
doubletype  value,
InsMode  mode 
)
inline

Definition at line 139 of file IssmVec.h.

139  {/*{{{*/
140  vector->SetValue(dof,value,mode);
141  }

◆ GetValue()

template<class doubletype >
void IssmVec< doubletype >::GetValue ( doubletype *  pvalue,
int  dof 
)
inline

Definition at line 143 of file IssmVec.h.

143  {/*{{{*/
144  vector->GetValue(pvalue,dof);
145  }

◆ GetSize()

template<class doubletype >
void IssmVec< doubletype >::GetSize ( int *  pM)
inline

Definition at line 147 of file IssmVec.h.

147  {/*{{{*/
148  vector->GetSize(pM);
149  }

◆ GetLocalSize()

template<class doubletype >
void IssmVec< doubletype >::GetLocalSize ( int *  pM)
inline

Definition at line 151 of file IssmVec.h.

151  {/*{{{*/
152  vector->GetLocalSize(pM);
153  }

◆ GetLocalVector()

template<class doubletype >
void IssmVec< doubletype >::GetLocalVector ( doubletype **  pvector,
int **  pindices 
)
inline

Definition at line 155 of file IssmVec.h.

155  {/*{{{*/
156  vector->GetLocalVector(pvector,pindices);
157  } /*}}}*/

◆ Duplicate()

template<class doubletype >
IssmVec<doubletype>* IssmVec< doubletype >::Duplicate ( void  )
inline

Definition at line 158 of file IssmVec.h.

158  {/*{{{*/
159 
160  IssmVec<doubletype>* issmvector=NULL;
161 
162  issmvector=new IssmVec<doubletype>();
163  issmvector->vector=this->vector->Duplicate();
164  this->vector->Copy(issmvector->vector);
165 
166  return issmvector;
167  }

◆ Set()

template<class doubletype >
void IssmVec< doubletype >::Set ( doubletype  value)
inline

Definition at line 169 of file IssmVec.h.

169  {/*{{{*/
170  vector->Set(value);
171  }

◆ AXPY()

template<class doubletype >
void IssmVec< doubletype >::AXPY ( IssmVec< doubletype > *  X,
doubletype  a 
)
inline

Definition at line 173 of file IssmVec.h.

173  {/*{{{*/
174  vector->AXPY(X->vector,a);
175  }

◆ AYPX()

template<class doubletype >
void IssmVec< doubletype >::AYPX ( IssmVec< doubletype > *  X,
doubletype  a 
)
inline

Definition at line 177 of file IssmVec.h.

177  {/*{{{*/
178  vector->AYPX(X->vector,a);
179  }

◆ ToMPISerial()

template<class doubletype >
doubletype* IssmVec< doubletype >::ToMPISerial ( void  )
inline

Definition at line 181 of file IssmVec.h.

181  {/*{{{*/
182  return vector->ToMPISerial();
183  }

◆ ToMPISerial0()

template<class doubletype >
doubletype* IssmVec< doubletype >::ToMPISerial0 ( void  )
inline

Definition at line 185 of file IssmVec.h.

185  {/*{{{*/
186  return vector->ToMPISerial0();
187  }

◆ Shift()

template<class doubletype >
void IssmVec< doubletype >::Shift ( doubletype  shift)
inline

Definition at line 189 of file IssmVec.h.

189  {/*{{{*/
190  vector->Shift(shift);
191  }

◆ Copy()

template<class doubletype >
void IssmVec< doubletype >::Copy ( IssmVec< doubletype > *  to)
inline

Definition at line 193 of file IssmVec.h.

193  {/*{{{*/
194  vector->Copy(to->vector);
195  }

◆ Norm()

template<class doubletype >
doubletype IssmVec< doubletype >::Norm ( NormMode  mode)
inline

Definition at line 197 of file IssmVec.h.

197  {/*{{{*/
198  return vector->Norm(mode);
199  }

◆ Scale()

template<class doubletype >
void IssmVec< doubletype >::Scale ( doubletype  scale_factor)
inline

Definition at line 201 of file IssmVec.h.

201  {/*{{{*/
202  vector->Scale(scale_factor);
203  }

◆ Dot()

template<class doubletype >
doubletype IssmVec< doubletype >::Dot ( IssmVec< doubletype > *  input)
inline

Definition at line 205 of file IssmVec.h.

205  {/*{{{*/
206  return vector->Dot(input->vector);
207  }

◆ PointwiseDivide()

template<class doubletype >
void IssmVec< doubletype >::PointwiseDivide ( IssmVec< doubletype > *  x,
IssmVec< doubletype > *  y 
)
inline

Definition at line 209 of file IssmVec.h.

209  {/*{{{*/
210  vector->PointwiseDivide(x->vector,y->vector);
211  }

Field Documentation

◆ vector

template<class doubletype >
IssmAbsVec<doubletype>* IssmVec< doubletype >::vector

Definition at line 38 of file IssmVec.h.


The documentation for this class was generated from the following files:
IssmSeqVec
Definition: IssmSeqVec.h:31
MpiEnum
@ MpiEnum
Definition: EnumDefinitions.h:1193
IssmVec
Definition: IssmVec.h:34
IssmVec::vector
IssmAbsVec< doubletype > * vector
Definition: IssmVec.h:38
IssmVecTypeFromToolkitOptions
int IssmVecTypeFromToolkitOptions(void)
Definition: IssmToolkitUtils.cpp:56
SeqEnum
@ SeqEnum
Definition: EnumDefinitions.h:1273
_error_
#define _error_(StreamArgs)
Definition: exceptions.h:49
IssmMpiVec
Definition: IssmMpiVec.h:34