source:
issm/oecreview/Archive/22819-23185/ISSM-23172-23173.diff
Last change on this file was 23186, checked in by , 7 years ago | |
---|---|
File size: 5.5 KB |
-
../trunk-jpl/src/c/modules/SetActiveNodesLSMx/SetActiveNodesLSMx.cpp
55 55 xDelete<IssmDouble>(mask); 56 56 } 57 57 }/*}}}*/ 58 void GetMaskOfIceVerticesLSMx(FemModel* femmodel){/*{{{*/59 58 59 void GetMaskOfIceVerticesLSMx0(FemModel* femmodel){/*{{{*/ 60 60 61 /*Initialize vector with number of vertices*/ 61 62 int numvertices=femmodel->vertices->NumberOfVertices(); 62 63 if(numvertices==0) return; … … 82 83 delete vec_mask_ice; 83 84 xDelete<IssmDouble>(mask_ice); 84 85 }/*}}}*/ 86 void GetMaskOfIceVerticesLSMx(FemModel* femmodel){/*{{{*/ 87 88 femmodel->SetCurrentConfiguration(LevelsetAnalysisEnum); 89 90 /*Create vector on gset*/ 91 int configuration_type; 92 femmodel->parameters->FindParam(&configuration_type,ConfigurationTypeEnum); 93 int gsize=femmodel->nodes->NumberOfDofs(configuration_type,GsetEnum); 94 if(gsize==0) return; 95 Vector<IssmDouble>* vec_mask_ice=new Vector<IssmDouble>(gsize); 96 97 /*Fill vector with values: */ 98 for(int i=0;i<femmodel->elements->Size();i++){ 99 Element* element=xDynamicCast<Element*>(femmodel->elements->GetObjectByOffset(i)); 100 101 if(element->IsIceInElement()){ 102 int numnodes = element->GetNumberOfNodes(); 103 int gsize_local=GetNumberOfDofs(element->nodes,numnodes,GsetEnum,NoneEnum); 104 int* glist_local=GetGlobalDofList(element->nodes,numnodes,GsetEnum,NoneEnum); 105 IssmDouble* ones = xNew<IssmDouble>(gsize_local); 106 for(int n=0;n<gsize_local;n++) ones[n] = 1.; 107 vec_mask_ice->SetValues(gsize_local,glist_local,ones,INS_VAL); 108 xDelete<IssmDouble>(ones); 109 xDelete<int>(glist_local); 110 } 111 } 112 113 /*Assemble vector and serialize */ 114 vec_mask_ice->Assemble(); 115 IssmDouble* mask_ice=vec_mask_ice->ToMPISerial(); 116 delete vec_mask_ice; 117 for(int i=0;i<femmodel->elements->Size();i++){ 118 Element* element=xDynamicCast<Element*>(femmodel->elements->GetObjectByOffset(i)); 119 element->InputUpdateFromSolutionOneDof(mask_ice,IceMaskNodeActivationEnum); 120 } 121 122 /*Clean up and return*/ 123 xDelete<IssmDouble>(mask_ice); 124 }/*}}}*/ -
../trunk-jpl/src/c/modules/SetActiveNodesLSMx/SetActiveNodesLSMx.h
8 8 #include "../../classes/classes.h" 9 9 10 10 void SetActiveNodesLSMx(FemModel* femmodel); 11 void GetMaskOfIceVerticesLSMx0(FemModel* femmodel); 11 12 void GetMaskOfIceVerticesLSMx(FemModel* femmodel); 12 #endif /* _ UPDATESPCSX_H*/13 #endif /* _SETACTIVENODESLSMX_H*/ -
../trunk-jpl/src/c/classes/FemModel.cpp
404 404 VerticesDofx(vertices,parameters); 405 405 406 406 if(VerboseMProcessor()) _printf0_(" detecting active vertices\n"); 407 GetMaskOfIceVerticesLSMx (this);407 GetMaskOfIceVerticesLSMx0(this); 408 408 } 409 409 410 410 if(VerboseMProcessor()) _printf0_(" resolving node constraints\n"); … … 2632 2632 delete this->constraints; this->constraints = new_constraints; 2633 2633 delete this->materials; this->materials = new_materials; 2634 2634 2635 GetMaskOfIceVerticesLSMx (this);2635 GetMaskOfIceVerticesLSMx0(this); 2636 2636 2637 2637 /*Insert MISMIP+ bed topography FIXME it could be stay in another place*/ 2638 2638 this->parameters->FindParam(&basalforcing_model,BasalforcingsEnum); -
../trunk-jpl/src/c/classes/Elements/Tria.cpp
3958 3958 3959 3959 _assert_(fieldvalue==0.); //field value != 0 not implemented yet 3960 3960 3961 /*Get field on vertices (we do not allow for higher order elements!!)*/ 3962 IssmDouble lsf[NUMVERTICES]; 3963 this->GetInputListOnVertices(&lsf[0],fieldenum); 3964 3961 3965 /*1. check that we do cross fieldvalue in this element*/ 3962 Input* input = inputs->GetInput(fieldenum); 3963 if(!input) _error_("Cannot calculate distance to "<<EnumToStringx(fieldenum)<<", input not found"); 3964 IssmDouble minvalue = input->Min(); 3966 IssmDouble minvalue = lsf[0]; 3967 IssmDouble maxvalue = lsf[0]; 3968 for(int i=1;i<NUMVERTICES;i++){ 3969 if(lsf[i]>maxvalue) maxvalue = lsf[i]; 3970 if(lsf[i]<minvalue) minvalue = lsf[i]; 3971 } 3965 3972 if(minvalue>fieldvalue) return; 3966 IssmDouble maxvalue = input->Max();3967 3973 if(maxvalue<fieldvalue) return; 3968 3974 3969 3975 /*2. Find coordinates of where levelset crosses 0*/ … … 3987 3993 } 3988 3994 } 3989 3995 else if(numiceverts==NUMVERTICES){ //NUMVERTICES ice vertices: calving front lies on element edge 3990 IssmDouble lsf[NUMVERTICES]; 3991 this->GetInputListOnVertices(&lsf[0],fieldenum); 3996 3992 3997 for(int i=0;i<NUMVERTICES;i++){ 3993 3998 if(lsf[indices[i]]==0.){ 3994 3999 x[counter]=xyz_list[indices[i]][0]; -
../trunk-jpl/src/c/classes/Nodes.cpp
348 348 /*Grab max of all cpus: */ 349 349 ISSM_MPI_Allreduce((void*)&flag,(void*)&allflag,1,ISSM_MPI_INT,ISSM_MPI_MAX,IssmComm::GetComm()); 350 350 351 if(allflag){ 352 return true; 353 } 354 else{ 355 return false; 356 } 351 if(allflag) return true; 352 else return false; 357 353 } 358 354 /*}}}*/
Note:
See TracBrowser
for help on using the repository browser.