Changeset 4353 for issm/trunk/src/c/objects/Elements/Tria.cpp
- Timestamp:
- 06/30/10 14:17:09 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/objects/Elements/Tria.cpp
r4350 r4353 302 302 /*FUNCTION Tria::InputUpdateFromConstant(int value, int name);{{{1*/ 303 303 void Tria::InputUpdateFromConstant(int constant, int name){ 304 /*Nothing updated for now*/ 304 /*Check that name is an element input*/ 305 if (!IsInput(name)) return; 306 307 /*update input*/ 308 this->inputs->AddInput(new IntInput(name,constant)); 305 309 } 306 310 /*}}}*/ 307 311 /*FUNCTION Tria::InputUpdateFromConstant(double value, int name);{{{1*/ 308 312 void Tria::InputUpdateFromConstant(double constant, int name){ 309 /*Nothing updated for now*/ 313 /*Check that name is an element input*/ 314 if (!IsInput(name)) return; 315 316 /*update input*/ 317 this->inputs->AddInput(new DoubleInput(name,constant)); 310 318 } 311 319 /*}}}*/ 312 320 /*FUNCTION Tria::InputUpdateFromConstant(bool value, int name);{{{1*/ 313 321 void Tria::InputUpdateFromConstant(bool constant, int name){ 314 /*Nothing updated for now*/ 322 /*Check that name is an element input*/ 323 if (!IsInput(name)) return; 324 325 /*update input*/ 326 this->inputs->AddInput(new BoolInput(name,constant)); 315 327 } 316 328 /*}}}*/ … … 329 341 else if (analysis_type==DiagnosticHorizAnalysisEnum){ 330 342 InputUpdateFromSolutionDiagnosticHoriz( solution); 343 } 344 else if (analysis_type==AdjointAnalysisEnum){ 345 InputUpdateFromSolutionAdjoint( solution); 331 346 } 332 347 else if (analysis_type==BedSlopeAnalysisEnum || analysis_type==SurfaceSlopeAnalysisEnum){ … … 721 736 double scale=0; 722 737 double S=0; 723 doublefit=-1;738 int fit=-1; 724 739 725 740 /*retrieve some parameters: */ … … 1887 1902 double scaley=1; 1888 1903 double S=0; 1889 doublefit=-1;1904 int fit=-1; 1890 1905 1891 1906 /*inputs: */ … … 2120 2135 /*inputs: */ 2121 2136 bool onwater; 2122 int 2137 int fit; 2123 2138 2124 2139 /*retrieve inputs :*/ … … 5319 5334 } 5320 5335 /*}}}*/ 5336 /*FUNCTION Tria::InputUpdateFromSolutionAdjoint {{{1*/ 5337 void Tria::InputUpdateFromSolutionAdjoint(double* solution){ 5338 5339 int i; 5340 5341 const int numvertices=3; 5342 const int numdofpervertex=2; 5343 const int numdof=numdofpervertex*numvertices; 5344 5345 int doflist[numdof]; 5346 double values[numdof]; 5347 double lambdax[numvertices]; 5348 double lambday[numvertices]; 5349 5350 int dummy; 5351 5352 /*Get dof list: */ 5353 GetDofList(&doflist[0],&dummy); 5354 5355 /*Use the dof list to index into the solution vector: */ 5356 for(i=0;i<numdof;i++){ 5357 values[i]=solution[doflist[i]]; 5358 } 5359 5360 /*Ok, we have vx and vy in values, fill in vx and vy arrays: */ 5361 for(i=0;i<numvertices;i++){ 5362 lambdax[i]=values[i*numdofpervertex+0]; 5363 lambday[i]=values[i*numdofpervertex+1]; 5364 } 5365 5366 /*Add vx and vy as inputs to the tria element: */ 5367 this->inputs->AddInput(new TriaVertexInput(AdjointxEnum,lambdax)); 5368 this->inputs->AddInput(new TriaVertexInput(AdjointyEnum,lambday)); 5369 5370 } 5371 /*}}}*/ 5321 5372 /*FUNCTION Tria::InputUpdateFromSolutionDiagnosticHoriz {{{1*/ 5322 5373 void Tria::InputUpdateFromSolutionDiagnosticHoriz(double* solution){ … … 5473 5524 /*FUNCTION Tria::IsInput{{{1*/ 5474 5525 bool Tria::IsInput(int name){ 5475 if (name==SurfaceSlopeXEnum || 5476 name==SurfaceSlopeYEnum){ 5526 if ( 5527 name==SurfaceSlopeXEnum || 5528 name==SurfaceSlopeYEnum || 5529 name==FitEnum 5530 ){ 5477 5531 return true; 5478 5532 }
Note:
See TracChangeset
for help on using the changeset viewer.