Ice Sheet System Model
4.18
Code documentation
src
c
modules
SurfaceAreax
SurfaceAreax.cpp
Go to the documentation of this file.
1
5
#include "
./SurfaceAreax.h
"
6
7
#include "../../shared/shared.h"
8
#include "../../toolkits/toolkits.h"
9
#include "../InputUpdateFromConstantx/InputUpdateFromConstantx.h"
10
11
void
SurfaceAreax
(
IssmDouble
* pS,
FemModel
*
femmodel
){
12
13
/*Intermediary*/
14
Element
* element=NULL;
15
16
/*output: */
17
IssmDouble
S = 0.;
18
IssmDouble
S_sum;
19
20
/*Compute gradients: */
21
for
(
int
i=0;i<
femmodel
->
elements
->
Size
();i++){
22
element=xDynamicCast<Element*>(
femmodel
->
elements
->
GetObjectByOffset
(i));
23
S+=element->
SurfaceArea
();
24
}
25
26
/*Sum all J from all cpus of the cluster:*/
27
ISSM_MPI_Reduce
(&S,&S_sum,1,
ISSM_MPI_DOUBLE
,
ISSM_MPI_SUM
,0,
IssmComm::GetComm
() );
28
ISSM_MPI_Bcast
(&S_sum,1,
ISSM_MPI_DOUBLE
,0,
IssmComm::GetComm
());
29
S=S_sum;
30
31
/*add surface area to element inputs:*/
32
InputUpdateFromConstantx
(
femmodel
,S,
SurfaceAreaEnum
);
33
34
/*Assign output pointers: */
35
if
(pS) *pS=S;
36
}
DataSet::Size
int Size()
Definition:
DataSet.cpp:399
IssmDouble
double IssmDouble
Definition:
types.h:37
Element::SurfaceArea
virtual IssmDouble SurfaceArea(void)=0
ISSM_MPI_SUM
#define ISSM_MPI_SUM
Definition:
issmmpi.h:134
IssmComm::GetComm
static ISSM_MPI_Comm GetComm(void)
Definition:
IssmComm.cpp:30
SurfaceAreax.h
header file for ...
Element
Definition:
Element.h:41
ISSM_MPI_DOUBLE
#define ISSM_MPI_DOUBLE
Definition:
issmmpi.h:125
SurfaceAreax
void SurfaceAreax(IssmDouble *pS, FemModel *femmodel)
Definition:
SurfaceAreax.cpp:11
SurfaceAreaEnum
@ SurfaceAreaEnum
Definition:
EnumDefinitions.h:820
InputUpdateFromConstantx
void InputUpdateFromConstantx(FemModel *femmodel, bool constant, int name)
Definition:
InputUpdateFromConstantx.cpp:10
FemModel::elements
Elements * elements
Definition:
FemModel.h:44
ISSM_MPI_Bcast
int ISSM_MPI_Bcast(void *buffer, int count, ISSM_MPI_Datatype datatype, int root, ISSM_MPI_Comm comm)
Definition:
issmmpi.cpp:162
FemModel
Definition:
FemModel.h:31
DataSet::GetObjectByOffset
Object * GetObjectByOffset(int offset)
Definition:
DataSet.cpp:334
ISSM_MPI_Reduce
int ISSM_MPI_Reduce(void *sendbuf, void *recvbuf, int count, ISSM_MPI_Datatype datatype, ISSM_MPI_Op op, int root, ISSM_MPI_Comm comm)
Definition:
issmmpi.cpp:373
femmodel
FemModel * femmodel
Definition:
esmfbinders.cpp:16
Generated on Thu Jul 2 2020 08:09:19 for Ice Sheet System Model by
1.8.19