 |
Ice Sheet System Model
4.18
Code documentation
|
Go to the documentation of this file.
6 #include "../../shared/shared.h"
7 #include "../../toolkits/toolkits.h"
12 int num_controls,analysisenum;
15 int *control_type = NULL;
32 gradient_list = xNew<Vector<IssmDouble>*>(num_controls);
33 norm_list = xNew<IssmDouble>(num_controls);
34 for(
int i=0;i<num_controls;i++){
40 for(
int i=0;i<num_controls;i++){
41 for(
int j=0;j<elements->
Size();j++){
43 analysis->
GradientJ(gradient_list[i],element,control_type[i],i);
50 for(
int i=0;i<num_controls;i++){
51 gradient->
AXPY(gradient_list[i],1.0);
52 delete gradient_list[i];
57 if(norm_inf<=0)
_error_(
"||dJ/dk|| = 0 gradient norm is zero");
58 if(xIsNan<IssmDouble>(norm_inf))
_error_(
"||dJ/dk|| = NaN gradient norm is NaN");
62 xDelete<Vector<IssmDouble>*>(gradient_list);
63 xDelete<int>(control_type);
65 *pnorm_list=norm_list;
68 xDelete<IssmDouble>(norm_list);
70 if(pgradient) *pgradient=gradient;
81 Gradjx(&vec_gradient,pnorm_list,elements,nodes, vertices,loads,materials,parameters);
header file for inverse methods gradient computation
Declaration of Vertices class.
Declaration of Nodes class.
@ InversionNumControlParametersEnum
#define _printf0_(StreamArgs)
@ InversionControlParametersEnum
Declaration of Parameters class.
Declaration of Elements class.
int NumberOfVertices(void)
doubletype Norm(NormMode norm_type)
void AXPY(Vector *X, doubletype a)
Declaration of Materials class.
virtual void GradientJ(Vector< IssmDouble > *gradient, Element *element, int control_type, int control_index)=0
void Gradjx(Vector< IssmDouble > **pgradient, IssmDouble **pnorm_list, Elements *elements, Nodes *nodes, Vertices *vertices, Loads *loads, Materials *materials, Parameters *parameters)
Analysis * EnumToAnalysis(int analysis_enum)
Declaration of Loads class.
#define _error_(StreamArgs)
Object * GetObjectByOffset(int offset)
void FindParam(bool *pinteger, int enum_type)
doubletype * ToMPISerial(void)