Changeset 6716


Ignore:
Timestamp:
12/10/10 10:50:48 (14 years ago)
Author:
jschierm
Message:

Response.cpp: Eric's request to remove enhancements in lieu of user manually entering Index parameter similar to Responsex. :(

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/mex/Response/Response.cpp

    r6689 r6716  
    11/*\file Response.c
    2  *\brief: compute misfit between modeled velocity and observed velocity
     2 *\brief: compute response according to a response descriptor
    33 */
    44
     
    1616        char       *response   = NULL;
    1717        bool        process_units;
     18
     19        /* output datasets: */
     20        double resp;
    1821
    1922        /*Boot module: */
     
    3841        loads->     Configure(elements, loads, nodes,vertices, materials,parameters);
    3942
    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);
    4345
    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);
    8348
    8449        /*Free ressources: */
Note: See TracChangeset for help on using the changeset viewer.