Ice Sheet System Model  4.18
Code documentation
Public Member Functions | Data Fields
Regionaloutput Class Reference

#include <Regionaloutput.h>

Inheritance diagram for Regionaloutput:
Object Definition

Public Member Functions

 Regionaloutput ()
 
 Regionaloutput (char *in_name, int in_definitionenum, char *in_outputname, IssmDouble *maskin, int Min)
 
 ~Regionaloutput ()
 
Objectcopy ()
 
void DeepEcho (void)
 
void Echo (void)
 
int Id (void)
 
void Marshall (char **pmarshalled_data, int *pmarshalled_data_size, int marshall_direction)
 
int ObjectEnum (void)
 
int DefinitionEnum ()
 
char * Name ()
 
IssmDouble Response (FemModel *femmodel)
 
- Public Member Functions inherited from Object
virtual ~Object ()
 
- Public Member Functions inherited from Definition
virtual ~Definition ()
 

Data Fields

int definitionenum
 
char * outputname
 
char * name
 
IssmDoublemask
 
int M
 

Detailed Description

Definition at line 15 of file Regionaloutput.h.

Constructor & Destructor Documentation

◆ Regionaloutput() [1/2]

Regionaloutput::Regionaloutput ( )

◆ Regionaloutput() [2/2]

Regionaloutput::Regionaloutput ( char *  in_name,
int  in_definitionenum,
char *  in_outputname,
IssmDouble maskin,
int  Min 
)

Definition at line 22 of file Regionaloutput.cpp.

22  { /*{{{*/
23 
24  this->definitionenum=in_definitionenum;
25  this->outputname = xNew<char>(strlen(in_outputname)+1);
26  xMemCpy<char>(this->outputname,in_outputname,strlen(in_outputname)+1);
27  this->name = xNew<char>(strlen(in_name)+1);
28  xMemCpy<char>(this->name,in_name,strlen(in_name)+1);
29 
30  this->mask = xNew<IssmDouble>(Min);
31  xMemCpy<IssmDouble>(this->mask, maskin, Min);
32 
33  this->M=Min;
34 
35 }

◆ ~Regionaloutput()

Regionaloutput::~Regionaloutput ( )

Definition at line 37 of file Regionaloutput.cpp.

37  {/*{{{*/
38  if(this->name)xDelete(this->name);
39  if(this->outputname)xDelete(this->outputname);
40  if(this->mask)xDelete(this->mask);
41 }

Member Function Documentation

◆ copy()

Object * Regionaloutput::copy ( void  )
virtual

Implements Object.

Definition at line 45 of file Regionaloutput.cpp.

45  {/*{{{*/
46  Regionaloutput* mf = new Regionaloutput(this->name,this->definitionenum,this->outputname,this->mask,this->M);
47  return (Object*) mf;
48 }

◆ DeepEcho()

void Regionaloutput::DeepEcho ( void  )
virtual

Implements Object.

Definition at line 50 of file Regionaloutput.cpp.

50  {/*{{{*/
51  this->Echo();
52 }

◆ Echo()

void Regionaloutput::Echo ( void  )
virtual

Implements Object.

Definition at line 54 of file Regionaloutput.cpp.

54  {/*{{{*/
55  _printf_(" Regionaloutput: " << this->name << " " << this->definitionenum << "\n");
56  _printf_(" outputname enum: " << this->outputname << "Enum\n");
57  _printf_(" mask: " << this->mask << "\n");
58  _printf_(" M: " << this->M << "\n");
59 }

◆ Id()

int Regionaloutput::Id ( void  )
virtual

Implements Object.

Definition at line 61 of file Regionaloutput.cpp.

61  {/*{{{*/
62  return -1;
63 }

◆ Marshall()

void Regionaloutput::Marshall ( char **  pmarshalled_data,
int *  pmarshalled_data_size,
int  marshall_direction 
)
virtual

Implements Object.

Definition at line 65 of file Regionaloutput.cpp.

65  {/*{{{*/
66  _error_("not implemented yet!");
67 }

◆ ObjectEnum()

int Regionaloutput::ObjectEnum ( void  )
virtual

Implements Object.

Definition at line 69 of file Regionaloutput.cpp.

69  {/*{{{*/
70  return RegionaloutputEnum;
71 }

◆ DefinitionEnum()

int Regionaloutput::DefinitionEnum ( )
virtual

Implements Definition.

