Changeset 3509
- Timestamp:
- 04/12/10 07:55:18 (15 years ago)
- Location:
- issm/trunk/src/c/objects
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/objects/Matice.cpp
r3479 r3509 52 52 53 53 /*Compute B on the element if provided*/ 54 if (iomodel->B){ 54 if (num_vertices==3 || num_vertices==6){ 55 if (iomodel->B){ 56 B_avg=0; 57 for(j=0;j<num_vertices;j++){ 58 B_avg+=*(iomodel->B+((int)*(iomodel->elements+num_vertices*i+j)-1)); 59 } 60 B_avg=B_avg/num_vertices; 61 } 62 } 63 else if (num_vertices==1 || num_vertices==2){ 55 64 B_avg=0; 56 for(j=0;j<num_vertices;j++){57 B_avg+=*(iomodel->B+ ((int)*(iomodel->elements+num_vertices*i+j)-1));65 if (iomodel->B){ 66 B_avg+=*(iomodel->B+i); 58 67 } 59 68 B_avg=B_avg/num_vertices; 60 69 } 70 else ISSMERROR("num_vertices = %i not supported yet",num_vertices); 61 71 62 72 if (iomodel->B) matice_B=B_avg; 63 73 else matice_B=UNDEF; 64 if (iomodel->n) matice_n=(double)*(iomodel->n+i); 74 if (iomodel->n){ 75 if (num_vertices==3 || num_vertices==6){ 76 matice_n=(double)*(iomodel->n+i); 77 } 78 else if (num_vertices==1 || num_vertices==2){ 79 /*n is on the elements for now, so just take the first one*/ 80 matice_n=(double)*(iomodel->n); 81 } 82 else ISSMERROR("num_vertices = %i not supported yet",num_vertices); 83 } 65 84 else matice_n=UNDEF; 66 85 -
issm/trunk/src/c/objects/Matpar.cpp
r3463 r3509 34 34 Matpar::Matpar(IoModel* iomodel){ 35 35 36 int matpar_mid;37 double 38 double 36 int matpar_mid; 37 double matpar_rho_ice; 38 double matpar_rho_water; 39 39 double matpar_heatcapacity; 40 40 double matpar_thermalconductivity; … … 46 46 double matpar_g; 47 47 48 matpar_mid=iomodel->numberofelements+1; //put it at the end of the materials 48 if (iomodel->analysis_type==DiagnosticAnalysisEnum() && iomodel->sub_analysis_type==HutterAnalysisEnum()){ 49 if (strcmp(iomodel->meshtype,"2d")==0){ 50 matpar_mid=iomodel->numberofvertices+1; //put it at the end of the materials 51 } 52 else{ matpar_mid=iomodel->numberofvertices2d*(iomodel->numlayers-1)+1;} 53 } 54 else{ 55 matpar_mid=iomodel->numberofelements+1; //put it at the end of the materials 56 } 49 57 matpar_g=iomodel->g; 50 58 matpar_rho_ice=iomodel->rho_ice;
Note:
See TracChangeset
for help on using the changeset viewer.