Changeset 13412
- Timestamp:
- 09/20/12 16:59:40 (13 years ago)
- Location:
- issm/trunk-jpl/src/c
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/DofIndexing.cpp
r13056 r13412 21 21 DofIndexing::DofIndexing(){ 22 22 23 this->gsize =UNDEF;24 this->fsize =UNDEF;25 this->ssize =UNDEF;26 this->clone =0;27 this->f_set =NULL;28 this->s_set =NULL;29 this->svalues =NULL;30 this->doftype =NULL;31 this->gdoflist =NULL;32 this->fdoflist =NULL;33 this->sdoflist =NULL;23 this->gsize = UNDEF; 24 this->fsize = UNDEF; 25 this->ssize = UNDEF; 26 this->clone = false; 27 this->f_set = NULL; 28 this->s_set = NULL; 29 this->svalues = NULL; 30 this->doftype = NULL; 31 this->gdoflist = NULL; 32 this->fdoflist = NULL; 33 this->sdoflist = NULL; 34 34 35 35 } … … 43 43 DofIndexing::DofIndexing(DofIndexing* in){ //copy constructor 44 44 45 int i; 46 this->gsize=in->gsize; 47 this->fsize=in->fsize; 48 this->ssize=in->ssize; 49 50 this->clone=in->clone; 45 this->gsize = in->gsize; 46 this->fsize = in->fsize; 47 this->ssize = in->ssize; 48 this->clone = in->clone; 51 49 52 50 if(this->gsize>0){ … … 58 56 } 59 57 else{ 60 this->f_set =NULL;61 this->s_set =NULL;62 this->svalues =NULL;63 this->doftype =NULL;64 this->gdoflist =NULL;58 this->f_set = NULL; 59 this->s_set = NULL; 60 this->svalues = NULL; 61 this->doftype = NULL; 62 this->gdoflist = NULL; 65 63 } 66 64 if(this->fsize>0 && this->fsize!=UNDEF)this->fdoflist=xNew<int>(this->fsize); else this->fdoflist=NULL; … … 95 93 void DofIndexing::Init(int in_gsize,int* in_doftype){ 96 94 97 int i;98 95 this->gsize=in_gsize; 99 100 this->clone=0; 96 this->clone=false; 101 97 102 98 /*allocate: */ … … 109 105 } 110 106 111 for (i=0;i<this->gsize;i++){107 for(int i=0;i<this->gsize;i++){ 112 108 /*assume dof is free, no constraints, no rigid body constraint: */ 113 109 this->f_set[i]=true; -
issm/trunk-jpl/src/c/classes/DofIndexing.h
r12821 r13412 18 18 19 19 /*partitioning: */ 20 intclone; //this node is replicated from another one20 bool clone; //this node is replicated from another one 21 21 22 22 /*boundary conditions sets: */ -
issm/trunk-jpl/src/c/classes/IoModel.cpp
r13376 r13412 228 228 229 229 extern int my_rank; 230 extern int num_procs;231 230 232 231 /*record descriptions; */ 233 232 int record_enum; 234 233 int record_length; 235 int record_code; //1 to 7 number234 int record_code; //1 to 7 number 236 235 237 236 /*records: */ 238 int booleanint=0;239 int integer=0;240 IssmPDouble scalar=0;241 char * string=NULL;242 int string_size;237 int booleanint = 0; 238 int integer = 0; 239 IssmPDouble scalar = 0; 240 char *string = NULL; 241 int string_size; 243 242 244 243 /*Check that some fields have been allocated*/ … … 458 457 459 458 extern int my_rank; 460 extern int num_procs;461 462 459 463 460 /*output: */ … … 488 485 489 486 extern int my_rank; 490 extern int num_procs;491 487 492 488 /*output: */ … … 515 511 void IoModel::FetchData(IssmDouble* pscalar,int data_enum){ 516 512 517 518 513 extern int my_rank; 519 extern int num_procs;520 521 514 522 515 /*output: */ … … 546 539 547 540 extern int my_rank; 548 extern int num_procs;549 550 541 551 542 /*output: */ … … 597 588 598 589 extern int my_rank; 599 extern int num_procs;600 590 int i,j; 601 591 … … 672 662 673 663 extern int my_rank; 674 extern int num_procs;675 664 676 665 /*output: */ … … 737 726 738 727 extern int my_rank; 739 extern int num_procs;740 741 728 int i; 742 729 … … 809 796 810 797 extern int my_rank; 811 extern int num_procs;812 798 813 799 /*output: */ … … 898 884 void IoModel::FetchData(Option** poption,int index){ 899 885 900 extern int my_rank;901 extern int num_procs;902 903 886 /*output: */ 904 int 905 char *name= NULL;887 int code; 888 char *name = NULL; 906 889 907 890 /*First get option name*/ … … 1220 1203 1221 1204 extern int my_rank; 1222 extern int num_procs;1223 1205 1224 1206 int found=0; … … 1315 1297 #ifdef _HAVE_ADOLC_ //cannot come here unless you are running AD mode, from DeclaredIndependents: 1316 1298 extern int my_rank; 1317 extern int num_procs;1318 1299 1319 1300 /*output: */ -
issm/trunk-jpl/src/c/classes/objects/Node.cpp
r13410 r13412 872 872 873 873 int i; 874 extern int my_rank;875 874 int dofcount; 876 875 … … 881 880 if(setenum==SsetEnum) this->indexing.InitSet(setenum); 882 881 883 884 882 /*For clone nodfs, don't distribute dofs, we will get them from another cpu in UpdateCloneDofs!*/ 885 883 if(indexing.clone){ … … 888 886 889 887 /*This node should distribute dofs for setenum set (eg, f_set or s_set), go ahead: */ 890 891 888 if(setenum==GsetEnum){ 892 889 for(i=0;i<this->indexing.gsize;i++){ … … 909 906 else _error_("set of enum type " << EnumToStringx(setenum) << " not supported yet!"); 910 907 911 912 908 /*Assign output pointers: */ 913 909 *pdofcount=dofcount; 914 915 910 } 916 911 /*}}}*/ … … 919 914 920 915 int i; 921 extern int my_rank;922 916 923 917 if(indexing.clone){ … … 943 937 944 938 int j; 945 extern int my_rank; 946 939 947 940 /*Are we a clone? : */ 948 if(indexing.clone) return;941 if(indexing.clone) return; 949 942 950 943 /*Ok, we are not a clone, just plug our dofs into truedofs: */ 951 if(setenum==GsetEnum)for(j=0;j<this->indexing.gsize;j++) *(truedofs+ncols*sid+j)=indexing.gdoflist[j]; 952 else if(setenum==FsetEnum)for(j=0;j<this->indexing.fsize;j++) *(truedofs+ncols*sid+j)=indexing.fdoflist[j]; 953 else if(setenum==SsetEnum)for(j=0;j<this->indexing.ssize;j++) *(truedofs+ncols*sid+j)=indexing.sdoflist[j]; 954 else _error_("set of enum type " << EnumToStringx(setenum) << " not supported yet!"); 944 switch(setenum){ 945 case GsetEnum: 946 for(j=0;j<this->indexing.gsize;j++) truedofs[ncols*sid+j]=indexing.gdoflist[j]; 947 break; 948 case FsetEnum: 949 for(j=0;j<this->indexing.fsize;j++) truedofs[ncols*sid+j]=indexing.fdoflist[j]; 950 break; 951 case SsetEnum: 952 for(j=0;j<this->indexing.ssize;j++) truedofs[ncols*sid+j]=indexing.sdoflist[j]; 953 break; 954 default: 955 _error_("set of enum type " << EnumToStringx(setenum) << " not supported yet!"); 956 } 955 957 956 958 } … … 960 962 961 963 int j; 962 extern int my_rank; 963 964 964 965 /*If we are not a clone, don't update, we already have dofs!: */ 965 if(indexing.clone==0)return; 966 966 if(!indexing.clone)return; 967 967 968 968 /*Ok, we are a clone node, but we did not create the dofs for this node. 969 * * Therefore, our doflist is garbage right now. Go pick it up in the alltruedofs: */ 970 if(setenum==GsetEnum)for(j=0;j<this->indexing.gsize;j++) indexing.gdoflist[j]=*(alltruedofs+ncols*sid+j); 971 else if(setenum==FsetEnum)for(j=0;j<this->indexing.fsize;j++) indexing.fdoflist[j]=*(alltruedofs+ncols*sid+j); 972 else if(setenum==SsetEnum)for(j=0;j<this->indexing.ssize;j++) indexing.sdoflist[j]=*(alltruedofs+ncols*sid+j); 973 else _error_("set of enum type " << EnumToStringx(setenum) << " not supported yet!"); 974 969 *Therefore, our doflist is garbage right now. Go pick it up in the alltruedofs: */ 970 switch(setenum){ 971 case GsetEnum: 972 for(j=0;j<this->indexing.gsize;j++) indexing.gdoflist[j]=alltruedofs[ncols*sid+j]; 973 break; 974 case FsetEnum: 975 for(j=0;j<this->indexing.fsize;j++) indexing.fdoflist[j]=alltruedofs[ncols*sid+j]; 976 break; 977 case SsetEnum: 978 for(j=0;j<this->indexing.ssize;j++) indexing.sdoflist[j]=alltruedofs[ncols*sid+j]; 979 break; 980 default: 981 _error_("set of enum type " << EnumToStringx(setenum) << " not supported yet!"); 982 } 975 983 } 976 984 /*}}}*/ … … 981 989 982 990 if (minranks[sid]==my_rank){ 983 indexing.clone= 0;991 indexing.clone=false; 984 992 } 985 993 else{ 986 994 /*!there is a cpu with lower rank that has the same node, 987 995 therefore, I am a clone*/ 988 indexing.clone=1; 989 } 990 991 } 992 /*}}}*/ 996 indexing.clone=true; 997 } 998 } 999 /*}}}*/ -
issm/trunk-jpl/src/c/io/PrintfFunction.cpp
r12543 r13412 17 17 int string_size; 18 18 extern int my_rank; 19 extern int num_procs;20 21 19 //variable list of arguments 22 20 va_list args; -
issm/trunk-jpl/src/c/matlab/io/PrintfFunction.cpp
r12511 r13412 19 19 int string_size; 20 20 extern int my_rank; 21 extern int num_procs; 22 21 23 22 //variable list of arguments 24 23 va_list args; -
issm/trunk-jpl/src/c/modules/ConstraintsStatex/ConstraintsStatex.cpp
r12515 r13412 13 13 void ConstraintsStatex(int* pconverged, int* pnum_unstable_constraints, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads,Materials* materials, Parameters* parameters){ 14 14 15 int i;16 17 extern int num_procs;18 extern int my_rank;19 20 15 /*output: */ 21 16 int converged=0; -
issm/trunk-jpl/src/c/modules/MassFluxx/MassFluxx.cpp
r13073 r13412 12 12 void MassFluxx(IssmDouble* pmass_flux, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters,bool process_units){ 13 13 14 int i,j; 15 extern int num_procs; 16 extern int my_rank; 17 18 Element* element=NULL; 19 int element_id; 14 int i,j; 15 Element *element = NULL; 16 int element_id; 20 17 21 18 /*output: */ 22 19 IssmDouble mass_flux=0; 23 20 IssmDouble all_mass_flux=0; 24 25 21 int counter; 26 22 27 23 /*all segments: */ 28 IssmDouble ** array=NULL;29 int M;30 int * mdims_array=NULL;31 int * ndims_array=NULL;24 IssmDouble **array = NULL; 25 int M; 26 int *mdims_array = NULL; 27 int *ndims_array = NULL; 32 28 33 29 /*our segments of interest: */ 34 IssmDouble * segments=NULL;35 int num_segments;30 IssmDouble *segments = NULL; 31 int num_segments; 36 32 37 33 /*First, figure out which segment to compute our mass flux on. Start with retrieving qmu_mass_flux_segments: */ -
issm/trunk-jpl/src/c/modules/ResetConstraintsx/ResetConstraintsx.cpp
r13056 r13412 12 12 13 13 void ResetConstraintsx(Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads,Materials* materials, Parameters* parameters){ 14 15 int i;16 17 extern int num_procs;18 extern int my_rank;19 14 20 15 /*output: */
Note:
See TracChangeset
for help on using the changeset viewer.