Changeset 976
- Timestamp:
- 06/13/09 09:41:11 (15 years ago)
- Location:
- issm/trunk/src/c
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/ModelProcessorx/DiagnosticHoriz/CreateElementsNodesAndMaterialsDiagnosticHoriz.cpp
r816 r976 75 75 int matice_mid; 76 76 double matice_B; 77 double matice_Bbar; 77 78 double matice_n; 78 79 … … 312 313 B_avg=B_avg/3; 313 314 matice_B=B_avg; 315 matice_Bbar=B_avg; 314 316 matice_n=(double)*(model->n+i); 315 317 316 318 /*Create matice using its constructor:*/ 317 matice= new Matice(matice_mid,matice_B,matice_ n);319 matice= new Matice(matice_mid,matice_B,matice_Bbar,matice_n); 318 320 319 321 /*Add matice element to materials dataset: */ … … 439 441 B_avg=B_avg/6; 440 442 matice_B= B_avg; 443 matice_Bbar= B_avg; 441 444 matice_n=(double)*(model->n+i); 442 445 443 446 /*Create matice using its constructor:*/ 444 matice= new Matice(matice_mid,matice_B,matice_ n);447 matice= new Matice(matice_mid,matice_B,matice_Bbar,matice_n); 445 448 446 449 /*Add matice element to materials dataset: */ -
issm/trunk/src/c/ModelProcessorx/DiagnosticHutter/CreateElementsNodesAndMaterialsDiagnosticHutter.cpp
r816 r976 55 55 int matice_mid; 56 56 double matice_B; 57 double matice_Bbar; 57 58 double matice_n; 58 59 … … 248 249 matice_mid=i+1; //same as the material id from the geom2 elements. 249 250 matice_B=model->B[i]; 251 matice_Bbar=model->B[i]; 250 252 matice_n=(double)model->n[1]; //n defined on elements not grids, so take the first value everywhere 251 253 252 254 /*Create matice using its constructor:*/ 253 matice= new Matice(matice_mid,matice_B,matice_ n);255 matice= new Matice(matice_mid,matice_B,matice_Bbar,matice_n); 254 256 255 257 /*Add matice element to materials dataset: */ … … 301 303 matice_mid=i+1; //same as the material id from the geom2 elements. 302 304 matice_B=model->B[i]; 305 matice_Bbar=model->B[i]; 303 306 matice_n=(double)model->n[1]; //n defined on elements not grids, so take the first value everywhere 304 307 305 308 /*Create matice ubeam its constructor:*/ 306 matice= new Matice(matice_mid,matice_B,matice_ n);309 matice= new Matice(matice_mid,matice_B,matice_Bbar,matice_n); 307 310 308 311 /*Add matice element to materials dataset: */ -
issm/trunk/src/c/ModelProcessorx/DiagnosticStokes/CreateElementsNodesAndMaterialsDiagnosticStokes.cpp
r864 r976 54 54 int matice_mid; 55 55 double matice_B; 56 double matice_Bbar; 56 57 double matice_n; 57 58 … … 285 286 B_avg=B_avg/6; 286 287 matice_B= B_avg; 288 matice_Bbar= B_avg; 287 289 matice_n=(double)*(model->n+i); 288 290 … … 290 292 291 293 /*Create matice using its constructor:*/ 292 matice= new Matice(matice_mid,matice_B,matice_ n);294 matice= new Matice(matice_mid,matice_B,matice_Bbar,matice_n); 293 295 294 296 /*Add matice element to materials dataset: */ -
issm/trunk/src/c/ModelProcessorx/DiagnosticVert/CreateElementsNodesAndMaterialsDiagnosticVert.cpp
r816 r976 53 53 int matice_mid; 54 54 double matice_B; 55 double matice_Bbar; 55 56 double matice_n; 56 57 … … 247 248 248 249 /*Create matice using its constructor:*/ 249 matice= new Matice(matice_mid,matice_B,matice_ n);250 matice= new Matice(matice_mid,matice_B,matice_Bbar,matice_n); 250 251 251 252 /*Add matice element to materials dataset: */ -
issm/trunk/src/c/ModelProcessorx/Melting/CreateElementsNodesAndMaterialsMelting.cpp
r816 r976 53 53 int matice_mid; 54 54 double matice_B; 55 double matice_Bbar; 55 56 double matice_n; 56 57 … … 256 257 B_avg=B_avg/6; 257 258 matice_B= B_avg; 259 matice_Bbar= B_avg; 258 260 matice_n=(double)*(model->n+i); 259 261 260 262 /*Create matice using its constructor:*/ 261 matice= new Matice(matice_mid,matice_B,matice_ n);263 matice= new Matice(matice_mid,matice_B,matice_Bbar,matice_n); 262 264 263 265 /*Add matice element to materials dataset: */ -
issm/trunk/src/c/ModelProcessorx/Prognostic/CreateElementsNodesAndMaterialsPrognostic.cpp
r820 r976 75 75 int matice_mid; 76 76 double matice_B; 77 double matice_Bbar; 77 78 double matice_n; 78 79 -
issm/trunk/src/c/ModelProcessorx/Thermal/CreateElementsNodesAndMaterialsThermal.cpp
r816 r976 54 54 int matice_mid; 55 55 double matice_B; 56 double matice_Bbar; 56 57 double matice_n; 57 58 … … 252 253 B_avg=B_avg/6; 253 254 matice_B= B_avg; 255 matice_Bbar= B_avg; 254 256 matice_n=(double)*(model->n+i); 255 257 256 258 /*Create matice using its constructor:*/ 257 matice= new Matice(matice_mid,matice_B,matice_ n);259 matice= new Matice(matice_mid,matice_B,matice_Bbar,matice_n); 258 260 259 261 /*Add matice element to materials dataset: */ -
issm/trunk/src/c/objects/Matice.cpp
r945 r976 20 20 return; 21 21 } 22 Matice::Matice(int matice_mid,double matice_B,double matice_ n){22 Matice::Matice(int matice_mid,double matice_B,double matice_Bbar,double matice_n){ 23 23 mid=matice_mid; 24 24 B=matice_B; 25 Bbar=matice_Bbar; 25 26 n=matice_n; 26 27 return; … … 35 36 printf(" mid: %i\n",mid); 36 37 printf(" B: %g\n",B); 38 printf(" Bbar: %g\n",Bbar); 37 39 printf(" n: %g\n",n); 38 40 return; … … 43 45 printf(" mid: %i\n",mid); 44 46 printf(" B: %g\n",B); 47 printf(" Bbar: %g\n",Bbar); 45 48 printf(" n: %g\n",n); 46 49 return; … … 63 66 memcpy(marshalled_dataset,&mid,sizeof(mid));marshalled_dataset+=sizeof(mid); 64 67 memcpy(marshalled_dataset,&B,sizeof(B));marshalled_dataset+=sizeof(B); 68 memcpy(marshalled_dataset,&Bbar,sizeof(Bbar));marshalled_dataset+=sizeof(Bbar); 65 69 memcpy(marshalled_dataset,&n,sizeof(n));marshalled_dataset+=sizeof(n); 66 70 … … 71 75 int Matice::MarshallSize(){ 72 76 73 return sizeof(mid)+sizeof(B)+sizeof( n)+sizeof(int); //sizeof(int) for enum type77 return sizeof(mid)+sizeof(B)+sizeof(Bbar)+sizeof(n)+sizeof(int); //sizeof(int) for enum type 74 78 } 75 79 … … 91 95 memcpy(&mid,marshalled_dataset,sizeof(mid));marshalled_dataset+=sizeof(mid); 92 96 memcpy(&B,marshalled_dataset,sizeof(B));marshalled_dataset+=sizeof(B); 97 memcpy(&Bbar,marshalled_dataset,sizeof(Bbar));marshalled_dataset+=sizeof(Bbar); 93 98 memcpy(&n,marshalled_dataset,sizeof(n));marshalled_dataset+=sizeof(n); 94 99 … … 127 132 128 133 134 #undef __FUNCT__ 135 #define __FUNCT__ "Matice::SetBbar" 136 void Matice::SetBbar(double Bbar_param){ 137 Bbar=Bbar_param; 138 } 139 129 140 130 141 #undef __FUNCT__ … … 158 169 if (n==1){ 159 170 /*Viscous behaviour! viscosity=B: */ 160 viscosity=B ;171 viscosity=Bbar; 161 172 } 162 173 else{ … … 178 189 else{ 179 190 e=(n-1)/2/n; 180 viscosity=2*B /(2*pow(A,e));191 viscosity=2*Bbar/(2*pow(A,e)); 181 192 } 182 193 } … … 387 398 } 388 399 400 double Matice::GetBbar(){ 401 return Bbar; 402 } 403 389 404 double Matice::GetN(){ 390 405 return n; -
issm/trunk/src/c/objects/Matice.h
r803 r976 13 13 int mid; 14 14 double B; 15 double Bbar; 15 16 double n; 16 17 … … 18 19 19 20 Matice(); 20 Matice(int mid,double B,double n);21 Matice(int mid,double B,double Bbar,double n); 21 22 ~Matice(); 22 23 … … 33 34 void UpdateFromInputs(void* inputs); 34 35 void SetB(double B_param); 36 void SetBbar(double Bbar_param); 35 37 void GetViscosity2d(double* pviscosity, double* pepsilon); 36 38 void GetViscosity2(double* pviscosity2, double* pepsilon); … … 39 41 Object* copy(); 40 42 double GetB(); 43 double GetBbar(); 41 44 double GetN(); 42 45 -
issm/trunk/src/c/objects/Penta.cpp
r950 r976 1101 1101 1102 1102 //Update material if necessary 1103 if(inputs->Recover("temperature_average",&temperature_list[0],1,dofs,6,(void**)nodes)){1104 if(matice){1105 temperature_average=(temperature_list[0]+temperature_list[1]+temperature_list[2]+temperature_list[3]+temperature_list[4]+temperature_list[5])/6.0;1106 B_average=Paterson(temperature_average);1107 matice->SetB(B_average);1108 }1109 }1110 1103 if(inputs->Recover("temperature",&temperature_list[0],1,dofs,6,(void**)nodes)){ 1111 1104 if(matice){ … … 1113 1106 B_average=Paterson(temperature_average); 1114 1107 matice->SetB(B_average); 1108 } 1109 } 1110 1111 if(inputs->Recover("temperature_average",&temperature_list[0],1,dofs,6,(void**)nodes)){ 1112 if(matice){ 1113 temperature_average=(temperature_list[0]+temperature_list[1]+temperature_list[2]+temperature_list[3]+temperature_list[4]+temperature_list[5])/6.0; 1114 B_average=Paterson(temperature_average); 1115 matice->SetBbar(B_average); 1115 1116 } 1116 1117 } -
issm/trunk/src/c/objects/Tria.cpp
r950 r976 1450 1450 temperature_average=(temperature_list[0]+temperature_list[1]+temperature_list[2])/3.0; 1451 1451 B_average=Paterson(temperature_average); 1452 matice->SetB (B_average);1452 matice->SetBbar(B_average); 1453 1453 } 1454 1454 1455 1455 if(inputs->Recover("B",&B_list[0],1,dofs,3,(void**)nodes)){ 1456 1456 B_average=(B_list[0]+B_list[1]+B_list[2])/3.0; 1457 matice->SetB (B_average);1457 matice->SetBbar(B_average); 1458 1458 } 1459 1459
Note:
See TracChangeset
for help on using the changeset viewer.