Changeset 5607
- Timestamp:
- 08/27/10 09:23:37 (15 years ago)
- Location:
- issm/trunk/src/c
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/modules/InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.cpp
r5187 r5607 90 90 if (tb.det>0){ 91 91 //Area coordinate 92 areacoord[0]= (double) dete[0]/ 93 areacoord[1]= (double) dete[1] /tb.det;94 areacoord[2]= (double) dete[2] /tb.det;92 areacoord[0]= (double) dete[0]/tb.det; 93 areacoord[1]= (double) dete[1]/tb.det; 94 areacoord[2]= (double) dete[2]/tb.det; 95 95 //3 vertices of the triangle 96 96 i0=Th.GetId(tb[0]); -
issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateLoadsDiagnosticHoriz.cpp
r5596 r5607 14 14 15 15 /*DataSets*/ 16 Loads * loads= NULL;17 Icefront * icefront= NULL;18 Riftfront * riftfront= NULL;19 Pengrid * pengrid= NULL;16 Loads *loads = NULL; 17 Icefront *icefront = NULL; 18 Riftfront *riftfront = NULL; 19 Pengrid *pengrid = NULL; 20 20 21 21 /*Intermediary*/ … … 150 150 for(i=0;i<iomodel->numrifts;i++){ 151 151 152 if(iomodel->my_elements[(int)*(iomodel->riftinfo+RIFTINFOSIZE*i+2)]){ 153 152 if(iomodel->my_elements[(int)*(iomodel->riftinfo+RIFTINFOSIZE*i+2)-1]){ 154 153 loads->AddObject(new Riftfront(iomodel->loadcounter+count+1,i,iomodel,DiagnosticHorizAnalysisEnum)); 155 154 count++; -
issm/trunk/src/c/modules/ModelProcessorx/ElementsAndVerticesPartitioning.cpp
r5096 r5607 87 87 if(my_rank==epart[i]){ 88 88 89 my_elements[i]= 1;89 my_elements[i]=true; 90 90 91 91 /*Now that we are here, we can also start building the list of vertices belonging to this cpu partition: we use … … 93 93 into the vertices coordinates. If we start plugging 1 into my_vertices for each index[n][i] (i=0:2), then my_vertices 94 94 will hold which vertices belong to this partition*/ 95 my_vertices[(int)*(iomodel->elements+elements_width*i+0)-1]= 1;96 my_vertices[(int)*(iomodel->elements+elements_width*i+1)-1]= 1;97 my_vertices[(int)*(iomodel->elements+elements_width*i+2)-1]= 1;95 my_vertices[(int)*(iomodel->elements+elements_width*i+0)-1]=true; 96 my_vertices[(int)*(iomodel->elements+elements_width*i+1)-1]=true; 97 my_vertices[(int)*(iomodel->elements+elements_width*i+2)-1]=true; 98 98 99 99 if(elements_width==6){ 100 my_vertices[(int)*(iomodel->elements+elements_width*i+3)-1]= 1;101 my_vertices[(int)*(iomodel->elements+elements_width*i+4)-1]= 1;102 my_vertices[(int)*(iomodel->elements+elements_width*i+5)-1]= 1;100 my_vertices[(int)*(iomodel->elements+elements_width*i+3)-1]=true; 101 my_vertices[(int)*(iomodel->elements+elements_width*i+4)-1]=true; 102 my_vertices[(int)*(iomodel->elements+elements_width*i+5)-1]=true; 103 103 } 104 104 } -
issm/trunk/src/c/objects/Hook.cpp
r5452 r5607 185 185 186 186 /*demarshall allocated ids and offsets: */ 187 ISSMASSERT(num<1000); 187 188 for (i=0;i<num;i++){ 188 189 memcpy(&this->ids[i],marshalled_dataset,sizeof(int));marshalled_dataset+=sizeof(int); -
issm/trunk/src/c/objects/Loads/Riftfront.cpp
r5341 r5607 215 215 return sizeof(id) 216 216 +sizeof(analysis_type) 217 218 217 +sizeof(active) 219 218 +sizeof(normal) -
issm/trunk/src/c/shared/Numerics/OptimalSearch.cpp
r5595 r5607 22 22 double fx1,fx2,fxbest; 23 23 double x1,x2,xmin,xbest; 24 double distance;25 24 26 25 /*tolerances: */ 27 double tol1,tol2,seps,tolerance;26 double seps,tolerance; 28 27 int maxiter; 29 28 … … 47 46 //update tolerances 48 47 seps=sqrt(DBL_EPSILON); 49 tol1=seps*sqrt(pow(x1,2))+tolerance/3.0;50 tol2=2.0*tol1;51 48 52 49 loop=true; … … 57 54 fx2 = (*f)(x2,optargs); 58 55 if isnan(fx2) ISSMERROR("Function evaluation returned NaN"); 59 _printf_(" %5i %12.6g %12.6g %12.6g\n",iter,x2,fx2, pow(pow(x2-x1,2),0.5));56 _printf_(" %5i %12.6g %12.6g %12.6g\n",iter,x2,fx2,fabs(x2-x1)>fabs(fx2-fx1)?fabs(fx2-fx1):fabs(x2-x1)); 60 57 61 58 //Stop the optimization? 62 tol1=seps*pow(pow(x2,2),0.5)+tolerance/3.0; 63 tol2=2.0*tol1; 64 if (sqrt(pow(x2-x1,2)) < (tol2-0.5*(distance))){ 65 _printf_(" %s%g\n","optimization terminated: the current x satisfies the termination criteria using 'tolx' of" ,tolerance); 59 if ((fabs(x2-x1)+seps)<tolerance || (fabs(fx2-fx1)+seps)<tolerance){ 60 _printf_(" %s%g\n","optimization terminated: the current x satisfies the termination criteria using 'tolx' of " ,tolerance); 66 61 loop=false; 67 62 }
Note:
See TracChangeset
for help on using the changeset viewer.