Definition at line 75 of file Regionaloutput.cpp.

75  {/*{{{*/
76 
77  return this->definitionenum;
78 }

◆ Name()

char * Regionaloutput::Name ( )
virtual

Implements Definition.

Definition at line 80 of file Regionaloutput.cpp.

80  {/*{{{*/
81 
82  char* name2=xNew<char>(strlen(this->name)+1);
83  xMemCpy(name2,this->name,strlen(this->name)+1);
84 
85  return name2;
86 }

◆ Response()

IssmDouble Regionaloutput::Response ( FemModel femmodel)
virtual

Implements Definition.

Definition at line 88 of file Regionaloutput.cpp.

88  {/*{{{*/
89 
90  int i;
91  IssmDouble val_t=0.;
92  IssmDouble all_val_t=0.;
93  int outputenum = StringToEnumx(this->outputname);
94 
95  for(i=0;i<femmodel->elements->Size();i++){
97  switch(outputenum){
98  case GroundedAreaEnum:
99  val_t+=element->GroundedArea(this->mask,false);
100  break;
102  val_t+=element->GroundedArea(this->mask,true);
103  break;
104  case FloatingAreaEnum:
105  val_t+=element->FloatingArea(this->mask,false);
106  break;
108  val_t+=element->FloatingArea(this->mask,true);
109  break;
110  case IceMassEnum:
111  val_t+=element->IceMass(this->mask,false);
112  break;
113  case IceMassScaledEnum:
114  val_t+=element->IceMass(this->mask,true);
115  break;
116  case IceVolumeEnum:
117  val_t+=element->IceVolume(this->mask,false);
118  break;
119  case IceVolumeScaledEnum:
120  val_t+=element->IceVolume(this->mask,true);
121  break;
123  val_t+=element->IceVolumeAboveFloatation(this->mask,false);
124  break;
126  val_t+=element->IceVolumeAboveFloatation(this->mask,true);
127  break;
129  val_t+=element->TotalFloatingBmb(this->mask,false);
130  break;
132  val_t+=element->TotalFloatingBmb(this->mask,true);
133  break;
135  val_t+=element->TotalGroundedBmb(this->mask,false);
136  break;
138  val_t+=element->TotalGroundedBmb(this->mask,true);
139  break;
140  case TotalSmbEnum:
141  val_t+=element->TotalSmb(this->mask,false);
142  break;
143  case TotalSmbScaledEnum:
144  val_t+=element->TotalSmb(this->mask,true);
145  break;
146  default:
147  _error_("Regional output type " << this->outputname << " not supported yet!");
148  }
149  }
150 
151  ISSM_MPI_Allreduce ( (void*)&val_t,(void*)&all_val_t,1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,IssmComm::GetComm());
152  val_t=all_val_t;
153 
154  return val_t;
155 }

Field Documentation

◆ definitionenum

int Regionaloutput::definitionenum

Definition at line 19 of file Regionaloutput.h.

◆ outputname

char* Regionaloutput::outputname

Definition at line 20 of file Regionaloutput.h.

◆ name

char* Regionaloutput::name

Definition at line 21 of file Regionaloutput.h.

◆ mask

IssmDouble* Regionaloutput::mask

Definition at line 22 of file Regionaloutput.h.

◆ M

int Regionaloutput::M

Definition at line 23 of file Regionaloutput.h.


