Changeset 4267
- Timestamp:
- 06/28/10 13:24:30 (15 years ago)
- Location:
- issm/trunk/src/c/objects/Elements
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/objects/Elements/Penta.cpp
r4266 r4267 27 27 this->matpar=NULL; 28 28 this->neighbors=NULL; 29 this->collapse=NULL;30 29 31 30 this->inputs=NULL; … … 39 38 delete results; 40 39 this->parameters=NULL; 41 xfree((void**)&collapse);42 40 } 43 41 /*}}}*/ … … 81 79 this->inputs=new Inputs(); 82 80 this->results=new Results(); 83 84 //collpase flags85 collapse=(bool*)xcalloc(nummodels,sizeof(bool));86 81 87 82 } … … 154 149 printf(" results\n"); 155 150 results->DeepEcho(); 156 printf(" collapse: \n ");157 for(i=0;i<numanalyses;i++)printf("%s|",collapse[i]?"true":"false");158 151 return; 159 152 } … … 175 168 176 169 /*allocate dynamic memory: */ 177 collapse=(bool*)xmalloc(numanalyses*sizeof(bool));178 170 InitHookNodes(numanalyses); 179 171 … … 194 186 results=(Results*)DataSetDemarshallRaw(&marshalled_dataset); 195 187 196 /*demarshall internal parameters: */197 memcpy(collapse,marshalled_dataset,numanalyses*sizeof(bool));marshalled_dataset+=numanalyses*sizeof(bool);198 199 188 /*parameters: may not exist even yet, so let Configure handle it: */ 200 189 this->parameters=NULL; … … 264 253 marshalled_dataset+=marshalled_results_size; 265 254 266 /*marshall internal parameters: */267 memcpy(marshalled_dataset,collapse,numanalyses*sizeof(bool));marshalled_dataset+=numanalyses*sizeof(bool);268 269 255 /*parameters: don't do anything about it. parameters are marshalled somewhere else!*/ 270 256 … … 291 277 +inputs->MarshallSize() 292 278 +results->MarshallSize() 293 +numanalyses*sizeof(bool)294 279 +sizeof(int); //sizeof(int) for enum type 295 280 } … … 854 839 855 840 /*Just branch to the correct InputUpdateFromSolution generator, according to the type of analysis we are carrying out: */ 856 if (analysis_type==DiagnosticAnalysisEnum){ 857 if (sub_analysis_type==HorizAnalysisEnum){ 858 GetSolutionFromInputsDiagnosticHoriz(solution); 859 } 860 else if(sub_analysis_type==VertAnalysisEnum){ 861 GetSolutionFromInputsDiagnosticVert(solution); 862 } 863 else if(sub_analysis_type==StokesAnalysisEnum){ 864 GetSolutionFromInputsDiagnosticStokes(solution); 865 } 866 else ISSMERROR("sub_analysis: %i (%s) not supported yet",sub_analysis_type,EnumAsString(sub_analysis_type)); 841 if (analysis_type==DiagnosticHorizAnalysisEnum){ 842 GetSolutionFromInputsDiagnosticHoriz(solution); 843 } 844 else if(analysis_type==DiagnosticVertAnalysisEnum){ 845 GetSolutionFromInputsDiagnosticVert(solution); 846 } 847 else if(analysis_type==DiagnosticStokesAnalysisEnum){ 848 GetSolutionFromInputsDiagnosticStokes(solution); 867 849 } 868 850 else{ … … 1717 1699 //elements of type 3 are macayeal type penta. we collapse the formulation on their base. 1718 1700 if(iomodel->elements_type){ 1719 if (*(iomodel->elements_type+2*index+0)==MacAyealFormulationEnum){ 1720 collapse[analysis_counter]=true; 1721 } 1722 else{ 1723 collapse[analysis_counter]=false; 1724 } 1701 if (*(iomodel->elements_type+2*index+0)==MacAyealFormulationEnum) 1702 this->inputs->AddInput(new BoolInput(CollapseEnum,true)); 1703 else 1704 this->inputs->AddInput(new BoolInput(CollapseEnum,false)); 1725 1705 } 1726 1706 } -
issm/trunk/src/c/objects/Elements/Penta.h
r4250 r4267 37 37 Inputs *inputs; 38 38 Results *results; 39 40 /*internal parameters: */41 bool *collapse; //collapse elements, depending on analysis_type42 39 43 40 /*Penta constructors and destructor: {{{1*/
Note:
See TracChangeset
for help on using the changeset viewer.