Changeset 3041
- Timestamp:
- 02/16/10 14:21:06 (15 years ago)
- Location:
- issm/trunk/src/c/objects
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/objects/Beam.cpp
r2907 r3041 666 666 #undef __FUNCT__ 667 667 #define __FUNCT__ "Beam::Misfit" 668 double Beam::Misfit(void*,int,int 668 double Beam::Misfit(void*,int,int,int){ 669 669 throw ErrorException(__FUNCT__," not supported yet!"); 670 670 } -
issm/trunk/src/c/objects/Beam.h
r2333 r3041 87 87 void GradjDrag(_p_Vec*, void*, int,int ); 88 88 void GradjB(_p_Vec*, void*, int,int ); 89 double Misfit(void*,int,int 89 double Misfit(void*,int,int,int); 90 90 void GetNodalFunctions(double* l1l2, double gauss_coord); 91 91 void GetParameterValue(double* pvalue, double* value_list,double gauss_coord); -
issm/trunk/src/c/objects/Element.h
r2333 r3041 38 38 virtual void GradjDrag(Vec grad_g,void* inputs,int analysis_type,int sub_analysis_type)=0; 39 39 virtual void GradjB(Vec grad_g,void* inputs,int analysis_type,int sub_analysis_type)=0; 40 virtual double Misfit(void* inputs,int analysis_type,int sub_analysis_type )=0;40 virtual double Misfit(void* inputs,int analysis_type,int sub_analysis_type,int real)=0; 41 41 virtual void ComputePressure(Vec p_g)=0; 42 42 virtual double MassFlux(double* segment,double* ug)=0; -
issm/trunk/src/c/objects/Penta.cpp
r2956 r3041 3926 3926 #undef __FUNCT__ 3927 3927 #define __FUNCT__ "Penta::Misfit" 3928 double Penta::Misfit(void* inputs,int analysis_type,int sub_analysis_type ){3928 double Penta::Misfit(void* inputs,int analysis_type,int sub_analysis_type,int real){ 3929 3929 3930 3930 double J; … … 3945 3945 * and compute Misfit*/ 3946 3946 tria=(Tria*)SpawnTria(0,1,2); //grids 0, 1 and 2 make the new tria (lower face). 3947 J=tria->Misfit(inputs,analysis_type,sub_analysis_type );3947 J=tria->Misfit(inputs,analysis_type,sub_analysis_type,real); 3948 3948 delete tria; 3949 3949 return J; … … 3952 3952 3953 3953 tria=(Tria*)SpawnTria(3,4,5); //grids 3, 4 and 5 make the new tria (upper face). 3954 J=tria->Misfit(inputs,analysis_type,sub_analysis_type );3954 J=tria->Misfit(inputs,analysis_type,sub_analysis_type,real); 3955 3955 delete tria; 3956 3956 return J; -
issm/trunk/src/c/objects/Penta.h
r2956 r3041 88 88 void GradjDrag(Vec grad_g,void* inputs,int analysis_type,int sub_analysis_type); 89 89 void GradjB(Vec grad_g,void* inputs,int analysis_type,int sub_analysis_type); 90 double Misfit(void* inputs,int analysis_type,int sub_analysis_type );90 double Misfit(void* inputs,int analysis_type,int sub_analysis_type,int real); 91 91 92 92 void GetThicknessList(double* thickness_list); -
issm/trunk/src/c/objects/Sing.cpp
r2908 r3041 515 515 #undef __FUNCT__ 516 516 #define __FUNCT__ "Sing::Misfit" 517 double Sing::Misfit(void*, int,int ){517 double Sing::Misfit(void*, int,int,int){ 518 518 throw ErrorException(__FUNCT__," not supported yet!"); 519 519 } -
issm/trunk/src/c/objects/Sing.h
r2333 r3041 82 82 void GradjDrag(_p_Vec*, void*, int,int); 83 83 void GradjB(_p_Vec*, void*, int,int); 84 double Misfit(void*,int,int );84 double Misfit(void*,int,int,int); 85 85 double MassFlux(double* segment,double* ug); 86 86 -
issm/trunk/src/c/objects/Tria.cpp
r2956 r3041 4322 4322 #undef __FUNCT__ 4323 4323 #define __FUNCT__ "Tria::Misfit" 4324 double Tria::Misfit(void* vinputs,int analysis_type,int sub_analysis_type ){4324 double Tria::Misfit(void* vinputs,int analysis_type,int sub_analysis_type,int real){ 4325 4325 4326 4326 int i; … … 4456 4456 4457 4457 /*Add dampening terms to misfit*/ 4458 if (strcmp(numpar->control_type,"drag")==0){ 4459 if (!shelf){ 4460 4458 if(!real){ 4459 if (strcmp(numpar->control_type,"drag")==0){ 4460 if (!shelf){ 4461 4462 //noise dampening 4463 GetParameterDerivativeValue(&dk[0], &k[0],&xyz_list[0][0], gauss_l1l2l3); 4464 Jelem+=numpar->cm_noisedmp*1/2*(pow(dk[0],2)+pow(dk[1],2))*Jdet*gauss_weight; 4465 4466 } 4467 } 4468 else if (strcmp(numpar->control_type,"B")==0){ 4469 if(!inputs->Recover("B",&B[0],1,dofs1,numgrids,(void**)nodes)){ 4470 throw ErrorException(__FUNCT__,"parameter B not found in input"); 4471 } 4461 4472 //noise dampening 4462 GetParameterDerivativeValue(&dk[0], &k[0],&xyz_list[0][0], gauss_l1l2l3); 4463 Jelem+=numpar->cm_noisedmp*1/2*(pow(dk[0],2)+pow(dk[1],2))*Jdet*gauss_weight; 4464 4473 GetParameterDerivativeValue(&dB[0], &B[0],&xyz_list[0][0], gauss_l1l2l3); 4474 Jelem+=numpar->cm_noisedmp*1/2*(pow(dB[0],2)+pow(dB[1],2))*Jdet*gauss_weight; 4475 4476 //min dampening 4477 GetParameterValue(&B_gauss, &B[0],gauss_l1l2l3); 4478 if(B_gauss<numpar->cm_mindmp_value){ 4479 Jelem+=numpar->cm_mindmp_slope*B_gauss*Jdet*gauss_weight; 4480 } 4481 4482 //max dampening 4483 if(B_gauss>numpar->cm_maxdmp_value){ 4484 Jelem+=numpar->cm_maxdmp_slope*B_gauss*Jdet*gauss_weight; 4485 } 4465 4486 } 4466 } 4467 else if (strcmp(numpar->control_type,"B")==0){ 4468 if(!inputs->Recover("B",&B[0],1,dofs1,numgrids,(void**)nodes)){ 4469 throw ErrorException(__FUNCT__,"parameter B not found in input"); 4487 else{ 4488 throw ErrorException(__FUNCT__,exprintf("%s%s","unsupported control type: ",numpar->control_type)); 4470 4489 } 4471 //noise dampening4472 GetParameterDerivativeValue(&dB[0], &B[0],&xyz_list[0][0], gauss_l1l2l3);4473 Jelem+=numpar->cm_noisedmp*1/2*(pow(dB[0],2)+pow(dB[1],2))*Jdet*gauss_weight;4474 4475 //min dampening4476 GetParameterValue(&B_gauss, &B[0],gauss_l1l2l3);4477 if(B_gauss<numpar->cm_mindmp_value){4478 Jelem+=numpar->cm_mindmp_slope*B_gauss*Jdet*gauss_weight;4479 }4480 4481 //max dampening4482 if(B_gauss>numpar->cm_maxdmp_value){4483 Jelem+=numpar->cm_maxdmp_slope*B_gauss*Jdet*gauss_weight;4484 }4485 }4486 else{4487 throw ErrorException(__FUNCT__,exprintf("%s%s","unsupported control type: ",numpar->control_type));4488 4490 } 4489 4491 … … 4511 4513 } 4512 4514 else throw ErrorException(__FUNCT__,exprintf("%s%i%s","fit type",fit," not supported yet!")); 4515 4513 4516 4514 4517 } … … 4518 4521 xfree((void**)&third_gauss_area_coord); 4519 4522 xfree((void**)&gauss_weights); 4520 4523 4521 4524 /*Return: */ 4522 4525 return Jelem; -
issm/trunk/src/c/objects/Tria.h
r2956 r3041 99 99 void SurfaceNormal(double* surface_normal, double xyz_list[3][3]); 100 100 void GradjB(Vec grad_g,void* inputs,int analysis_type,int sub_analysis_type); 101 double Misfit(void* inputs,int analysis_type,int sub_analysis_type );101 double Misfit(void* inputs,int analysis_type,int sub_analysis_type,int real); 102 102 103 103 void CreatePVectorDiagnosticHoriz(Vec pg,void* inputs,int analysis_type,int sub_analysis_type);
Note:
See TracChangeset
for help on using the changeset viewer.