Changeset 16759
- Timestamp:
- 11/14/13 10:05:38 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/analyses/AdjointHorizAnalysis.cpp
r16752 r16759 92 92 93 93 /*Initialize values*/ 94 IssmDouble* vvalues = xNew<IssmDouble>(vnumdof); 95 IssmDouble* pvalues = xNew<IssmDouble>(pnumdof); 94 IssmDouble* values = xNew<IssmDouble>(vnumdof+pnumdof); 96 95 IssmDouble* lambdax = xNew<IssmDouble>(vnumnodes); 97 96 IssmDouble* lambday = xNew<IssmDouble>(vnumnodes); 98 97 IssmDouble* lambdaz = xNew<IssmDouble>(vnumnodes); 99 98 IssmDouble* lambdap = xNew<IssmDouble>(pnumnodes); 99 100 int* cs_list = xNew<int>(vnumnodes+pnumnodes); 101 for(i=0;i<vnumnodes;i++) cs_list[i] = XYZEnum; 102 for(i=0;i<pnumnodes;i++) cs_list[vnumnodes+i] = PressureEnum; 100 103 101 104 /*Get dof list: */ … … 104 107 105 108 /*Use the dof list to index into the solution vector: */ 106 for(i=0;i<vnumdof;i++) v values[i]=solution[vdoflist[i]];107 for(i=0;i<pnumdof;i++) pvalues[i]=solution[pdoflist[i]];109 for(i=0;i<vnumdof;i++) values[i] =solution[vdoflist[i]]; 110 for(i=0;i<pnumdof;i++) values[vnumdof+i]=solution[pdoflist[i]]; 108 111 109 112 /*Transform solution in Cartesian Space*/ 110 element->TransformSolutionCoord( &vvalues[0],XYZEnum);113 element->TransformSolutionCoord(values,cs_list); 111 114 112 115 /*fill in all arrays: */ 113 116 for(i=0;i<vnumnodes;i++){ 114 lambdax[i] = v values[i*NDOF3+0]; if(xIsNan<IssmDouble>(lambdax[i])) _error_("NaN found in solution vector");115 lambday[i] = v values[i*NDOF3+1]; if(xIsNan<IssmDouble>(lambday[i])) _error_("NaN found in solution vector");116 lambdaz[i] = v values[i*NDOF3+2]; if(xIsNan<IssmDouble>(lambdaz[i])) _error_("NaN found in solution vector");117 lambdax[i] = values[i*NDOF3+0]; if(xIsNan<IssmDouble>(lambdax[i])) _error_("NaN found in solution vector"); 118 lambday[i] = values[i*NDOF3+1]; if(xIsNan<IssmDouble>(lambday[i])) _error_("NaN found in solution vector"); 119 lambdaz[i] = values[i*NDOF3+2]; if(xIsNan<IssmDouble>(lambdaz[i])) _error_("NaN found in solution vector"); 117 120 } 118 121 for(i=0;i<pnumnodes;i++){ 119 lambdap[i] = pvalues[i]; if(xIsNan<IssmDouble>(lambdap[i])) _error_("NaN found in solution vector");122 lambdap[i] = values[vnumdof+i]; if(xIsNan<IssmDouble>(lambdap[i])) _error_("NaN found in solution vector"); 120 123 } 121 124 … … 133 136 xDelete<int>(vdoflist); 134 137 xDelete<int>(pdoflist); 138 xDelete<int>(cs_list); 135 139 xDelete<IssmDouble>(lambdap); 136 140 xDelete<IssmDouble>(lambdaz); 137 141 xDelete<IssmDouble>(lambday); 138 142 xDelete<IssmDouble>(lambdax); 139 xDelete<IssmDouble>(vvalues); 140 xDelete<IssmDouble>(pvalues); 143 xDelete<IssmDouble>(values); 141 144 }/*}}}*/
Note:
See TracChangeset
for help on using the changeset viewer.