Changeset 1104
- Timestamp:
- 06/25/09 17:42:16 (16 years ago)
- Location:
- issm/trunk/src/c
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/ModelProcessorx/DiagnosticHoriz/CreateElementsNodesAndMaterialsDiagnosticHoriz.cpp
r1025 r1104 71 71 double tria_viscosity_overshoot; 72 72 int tria_artdiff; 73 bool tria_onwater; 73 74 74 75 /*matice constructor input: */ … … 231 232 ModelFetchData((void**)&model->q,NULL,NULL,model_handle,"q","Matrix","Mat"); 232 233 ModelFetchData((void**)&model->elementoniceshelf,NULL,NULL,model_handle,"elementoniceshelf","Matrix","Mat"); 234 ModelFetchData((void**)&model->elementonwater,NULL,NULL,model_handle,"elementonwater","Matrix","Mat"); 233 235 ModelFetchData((void**)&model->elements_type,NULL,NULL,model_handle,"elements_type","Matrix","Mat"); 234 236 ModelFetchData((void**)&model->B,NULL,NULL,model_handle,"B","Matrix","Mat"); … … 288 290 tria_accumulation[2]=*(model->accumulation+ ((int)*(model->elements+elements_width*i+2)-1)); 289 291 290 /*element on iceshelf ?:*/292 /*element on iceshelf, water?:*/ 291 293 tria_shelf=(int)*(model->elementoniceshelf+i); 294 tria_onwater=(bool)*(model->elementonwater+i); 292 295 293 296 tria_meanvel=model->meanvel; … … 298 301 299 302 /*Create tria element using its constructor:*/ 300 tria=new Tria(tria_id, tria_mid, tria_mparid, tria_g, tria_h, tria_s, tria_b, tria_k, tria_melting,tria_accumulation,tria_geothermalflux,tria_friction_type, tria_p, tria_q, tria_shelf, tria_meanvel, tria_epsvel, tria_viscosity_overshoot,tria_artdiff );303 tria=new Tria(tria_id, tria_mid, tria_mparid, tria_g, tria_h, tria_s, tria_b, tria_k, tria_melting,tria_accumulation,tria_geothermalflux,tria_friction_type, tria_p, tria_q, tria_shelf, tria_meanvel, tria_epsvel, tria_viscosity_overshoot,tria_artdiff,tria_onwater); 301 304 302 305 /*Add tria element to elements dataset: */ … … 349 352 xfree((void**)&model->q); 350 353 xfree((void**)&model->elementoniceshelf); 354 xfree((void**)&model->elementonwater); 351 355 xfree((void**)&model->B); 352 356 xfree((void**)&model->n); … … 425 429 penta_p,penta_q,penta_shelf,penta_onbed,penta_onsurface,penta_meanvel,penta_epsvel, 426 430 penta_collapse,penta_melting,penta_accumulation,penta_geothermalflux,penta_artdiff, 427 penta_thermal_steadystate,penta_viscosity_overshoot,penta_stokesreconditioning );431 penta_thermal_steadystate,penta_viscosity_overshoot,penta_stokesreconditioning,0); 428 432 429 433 /*Add penta element to elements dataset: */ -
issm/trunk/src/c/ModelProcessorx/DiagnosticHutter/CreateElementsNodesAndMaterialsDiagnosticHutter.cpp
r1025 r1104 73 73 double beam_b[2]; 74 74 double beam_k[2]; 75 intbeam_onbed;75 bool beam_onbed; 76 76 77 77 /*matpar constructor input: */ … … 291 291 beam_k[1]=model->drag[(int)(model->uppernodes[i]-1)]; 292 292 293 beam_onbed=( int)model->gridonbed[i];293 beam_onbed=(bool)model->gridonbed[i]; 294 294 295 295 /*Create beam element ubeam its constructor:*/ -
issm/trunk/src/c/ModelProcessorx/DiagnosticStokes/CreateElementsNodesAndMaterialsDiagnosticStokes.cpp
r1025 r1104 270 270 penta_p,penta_q,penta_shelf,penta_onbed,penta_onsurface,penta_meanvel,penta_epsvel, 271 271 penta_collapse,penta_melting,penta_accumulation,penta_geothermalflux,penta_artdiff, 272 penta_thermal_steadystate,penta_viscosity_overshoot,penta_stokesreconditioning );272 penta_thermal_steadystate,penta_viscosity_overshoot,penta_stokesreconditioning,0); 273 273 274 274 /*Add penta element to elements dataset: */ -
issm/trunk/src/c/ModelProcessorx/DiagnosticVert/CreateElementsNodesAndMaterialsDiagnosticVert.cpp
r1025 r1104 238 238 penta_p,penta_q,penta_shelf,penta_onbed,penta_onsurface,penta_meanvel,penta_epsvel, 239 239 penta_collapse,penta_melting,penta_accumulation,penta_geothermalflux,penta_artdiff, 240 penta_thermal_steadystate,penta_viscosity_overshoot,penta_stokesreconditioning );240 penta_thermal_steadystate,penta_viscosity_overshoot,penta_stokesreconditioning,0); 241 241 242 242 /*Add penta element to elements dataset: */ -
issm/trunk/src/c/ModelProcessorx/Melting/CreateElementsNodesAndMaterialsMelting.cpp
r1025 r1104 242 242 penta_p,penta_q,penta_shelf,penta_onbed,penta_onsurface,penta_meanvel,penta_epsvel, 243 243 penta_collapse,penta_melting,penta_accumulation,penta_geothermalflux,penta_artdiff, 244 penta_thermal_steadystate,penta_viscosity_overshoot,penta_stokesreconditioning );244 penta_thermal_steadystate,penta_viscosity_overshoot,penta_stokesreconditioning,0); 245 245 246 246 /*Add penta element to elements dataset: */ -
issm/trunk/src/c/ModelProcessorx/Model.cpp
r962 r1104 76 76 model->bed=NULL; 77 77 model->elementoniceshelf=NULL; 78 model->elementonwater=NULL; 78 79 model->gridonicesheet=NULL; 79 80 model->gridoniceshelf=NULL; … … 237 238 xfree((void**)&model->q); 238 239 xfree((void**)&model->elementoniceshelf); 240 xfree((void**)&model->elementonwater); 239 241 xfree((void**)&model->gridonicesheet); 240 242 xfree((void**)&model->gridoniceshelf); -
issm/trunk/src/c/ModelProcessorx/Model.h
r962 r1104 73 73 double* bed; 74 74 double* elementoniceshelf; 75 double* elementonwater; 75 76 double* gridonicesheet; 76 77 double* gridoniceshelf; -
issm/trunk/src/c/ModelProcessorx/Prognostic/CreateElementsNodesAndMaterialsPrognostic.cpp
r1025 r1104 71 71 double tria_viscosity_overshoot; 72 72 int tria_artdiff; 73 bool tria_onwater; 73 74 74 75 /*matice constructor input: */ … … 225 226 ModelFetchData((void**)&model->bed,NULL,NULL,model_handle,"bed","Matrix","Mat"); 226 227 ModelFetchData((void**)&model->elementoniceshelf,NULL,NULL,model_handle,"elementoniceshelf","Matrix","Mat"); 228 ModelFetchData((void**)&model->elementonwater,NULL,NULL,model_handle,"elementonwater","Matrix","Mat"); 227 229 228 230 for (i=0;i<model->numberofelements;i++){ … … 259 261 /*element on iceshelf?:*/ 260 262 tria_shelf=(int)*(model->elementoniceshelf+i); 263 tria_onwater=(bool)*(model->elementonwater+i); 261 264 tria_artdiff=model->artificial_diffusivity; 262 265 263 266 /*Create tria element using its constructor:*/ 264 tria=new Tria(tria_id, tria_mid, tria_mparid, tria_g, tria_h, tria_s, tria_b, tria_k, tria_melting,tria_accumulation,tria_geothermalflux,tria_friction_type, tria_p, tria_q, tria_shelf, tria_meanvel, tria_epsvel, tria_viscosity_overshoot,tria_artdiff );267 tria=new Tria(tria_id, tria_mid, tria_mparid, tria_g, tria_h, tria_s, tria_b, tria_k, tria_melting,tria_accumulation,tria_geothermalflux,tria_friction_type, tria_p, tria_q, tria_shelf, tria_meanvel, tria_epsvel, tria_viscosity_overshoot,tria_artdiff,tria_onwater); 265 268 266 269 /*Add tria element to elements dataset: */ … … 290 293 xfree((void**)&model->bed); 291 294 xfree((void**)&model->elementoniceshelf); 295 xfree((void**)&model->elementonwater); 292 296 293 297 } … … 335 339 penta_p,penta_q,penta_shelf,penta_onbed,penta_onsurface,penta_meanvel,penta_epsvel, 336 340 penta_collapse,penta_melting,penta_accumulation,penta_geothermalflux,penta_artdiff, 337 penta_thermal_steadystate,penta_viscosity_overshoot,penta_stokesreconditioning );341 penta_thermal_steadystate,penta_viscosity_overshoot,penta_stokesreconditioning,0); 338 342 339 343 /*Add penta element to elements dataset: */ -
issm/trunk/src/c/ModelProcessorx/Qmu/CreateParametersQmu.cpp
r962 r1104 156 156 #endif 157 157 158 /*partition grids in model->qmu_npart parts: */ 159 160 if(strcmp(model->meshtype,"2d")==0){ 161 ModelFetchData((void**)&model->elements,NULL,NULL,model_handle,"elements","Matrix","Mat"); 162 elements_width=3; //tria elements 163 } 164 else{ 165 ModelFetchData((void**)&model->elements2d,NULL,NULL,model_handle,"elements2d","Matrix","Mat"); 166 elements_width=6; //penta elements 167 } 168 169 MeshPartitionx(&epart, &part,model->numberofelements,model->numberofnodes,model->elements, model->numberofelements2d,model->numberofnodes2d,model->elements2d,model->numlayers,elements_width, model->meshtype,model->qmu_npart); 170 171 dpart=(double*)xmalloc(model->numberofnodes*sizeof(double)); 172 for(i=0;i<model->numberofnodes;i++)dpart[i]=part[i]; 158 /*partition grids in model->qmu_npart parts, unless a partition is already present: */ 159 ModelFetchData((void**)&dpart,NULL,NULL,model_handle,"part","Matrix","Mat"); 160 161 if(!dpart){ 162 163 if(strcmp(model->meshtype,"2d")==0){ 164 ModelFetchData((void**)&model->elements,NULL,NULL,model_handle,"elements","Matrix","Mat"); 165 elements_width=3; //tria elements 166 } 167 else{ 168 ModelFetchData((void**)&model->elements2d,NULL,NULL,model_handle,"elements2d","Matrix","Mat"); 169 elements_width=6; //penta elements 170 } 171 172 MeshPartitionx(&epart, &part,model->numberofelements,model->numberofnodes,model->elements, model->numberofelements2d,model->numberofnodes2d,model->elements2d,model->numlayers,elements_width, model->meshtype,model->qmu_npart); 173 174 dpart=(double*)xmalloc(model->numberofnodes*sizeof(double)); 175 for(i=0;i<model->numberofnodes;i++)dpart[i]=part[i]; 176 } 173 177 174 178 count++; -
issm/trunk/src/c/ModelProcessorx/SlopeCompute/CreateElementsNodesAndMaterialsSlopeCompute.cpp
r1036 r1104 67 67 double tria_viscosity_overshoot; 68 68 int tria_artdiff; 69 bool tria_onwater; 69 70 70 71 /*penta constructor input: */ … … 201 202 ModelFetchData((void**)&model->elements,NULL,NULL,model_handle,"elements","Matrix","Mat"); 202 203 ModelFetchData((void**)&model->surface,NULL,NULL,model_handle,"surface","Matrix","Mat"); 204 ModelFetchData((void**)&model->elementonwater,NULL,NULL,model_handle,"elementonwater","Matrix","Mat"); 203 205 ModelFetchData((void**)&model->bed,NULL,NULL,model_handle,"bed","Matrix","Mat"); 204 206 … … 229 231 tria_b[1]=*(model->bed+ ((int)*(model->elements+elements_width*i+1)-1)); 230 232 tria_b[2]=*(model->bed+ ((int)*(model->elements+elements_width*i+2)-1)); 233 234 /*element on water? : */ 235 tria_onwater=(bool)*(model->elementonwater+i); 231 236 232 237 /*Create tria element using its constructor:*/ 233 tria=new Tria(tria_id, tria_mid, tria_mparid, tria_g, tria_h, tria_s, tria_b, tria_k, tria_melting,tria_accumulation,tria_geothermalflux,tria_friction_type, tria_p, tria_q, tria_shelf, tria_meanvel, tria_epsvel, tria_viscosity_overshoot,tria_artdiff );238 tria=new Tria(tria_id, tria_mid, tria_mparid, tria_g, tria_h, tria_s, tria_b, tria_k, tria_melting,tria_accumulation,tria_geothermalflux,tria_friction_type, tria_p, tria_q, tria_shelf, tria_meanvel, tria_epsvel, tria_viscosity_overshoot,tria_artdiff,tria_onwater); 234 239 235 240 /*Add tria element to elements dataset: */ … … 294 299 penta_p,penta_q,penta_shelf,penta_onbed,penta_onsurface,penta_meanvel,penta_epsvel, 295 300 penta_collapse,penta_melting,penta_accumulation,penta_geothermalflux,penta_artdiff, 296 penta_thermal_steadystate,penta_viscosity_overshoot,penta_stokesreconditioning );301 penta_thermal_steadystate,penta_viscosity_overshoot,penta_stokesreconditioning,0); 297 302 298 303 /*Add penta element to elements dataset: */ -
issm/trunk/src/c/ModelProcessorx/Thermal/CreateElementsNodesAndMaterialsThermal.cpp
r1025 r1104 246 246 penta_p,penta_q,penta_shelf,penta_onbed,penta_onsurface,penta_meanvel,penta_epsvel, 247 247 penta_collapse,penta_melting,penta_accumulation,penta_geothermalflux,penta_artdiff, 248 penta_thermal_steadystate,penta_viscosity_overshoot,penta_stokesreconditioning );248 penta_thermal_steadystate,penta_viscosity_overshoot,penta_stokesreconditioning,0); 249 249 250 250 /*Add penta element to elements dataset: */ -
issm/trunk/src/c/objects/Beam.cpp
r803 r1104 26 26 } 27 27 28 Beam::Beam(int beam_id, int beam_mid, int beam_mparid, int beam_g[2], double beam_h[2], double beam_s[2],double beam_b[2],double beam_k[2], intbeam_onbed){28 Beam::Beam(int beam_id, int beam_mid, int beam_mparid, int beam_g[2], double beam_h[2], double beam_s[2],double beam_b[2],double beam_k[2],bool beam_onbed){ 29 29 30 30 int i; -
issm/trunk/src/c/objects/Beam.h
r803 r1104 39 39 double k[2]; 40 40 41 intonbed;41 bool onbed; 42 42 43 43 public: 44 44 45 45 Beam(); 46 Beam(int beam_id, int beam_mid, int beam_mparid, int beam_g[2], double beam_h[2], double beam_s[2],double beam_b[2],double beam_k[2], intbeam_onbed);46 Beam(int beam_id, int beam_mid, int beam_mparid, int beam_g[2], double beam_h[2], double beam_s[2],double beam_b[2],double beam_k[2],bool beam_onbed); 47 47 ~Beam(); 48 48 -
issm/trunk/src/c/objects/Penta.cpp
r995 r1104 22 22 double penta_p, double penta_q, int penta_shelf, int penta_onbed, int penta_onsurface, double penta_meanvel,double penta_epsvel, 23 23 int penta_collapse, double penta_melting[6], double penta_accumulation[6], double penta_geothermalflux[6], 24 int penta_artdiff, int penta_thermal_steadystate,double penta_viscosity_overshoot,double penta_stokesreconditioning ){24 int penta_artdiff, int penta_thermal_steadystate,double penta_viscosity_overshoot,double penta_stokesreconditioning,bool penta_onwater){ 25 25 26 26 int i; … … 52 52 shelf = penta_shelf; 53 53 onbed = penta_onbed; 54 onwater = penta_onwater; 54 55 onsurface = penta_onsurface; 55 56 meanvel = penta_meanvel; … … 89 90 printf(" shelf: %i\n",shelf); 90 91 printf(" onbed: %i\n",onbed); 92 printf(" onwater: %i\n",onwater); 91 93 printf(" onsurface: %i\n",onsurface); 92 94 printf(" meanvel: %g\n",meanvel); … … 125 127 printf(" shelf: %i\n",shelf); 126 128 printf(" onbed: %i\n",onbed); 129 printf(" onwater: %i\n",onwater); 127 130 printf(" onsurface: %i\n",onsurface); 128 131 printf(" meanvel: %g\n",meanvel); … … 173 176 memcpy(marshalled_dataset,&shelf,sizeof(shelf));marshalled_dataset+=sizeof(shelf); 174 177 memcpy(marshalled_dataset,&onbed,sizeof(onbed));marshalled_dataset+=sizeof(onbed); 178 memcpy(marshalled_dataset,&onwater,sizeof(onwater));marshalled_dataset+=sizeof(onwater); 175 179 memcpy(marshalled_dataset,&onsurface,sizeof(onsurface));marshalled_dataset+=sizeof(onsurface); 176 180 memcpy(marshalled_dataset,&meanvel,sizeof(meanvel));marshalled_dataset+=sizeof(meanvel); … … 210 214 sizeof(shelf)+ 211 215 sizeof(onbed)+ 216 sizeof(onwater)+ 212 217 sizeof(onsurface)+ 213 218 sizeof(meanvel)+ … … 258 263 memcpy(&shelf,marshalled_dataset,sizeof(shelf));marshalled_dataset+=sizeof(shelf); 259 264 memcpy(&onbed,marshalled_dataset,sizeof(onbed));marshalled_dataset+=sizeof(onbed); 265 memcpy(&onwater,marshalled_dataset,sizeof(onwater));marshalled_dataset+=sizeof(onwater); 260 266 memcpy(&onsurface,marshalled_dataset,sizeof(onsurface));marshalled_dataset+=sizeof(onsurface); 261 267 memcpy(&meanvel,marshalled_dataset,sizeof(meanvel));marshalled_dataset+=sizeof(meanvel); … … 452 458 /*Collapsed formulation: */ 453 459 Tria* tria=NULL; 460 461 /*If on water, skip stiffness: */ 462 if(onwater)return; 463 454 464 455 465 /*recover pointers: */ … … 1325 1335 tria_node_offsets[2]=node_offsets[g2]; 1326 1336 1327 tria= new Tria(id,mid,mparid,tria_node_ids,tria_h,tria_s,tria_b,tria_k, tria_melting, tria_accumulation, tria_geothermalflux,friction_type,p,q,shelf,meanvel,epsvel,viscosity_overshoot,artdiff );1337 tria= new Tria(id,mid,mparid,tria_node_ids,tria_h,tria_s,tria_b,tria_k, tria_melting, tria_accumulation, tria_geothermalflux,friction_type,p,q,shelf,meanvel,epsvel,viscosity_overshoot,artdiff,onwater); 1328 1338 1329 1339 tria->NodeConfiguration(tria_node_ids,tria_nodes,tria_node_offsets); … … 1768 1778 /*Spawning: */ 1769 1779 Tria* tria=NULL; 1780 1781 /*If on water, skip load: */ 1782 if(onwater)return; 1770 1783 1771 1784 /*recover pointers: */ -
issm/trunk/src/c/objects/Penta.h
r848 r1104 46 46 int onbed; 47 47 int onsurface; 48 bool onwater; 48 49 double meanvel;/*!scaling ratio for velocities*/ 49 50 double epsvel; /*!minimum velocity to avoid infinite velocity ratios*/ … … 61 62 double p, double q, int shelf, int onbed, int onsurface, double meanvel,double epsvel, 62 63 int collapse, double melting[6], double accumulation[6], double geothermalflux[6], 63 int artdiff, int thermal_steadystate,double viscosity_overshoot,double stokesreconditioning );64 int artdiff, int thermal_steadystate,double viscosity_overshoot,double stokesreconditioning,bool onwater); 64 65 ~Penta(); 65 66 -
issm/trunk/src/c/objects/Tria.cpp
r1051 r1104 34 34 Tria::Tria(int tria_id,int tria_mid,int tria_mparid,int tria_node_ids[3],double tria_h[3],double tria_s[3],double tria_b[3],double tria_k[3],double tria_melting[3], 35 35 double tria_accumulation[3],double tria_geothermalflux[3],int tria_friction_type,double tria_p,double tria_q,int tria_shelf,double tria_meanvel,double tria_epsvel, 36 double tria_viscosity_overshoot,int tria_artdiff ){36 double tria_viscosity_overshoot,int tria_artdiff,bool tria_onwater){ 37 37 38 38 int i; … … 64 64 epsvel=tria_epsvel; 65 65 onbed=1; 66 onwater=tria_onwater; 66 67 viscosity_overshoot=tria_viscosity_overshoot; 67 68 artdiff=tria_artdiff; … … 97 98 printf(" epsvel: %g\n",epsvel); 98 99 printf(" onbed: %i\n",onbed); 100 printf(" onwater: %i\n",onwater); 99 101 printf(" viscosity_overshoot=%g\n",viscosity_overshoot); 100 102 printf(" artdiff=%g\n",artdiff); … … 135 137 printf(" epsvel: %g\n",epsvel); 136 138 printf(" onbed: %i\n",onbed); 139 printf(" onwater: %i\n",onwater); 137 140 printf(" viscosity_overshoot=%g\n",viscosity_overshoot); 138 141 printf(" artdiff=%g\n",artdiff); … … 180 183 memcpy(marshalled_dataset,&friction_type,sizeof(friction_type));marshalled_dataset+=sizeof(friction_type); 181 184 memcpy(marshalled_dataset,&onbed,sizeof(onbed));marshalled_dataset+=sizeof(onbed); 185 memcpy(marshalled_dataset,&onwater,sizeof(onwater));marshalled_dataset+=sizeof(onwater); 182 186 memcpy(marshalled_dataset,&p,sizeof(p));marshalled_dataset+=sizeof(p); 183 187 memcpy(marshalled_dataset,&q,sizeof(q));marshalled_dataset+=sizeof(q); … … 212 216 +sizeof(friction_type) 213 217 +sizeof(onbed) 218 +sizeof(onwater) 214 219 +sizeof(p) 215 220 +sizeof(q) … … 256 261 memcpy(&friction_type,marshalled_dataset,sizeof(friction_type));marshalled_dataset+=sizeof(friction_type); 257 262 memcpy(&onbed,marshalled_dataset,sizeof(onbed));marshalled_dataset+=sizeof(onbed); 263 memcpy(&onwater,marshalled_dataset,sizeof(onwater));marshalled_dataset+=sizeof(onwater); 258 264 memcpy(&p,marshalled_dataset,sizeof(p));marshalled_dataset+=sizeof(p); 259 265 memcpy(&q,marshalled_dataset,sizeof(q));marshalled_dataset+=sizeof(q); … … 399 405 400 406 ParameterInputs* inputs=NULL; 407 408 /*First, if we are on water, return empty matrix: */ 409 if(onwater)return; 401 410 402 411 /*recover pointers: */ … … 1204 1213 ParameterInputs* inputs=NULL; 1205 1214 1215 /*First, if we are on water, return empty vector: */ 1216 if(onwater)return; 1217 1206 1218 /*recover pointers: */ 1207 1219 inputs=(ParameterInputs*)vinputs; -
issm/trunk/src/c/objects/Tria.h
r803 r1104 48 48 double epsvel; /*!minimum velocity to avoid infinite velocity ratios*/ 49 49 int onbed; 50 bool onwater; 50 51 double viscosity_overshoot; 51 52 int artdiff; … … 55 56 Tria(); 56 57 Tria(int id,int mid,int mparid,int node_ids[3],double h[3],double s[3],double b[3],double k[3],double melting[3],double accumulation[3],double geothermalflux[3], 57 int friction_type,double p,double q,int shelf,double meanvel,double epsvel,double viscosity_overshoot,int artdiff );58 int friction_type,double p,double q,int shelf,double meanvel,double epsvel,double viscosity_overshoot,int artdiff,bool onwater); 58 59 ~Tria(); 59 60
Note:
See TracChangeset
for help on using the changeset viewer.