Changeset 6689
- Timestamp:
- 12/07/10 11:28:12 (14 years ago)
- Location:
- issm/trunk/src/mex/Response
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/mex/Response/Response.cpp
r6573 r6689 16 16 char *response = NULL; 17 17 bool process_units; 18 19 /* output datasets: */20 double resp;21 18 22 19 /*Boot module: */ … … 41 38 loads-> Configure(elements, loads, nodes,vertices, materials,parameters); 42 39 43 /*!Call core code: */ 44 Responsex(&resp, elements,nodes,vertices, loads,materials,parameters,response,process_units); 40 /*for MassFlux, loop over all profiles: */ 41 if (StringToEnum(response) == MassFluxEnum) { 42 int counter; 45 43 46 /*write output : */ 47 WriteData(OUTPUT,resp); 44 /*all segments: */ 45 double** array=NULL; 46 int M; 47 48 /* output datasets: */ 49 double* resp; 50 51 /*First, figure out which segment to compute our mass flux on. Start with retrieving qmu_mass_flux_segments: */ 52 if(!parameters->FindParam(&array,&M,NULL,NULL,QmuMassFluxSegmentsEnum))_error_(" could not find QmuMassFluxSegmentsEnum"); 53 54 /*Retrieve index of segments being used for MassFlux computation: */ 55 // if(!parameters->FindParam(&counter,IndexEnum))_error_(" could not find IndexEnum"); 56 57 resp=(double*)xcalloc(M,sizeof(double)); 58 for (counter=0; counter<M; counter++) { 59 /*indexed response: plug index into parameters and call response module: */ 60 parameters->SetParam(counter+1,IndexEnum); 61 62 /*!Call core code: */ 63 Responsex(&resp[counter], elements,nodes,vertices, loads,materials,parameters,response,process_units); 64 } 65 66 /*write output : */ 67 WriteData(OUTPUT,resp,M); 68 // WriteData does not copy data, so don't free (jes, 11/30/10) 69 // xfree((void**)&resp); 70 } 71 72 /*otherwise a single call: */ 73 else { 74 /* output datasets: */ 75 double resp; 76 77 /*!Call core code: */ 78 Responsex(&resp, elements,nodes,vertices, loads,materials,parameters,response,process_units); 79 80 /*write output : */ 81 WriteData(OUTPUT,resp); 82 } 48 83 49 84 /*Free ressources: */ -
issm/trunk/src/mex/Response/Response.h
r6573 r6689 3 3 */ 4 4 5 #ifndef _ COSTFUNCTION_H6 #define _ COSTFUNCTION_H5 #ifndef _RESPONSE_H 6 #define _RESPONSE_H 7 7 8 8 /* local prototypes: */ … … 12 12 #include "../../c/Container/Container.h" 13 13 #include "../../c/shared/shared.h" 14 #include "../../c/EnumDefinitions/EnumDefinitions.h" 14 15 15 16 #undef __FUNCT__ … … 35 36 #define NRHS 8 36 37 37 #endif /* _ COSTFUNCTION_H */38 #endif /* _RESPONSE_H */ 38 39 39 40
Note:
See TracChangeset
for help on using the changeset viewer.