Changeset 1805
- Timestamp:
- 08/24/09 14:26:14 (16 years ago)
- Location:
- issm/trunk/src
- Files:
-
- 9 added
- 29 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/DataSet/DataSet.cpp
r1784 r1805 1383 1383 1384 1384 } 1385 1386 void DataSet::OutputRifts(Vec riftproperties){ 1387 1388 vector<Object*>::iterator object; 1389 Riftfront* riftfront=NULL; 1390 1391 for ( object=objects.begin() ; object < objects.end(); object++ ){ 1392 1393 if((*object)->Enum()==RiftfrontEnum()){ 1394 1395 riftfront=(Riftfront*)(*object); 1396 riftfront->OutputProperties(riftproperties); 1397 } 1398 } 1399 1400 1401 1402 } -
issm/trunk/src/c/DataSet/DataSet.h
r1784 r1805 82 82 void FieldExtrude(Vec field,double* field_serial,char* field_name, int collapse); 83 83 void UpdateNodePositions(double* thickness,double* bed); 84 void OutputRifts(Vec riftproperties); 84 85 85 86 }; -
issm/trunk/src/c/Makefile.am
r1787 r1805 292 292 ./FieldDepthAveragex/FieldDepthAveragex.h\ 293 293 ./FieldExtrudex/FieldExtrudex.cpp\ 294 ./FieldExtrudex/FieldExtrudex.h 294 ./FieldExtrudex/FieldExtrudex.h\ 295 ./OutputRiftsx/OutputRiftsx.h\ 296 ./OutputRiftsx/OutputRiftsx.cpp 295 297 296 298 … … 577 579 ./FieldExtrudex/FieldExtrudex.cpp\ 578 580 ./FieldExtrudex/FieldExtrudex.h\ 581 ./OutputRiftsx/OutputRiftsx.h\ 582 ./OutputRiftsx/OutputRiftsx.cpp\ 579 583 ./parallel/diagnostic_core.cpp\ 580 584 ./parallel/diagnostic_core_linear.cpp\ … … 596 600 ./parallel/transient_core_2d.cpp\ 597 601 ./parallel/transient_core_3d.cpp\ 602 ./parallel/thermalstatic_core.cpp\ 598 603 ./parallel/OutputResults.cpp\ 599 604 ./parallel/OutputControl.cpp … … 604 609 bin_PROGRAMS = 605 610 else 606 bin_PROGRAMS = diagnostic.exe control.exe thermal.exe prognostic.exe transient.exe 611 bin_PROGRAMS = diagnostic.exe control.exe thermal.exe prognostic.exe transient.exe thermalstatic.exe 607 612 endif 608 613 … … 612 617 diagnostic_exe_CXXFLAGS= -fPIC -D_PARALLEL_ 613 618 619 thermalstatic_exe_SOURCES = parallel/thermalstatic.cpp 620 thermalstatic_exe_CXXFLAGS= -fPIC -D_PARALLEL_ 621 614 622 control_exe_SOURCES = parallel/control.cpp 615 623 control_exe_CXXFLAGS= -fPIC -D_PARALLEL_ -
issm/trunk/src/c/ModelProcessorx/CreateDataSets.cpp
r1648 r1805 18 18 19 19 void CreateDataSets(DataSet** pelements,DataSet** pnodes, DataSet** pmaterials, DataSet** pconstraints, DataSet** ploads,DataSet** pparameters,Model* model,ConstDataHandle model_handle){ 20 21 20 22 21 /*create parameters common to all solutions: */ … … 125 124 throw ErrorException(__FUNCT__,exprintf("%s%i%s%i%s"," analysis_type: ",model->analysis_type," sub_analysis_type: ",model->sub_analysis_type," not supported yet!")); 126 125 } 126 127 127 128 128 } -
issm/trunk/src/c/ModelProcessorx/CreateParameters.cpp
r1666 r1805 203 203 param->SetInteger(numberofdofspernode); 204 204 parameters->AddObject(param); 205 206 /*numrifts: */ 207 ModelFetchData((void**)&model->riftinfo,&model->numrifts,NULL,model_handle,"riftinfo","Matrix","Mat"); 208 count++; 209 param= new Param(count,"numrifts",INTEGER); 210 param->SetInteger(model->numrifts); 211 parameters->AddObject(param); 212 xfree((void**)&model->riftinfo); 205 213 206 214 /*All our datasets are already ordered by ids. Set presort flag so that later on, when sorting is requested on these -
issm/trunk/src/c/ModelProcessorx/DiagnosticHoriz/CreateLoadsDiagnosticHoriz.cpp
r1784 r1805 55 55 double riftfront_friction; 56 56 double riftfront_fraction; 57 double riftfront_fractionincrement; 57 58 bool riftfront_shelf; 58 59 double riftfront_penalty_offset; … … 68 69 double friction; 69 70 double fraction; 71 double fractionincrement; 70 72 71 73 /*Create loads: */ … … 186 188 friction=*(model->riftinfo+RIFTINFOSIZE*i+8); 187 189 fraction=*(model->riftinfo+RIFTINFOSIZE*i+9); 190 fractionincrement=*(model->riftinfo+RIFTINFOSIZE*i+10); 188 191 189 192 strcpy(riftfront_type,"2d"); … … 209 212 riftfront_friction=friction; 210 213 riftfront_fraction=fraction; 214 riftfront_fractionincrement=fractionincrement; 211 215 riftfront_shelf=(bool)model->gridoniceshelf[grid1-1]; 212 216 … … 218 222 riftfront_prestable=0; 219 223 220 riftfront=new Riftfront(riftfront_type,riftfront_id, riftfront_node_ids, riftfront_mparid, riftfront_h,riftfront_b,riftfront_s,riftfront_normal,riftfront_length,riftfront_fill,riftfront_friction, riftfront_fraction, riftfront_ penalty_offset, riftfront_penalty_lock, riftfront_active,riftfront_counter,riftfront_prestable,riftfront_shelf);224 riftfront=new Riftfront(riftfront_type,riftfront_id, riftfront_node_ids, riftfront_mparid, riftfront_h,riftfront_b,riftfront_s,riftfront_normal,riftfront_length,riftfront_fill,riftfront_friction, riftfront_fraction, riftfront_fractionincrement, riftfront_penalty_offset, riftfront_penalty_lock, riftfront_active,riftfront_counter,riftfront_prestable,riftfront_shelf); 221 225 222 226 loads->AddObject(riftfront); -
issm/trunk/src/c/ModelProcessorx/Model.h
r1784 r1805 11 11 #include "../toolkits/toolkits.h" 12 12 13 #define RIFTINFOSIZE 1 013 #define RIFTINFOSIZE 11 14 14 15 15 struct Model { -
issm/trunk/src/c/PenaltyConstraintsx/RiftConstraints.cpp
r1784 r1805 16 16 int potential; 17 17 18 /*First, has the material non-linearity stabilized? : */ 19 if(!IsMaterialStable(loads,inputs,analysis_type)){ 20 /*Do nothing, no constraints activated!: */ 21 printf("converging material\n"); 22 num_unstable_constraints=0; 23 converged=0; 24 } 25 else{ 26 /*Ok, start constraining: */ 27 printf("converged material: constraining\n"); 28 29 #ifdef _ZIGZAGCOUNTER_ 30 if(!IsPreStable(loads)){ 31 32 PreConstrain(&num_unstable_constraints,loads,inputs,analysis_type); 33 34 if(!num_unstable_constraints){ 35 /*Ok, preconstraining is done. Figure out size of unstable constraints pool. Then set 36 * prestable flag to 1 for all rift grids: */ 37 38 potential=PotentialUnstableConstraints(loads,inputs,analysis_type); 39 printf(" set of constraints is prestabilised; unstable constraints potentialnumber: %i\n",potential); 40 41 SetPreStable(loads); 42 num_unstable_constraints=-1; //ensure convergence does not happen! 43 } 44 45 } 46 else{ 47 /*Ok, set of constraints is stable. Start increasing number of inactive constraints, one by one: */ 48 49 /*Figure out max penetration: */ 50 MaxPenetrationInInputs(loads,inputs,analysis_type); 51 52 /*Constrain rifts: */ 53 Constrain(&num_unstable_constraints,loads,inputs,analysis_type); 54 } 55 #else 56 Constrain(&num_unstable_constraints,loads,inputs,analysis_type); 57 #endif 58 59 if(num_unstable_constraints==0)converged=1; 60 } 18 Constrain(&num_unstable_constraints,loads,inputs,analysis_type); 19 if(num_unstable_constraints==0)converged=1; 61 20 62 21 /*Assign output pointers: */ -
issm/trunk/src/c/issm.h
r1665 r1805 57 57 #include "./NodeConnectivityx/NodeConnectivityx.h" 58 58 #include "./ElementConnectivityx/ElementConnectivityx.h" 59 #include "./OutputRiftsx/OutputRiftsx.h" 59 60 60 61 -
issm/trunk/src/c/objects/Riftfront.cpp
r1784 r1805 25 25 } 26 26 27 Riftfront::Riftfront(char riftfront_type[RIFTFRONTSTRING],int riftfront_id, int riftfront_node_ids[MAX_RIFTFRONT_GRIDS], int riftfront_mparid, double riftfront_h[MAX_RIFTFRONT_GRIDS],double riftfront_b[MAX_RIFTFRONT_GRIDS],double riftfront_s[MAX_RIFTFRONT_GRIDS],double riftfront_normal[2],double riftfront_length,int riftfront_fill,double riftfront_friction, double riftfront_fraction,double riftfront_ penalty_offset, int riftfront_penalty_lock, bool riftfront_active,int riftfront_counter,bool riftfront_prestable,bool riftfront_shelf){27 Riftfront::Riftfront(char riftfront_type[RIFTFRONTSTRING],int riftfront_id, int riftfront_node_ids[MAX_RIFTFRONT_GRIDS], int riftfront_mparid, double riftfront_h[MAX_RIFTFRONT_GRIDS],double riftfront_b[MAX_RIFTFRONT_GRIDS],double riftfront_s[MAX_RIFTFRONT_GRIDS],double riftfront_normal[2],double riftfront_length,int riftfront_fill,double riftfront_friction, double riftfront_fraction,double riftfront_fractionincrement, double riftfront_penalty_offset, int riftfront_penalty_lock, bool riftfront_active,int riftfront_counter,bool riftfront_prestable,bool riftfront_shelf){ 28 28 29 29 int i; … … 54 54 friction=riftfront_friction; 55 55 fraction=riftfront_fraction; 56 fractionincrement=riftfront_fractionincrement; 56 57 penalty_offset=riftfront_penalty_offset; 57 58 penalty_lock=riftfront_penalty_lock; … … 85 86 86 87 printf("normal [%g,%g], length %g\n",normal[0],normal[1],normal[2]); 87 printf("fill: %i friction %g fraction %g \n",fill,friction,fraction);88 printf("fill: %i friction %g fraction %g fractionincrement %g \n",fill,friction,fraction,fractionincrement); 88 89 printf("penalty_offset %g\n",penalty_offset); 89 90 printf("penalty_lock %i\n",penalty_lock); … … 114 115 115 116 printf("normal [%g,%g], length %g\n",normal[0],normal[1],normal[2]); 116 printf("fill: %i friction %g fraction %g \n",fill,friction,fraction);117 printf("fill: %i friction %g fraction %g fractionincrement %g \n",fill,friction,fraction,fractionincrement); 117 118 printf("penalty_offset %g\n",penalty_offset); 118 119 printf("penalty_lock %i\n",penalty_lock); … … 156 157 memcpy(marshalled_dataset,&friction,sizeof(friction));marshalled_dataset+=sizeof(friction); 157 158 memcpy(marshalled_dataset,&fraction,sizeof(fraction));marshalled_dataset+=sizeof(fraction); 159 memcpy(marshalled_dataset,&fractionincrement,sizeof(fractionincrement));marshalled_dataset+=sizeof(fractionincrement); 158 160 memcpy(marshalled_dataset,&penalty_offset,sizeof(penalty_offset));marshalled_dataset+=sizeof(penalty_offset); 159 161 memcpy(marshalled_dataset,&penalty_lock,sizeof(penalty_lock));marshalled_dataset+=sizeof(penalty_lock); … … 184 186 sizeof(friction)+ 185 187 sizeof(fraction)+ 188 sizeof(fractionincrement)+ 186 189 sizeof(penalty_offset)+ 187 190 sizeof(penalty_lock)+ … … 225 228 memcpy(&friction,marshalled_dataset,sizeof(friction));marshalled_dataset+=sizeof(friction); 226 229 memcpy(&fraction,marshalled_dataset,sizeof(fraction));marshalled_dataset+=sizeof(fraction); 230 memcpy(&fractionincrement,marshalled_dataset,sizeof(fractionincrement));marshalled_dataset+=sizeof(fractionincrement); 227 231 memcpy(&penalty_offset,marshalled_dataset,sizeof(penalty_offset));marshalled_dataset+=sizeof(penalty_offset); 228 232 memcpy(&penalty_lock,marshalled_dataset,sizeof(penalty_lock));marshalled_dataset+=sizeof(penalty_lock); … … 621 625 penetration=(vxvy_list[1][0]-vxvy_list[0][0])*normal[0]+(vxvy_list[1][1]-vxvy_list[0][1])*normal[1]; 622 626 623 #ifdef _ZIGZAGCOUNTER_ 624 625 found=inputs->Recover("max_penetration",&max_penetration); 626 if(!found)throw ErrorException(__FUNCT__," could not find max_penetration in inputs!"); 627 628 /*Activate or deactivate penalties: */ 629 if(penetration<0){ 630 //printf("riftfront %i penetrating.\n",this->GetId()); 631 /*There is penetration, we need to active the penalty so this penetration will be NULL: */ 632 activate=1; 633 } 634 else{ 635 /*Ok, there is no penetration for these two grids of the rift. We want to deactivate the penalty. If we do 636 * it all at once, then we will zigzag forever. Only deactivate once at a time. Deactivate the one that most 637 * wants to, ie the one with the max penetration: */ 638 if (penetration==max_penetration){ 639 //printf("riftfront %i at max penetration.\n",this->GetId()); 640 activate=0; 641 } 642 else{ 643 /*Ok, we are dealing with the rest of the penalties that want to be freed. But may be in this lot there 644 * are penalties that were already free? Keep them as such. For the rest, do not release them yet: */ 645 if (this->active==0){ 646 activate=0; 647 } 648 else{ 649 activate=1; 650 } 651 } 652 } 653 654 /*Here, we try to avoid zigzaging. When a penalty activates and deactivates for more than penalty_lock times, 655 * we lock it: */ 656 if(this->counter>this->penalty_lock){ 657 /*This penalty has zig zagged too long, fix it to smooth results: */ 658 activate=1; this->active=activate; 659 if (this->counter==(this->penalty_lock+1)){ 660 printf("riftfront %i locking at %g m/yr\n",this->GetId(),penetration*365.0*24.0*3600.0); 661 this->counter++; 662 } 663 } 664 #else 627 /*activation: */ 665 628 if(penetration<0)activate=1; 666 629 else activate=0; 667 #endif 630 631 /*Here, we try to avoid zigzaging. When a penalty activates and deactivates for more than penalty_lock times, 632 * we increase the fraction of melange:*/ 633 if(this->counter>this->penalty_lock){ 634 /*reset counter: */ 635 this->counter=0; 636 /*increase melange fraction: */ 637 this->fraction+=this->fractionincrement; 638 if (this->fraction>1)this->fraction=(double)1.0; 639 //printf("riftfront %i fraction: %g\n",this->GetId(),this->fraction); 640 } 668 641 669 642 //Figure out stability of this penalty … … 814 787 return this->material_converged; 815 788 } 789 790 #undef __FUNCT__ 791 #define __FUNCT__ "Riftfront::OutputProperties" 792 void Riftfront::OutputProperties(Vec riftproperties){ 793 794 int row_id=0; 795 double value; 796 797 /*recover id of penalty: */ 798 row_id=this->GetId()-1; //c indexing, ids were matlab indexed 799 value=(double)this->fraction; 800 801 /*Plug id and fraction into riftproperties matrix: */ 802 VecSetValues(riftproperties,1,&row_id,&value,INSERT_VALUES); 803 } -
issm/trunk/src/c/objects/Riftfront.h
r1784 r1805 42 42 double friction; 43 43 double fraction; 44 double fractionincrement; 44 45 bool shelf; 45 46 … … 57 58 58 59 Riftfront(); 59 Riftfront(char type[RIFTFRONTSTRING],int id, int node_ids[MAX_RIFTFRONT_GRIDS], int mparid, double h[MAX_RIFTFRONT_GRIDS],double b[MAX_RIFTFRONT_GRIDS],double s[MAX_RIFTFRONT_GRIDS],double normal[2],double length,int fill,double friction, double fraction, double penalty_offset, int penalty_lock,bool active,int counter,bool prestable,bool shelf);60 Riftfront(char type[RIFTFRONTSTRING],int id, int node_ids[MAX_RIFTFRONT_GRIDS], int mparid, double h[MAX_RIFTFRONT_GRIDS],double b[MAX_RIFTFRONT_GRIDS],double s[MAX_RIFTFRONT_GRIDS],double normal[2],double length,int fill,double friction, double fraction, double fractionincrement, double penalty_offset, int penalty_lock,bool active,int counter,bool prestable,bool shelf); 60 61 ~Riftfront(); 61 62 … … 84 85 int PotentialUnstableConstraint(int* punstable, void* inputs, int analysis_type); 85 86 int IsMaterialStable(void* inputs, int analysis_type); 87 void OutputProperties(Vec riftproperties); 86 88 Object* copy(); 87 89 }; -
issm/trunk/src/c/parallel/ControlInitialization.cpp
r1707 r1805 97 97 //horizontal velocity 98 98 if(debug)_printf_("%s\n"," computing horizontal velocities..."); 99 diagnostic_core_nonlinear(&ug,NULL,NULL, fem_dh,inputs,DiagnosticAnalysisEnum(),HorizAnalysisEnum());99 diagnostic_core_nonlinear(&ug,NULL,NULL,NULL, fem_dh,inputs,DiagnosticAnalysisEnum(),HorizAnalysisEnum()); 100 100 if(debug)_printf_("%s\n"," extruding horizontal velocities..."); 101 101 VecDuplicatePatch(&ug_horiz,ug); FieldExtrudex( ug_horiz,fem_dh->elements,fem_dh->nodes, fem_dh->loads,fem_dh-> materials,"velocity",1); … … 138 138 if(debug)_printf_("%s\n"," computing stokes velocities and pressure ..."); 139 139 VecFree(&ug); 140 diagnostic_core_nonlinear(&ug,NULL,NULL, fem_ds,inputs,DiagnosticAnalysisEnum(),StokesAnalysisEnum());140 diagnostic_core_nonlinear(&ug,NULL,NULL,NULL, fem_ds,inputs,DiagnosticAnalysisEnum(),StokesAnalysisEnum()); 141 141 VecFree(&pg); 142 142 -
issm/trunk/src/c/parallel/GradJCompute.cpp
r1210 r1805 59 59 60 60 _printf_("%s\n"," recover solution for this stiffness and right hand side:"); 61 diagnostic_core_nonlinear(&u_g,&K_ff0,&K_fs0, femmodel,inputs,DiagnosticAnalysisEnum(),sub_analysis_type);61 diagnostic_core_nonlinear(&u_g,&K_ff0,&K_fs0,NULL, femmodel,inputs,DiagnosticAnalysisEnum(),sub_analysis_type); 62 62 VecToMPISerial(&u_g_double,u_g); VecFree(&u_g); 63 63 inputs->Add("velocity",u_g_double,numberofdofspernode,numberofnodes); -
issm/trunk/src/c/parallel/ProcessResults.cpp
r1209 r1805 70 70 double* param_g=NULL; 71 71 double* parameter=NULL; 72 Vec riftproperties=NULL; 73 double* riftproperties_serial=NULL; 74 int numrifts=0; 72 75 73 76 Vec s_g=NULL; … … 106 109 fem_dhu=fems+3; 107 110 fem_sl=fems+4; 111 112 /*some flags needed: */ 113 fem_dh->parameters->FindParam((void*)&dim,"dim"); 114 fem_dhu->parameters->FindParam((void*)&ishutter,"ishutter"); 115 fem_ds->parameters->FindParam((void*)&isstokes,"isstokes"); 116 fem_dh->parameters->FindParam((void*)&ismacayealpattyn,"ismacayealpattyn"); 117 } 118 if(analysis_type==ThermalstaticAnalysisEnum()){ 119 fem_dh=fems+0; 120 fem_dv=fems+1; 121 fem_ds=fems+2; 122 fem_dhu=fems+3; 123 fem_sl=fems+4; 124 fem_t=fems+5; 108 125 109 126 /*some flags needed: */ … … 411 428 xfree((void**)&partition); 412 429 } 430 else if(strcmp(result->GetFieldName(),"riftproperties")==0){ 431 result->GetField(&riftproperties); 432 fem_dh->parameters->FindParam((void*)&numrifts,"numrifts"); 433 VecToMPISerial(&riftproperties_serial,riftproperties); 434 435 /*Ok, add parameter to newresults: */ 436 newresult=new Result(newresults->Size()+1,result->GetTime(),result->GetStep(),"riftproperties",riftproperties_serial,numrifts); 437 newresults->AddObject(newresult); 438 439 } 413 440 else{ 414 441 /*Just copy the result into the new results dataset: */ -
issm/trunk/src/c/parallel/diagnostic_core.cpp
r1723 r1805 35 35 Vec slopex=NULL; 36 36 Vec slopey=NULL; 37 Vec riftproperties=NULL; 37 38 38 39 /*flags: */ … … 46 47 int numberofdofspernode_ds; 47 48 int numberofnodes; 49 int numrifts=0; 48 50 49 51 double stokesreconditioning; … … 70 72 fem_ds->parameters->FindParam((void*)&isstokes,"isstokes"); 71 73 fem_ds->parameters->FindParam((void*)&stokesreconditioning,"stokesreconditioning"); 74 fem_dh->parameters->FindParam((void*)&numrifts,"numrifts"); 72 75 73 76 //specific parameters for specific models … … 112 115 113 116 if(debug)_printf_("%s\n"," computing horizontal velocities..."); 114 diagnostic_core_nonlinear(&ug,NULL,NULL,fem_dh ,inputs,DiagnosticAnalysisEnum(),HorizAnalysisEnum());117 diagnostic_core_nonlinear(&ug,NULL,NULL,fem_dh->loads,fem_dh,inputs,DiagnosticAnalysisEnum(),HorizAnalysisEnum()); 115 118 116 119 if(debug)_printf_("%s\n"," computing pressure according to MacAyeal..."); … … 169 172 if(debug)_printf_("%s\n"," computing stokes velocities and pressure ..."); 170 173 VecFree(&ug); 171 diagnostic_core_nonlinear(&ug,NULL,NULL, fem_ds,inputs,DiagnosticAnalysisEnum(),StokesAnalysisEnum());174 diagnostic_core_nonlinear(&ug,NULL,NULL,NULL,fem_ds,inputs,DiagnosticAnalysisEnum(),StokesAnalysisEnum()); 172 175 173 176 //decondition" pressure … … 183 186 result=new Result(results->Size()+1,0,1,"p_g",pg); 184 187 results->AddObject(result); 188 189 /*output if we have rifts: */ 190 if(numrifts){ 191 OutputRiftsx( &riftproperties,fem_dh->loads,numrifts); 192 result=new Result(results->Size()+1,0,1,"riftproperties",riftproperties); 193 results->AddObject(result); 194 } 185 195 } -
issm/trunk/src/c/parallel/diagnostic_core_nonlinear.cpp
r1784 r1805 12 12 #include "./parallel.h" 13 13 14 void diagnostic_core_nonlinear(Vec* pug,Mat* pKff0,Mat* pKfs0, FemModel* fem,ParameterInputs* inputs,int analysis_type,int sub_analysis_type){14 void diagnostic_core_nonlinear(Vec* pug,Mat* pKff0,Mat* pKfs0, DataSet* input_loads,FemModel* fem,ParameterInputs* inputs,int analysis_type,int sub_analysis_type){ 15 15 16 16 … … 47 47 fem->parameters->FindParam((void*)&solver_string,"solverstring"); 48 48 49 /*Copy loads for backup: */ 50 loads=fem->loads->Copy(); 49 /*Were loads requested as output? : */ 50 if(!input_loads){ 51 loads=fem->loads->Copy(); //we don't want to clobber loads, as they are not needed in output. 52 } 53 else{ 54 loads=input_loads; //we are going to modify the loads! 55 } 51 56 52 57 /*Initialize ug, uf, ug_old and uf_old */ … … 146 151 } 147 152 148 /*Delete loads : */149 delete loads;153 /*Delete loads only if no ouput was requested: */ 154 if(!input_loads)delete loads; 150 155 151 156 /*clean up*/ -
issm/trunk/src/c/parallel/objectivefunctionC.cpp
r1209 r1805 77 77 78 78 //Run diagnostic with updated parameters. 79 diagnostic_core_nonlinear(&u_g,NULL,NULL, femmodel,inputs,DiagnosticAnalysisEnum(),sub_analysis_type);79 diagnostic_core_nonlinear(&u_g,NULL,NULL,NULL,femmodel,inputs,DiagnosticAnalysisEnum(),sub_analysis_type); 80 80 VecToMPISerial(&u_g_double,u_g); VecFree(&u_g); 81 81 inputs->Add("velocity",u_g_double,numberofdofspernode,numberofnodes); -
issm/trunk/src/c/parallel/parallel.h
r1671 r1805 18 18 void thermal_core_nonlinear(Vec* ptg,double* pmelting_offset,FemModel* fem,ParameterInputs* inputs,int analysis_type,int sub_analysis_type); 19 19 20 void diagnostic_core_nonlinear(Vec* pug,Mat* pK_ff0,Mat* pK_fs0, FemModel* fem,ParameterInputs* inputs,int analysis_type,int sub_analysis_type); 20 void thermalstatic_core(DataSet* results,FemModel* fems, ParameterInputs* inputs); 21 22 void diagnostic_core_nonlinear(Vec* pug,Mat* pK_ff0,Mat* pK_fs0, DataSet* input_loads, FemModel* fem,ParameterInputs* inputs,int analysis_type,int sub_analysis_type); 21 23 void diagnostic_core_linear(Vec* ppg,FemModel* fem,ParameterInputs* inputs,int analysis_type,int sub_analysis_type); 22 24 void convergence(int* pconverged, Mat K_ff,Vec p_f,Vec u_f,Vec u_f_old,DataSet* parameters); -
issm/trunk/src/m/classes/@model/model.m
r1755 r1805 76 76 md.rifts=NaN; 77 77 md.riftinfo=NaN; 78 md.riftproperties=NaN; 78 79 md.numrifts=0; 79 80 -
issm/trunk/src/m/classes/public/loadresultsfromdisk.m
r1790 r1805 16 16 end 17 17 18 structure=parseresultsfromdisk(filename) ;18 structure=parseresultsfromdisk(filename) 19 19 md.results.(structure.analysis_type)=structure; 20 20 -
issm/trunk/src/m/classes/public/plot/plot_manager.m
r1758 r1805 69 69 plot_riftpenetration(md,options_structure,width,i); 70 70 return; 71 case 'riftfraction', 72 plot_riftfraction(md,options_structure,width,i); 73 return; 71 74 case 'sarpwr', 72 75 plot_sarpwr(md,options_structure,width,i) -
issm/trunk/src/m/classes/public/plot/plotdoc.m
r1745 r1805 29 29 disp(' - ''riftrelvel'': relative velocities along rifts'); 30 30 disp(' - ''riftpenetration'': penetration levels for a fault'); 31 disp(' - ''riftfraction'': fill fractions for every node of the rifts'); 31 32 disp(' - ''strainrate_tensor'': plot the components of the strainrate tensor (exx,eyy,ezz,exy,exz,eyz) if computed'); 32 33 disp(' - ''strainrate_principal'': plot the strainrate tensor principal axis and principal values)'); -
issm/trunk/src/m/classes/public/presolve.m
r1784 r1805 26 26 md.riftinfo(count:count+numpairsforthisrift-1,9)=md.rifts(i).friction; 27 27 md.riftinfo(count:count+numpairsforthisrift-1,10)=md.rifts(i).fraction; 28 md.riftinfo(count:count+numpairsforthisrift-1,11)=md.rifts(i).fractionincrement; 28 29 count=count+numpairsforthisrift; 29 30 end -
issm/trunk/src/m/classes/public/tres.m
r1787 r1805 13 13 md.vel=md.results.diagnostic.vel; 14 14 md.pressure=md.results.diagnostic.pressure; 15 if md.numrifts, 16 md.riftproperties=md.results.diagnostic.riftproperties; 17 end 15 18 elseif strcmpi(string,'thermalstatic'), 16 19 md.vx=md.results.thermalstatic.vx; -
issm/trunk/src/m/solutions/cielo/diagnostic_core.m
r1656 r1805 19 19 ismacayealpattyn=m_dh.parameters.ismacayealpattyn; 20 20 isstokes=m_ds.parameters.isstokes; 21 numrifts=m_dhu.parameters.numrifts; 21 22 22 23 if ishutter, … … 53 54 54 55 displaystring(debug,'\n%s',['computing horizontal velocities...']); 55 u_g=diagnostic_core_nonlinear(m_dh,inputs,DiagnosticAnalysisEnum(),HorizAnalysisEnum());56 [u_g m_dh.loads]=diagnostic_core_nonlinear(m_dh,inputs,DiagnosticAnalysisEnum(),HorizAnalysisEnum()); 56 57 57 58 displaystring(debug,'\n%s',['computing pressure according to MacAyeal...']); … … 103 104 104 105 displaystring(debug,'\n%s',['computing stokes velocities and pressure ...']); 105 u_g =diagnostic_core_nonlinear(m_ds,inputs,DiagnosticAnalysisEnum(),StokesAnalysisEnum());106 u_g =diagnostic_core_nonlinear(m_ds,inputs,DiagnosticAnalysisEnum(),StokesAnalysisEnum()); 106 107 107 108 %"decondition" pressure … … 115 116 results.u_g=u_g; 116 117 results.p_g=p_g; 118 119 if numrifts, 120 results.riftproperties=OutputRifts(m_dh.loads,m_dh.parameters); 121 end -
issm/trunk/src/m/solutions/cielo/diagnostic_core_nonlinear.m
r1786 r1805 86 86 varargout(2)={K_fs}; 87 87 end 88 if nout==1, 89 varargout(1)={loads}; 90 end 88 91 end -
issm/trunk/src/m/solutions/cielo/thermalstatic_core.m
r1787 r1805 44 44 results_thermal=thermal_core(models,inputs); 45 45 46 %save results from thermal47 results.t_g=results_thermal.t_g;48 results.m_g=results_thermal.m_g;49 50 46 %add temperature to inputs. 51 47 %Compute depth averaged temperature 52 temperature_average=FieldDepthAverage(m_t.elements,m_t.nodes,m_t.loads,m_t.materials,results .t_g,'temperature');48 temperature_average=FieldDepthAverage(m_t.elements,m_t.nodes,m_t.loads,m_t.materials,results_thermal.t_g,'temperature'); 53 49 inputs=add(inputs,'temperature_average',temperature_average,'doublevec',1,m_t.parameters.numberofnodes); 54 inputs=add(inputs,'temperature',results .t_g,'doublevec',1,m_t.parameters.numberofnodes);50 inputs=add(inputs,'temperature',results_thermal.t_g,'doublevec',1,m_t.parameters.numberofnodes); 55 51 56 52 %now compute diagnostic velocity using the steady state temperature. 57 53 results_diagnostic=diagnostic_core(models,inputs); 58 54 59 %save results from thermal60 results.u_g=results_diagnostic.u_g;61 results.p_g=results_diagnostic.p_g;62 63 55 %convergence? 64 du_g=results .u_g-u_g_old;56 du_g=results_diagnostic.u_g-u_g_old; 65 57 ndu=norm(du_g,2); 66 58 nu=norm(u_g_old,2); 67 59 68 dt_g=results .t_g-t_g_old;60 dt_g=results_thermal.t_g-t_g_old; 69 61 ndt=norm(dt_g,2); 70 62 nt=norm(t_g_old,2); 71 63 72 u_g_old=results .u_g;73 t_g_old=results .t_g;64 u_g_old=results_diagnostic.u_g; 65 t_g_old=results_thermal.t_g; 74 66 75 67 displaystring(debug,'%-60s%g\n %s%g\n %s%g%s',... … … 87 79 end 88 80 81 %save results from thermal and diagnostic 82 results.u_g=results_diagnostic.u_g; 83 results.p_g=results_diagnostic.p_g; 84 results.t_g=results_thermal.t_g; 85 results.m_g=results_thermal.m_g; 89 86 results.step=step; 90 87 results.time=0; -
issm/trunk/src/mex/Makefile.am
r1665 r1805 30 30 NormalizeConstraints\ 31 31 Orth\ 32 OutputRifts\ 32 33 ParamsToWorkspace\ 33 34 PenaltyConstraints\ … … 157 158 Orth/Orth.h 158 159 160 OutputRifts_SOURCES = OutputRifts/OutputRifts.cpp\ 161 OutputRifts/OutputRifts.h 162 159 163 ParamsToWorkspace_SOURCES = ParamsToWorkspace/ParamsToWorkspace.cpp\ 160 164 ParamsToWorkspace/ParamsToWorkspace.h -
issm/trunk/src/mex/TriMeshProcessRifts/TriMeshProcessRifts.cpp
r1784 r1805 27 27 /*empty rifts structure: */ 28 28 double* pNaN=NULL; 29 const char* fnames[ 8];29 const char* fnames[9]; 30 30 mwSize ndim=2; 31 31 mwSize dimensions[2] = {1,1}; … … 240 240 fnames[6] = "friction"; 241 241 fnames[7] = "fraction"; 242 fnames[8] = "fractionincrement"; 242 243 243 244 dimensions[0]=out_numrifts; 244 245 245 pmxa_array=mxCreateStructArray( ndim,dimensions, 8,fnames);246 pmxa_array=mxCreateStructArray( ndim,dimensions,9,fnames); 246 247 247 248 for (i=0;i<out_numrifts;i++){ … … 284 285 mxSetField(pmxa_array,i,"penaltypairs",pmxa_array3); 285 286 286 /*Friction fraction and fill: set to 0 both*/287 /*Friction fraction, fractionincrement and fill: */ 287 288 mxSetField(pmxa_array,i,"friction",mxCreateDoubleScalar(0)); 288 289 mxSetField(pmxa_array,i,"fill",mxCreateDoubleScalar(IceEnum())); //default is ice 289 290 mxSetField(pmxa_array,i,"fraction",mxCreateDoubleScalar(0)); //default is ice 291 mxSetField(pmxa_array,i,"fractionincrement",mxCreateDoubleScalar(0.1)); 290 292 } 291 293 }
Note:
See TracChangeset
for help on using the changeset viewer.