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

#include <Masscon.h>

Inheritance diagram for Masscon:
Object Definition

Public Member Functions

 Masscon ()
 
 Masscon (char *in_name, int in_definitionenum, IssmDouble *levelsetin, int Min)
 
 ~Masscon ()
 
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 * name
 
IssmDoublelevelset
 
int M
 

Detailed Description

Definition at line 18 of file Masscon.h.

Constructor & Destructor Documentation

◆ Masscon() [1/2]

Masscon::Masscon ( )
inline

Definition at line 28 of file Masscon.h.

28  {/*{{{*/
29 
30  this->definitionenum = -1;
31  this->name = NULL;
32  this->levelset=NULL;
33  this->M=0;
34 
35  }

◆ Masscon() [2/2]

Masscon::Masscon ( char *  in_name,
int  in_definitionenum,
IssmDouble levelsetin,
int  Min 
)
inline

Definition at line 37 of file Masscon.h.

37  { /*{{{*/
38 
39  this->definitionenum=in_definitionenum;
40  this->name = xNew<char>(strlen(in_name)+1);
41  xMemCpy<char>(this->name,in_name,strlen(in_name)+1);
42 
43  this->levelset = xNew<IssmDouble>(Min);
44  xMemCpy<IssmDouble>(this->levelset, levelsetin, Min);
45 
46  this->M=Min;
47 
48  }

◆ ~Masscon()

Masscon::~Masscon ( )
inline

Definition at line 50 of file Masscon.h.

50  {/*{{{*/
51  if(this->name)xDelete(this->name);
52  if(this->levelset)xDelete(this->levelset);
53  }

Member Function Documentation

◆ copy()

Object* Masscon::copy ( void  )
inlinevirtual

Implements Object.

Definition at line 56 of file Masscon.h.

56  {/*{{{*/
57  Masscon* mf = new Masscon(this->name,this->definitionenum,this->levelset,this->M);
58  return (Object*) mf;
59  }

◆ DeepEcho()

void Masscon::DeepEcho ( void  )
inlinevirtual

Implements Object.

Definition at line 61 of file Masscon.h.

61  {/*{{{*/
62  this->Echo();
63  }

◆ Echo()

void Masscon::Echo ( void  )
inlinevirtual

Implements Object.

Definition at line 65 of file Masscon.h.

65  {/*{{{*/
66  _printf_(" Masscon: " << this->name << " " << this->definitionenum << "\n");
67  _printf_(" levelset: " << this->levelset << "\n");
68  _printf_(" M: " << this->M << "\n");
69  }

◆ Id()

int Masscon::Id ( void  )
inlinevirtual

Implements Object.

Definition at line 71 of file Masscon.h.

71  {/*{{{*/
72  return -1;
73  }

◆ Marshall()

void Masscon::Marshall ( char **  pmarshalled_data,
int *  pmarshalled_data_size,
int  marshall_direction 
)
inlinevirtual

Implements Object.

Definition at line 75 of file Masscon.h.

75  {/*{{{*/
76  _error_("not implemented yet!");
77  }

◆ ObjectEnum()

int Masscon::ObjectEnum ( void  )
inlinevirtual

Implements Object.

Definition at line 79 of file Masscon.h.

79  {/*{{{*/
80  return MassconEnum;
81  }

◆ DefinitionEnum()

int Masscon::DefinitionEnum ( )
inlinevirtual

Implements Definition.

Definition at line 84 of file Masscon.h.

84  {/*{{{*/
85 
86  return this->definitionenum;
87  }

◆ Name()

char* Masscon::Name ( )
inlinevirtual

Implements Definition.

Definition at line 89 of file Masscon.h.

89  {/*{{{*/
90 
91  char* name2=xNew<char>(strlen(this->name)+1);
92  xMemCpy(name2,this->name,strlen(this->name)+1);
93 
94  return name2;
95  }

◆ Response()

IssmDouble Masscon::Response ( FemModel femmodel)
inlinevirtual

Implements Definition.

Definition at line 97 of file Masscon.h.

97  {/*{{{*/
98 
99  int i;
100  IssmDouble mass_t=0.;
101  IssmDouble all_mass_t=0.;
102 
103 
104  for(i=0;i<femmodel->elements->Size();i++){
106  mass_t+=element->Masscon(this->levelset);
107  }
108 
109  ISSM_MPI_Allreduce ( (void*)&mass_t,(void*)&all_mass_t,1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,IssmComm::GetComm());
110  mass_t=all_mass_t;
111 
112  return mass_t;
113  }

Field Documentation

◆ definitionenum

int Masscon::definitionenum

Definition at line 22 of file Masscon.h.

◆ name

char* Masscon::name

Definition at line 23 of file Masscon.h.

◆ levelset

IssmDouble* Masscon::levelset

Definition at line 24 of file Masscon.h.

◆ M

int Masscon::M

Definition at line 25 of file Masscon.h.


The documentation for this class was generated from the following file:
DataSet::Size
int Size()
Definition: DataSet.cpp:399
IssmDouble
double IssmDouble
Definition: types.h:37
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
_printf_
#define _printf_(StreamArgs)
Definition: Print.h:22
Masscon::name
char * name
Definition: Masscon.h:23
ISSM_MPI_SUM
#define ISSM_MPI_SUM
Definition: issmmpi.h:134
IssmComm::GetComm
static ISSM_MPI_Comm GetComm(void)
Definition: IssmComm.cpp:30
Element::Masscon
virtual IssmDouble Masscon(IssmDouble *levelset)=0
Element
Definition: Element.h:41
MassconEnum
@ MassconEnum
Definition: EnumDefinitions.h:1160
ISSM_MPI_DOUBLE
#define ISSM_MPI_DOUBLE
Definition: issmmpi.h:125
Object
Definition: Object.h:13
xDelete
void xDelete(T **&aT_pp)
Definition: MemOps.h:97
Masscon::M
int M
Definition: Masscon.h:25
Masscon::definitionenum
int definitionenum
Definition: Masscon.h:22
Masscon::Masscon
Masscon()
Definition: Masscon.h:28
FemModel::elements
Elements * elements
Definition: FemModel.h:44
Masscon::levelset
IssmDouble * levelset
Definition: Masscon.h:24
Masscon
Definition: Masscon.h:18
_error_
#define _error_(StreamArgs)
Definition: exceptions.h:49
DataSet::GetObjectByOffset
Object * GetObjectByOffset(int offset)
Definition: DataSet.cpp:334
Masscon::Echo
void Echo(void)
Definition: Masscon.h:65
xMemCpy
T * xMemCpy(T *dest, const T *src, unsigned int size)
Definition: MemOps.h:152
bamg::Min
T Min(const T &a, const T &b)
Definition: extrema.h:6
femmodel
FemModel * femmodel
Definition: esmfbinders.cpp:16