Ice Sheet System Model  4.18
Code documentation
Data Structures | Functions
IssmVec.h File Reference

Main Vector class for the Issm toolkit. More...

#include "../../shared/Enum/Enum.h"
#include "../../shared/Exceptions/exceptions.h"
#include "../../shared/MemOps/MemOps.h"
#include "./IssmToolkitUtils.h"
#include <math.h>

Go to the source code of this file.

Data Structures

class  IssmVec< doubletype >
 

Functions

int IssmVecTypeFromToolkitOptions (void)
 

Detailed Description

Main Vector class for the Issm toolkit.

Definition in file IssmVec.h.

Function Documentation

◆ IssmVecTypeFromToolkitOptions()

int IssmVecTypeFromToolkitOptions ( void  )

Definition at line 56 of file IssmToolkitUtils.cpp.

56  { /*{{{*/
57 
58  char* vec_type=NULL;
59  int vec_type_enum;
60  int num_procs=0;
61  bool isparallel=false;
62 
63  /*first, figure out if we are running in parallel: */
64  num_procs=IssmComm::GetSize();
65  if(num_procs>1)isparallel=true;
66 
67  /*retrieve vector type as a string, from the Toolkits Options database, similar to what Petsc does. Actually,
68  *we try and stick with the Petsc vector types: */
69  vec_type=ToolkitOptions::GetToolkitOptionValue("vec_type");
70 
71  if (strcmp(vec_type,"mpi")==0){
72  vec_type_enum=MpiEnum;
73  }
74  else if (strcmp(vec_type,"seq")==0){
75  if (isparallel) _error_("Dense vector type not supported for parallel runs with num_procs>1");
76  else vec_type_enum=SeqEnum;
77  }
78  else _error_("vector type not supported yet!");
79 
80  /*free ressources: */
81  xDelete<char>(vec_type);
82 
83  /*return: */
84  return vec_type_enum;
85 } /*}}}*/
MpiEnum
@ MpiEnum
Definition: EnumDefinitions.h:1193
ToolkitOptions::GetToolkitOptionValue
static char * GetToolkitOptionValue(const char *option)
Definition: ToolkitOptions.cpp:36
IssmComm::GetSize
static int GetSize(void)
Definition: IssmComm.cpp:46
SeqEnum
@ SeqEnum
Definition: EnumDefinitions.h:1273
_error_
#define _error_(StreamArgs)
Definition: exceptions.h:49