Changeset 21574
- Timestamp:
- 02/22/17 11:34:34 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/FemModel.cpp
r21573 r21574 2954 2954 /*}}}*/ 2955 2955 void FemModel::ReMesh(void){/*{{{*/ 2956 2956 2957 2957 /*Variables*/ 2958 2958 IssmDouble *newx = NULL; … … 2973 2973 this->ElementsAndVerticesPartitioning(newnumberofvertices,newnumberofelements,elementswidth,newelementslist,&my_elements,&my_vertices); 2974 2974 2975 if(this->loads->Size()!=0){ 2976 _error_("not supported yet"); 2977 } 2975 if(this->loads->Size()!=0) _error_("not supported yet"); 2978 2976 2979 2977 /*Create vertices*/ … … 3009 3007 this->UpdateElements(newnumberofelements,newelementslist,my_elements,nodecounter,i,new_elements); 3010 3008 3011 3012 if(IssmComm::GetRank()==2){3013 _printf_("New constraints: CPU 1\n");3014 //this->constraints->DeepEcho();3015 new_constraints->DeepEcho();3016 printarray(my_vertices,newnumberofvertices,1);3017 _error_("stop!");3018 }3019 3020 3021 3009 if(new_nodes->Size()) nodecounter=new_nodes->MaximumId(); 3022 3010 constraintcounter = new_constraints->NumberOfConstraints(); … … 3069 3057 /*Finally: interpolate all inputs and insert them into the new elements.*/ 3070 3058 this->InterpolateInputs(new_vertices,new_elements); 3071 3072 if(IssmComm::GetRank()==2){3073 _printf_("New constraints: CPU 1\n");3074 //this->constraints->DeepEcho();3075 new_constraints->DeepEcho();3076 _error_("stop!");3077 }3078 3079 3059 3080 3060 /*Delete old structure and set new pointers*/ … … 3631 3611 Vector<IssmDouble>* vspcvyflag = new Vector<IssmDouble>(numberofnodes_analysistype); 3632 3612 3633 for(int i=0;i<numberofnodes_analysistype;i++){3634 vspcvx->SetValue(i,0.,INS_VAL);3635 vspcvy->SetValue(i,0.,INS_VAL);3636 vspcvxflag->SetValue(i,0.,INS_VAL);3637 vspcvyflag->SetValue(i,0.,INS_VAL);3638 }3639 3640 3613 for(int i=0;i<this->constraints->Size();i++){ 3641 3614 SpcStatic* spc = xDynamicCast<SpcStatic*>(this->constraints->GetObjectByOffset(i)); … … 3645 3618 int nodeindex = node-1; 3646 3619 3647 if(IssmComm::GetRank()==0) 3648 {//itapopo 3649 if(dof==0) {//vx 3650 if(IssmComm::GetRank()==0) _printf_("Node: " << nodeindex << "\tdof: " << dof << "\tspcvalue: " << spcvalue << "\n") ; 3620 if(dof==0) {//vx 3651 3621 vspcvx->SetValue(nodeindex,spcvalue,INS_VAL); 3652 3622 vspcvxflag->SetValue(nodeindex,1,INS_VAL); … … 3656 3626 vspcvyflag->SetValue(nodeindex,1,INS_VAL); 3657 3627 } 3658 3659 }//itapopo 3660 } 3661 3662 #ifdef _HAVE_PETSC_ 3663 _printf_("Tem PETSC\n"); 3664 #endif 3628 } 3665 3629 3666 3630 /*Assemble*/ … … 3670 3634 vspcvyflag->Assemble(); 3671 3635 3672 IssmDouble pvalue1,pvalue2;3673 vspcvx->GetValue(&pvalue1,0);3674 vspcvxflag->GetValue(&pvalue2,0);3675 if(IssmComm::GetRank()==0) _printf_("Node: " << 0 << "\tspcvalue: " << pvalue1 << "\tflag: " << pvalue2 << "\n") ;3676 vspcvx->GetValue(&pvalue1,5);3677 vspcvxflag->GetValue(&pvalue2,5);3678 if(IssmComm::GetRank()==0) _printf_("Node: " << 5 << "\tspcvalue: " << pvalue1 << "\tflag: " << pvalue2 << "\n") ;3679 3680 3681 3682 3636 /*Serialize*/ 3683 3637 spcvx = vspcvx->ToMPISerial(); … … 3702 3656 InterpFromMeshToMesh2dx(&newspcvyflag,elementslist,x,y,nods_data,nels_data,spcvyflag,M_data,N_data,newx,newy,N_interp,NULL); 3703 3657 3704 if(IssmComm::GetRank()==1){3705 _printf_("CPU 1:\n");3706 _printf_("Old spcvx:\n");3707 printarray(spcvx,nods_data,1);3708 _printf_("Old spcvxflag:\n");3709 printarray(spcvxflag,nods_data,1);3710 _error_("Stop!!");3711 }3712 3713 3714 3715 3716 3717 3658 int count = 0; 3718 3659 IssmDouble eps = 1.e-8; … … 3720 3661 /*Now, insert the interpolated constraints in the data set (constraints)*/ 3721 3662 for(int i=0;i<newnumberofvertices;i++){ 3722 if(my_vertices[i]) 3723 /*spcvx*/ 3724 if(!xIsNan<IssmDouble>(newspcvx[i]) && newspcvxflag[i]>(1-eps)){ 3725 constraints->AddObject(new SpcStatic(constraintcounter+count+1,nodecounter+i+1,0,newspcvx[i],StressbalanceAnalysisEnum)); 3726 //add count'th spc, on node i+1, setting dof 1 to vx. 3727 count++; 3663 if(my_vertices[i]){ 3664 /*spcvx*/ 3665 if(!xIsNan<IssmDouble>(newspcvx[i]) && newspcvxflag[i]>(1-eps)){ 3666 constraints->AddObject(new SpcStatic(constraintcounter+count+1,nodecounter+i+1,0,newspcvx[i],StressbalanceAnalysisEnum)); 3667 //add count'th spc, on node i+1, setting dof 1 to vx. 3668 count++; 3669 } 3728 3670 } 3729 3671 } 3730 3672 count=0; 3731 3673 for(int i=0;i<newnumberofvertices;i++){ 3732 if(my_vertices[i]) 3733 /*spcvy*/ 3734 if(!xIsNan<IssmDouble>(newspcvy[i]) && newspcvyflag[i]>(1-eps) ){ 3735 constraints->AddObject(new SpcStatic(constraintcounter+count+1,nodecounter+i+1,1,newspcvy[i],StressbalanceAnalysisEnum)); 3736 //add count'th spc, on node i+1, setting dof 1 to vx. 3737 count++; 3674 if(my_vertices[i]){ 3675 /*spcvy*/ 3676 if(!xIsNan<IssmDouble>(newspcvy[i]) && newspcvyflag[i]>(1-eps) ){ 3677 constraints->AddObject(new SpcStatic(constraintcounter+count+1,nodecounter+i+1,1,newspcvy[i],StressbalanceAnalysisEnum)); 3678 //add count'th spc, on node i+1, setting dof 1 to vx. 3679 count++; 3680 } 3738 3681 } 3739 3682 }
Note:
See TracChangeset
for help on using the changeset viewer.