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

: header file for Cfdragcoeffabsgrad object More...

#include "./Definition.h"
#include "./FemModel.h"

Go to the source code of this file.

Data Structures

class  Cfdragcoeffabsgrad
 

Functions

IssmDouble OutputDefinitionsResponsex (FemModel *femmodel, int output_enum)
 
void GetVectorFromInputsx (IssmDouble **pvector, int *pvector_size, FemModel *femmodel, int name)
 

Detailed Description

: header file for Cfdragcoeffabsgrad object

Definition in file Cfdragcoeffabsgrad.h.

Function Documentation

◆ OutputDefinitionsResponsex()

IssmDouble OutputDefinitionsResponsex ( FemModel femmodel,
int  output_enum 
)

Definition at line 38 of file OutputDefinitionsResponsex.cpp.

38  {
39 
40  /*Ok, go find the output definitions dataset in the parameters, where our responses are hiding: */
42 
43  /*Now, go through the output definitions, and retrieve the object which corresponds to our requested response, output_enum: */
44  for(int i=0;i<output_definitions->Size();i++){
45 
46  //Definition* definition=xDynamicCast<Definition*>(output_definitions->GetObjectByOffset(i));
47  Definition* definition=dynamic_cast<Definition*>(output_definitions->GetObjectByOffset(i));
48 
49  int en = definition->DefinitionEnum();
50  if(en==output_enum){
51 
52  /*This is the object that we have been chasing for. compute the response and return: */
53  IssmDouble return_value=definition->Response(femmodel);
54 
55  /*return:*/
56  return return_value;
57  }
58  }
59 
60  /*If we are here, did not find the definition for this response, not good!: */
61  _error_("Could not find the response for output definition " << EnumToStringx(output_enum)
62  <<" ("<<output_enum<<")"
63  << " because could not find the definition itself!");
64 }

◆ GetVectorFromInputsx()

void GetVectorFromInputsx ( IssmDouble **  pvector,
int *  pvector_size,
FemModel femmodel,
int  name 
)

Definition at line 81 of file GetVectorFromInputsx.cpp.

81  { /*{{{*/
82 
83  int interpolation_type;
84  /*this one is special: we don't specify the type, but let the nature of the inputs dictace.
85  * P0 -> ElementSIdEnum, P1 ->VertexSIdEnum: */
86 
87  /*We go find the input of the first element, and query its interpolation type: */
88  Element* element=xDynamicCast<Element*>(femmodel->elements->GetObjectByOffset(0));
89  Input2* input=element->GetInput2(name);
90  if (!input) _error_("could not find input: " << name);
91 
92  interpolation_type=input->GetInputInterpolationType();
93  if(interpolation_type==P0Enum){
94  *pvector_size=femmodel->elements->NumberOfElements();
96  }
97  else if(interpolation_type==P1Enum){
98  *pvector_size=femmodel->vertices->NumberOfVertices();
100  }
101  else _error_("interpolation type : " << interpolation_type << " not supported yet!");
102 }/*}}}*/
DataSet::Size
int Size()
Definition: DataSet.cpp:399
Definition::Response
virtual IssmDouble Response(FemModel *)=0
FemModel::vertices
Vertices * vertices
Definition: FemModel.h:49
IssmDouble
double IssmDouble
Definition: types.h:37
FemModel::parameters
Parameters * parameters
Definition: FemModel.h:46
GetVectorFromInputsx
void GetVectorFromInputsx(Vector< IssmDouble > **pvector, FemModel *femmodel, int name, int type)
Definition: GetVectorFromInputsx.cpp:9
P0Enum
@ P0Enum
Definition: EnumDefinitions.h:661
Input2::GetInputInterpolationType
virtual int GetInputInterpolationType()
Definition: Input2.h:39
Vertices::NumberOfVertices
int NumberOfVertices(void)
Definition: Vertices.cpp:255
OutputdefinitionEnum
@ OutputdefinitionEnum
Definition: EnumDefinitions.h:285
Element::GetInput2
virtual Input2 * GetInput2(int inputenum)=0
Element
Definition: Element.h:41
P1Enum
@ P1Enum
Definition: EnumDefinitions.h:662
VertexSIdEnum
@ VertexSIdEnum
Definition: EnumDefinitions.h:1325
EnumToStringx
const char * EnumToStringx(int enum_in)
Definition: EnumToStringx.cpp:15
ElementSIdEnum
@ ElementSIdEnum
Definition: EnumDefinitions.h:1051
Definition
Definition: Definition.h:10
FemModel::elements
Elements * elements
Definition: FemModel.h:44
Input2
Definition: Input2.h:18
DataSetParam
Definition: DataSetParam.h:20
Definition::DefinitionEnum
virtual int DefinitionEnum()=0
_error_
#define _error_(StreamArgs)
Definition: exceptions.h:49
DataSet::GetObjectByOffset
Object * GetObjectByOffset(int offset)
Definition: DataSet.cpp:334
Elements::NumberOfElements
int NumberOfElements(void)
Definition: Elements.cpp:67
Parameters::FindParamObject
Param * FindParamObject(int enum_type)
Definition: Parameters.cpp:588
DataSet
Declaration of DataSet class.
Definition: DataSet.h:14
femmodel
FemModel * femmodel
Definition: esmfbinders.cpp:16