Ice Sheet System Model  4.18
Code documentation
Functions
InputUpdateFromConstantx.h File Reference

header file for updating datasets from inputs More...

#include "../../classes/classes.h"

Go to the source code of this file.

Functions

void InputUpdateFromConstantx (FemModel *femmodel, bool constant, int name)
 
void InputUpdateFromConstantx (FemModel *femmodel, int constant, int name)
 
void InputUpdateFromConstantx (FemModel *femmodel, IssmDouble constant, int name)
 
void InputUpdateFromConstantx (Inputs2 *inputs2, Elements *elements, IssmDouble constant, int name)
 
void InputUpdateFromConstantx (Inputs2 *inputs2, Elements *elements, bool constant, int name)
 

Detailed Description

header file for updating datasets from inputs

Definition in file InputUpdateFromConstantx.h.

Function Documentation

◆ InputUpdateFromConstantx() [1/5]

void InputUpdateFromConstantx ( FemModel femmodel,
bool  constant,
int  name 
)

Definition at line 10 of file InputUpdateFromConstantx.cpp.

10  {
11  if(VerboseModule()) _printf0_(" Input updates from constant\n");
12 
13  /*Elements and loads drive the update: */
14  for(int i=0;i<femmodel->elements->Size();i++){
15  Element* element=xDynamicCast<Element*>(femmodel->elements->GetObjectByOffset(i));
16  element->InputUpdateFromConstant(constant,name);
17  }
18 }

◆ InputUpdateFromConstantx() [2/5]

void InputUpdateFromConstantx ( FemModel femmodel,
int  constant,
int  name 
)

Definition at line 19 of file InputUpdateFromConstantx.cpp.

19  {
20 
21  if(VerboseModule()) _printf0_(" Input updates from constant\n");
22 
23  /*Elements and loads drive the update: */
24  for(int i=0;i<femmodel->elements->Size();i++){
25  Element* element=xDynamicCast<Element*>(femmodel->elements->GetObjectByOffset(i));
26  element->InputUpdateFromConstant(constant,name);
27  }
28 }

◆ InputUpdateFromConstantx() [3/5]

void InputUpdateFromConstantx ( FemModel femmodel,
IssmDouble  constant,
int  name 
)

Definition at line 29 of file InputUpdateFromConstantx.cpp.

29  {
30 
31  if(VerboseModule()) _printf0_(" Input updates from constant\n");
32 
33  /*Elements and loads drive the update: */
34  if(IsInputEnum(name)){
35  for(int i=0;i<femmodel->elements->Size();i++){
36  Element* element=xDynamicCast<Element*>(femmodel->elements->GetObjectByOffset(i));
37  element->InputUpdateFromConstant(constant,name);
38  }
39  }
40  else if(IsParamEnum(name)){
41  if(femmodel->parameters->Exist(name)){
42  femmodel->parameters->SetParam(constant,name);
43  }
44  else{
45  _error_("Param not set");
46  }
47  }
48  else{
49  _error_("not supported");
50  }
51 }

◆ InputUpdateFromConstantx() [4/5]

void InputUpdateFromConstantx ( Inputs2 inputs2,
Elements elements,
IssmDouble  constant,
int  name 
)

Definition at line 52 of file InputUpdateFromConstantx.cpp.

52  {
53 
54  if(VerboseModule()) _printf0_(" Input updates from constant\n");
55 
56  /*Elements and loads drive the update: */
57  for(int i=0;i<elements->Size();i++){
58  Element* element=xDynamicCast<Element*>(elements->GetObjectByOffset(i));
59  element->SetElementInput(inputs2,name,constant);
60  }
61 }

◆ InputUpdateFromConstantx() [5/5]

void InputUpdateFromConstantx ( Inputs2 inputs2,
Elements elements,
bool  constant,
int  name 
)

Definition at line 62 of file InputUpdateFromConstantx.cpp.

62  {
63 
64  if(VerboseModule()) _printf0_(" Input updates from constant\n");
65 
66  /*Elements and loads drive the update: */
67  for(int i=0;i<elements->Size();i++){
68  Element* element=xDynamicCast<Element*>(elements->GetObjectByOffset(i));
69  element->SetBoolInput(inputs2,name,constant);
70  }
71 }
DataSet::Size
int Size()
Definition: DataSet.cpp:399
_printf0_
#define _printf0_(StreamArgs)
Definition: Print.h:29
Element::SetBoolInput
void SetBoolInput(Inputs2 *inputs2, int enum_in, bool value)
Definition: Element.cpp:3355
Parameters::Exist
bool Exist(int enum_type)
Definition: Parameters.cpp:254
FemModel::parameters
Parameters * parameters
Definition: FemModel.h:46
VerboseModule
bool VerboseModule(void)
Definition: Verbosity.cpp:23
Element
Definition: Element.h:41
Parameters::SetParam
void SetParam(bool boolean, int enum_type)
Definition: Parameters.cpp:441
IsParamEnum
bool IsParamEnum(int enum_in)
Definition: EnumToStringx.cpp:1373
IsInputEnum
bool IsInputEnum(int enum_in)
Definition: EnumToStringx.cpp:1368
FemModel::elements
Elements * elements
Definition: FemModel.h:44
Element::SetElementInput
virtual void SetElementInput(int enum_in, IssmDouble values)
Definition: Element.h:333
_error_
#define _error_(StreamArgs)
Definition: exceptions.h:49
DataSet::GetObjectByOffset
Object * GetObjectByOffset(int offset)
Definition: DataSet.cpp:334
Element::InputUpdateFromConstant
void InputUpdateFromConstant(IssmDouble constant, int name)
Definition: Element.cpp:1963
femmodel
FemModel * femmodel
Definition: esmfbinders.cpp:16