Changeset 3612 for issm/trunk/src/c/objects/Penta.cpp
- Timestamp:
- 04/23/10 11:09:28 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/objects/Penta.cpp
r3599 r3612 266 266 } 267 267 /*}}}*/ 268 /*FUNCTION UpdateFromInputs {{{1*/269 void Penta::UpdateFromInputs(void* vinputs){270 271 int dofs[1]={0};272 double temperature_list[6];273 double temperature_average;274 double B_list[6];275 double B_average;276 277 /*dynamic objects pointed to by hooks: */278 Node** nodes=NULL;279 Matice* matice=NULL;280 281 ParameterInputs* inputs=NULL;282 283 /*If on water, skip: */284 if(this->properties.onwater)return;285 286 /*recover objects from hooks: */287 nodes=(Node**)hnodes.deliverp();288 matice=(Matice*)hmatice.delivers();289 290 /*recover pointers: */291 inputs=(ParameterInputs*)vinputs;292 293 /*Update internal data if inputs holds new values: */294 if (this->properties.h) inputs->Recover("thickness",&this->properties.h[0],1,dofs,6,(void**)nodes);295 if (this->properties.s) inputs->Recover("surface",&this->properties.s[0],1,dofs,6,(void**)nodes);296 if (this->properties.b) inputs->Recover("bed",&this->properties.b[0],1,dofs,6,(void**)nodes);297 if (this->properties.k) inputs->Recover("drag",&this->properties.k[0],1,dofs,6,(void**)nodes);298 if (this->properties.melting) inputs->Recover("melting",&this->properties.melting[0],1,dofs,6,(void**)nodes);299 if (this->properties.accumulation) inputs->Recover("accumulation",&this->properties.accumulation[0],1,dofs,6,(void**)nodes);300 if (this->properties.geothermalflux) inputs->Recover("geothermalflux",&this->properties.geothermalflux[0],1,dofs,6,(void**)nodes);301 302 //Update material if necessary303 if(inputs->Recover("temperature",&temperature_list[0],1,dofs,6,(void**)nodes)){304 if(matice && !this->properties.collapse){305 //B_average=(Paterson(temperature_list[0])+Paterson(temperature_list[1])+Paterson(temperature_list[2])306 // +Paterson(temperature_list[3])+Paterson(temperature_list[4])+Paterson(temperature_list[5]))/6.0;307 temperature_average=(temperature_list[0]+temperature_list[1]+temperature_list[2]+temperature_list[3]+temperature_list[4]+temperature_list[5])/6.0;308 B_average=Paterson(temperature_average);309 matice->SetB(B_average);310 }311 }312 313 if(inputs->Recover("temperature_average",&temperature_list[0],1,dofs,6,(void**)nodes)){314 if(matice && this->properties.collapse){315 temperature_average=(temperature_list[0]+temperature_list[1]+temperature_list[2]+temperature_list[3]+temperature_list[4]+temperature_list[5])/6.0;316 B_average=Paterson(temperature_average);317 //B_average=(Paterson(temperature_list[0])+Paterson(temperature_list[1])+Paterson(temperature_list[2])318 // +Paterson(temperature_list[3])+Paterson(temperature_list[4])+Paterson(temperature_list[5]))/6.0;319 matice->SetB(B_average);320 }321 }322 323 if(inputs->Recover("B",&B_list[0],1,dofs,6,(void**)nodes)){324 if(matice){325 B_average=(B_list[0]+B_list[1]+B_list[2]+B_list[3]+B_list[4]+B_list[5])/6.0;326 matice->SetB(B_average);327 }328 }329 330 }331 /*}}}*/332 268 /*FUNCTION UpdateFromDakota {{{1*/ 333 269 void Penta::UpdateFromDakota(void* vinputs){ … … 345 281 /*Object functions*/ 346 282 /*FUNCTION ComputeBasalStress {{{1*/ 347 void Penta::ComputeBasalStress(Vec sigma_b, void* vinputs,int analysis_type,int sub_analysis_type){283 void Penta::ComputeBasalStress(Vec sigma_b,int analysis_type,int sub_analysis_type){ 348 284 349 285 int i,j; … … 477 413 /*}}}*/ 478 414 /*FUNCTION ComputePressure {{{1*/ 479 void Penta::ComputePressure(Vec pg, void* vinputs,int analysis_type,int sub_analysis_type){415 void Penta::ComputePressure(Vec pg,int analysis_type,int sub_analysis_type){ 480 416 481 417 int i; … … 519 455 /*}}}*/ 520 456 /*FUNCTION ComputeStrainRate {{{1*/ 521 void Penta::ComputeStrainRate(Vec eps, void* vinputs,int analysis_type,int sub_analysis_type){457 void Penta::ComputeStrainRate(Vec eps,int analysis_type,int sub_analysis_type){ 522 458 523 459 ISSMERROR("Not implemented yet"); … … 526 462 /*}}}*/ 527 463 /*FUNCTION CostFunction {{{1*/ 528 double Penta::CostFunction( void* inputs,int analysis_type,int sub_analysis_type){464 double Penta::CostFunction(int analysis_type,int sub_analysis_type){ 529 465 530 466 double J; … … 560 496 /*FUNCTION CreateKMatrix {{{1*/ 561 497 562 void Penta::CreateKMatrix(Mat Kgg, void* inputs,int analysis_type,int sub_analysis_type){498 void Penta::CreateKMatrix(Mat Kgg,int analysis_type,int sub_analysis_type){ 563 499 564 500 /*Just branch to the correct element stiffness matrix generator, according to the type of analysis we are carrying out: */ … … 608 544 /*}}}*/ 609 545 /*FUNCTION CreateKMatrixDiagnosticHoriz {{{1*/ 610 void Penta::CreateKMatrixDiagnosticHoriz( Mat Kgg, void* vinputs,int analysis_type,int sub_analysis_type){546 void Penta::CreateKMatrixDiagnosticHoriz( Mat Kgg, int analysis_type,int sub_analysis_type){ 611 547 612 548 … … 844 780 /*}}}*/ 845 781 /*FUNCTION CreateKMatrixDiagnosticStokes {{{1*/ 846 void Penta::CreateKMatrixDiagnosticStokes( Mat Kgg, void* vinputs,int analysis_type,int sub_analysis_type){782 void Penta::CreateKMatrixDiagnosticStokes( Mat Kgg, int analysis_type,int sub_analysis_type){ 847 783 848 784 int i,j; … … 1139 1075 /*}}}*/ 1140 1076 /*FUNCTION CreateKMatrixDiagnosticVert {{{1*/ 1141 void Penta::CreateKMatrixDiagnosticVert( Mat Kgg, void* vinputs,int analysis_type,int sub_analysis_type){1077 void Penta::CreateKMatrixDiagnosticVert( Mat Kgg, int analysis_type,int sub_analysis_type){ 1142 1078 1143 1079 /* local declarations */ … … 1275 1211 /*}}}*/ 1276 1212 /*FUNCTION CreateKMatrixMelting {{{1*/ 1277 void Penta::CreateKMatrixMelting(Mat Kgg, void* inputs,int analysis_type,int sub_analysis_type){1213 void Penta::CreateKMatrixMelting(Mat Kgg,int analysis_type,int sub_analysis_type){ 1278 1214 1279 1215 Tria* tria=NULL; … … 1296 1232 /*FUNCTION CreateKMatrixPrognostic {{{1*/ 1297 1233 1298 void Penta::CreateKMatrixPrognostic(Mat Kgg, void* inputs,int analysis_type,int sub_analysis_type){1234 void Penta::CreateKMatrixPrognostic(Mat Kgg,int analysis_type,int sub_analysis_type){ 1299 1235 1300 1236 /*Collapsed formulation: */ … … 1317 1253 /*FUNCTION CreateKMatrixSlopeCompute {{{1*/ 1318 1254 1319 void Penta::CreateKMatrixSlopeCompute(Mat Kgg, void* inputs,int analysis_type,int sub_analysis_type){1255 void Penta::CreateKMatrixSlopeCompute(Mat Kgg,int analysis_type,int sub_analysis_type){ 1320 1256 1321 1257 /*Collapsed formulation: */ … … 1337 1273 /*}}}*/ 1338 1274 /*FUNCTION CreateKMatrixThermal {{{1*/ 1339 void Penta::CreateKMatrixThermal(Mat Kgg, void* vinputs,int analysis_type,int sub_analysis_type){1275 void Penta::CreateKMatrixThermal(Mat Kgg,int analysis_type,int sub_analysis_type){ 1340 1276 1341 1277 /* local declarations */ … … 1600 1536 /*}}}*/ 1601 1537 /*FUNCTION CreatePVector {{{1*/ 1602 void Penta::CreatePVector(Vec pg, void* inputs,int analysis_type,int sub_analysis_type){1538 void Penta::CreatePVector(Vec pg, int analysis_type,int sub_analysis_type){ 1603 1539 1604 1540 /*Just branch to the correct element stiffness matrix generator, according to the type of analysis we are carrying out: */ … … 1646 1582 /*}}}*/ 1647 1583 /*FUNCTION CreatePVectorDiagnosticHoriz {{{1*/ 1648 void Penta::CreatePVectorDiagnosticHoriz( Vec pg, void* vinputs,int analysis_type,int sub_analysis_type){1584 void Penta::CreatePVectorDiagnosticHoriz( Vec pg, int analysis_type,int sub_analysis_type){ 1649 1585 1650 1586 int i,j; … … 1801 1737 /*}}}*/ 1802 1738 /*FUNCTION CreatePVectorDiagnosticStokes {{{1*/ 1803 void Penta::CreatePVectorDiagnosticStokes( Vec pg, void* vinputs,int analysis_type,int sub_analysis_type){1739 void Penta::CreatePVectorDiagnosticStokes( Vec pg, int analysis_type,int sub_analysis_type){ 1804 1740 1805 1741 /*indexing: */ … … 2051 1987 /*}}}*/ 2052 1988 /*FUNCTION CreatePVectorDiagnosticVert {{{1*/ 2053 void Penta::CreatePVectorDiagnosticVert( Vec pg, void* vinputs,int analysis_type,int sub_analysis_type){1989 void Penta::CreatePVectorDiagnosticVert( Vec pg, int analysis_type,int sub_analysis_type){ 2054 1990 2055 1991 int i; … … 2190 2126 /*}}}*/ 2191 2127 /*FUNCTION CreatePVectorMelting {{{1*/ 2192 void Penta::CreatePVectorMelting( Vec pg, void* vinputs,int analysis_type,int sub_analysis_type){2128 void Penta::CreatePVectorMelting( Vec pg, int analysis_type,int sub_analysis_type){ 2193 2129 return; 2194 2130 } … … 2196 2132 /*FUNCTION CreatePVectorPrognostic {{{1*/ 2197 2133 2198 void Penta::CreatePVectorPrognostic( Vec pg, void* inputs,int analysis_type,int sub_analysis_type){2134 void Penta::CreatePVectorPrognostic( Vec pg, int analysis_type,int sub_analysis_type){ 2199 2135 2200 2136 /*Collapsed formulation: */ … … 2216 2152 /*FUNCTION CreatePVectorSlopeCompute {{{1*/ 2217 2153 2218 void Penta::CreatePVectorSlopeCompute( Vec pg, void* inputs,int analysis_type,int sub_analysis_type){2154 void Penta::CreatePVectorSlopeCompute( Vec pg, int analysis_type,int sub_analysis_type){ 2219 2155 2220 2156 /*Collapsed formulation: */ … … 2235 2171 /*}}}*/ 2236 2172 /*FUNCTION CreatePVectorThermal {{{1*/ 2237 void Penta::CreatePVectorThermal( Vec pg, void* vinputs,int analysis_type,int sub_analysis_type){2173 void Penta::CreatePVectorThermal( Vec pg, int analysis_type,int sub_analysis_type){ 2238 2174 2239 2175 … … 2438 2374 /*}}}*/ 2439 2375 /*FUNCTION Du {{{1*/ 2440 void Penta::Du(Vec du_g, void* inputs,int analysis_type,int sub_analysis_type){2376 void Penta::Du(Vec du_g,int analysis_type,int sub_analysis_type){ 2441 2377 2442 2378 int i; … … 3647 3583 /*}}}*/ 3648 3584 /*FUNCTION GetOnBed {{{1*/ 3649 intPenta::GetOnBed(){3585 bool Penta::GetOnBed(){ 3650 3586 return this->properties.onbed; 3651 3587 } … … 3792 3728 /*}}}*/ 3793 3729 /*FUNCTION Gradj {{{1*/ 3794 void Penta::Gradj(Vec grad_g, void* inputs,int analysis_type,int sub_analysis_type,char* control_type){3730 void Penta::Gradj(Vec grad_g,int analysis_type,int sub_analysis_type,char* control_type){ 3795 3731 3796 3732 /*If on water, skip grad (=0): */ … … 3807 3743 /*}}}*/ 3808 3744 /*FUNCTION GradjDrag {{{1*/ 3809 void Penta::GradjDrag(Vec grad_g, void* inputs,int analysis_type,int sub_analysis_type){3745 void Penta::GradjDrag(Vec grad_g,int analysis_type,int sub_analysis_type){ 3810 3746 3811 3747 Tria* tria=NULL; … … 3840 3776 /*}}}*/ 3841 3777 /*FUNCTION GradjB {{{1*/ 3842 void Penta::GradjB(Vec grad_g, void* inputs,int analysis_type,int sub_analysis_type){3778 void Penta::GradjB(Vec grad_g,int analysis_type,int sub_analysis_type){ 3843 3779 3844 3780 Tria* tria=NULL; … … 3873 3809 /*}}}*/ 3874 3810 /*FUNCTION Misfit {{{1*/ 3875 double Penta::Misfit( void* inputs,int analysis_type,int sub_analysis_type){3811 double Penta::Misfit(int analysis_type,int sub_analysis_type){ 3876 3812 3877 3813 double J; … … 4006 3942 /*}}}1*/ 4007 3943 /*FUNCTION SurfaceArea {{{1*/ 4008 double Penta::SurfaceArea( void* inputs,int analysis_type,int sub_analysis_type){3944 double Penta::SurfaceArea(int analysis_type,int sub_analysis_type){ 4009 3945 4010 3946 double S;
Note:
See TracChangeset
for help on using the changeset viewer.