Changeset 4316


Ignore:
Timestamp:
06/29/10 13:50:59 (15 years ago)
Author:
Mathieu Morlighem
Message:

Now PatchSize is added to results

Location:
issm/trunk/src/c
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/EnumDefinitions/EnumAsString.cpp

    r4297 r4316  
    237237                case JEnum : return "J";
    238238                case PatchEnum : return "Patch";
     239                case PatchVerticesEnum : return "PatchVertices";
     240                case PatchNodesEnum : return "PatchNodes";
    239241                case TimeEnum : return "Time";
    240242                case RelativeEnum : return "Relative";
  • issm/trunk/src/c/EnumDefinitions/EnumDefinitions.h

    r4297 r4316  
    269269        JEnum,
    270270        PatchEnum,
     271        PatchVerticesEnum,
     272        PatchNodesEnum,
    271273        TimeEnum,
    272274        /*}}}*/
  • issm/trunk/src/c/EnumDefinitions/StringAsEnum.cpp

    r4297 r4316  
    235235        else if (strcmp(name,"J")==0) return JEnum;
    236236        else if (strcmp(name,"Patch")==0) return PatchEnum;
     237        else if (strcmp(name,"PatchVertices")==0) return PatchVerticesEnum;
     238        else if (strcmp(name,"PatchNodes")==0) return PatchNodesEnum;
    237239        else if (strcmp(name,"Time")==0) return TimeEnum;
    238240        else if (strcmp(name,"Relative")==0) return RelativeEnum;
  • issm/trunk/src/c/modules/OutputResultsx/ElementResultsToPatch.cpp

    r4236 r4316  
    4545         * For example, we could build the following patch table, for velocities:
    4646         *
    47          * VxEnum 1  .5  1 P0  1 2       4.5 NaN  NaN //on a Beam element, Vx, at step 1, time .5, element id 1, interpolation type P0 (constant value on a beam element), vertices ids 1 and 2, one constant value 4.5
    48          * VzEnum 2  .8  2 P1  1 3 4     4.5 3.2  2.5 //on a Tria element, Vz, at step 2, time .8, element id 2, interpolation type P1  (linear values on a tria element), vertices ids 1 3 and 4, with values at 3 nodes 4.5, 3.2, 2.5
     47         1. on a Beam element, Vx, at step 1, time .5, element id 1, interpolation type P0 (constant), vertices ids 1 and 2, one constant value 4.5
     48         VxEnum 1  .5  1 P0  1 2       4.5 NaN  NaN
     49         2. on a Tria element, Vz, at step 2, time .8, element id 2, interpolation type P1 (linear), vertices ids 1 3 and 4, with values at 3 nodes 4.5, 3.2, 2.5
     50         VzEnum 2  .8  2 P1  1 3 4     4.5 3.2  2.5
    4951         * ... etc ...
    5052         *
     
    9597
    9698        /*create result object and add to results dataset: */
     99        results->AddObject(new       IntExternalResult(results->Size()+1,PatchVerticesEnum,patch->maxvertices,1,0));
     100        results->AddObject(new       IntExternalResult(results->Size()+1,PatchNodesEnum,   patch->maxnodes,1,0));
    97101        results->AddObject(new DoubleMatExternalResult(results->Size()+1,PatchEnum,patch->values,patch->numrows,patch->numcols,1,0));
    98102
  • issm/trunk/src/c/modules/OutputResultsx/FileWriteResults.cpp

    r4167 r4316  
    1313#include "../../shared/shared.h"
    1414#include "../../include/include.h"
    15 
    1615
    1716void FileWriteResults(Parameters* parameters, DataSet* results){
     
    3635
    3736        /*Close file: */
    38         if(my_rank==0)pfclose(fid,filename);
     37        if(my_rank==0) pfclose(fid,filename);
    3938
    4039        /*Free ressources:*/
  • issm/trunk/src/c/objects/Patch.cpp

    r4312 r4316  
    164164}
    165165/*}}}*/
    166 /*FUNCTION Patch::WriteToDisk(int solutiontype,char* filename);{{{1*/
    167 void Patch::WriteToDisk(int solutiontype,char* filename){
    168 
    169         extern int my_rank;
    170         FILE* fid=NULL;
    171 
    172        
    173         if(my_rank!=0)return; //do not output on other nodes!
    174 
    175         /* Open output file to write raw binary data: */
    176         fid=pfopen(filename,"wb");
    177 
    178         /*Now, write solutiontype: */
    179         fwrite(&solutiontype,sizeof(int),1,fid);
    180 
    181         /*Write dimensions of patch: */
    182         fwrite(&this->numrows,sizeof(int),1,fid);
    183         fwrite(&this->numcols,sizeof(int),1,fid);
    184 
    185         /*Write patch: */
    186         fwrite(this->values,this->numrows*this->numcols*sizeof(double),1,fid);
    187        
    188         /*Close file: */
    189         pfclose(fid,filename);
    190 
    191 }
    192 /*}}}*/
  • issm/trunk/src/c/objects/Patch.h

    r4312 r4316  
    4545                void fillresultinfo(int row,int enum_type,int step, double time, int interpolation, double* nodal_values, int num_nodes);
    4646                void MPI_Gather(void);
    47                 void WriteToDisk(int solutiontype,char* filename);
    4847
    4948};
Note: See TracChangeset for help on using the changeset viewer.