Changeset 3188
- Timestamp:
- 03/05/10 08:41:02 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/objects/Tria.cpp
r3180 r3188 2930 2930 } 2931 2931 2932 /*Get Du at the 3 nodes (integration of the linearized function)*/ 2932 /*Get Du at the 3 nodes (integration of the linearized function) 2933 * Here we integrate linearized functions: 2934 * 2935 * J(E) = int_E sum_{i=1}^3 J_i Phi_i 2936 * 2937 * d J dJ_i 2938 * DU= - --- = sum_{i=1}^3 - --- Phi_i = sum_{i=1}^3 DU_i Phi_i 2939 * d u du_i 2940 * 2941 * where J_i are the misfits at the 3 nodes of the triangle 2942 * Phi_i is the nodal function (P1) with respect to 2943 * the vertex i 2944 */ 2933 2945 if(fit==0){ 2934 /*We are using an absolute misfit: */ 2946 /*We are using an absolute misfit: 2947 * 2948 * 1 [ 2 2 ] 2949 * J = --- | (u - u ) + (v - v ) | 2950 * 2 [ obs obs ] 2951 * 2952 * dJ 2 2953 * DU = - -- = (u - u ) 2954 * du obs 2955 */ 2935 2956 for (i=0;i<numgrids;i++){ 2936 2957 dux_list[i]=obs_vx_list[i]-vx_list[i]; … … 2939 2960 } 2940 2961 else if(fit==1){ 2941 /*We are using a relative misfit: */ 2962 /*We are using a relative misfit: 2963 * 2964 * 1 [ \bar{v}^2 2 \bar{v}^2 2 ] 2965 * J = --- | ------------- (u - u ) + ------------- (v - v ) | 2966 * 2 [ (u + eps)^2 obs (v + eps)^2 obs ] 2967 * obs obs 2968 * 2969 * dJ \bar{v}^2 2970 * DU = - -- = ------------- (u - u ) 2971 * du (u + eps)^2 obs 2972 * obs 2973 */ 2942 2974 for (i=0;i<numgrids;i++){ 2943 2975 scalex=pow(numpar->meanvel/(obs_vx_list[i]+numpar->epsvel),2); … … 2950 2982 } 2951 2983 else if(fit==2){ 2952 /*We are using a logarithmic misfit: */ 2984 /*We are using a logarithmic misfit: 2985 * 2986 * [ vel + eps ] 2 2987 * J = 4 \bar{v}^2 | log ( ----------- ) | 2988 * [ vel + eps ] 2989 * obs 2990 * 2991 * dJ 2 * log(...) 2992 * DU = - -- = - 4 \bar{v}^2 ------------- u 2993 * du vel^2 + eps 2994 * 2995 */ 2953 2996 for (i=0;i<numgrids;i++){ 2954 2997 velocity_mag=sqrt(pow(vx_list[i],2)+pow(vy_list[i],2))+numpar->epsvel; //epsvel to avoid velocity being nil. … … 2960 3003 } 2961 3004 else if(fit==3){ 2962 /*We are using an spacially average absolute misfit: */ 3005 /*We are using an spacially average absolute misfit: 3006 * 3007 * 1 2 2 3008 * J = --- sqrt( (u - u ) + (v - v ) ) 3009 * S obs obs 3010 * 3011 * dJ 1 1 3012 * DU = - -- = - --- ----------- * 2 (u - u ) 3013 * du S 2 sqrt(...) obs 3014 */ 2963 3015 for (i=0;i<numgrids;i++){ 2964 3016 scale=1.0/(S*sqrt(pow(vx_list[i]-obs_vx_list[i],2)+pow(vy_list[i]-obs_vx_list[i],2))+numpar->epsvel); … … 4475 4527 } 4476 4528 4477 /*Compute Misfit at the 3 nodes (integration of the linearized function)*/ 4529 /* Compute Misfit at the 3 nodes 4530 * Here we integrate linearized functions: 4531 * 4532 * J(E) = int_E sum_{i=1}^3 J_i Phi_i 4533 * 4534 * where J_i are the misfits at the 3 nodes of the triangle 4535 * Phi_i is the nodal function (P1) with respect to 4536 * the vertex i 4537 */ 4478 4538 if(fit==0){ 4479 /*We are using an absolute misfit: */ 4539 /*We are using an absolute misfit: 4540 * 4541 * 1 [ 2 2 ] 4542 * J = --- | (u - u ) + (v - v ) | 4543 * 2 [ obs obs ] 4544 * 4545 */ 4480 4546 for (i=0;i<numgrids;i++){ 4481 4547 misfit_list[i]=0.5*(pow((vx_list[i]-obs_vx_list[i]),(double)2)+pow((vy_list[i]-obs_vy_list[i]),(double)2)); … … 4483 4549 } 4484 4550 else if(fit==1){ 4485 /*We are using a relative misfit: */ 4551 /*We are using a relative misfit: 4552 * 4553 * 1 [ \bar{v}^2 2 \bar{v}^2 2 ] 4554 * J = --- | ------------- (u - u ) + ------------- (v - v ) | 4555 * 2 [ (u + eps)^2 obs (v + eps)^2 obs ] 4556 * obs obs 4557 */ 4486 4558 for (i=0;i<numgrids;i++){ 4487 4559 scalex=pow(numpar->meanvel/(obs_vx_list[i]+numpar->epsvel),(double)2); … … 4493 4565 } 4494 4566 else if(fit==2){ 4495 /*We are using a logarithmic misfit: */ 4567 /*We are using a logarithmic misfit: 4568 * 4569 * [ vel + eps ] 2 4570 * J = 4 \bar{v}^2 | log ( ----------- ) | 4571 * [ vel + eps ] 4572 * obs 4573 */ 4496 4574 for (i=0;i<numgrids;i++){ 4497 4575 velocity_mag=sqrt(pow(vx_list[i],(double)2)+pow(vy_list[i],(double)2))+numpar->epsvel; //epsvel to avoid velocity being nil. … … 4501 4579 } 4502 4580 else if(fit==3){ 4503 /*We are using an spacially average absolute misfit: */ 4581 /*We are using an spacially average absolute misfit: 4582 * 4583 * 1 2 2 4584 * J = --- sqrt( (u - u ) + (v - v ) ) 4585 * S obs obs 4586 */ 4504 4587 for (i=0;i<numgrids;i++){ 4505 4588 misfit_list[i]=sqrt(pow(vx_list[i]-obs_vx_list[i],2)+pow(vy_list[i]-obs_vx_list[i],2))/S;
Note:
See TracChangeset
for help on using the changeset viewer.