Changeset 6716
- Timestamp:
- 12/10/10 10:50:48 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/mex/Response/Response.cpp
r6689 r6716 1 1 /*\file Response.c 2 *\brief: compute misfit between modeled velocity and observed velocity2 *\brief: compute response according to a response descriptor 3 3 */ 4 4 … … 16 16 char *response = NULL; 17 17 bool process_units; 18 19 /* output datasets: */ 20 double resp; 18 21 19 22 /*Boot module: */ … … 38 41 loads-> Configure(elements, loads, nodes,vertices, materials,parameters); 39 42 40 /*for MassFlux, loop over all profiles: */ 41 if (StringToEnum(response) == MassFluxEnum) { 42 int counter; 43 /*!Call core code: */ 44 Responsex(&resp, elements,nodes,vertices, loads,materials,parameters,response,process_units); 43 45 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 } 46 /*write output : */ 47 WriteData(OUTPUT,resp); 83 48 84 49 /*Free ressources: */
Note:
See TracChangeset
for help on using the changeset viewer.