Ice Sheet System Model  4.18
Code documentation
AdjointCorePointerFromSolutionEnum.cpp
Go to the documentation of this file.
1 
5 #ifdef HAVE_CONFIG_H
6  #include <config.h>
7 #else
8 #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
9 #endif
10 
11 #include "./cores.h"
12 #include "../toolkits/toolkits.h"
13 #include "../classes/classes.h"
14 #include "../shared/shared.h"
15 #include "../modules/modules.h"
16 #include "../solutionsequences/solutionsequences.h"
17 
18 void AdjointCorePointerFromSolutionEnum(void (**padjointcore)(FemModel*),int solutiontype){
19 
20  /*output: */
21  void (*adjointcore)(FemModel*)=NULL;
22 
23  switch(solutiontype){
24 
26  adjointcore=&adjointstressbalance_core;
27  break;
29  adjointcore=&adjointstressbalance_core;
30  break;
32  adjointcore=&adjointbalancethickness_core;
33  break;
35  adjointcore=&adjointbalancethickness2_core;
36  break;
38  adjointcore=&dummy_core;
39  break;
40  default:
41  _error_("No adjoint has been implemented for solution " << EnumToStringx(solutiontype) << " yet");
42  break;
43  }
44 
45  /*Assign output pointer:*/
46  _assert_(padjointcore);
47  *padjointcore=adjointcore;
48 
49 }
_assert_
#define _assert_(ignore)
Definition: exceptions.h:37
adjointstressbalance_core
void adjointstressbalance_core(FemModel *femmodel)
Definition: adjointstressbalance_core.cpp:12
Balancethickness2SolutionEnum
@ Balancethickness2SolutionEnum
Definition: EnumDefinitions.h:980
dummy_core
void dummy_core(FemModel *femmodel)
Definition: dummy_core.cpp:7
AdjointCorePointerFromSolutionEnum
void AdjointCorePointerFromSolutionEnum(void(**padjointcore)(FemModel *), int solutiontype)
Definition: AdjointCorePointerFromSolutionEnum.cpp:18
cores.h
adjointbalancethickness2_core
void adjointbalancethickness2_core(FemModel *femmodel)
Definition: adjointbalancethickness2_core.cpp:12
BalancethicknessSoftSolutionEnum
@ BalancethicknessSoftSolutionEnum
Definition: EnumDefinitions.h:984
BalancethicknessSolutionEnum
@ BalancethicknessSolutionEnum
Definition: EnumDefinitions.h:985
EnumToStringx
const char * EnumToStringx(int enum_in)
Definition: EnumToStringx.cpp:15
StressbalanceSolutionEnum
@ StressbalanceSolutionEnum
Definition: EnumDefinitions.h:1288
FemModel
Definition: FemModel.h:31
adjointbalancethickness_core
void adjointbalancethickness_core(FemModel *femmodel)
Definition: adjointbalancethickness_core.cpp:12
_error_
#define _error_(StreamArgs)
Definition: exceptions.h:49
SteadystateSolutionEnum
@ SteadystateSolutionEnum
Definition: EnumDefinitions.h:1283