- Timestamp:
- 06/01/12 17:26:03 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/modules/OutputResultsx/OutputResultsx.cpp
r11995 r12330 16 16 #include "../../objects/objects.h" 17 17 18 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)19 void OutputResultsx(mxArray** pdataref, Elements* elements, Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,Results* results){20 #else21 18 void OutputResultsx( Elements* elements, Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,Results* results){ 22 #endif23 19 24 20 extern int my_rank; … … 31 27 bool dakota_analysis = false; 32 28 33 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)34 const char **fnames = NULL;35 mwSize onebyone[2] = {0,0};36 mwSize ndim = 2;37 int nfields=0;38 #endif39 40 29 /*retrieve parameters: */ 41 30 parameters->FindParam(&dakota_analysis,QmuIsdakotaEnum); … … 43 32 if(dakota_analysis){ 44 33 //no need to output anything, Dakota analysis has different outputs 45 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)46 *pdataref=mxCreateStructArray( ndim,onebyone,nfields,fnames);47 #endif48 34 return; 49 35 } … … 56 42 /*Results do not include the type of solution being run . In parallel, we output results to a filename, 57 43 *therefore, we need to include the solutiontype into the filename: */ 58 #ifdef _PARALLEL_59 44 if(my_rank==0){ 60 45 parameters->FindParam(&solutiontype,SolutionTypeEnum); … … 88 73 parameters->SetParam(fid,OutputFilePointerEnum); 89 74 } 90 #endif91 75 92 /*Write results to disk (in parallel), or to memory (in serial mode): */ 93 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_) 94 results->Write(pdataref); 95 #else 96 results->Write(parameters); 97 #endif 76 /*Write results to disk: */ 77 results->Write(parameters); 98 78 99 79 /*Delete and reinitialize results, in parallel: */ 100 #ifdef _PARALLEL_ 101 results->clear(); 80 results->clear(); 102 81 103 /*Close output file? :*/ 104 /*WARNING: issm.cpp is taking care of it for now (quick fix) 105 if((step==1) && (time==0)){ 106 if(io_gather){ 107 if(my_rank==0) pfclose(fid,outputfilename); 108 } 109 else pfclose(fid,cpu_outputfilename); 110 } 111 */ 112 #endif 82 /*Close output file? :*/ 83 /*WARNING: issm.cpp is taking care of it for now (quick fix) 84 if((step==1) && (time==0)){ 85 if(io_gather){ 86 if(my_rank==0) pfclose(fid,outputfilename); 87 } 88 else pfclose(fid,cpu_outputfilename); 89 } 90 */ 113 91 }
Note:
See TracChangeset
for help on using the changeset viewer.