Changeset 16589
- Timestamp:
- 10/30/13 21:15:33 (11 years ago)
- Location:
- issm/trunk-jpl/src/c/classes
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/Elements/Element.h
r16494 r16589 60 60 virtual void ComputeStrainRate(Vector<IssmDouble>* eps)=0; 61 61 virtual void ResultInterpolation(int* pinterpolation,int output_enum)=0; 62 virtual void ResultToVector(Vector<Issm PDouble>* vector,int output_enum)=0;62 virtual void ResultToVector(Vector<IssmDouble>* vector,int output_enum)=0; 63 63 virtual void Update(int index, IoModel* iomodel,int analysis_counter,int analysis_type,int finite_element)=0; 64 64 virtual void InputDuplicate(int original_enum,int new_enum)=0; -
issm/trunk-jpl/src/c/classes/Elements/Penta.cpp
r16545 r16589 2864 2864 /*}}}*/ 2865 2865 /*FUNCTION Penta::ResultToVector{{{*/ 2866 void Penta::ResultToVector(Vector<Issm PDouble>* vector,int output_enum){2866 void Penta::ResultToVector(Vector<IssmDouble>* vector,int output_enum){ 2867 2867 2868 2868 Input* input=this->inputs->GetInput(output_enum); … … 2875 2875 case P1Enum:{ 2876 2876 IssmDouble values[NUMVERTICES]; 2877 IssmPDouble pvalues[NUMVERTICES];2878 2877 int connectivity[NUMVERTICES]; 2879 2878 int sidlist[NUMVERTICES]; … … 2882 2881 this->GetConnectivityList(&connectivity[0]); 2883 2882 this->GetInputListOnVertices(&values[0],output_enum); 2884 for(int i=0;i<NUMVERTICES;i++) pvalues[i] = reCast<IssmPDouble>(values[i])/reCast<IssmPDouble>(connectivity[i]);2885 2886 vector->SetValues(NUMVERTICES,&sidlist[0],& pvalues[0],ADD_VAL);2883 for(int i=0;i<NUMVERTICES;i++) values[i] = values[i]/reCast<IssmDouble>(connectivity[i]); 2884 2885 vector->SetValues(NUMVERTICES,&sidlist[0],&values[0],ADD_VAL); 2887 2886 break; 2888 2887 } -
issm/trunk-jpl/src/c/classes/Elements/Penta.h
r16529 r16589 96 96 97 97 void ResultInterpolation(int* pinterpolation,int output_enum); 98 void ResultToVector(Vector<Issm PDouble>* vector,int output_enum);98 void ResultToVector(Vector<IssmDouble>* vector,int output_enum); 99 99 void PositiveDegreeDay(IssmDouble* pdds,IssmDouble* pds,IssmDouble signorm); 100 100 void ResetCoordinateSystem(void); -
issm/trunk-jpl/src/c/classes/Elements/Seg.h
r16529 r16589 112 112 void PositiveDegreeDay(IssmDouble* pdds,IssmDouble* pds,IssmDouble signorm){_error_("not implemented yet");}; 113 113 void ResultInterpolation(int* pinterpolation,int output_enum){_error_("not implemented");}; 114 void ResultToVector(Vector<Issm PDouble>* vector,int output_enum){_error_("not implemented");};114 void ResultToVector(Vector<IssmDouble>* vector,int output_enum){_error_("not implemented");}; 115 115 void ResetCoordinateSystem(void){_error_("not implemented yet");}; 116 116 void SmbGradients(){_error_("not implemented yet");}; -
issm/trunk-jpl/src/c/classes/Elements/Tria.cpp
r16573 r16589 2464 2464 /*}}}*/ 2465 2465 /*FUNCTION Tria::ResultToVector{{{*/ 2466 void Tria::ResultToVector(Vector<Issm PDouble>* vector,int output_enum){2466 void Tria::ResultToVector(Vector<IssmDouble>* vector,int output_enum){ 2467 2467 2468 2468 Input* input=this->inputs->GetInput(output_enum); … … 2475 2475 case P1Enum:{ 2476 2476 IssmDouble values[NUMVERTICES]; 2477 IssmPDouble pvalues[NUMVERTICES];2478 2477 int connectivity[NUMVERTICES]; 2479 2478 int sidlist[NUMVERTICES]; … … 2482 2481 this->GetConnectivityList(&connectivity[0]); 2483 2482 this->GetInputListOnVertices(&values[0],output_enum); 2484 for(int i=0;i<NUMVERTICES;i++) pvalues[i] = reCast<IssmPDouble>(values[i])/reCast<IssmPDouble>(connectivity[i]);2485 2486 vector->SetValues(NUMVERTICES,&sidlist[0],& pvalues[0],ADD_VAL);2483 for(int i=0;i<NUMVERTICES;i++) values[i] = values[i]/reCast<IssmDouble>(connectivity[i]); 2484 2485 vector->SetValues(NUMVERTICES,&sidlist[0],&values[0],ADD_VAL); 2487 2486 break; 2488 2487 } -
issm/trunk-jpl/src/c/classes/Elements/Tria.h
r16529 r16589 103 103 void PositiveDegreeDay(IssmDouble* pdds,IssmDouble* pds,IssmDouble signorm); 104 104 void ResultInterpolation(int* pinterpolation,int output_enum); 105 void ResultToVector(Vector<Issm PDouble>* vector,int output_enum);105 void ResultToVector(Vector<IssmDouble>* vector,int output_enum); 106 106 void ResetCoordinateSystem(void); 107 107 void SmbGradients(); -
issm/trunk-jpl/src/c/classes/ExternalResults/GenericExternalResult.h
r16504 r16589 383 383 return new GenericExternalResult<Vector<IssmPDouble>*>(this->id,StringToEnumx(this->result_name),this->value,this->step,this->time); 384 384 } /*}}}*/ 385 #if defined(_HAVE_ADOLC_) && !defined(_WRAPPERS_) //We hook off this specific specialization when not running ADOLC, otherwise we get a redeclaration with the next specialization. 385 386 template <> inline void GenericExternalResult<Vector<IssmPDouble>*>::WriteData(FILE* fid,bool io_gather){ /*{{{*/ 386 387 … … 420 421 } 421 422 /*}}}*/ 423 #endif 422 424 template <> inline int GenericExternalResult<Vector<IssmPDouble>*>::ObjectEnum(void){ /*{{{*/ 423 425 return NoneEnum; … … 425 427 } /*}}}*/ 426 428 429 /*Specifics instantiations for Vector<IssmDouble>*/ 430 template <> inline void GenericExternalResult<Vector<IssmDouble>*>::WriteData(FILE* fid,bool io_gather){ /*{{{*/ 431 432 int i; 433 char *name = NULL; 434 int length,rows,cols=1; 435 IssmDouble* serialvalues = NULL; 436 IssmPDouble* pserialvalues = NULL; 437 438 if(!io_gather){ 439 _error_("not supported yet"); 440 } 441 442 /*Serialize vector*/ 443 serialvalues = this->value->ToMPISerial(); 444 this->value->GetSize(&rows); 445 446 pserialvalues=xNew<IssmPDouble>(rows); 447 for(i=0;i<rows;i++)pserialvalues[i]=reCast<IssmPDouble>(serialvalues[i]); 448 449 if(IssmComm::GetRank()==0){ 450 /*First write name: */ 451 length=(strlen(this->result_name)+1)*sizeof(char); 452 fwrite(&length,sizeof(int),1,fid); 453 fwrite(this->result_name,length,1,fid); 454 455 /*Now write time and step: */ 456 IssmPDouble passiveDouble=reCast<IssmPDouble>(time); 457 fwrite(&passiveDouble,sizeof(IssmPDouble),1,fid); 458 fwrite(&step,sizeof(int),1,fid); 459 460 /*writing a IssmDouble array, type is 3:*/ 461 int type=3; 462 fwrite(&type,sizeof(int),1,fid); 463 fwrite(&rows,sizeof(int),1,fid); 464 fwrite(&cols,sizeof(int),1,fid); 465 fwrite(pserialvalues,cols*rows*sizeof(IssmPDouble),1,fid); 466 } 467 468 /*Clean up*/ 469 xDelete<IssmPDouble>(pserialvalues); 470 xDelete<IssmDouble>(serialvalues); 471 472 } 473 /*}}}*/ 474 427 475 #endif /* _EXTERNAL_RESULTOBJECT_H */ -
issm/trunk-jpl/src/c/classes/FemModel.cpp
r16518 r16589 562 562 563 563 } 564 Vector<Issm PDouble> *vector_result = new Vector<IssmPDouble>(this->vertices->NumberOfVertices());564 Vector<IssmDouble> *vector_result = new Vector<IssmDouble>(this->vertices->NumberOfVertices()); 565 565 566 566 /*Fill in vector*/ … … 571 571 vector_result->Assemble(); 572 572 573 results->AddResult(new GenericExternalResult<Vector<Issm PDouble>*>(results->Size()+1,output_enum,vector_result,step,time));573 results->AddResult(new GenericExternalResult<Vector<IssmDouble>*>(results->Size()+1,output_enum,vector_result,step,time)); 574 574 isvec = true; 575 575 break;
Note:
See TracChangeset
for help on using the changeset viewer.