The documentation for this class was generated from the following files:
DataSet::Size
int Size()
Definition: DataSet.cpp:399
IceVolumeAboveFloatationScaledEnum
@ IceVolumeAboveFloatationScaledEnum
Definition: EnumDefinitions.h:1113
Regionaloutput::outputname
char * outputname
Definition: Regionaloutput.h:20
Element::TotalFloatingBmb
IssmDouble TotalFloatingBmb(IssmDouble *mask, bool scaled)
Definition: Element.cpp:4260
IssmDouble
double IssmDouble
Definition: types.h:37
IceVolumeScaledEnum
@ IceVolumeScaledEnum
Definition: EnumDefinitions.h:1115
Regionaloutput::M
int M
Definition: Regionaloutput.h:23
ISSM_MPI_Allreduce
int ISSM_MPI_Allreduce(void *sendbuf, void *recvbuf, int count, ISSM_MPI_Datatype datatype, ISSM_MPI_Op op, ISSM_MPI_Comm comm)
Definition: issmmpi.cpp:116
FloatingAreaScaledEnum
@ FloatingAreaScaledEnum
Definition: EnumDefinitions.h:1068
RegionaloutputEnum
@ RegionaloutputEnum
Definition: EnumDefinitions.h:1237
_printf_
#define _printf_(StreamArgs)
Definition: Print.h:22
TotalFloatingBmbScaledEnum
@ TotalFloatingBmbScaledEnum
Definition: EnumDefinitions.h:1308
ISSM_MPI_SUM
#define ISSM_MPI_SUM
Definition: issmmpi.h:134
IssmComm::GetComm
static ISSM_MPI_Comm GetComm(void)
Definition: IssmComm.cpp:30
Element::IceVolumeAboveFloatation
IssmDouble IceVolumeAboveFloatation(IssmDouble *mask, bool scaled)
Definition: Element.cpp:1607
TotalSmbScaledEnum
@ TotalSmbScaledEnum
Definition: EnumDefinitions.h:1312
Element::GroundedArea
IssmDouble GroundedArea(IssmDouble *mask, bool scaled)
Definition: Element.cpp:1548
Regionaloutput::definitionenum
int definitionenum
Definition: Regionaloutput.h:19
Element::FloatingArea
IssmDouble FloatingArea(IssmDouble *mask, bool scaled)
Definition: Element.cpp:948
Regionaloutput::name
char * name
Definition: Regionaloutput.h:21
TotalGroundedBmbEnum
@ TotalGroundedBmbEnum
Definition: EnumDefinitions.h:1309
Element
Definition: Element.h:41
ISSM_MPI_DOUBLE
#define ISSM_MPI_DOUBLE
Definition: issmmpi.h:125
Object
Definition: Object.h:13
Element::IceVolume
IssmDouble IceVolume(IssmDouble *mask, bool scaled)
Definition: Element.cpp:1594
xDelete
void xDelete(T **&aT_pp)
Definition: MemOps.h:97
Regionaloutput
Definition: Regionaloutput.h:15
Element::TotalSmb
IssmDouble TotalSmb(IssmDouble *mask, bool scaled)
Definition: Element.cpp:4286
IceMassScaledEnum
@ IceMassScaledEnum
Definition: EnumDefinitions.h:1111
IceVolumeEnum
@ IceVolumeEnum
Definition: EnumDefinitions.h:1114
FemModel::elements
Elements * elements
Definition: FemModel.h:44
StringToEnumx
int StringToEnumx(const char *string_in, bool notfounderror=true)
Definition: StringToEnumx.cpp:14
TotalSmbEnum
@ TotalSmbEnum
Definition: EnumDefinitions.h:1311
Regionaloutput::Echo
void Echo(void)
Definition: Regionaloutput.cpp:54
Regionaloutput::Regionaloutput
Regionaloutput()
FloatingAreaEnum
@ FloatingAreaEnum
Definition: EnumDefinitions.h:1067
_error_
#define _error_(StreamArgs)
Definition: exceptions.h:49
DataSet::GetObjectByOffset
Object * GetObjectByOffset(int offset)
Definition: DataSet.cpp:334
Regionaloutput::mask
IssmDouble * mask
Definition: Regionaloutput.h:22
GroundedAreaScaledEnum
@ GroundedAreaScaledEnum
Definition: EnumDefinitions.h:1090
IceVolumeAboveFloatationEnum
@ IceVolumeAboveFloatationEnum
Definition: EnumDefinitions.h:1112
Element::TotalGroundedBmb
IssmDouble TotalGroundedBmb(IssmDouble *mask, bool scaled)
Definition: Element.cpp:4273
xMemCpy
T * xMemCpy(T *dest, const T *src, unsigned int size)
Definition: MemOps.h:152
Element::IceMass
IssmDouble IceMass(bool scaled)
Definition: Element.cpp:1569
IceMassEnum
@ IceMassEnum
Definition: EnumDefinitions.h:1110
bamg::Min
T Min(const T &a, const T &b)
Definition: extrema.h:6
TotalGroundedBmbScaledEnum
@ TotalGroundedBmbScaledEnum
Definition: EnumDefinitions.h:1310
GroundedAreaEnum
@ GroundedAreaEnum
Definition: EnumDefinitions.h:1089
TotalFloatingBmbEnum
@ TotalFloatingBmbEnum
Definition: EnumDefinitions.h:1307
femmodel
FemModel * femmodel
Definition: esmfbinders.cpp:16