trace_term.h File Reference

#include "traceio.h"
#include "parser.h"
#include "grid.h"
#include "model.h"

Go to the source code of this file.

Classes

struct  TRACE_TERM

Functions

int traceterm_construct (TRACE_TERM *t, PARARRAY *par, int load, const char *hdrkey, const char *datakey, FILE *stream)
 Trace handler default constructor.
int traceterm_init (TRACE_TERM *t, IMODEL *m, PARARRAY *par, FILE *stream)
 Post-construction initialization.
int traceterm_destroy (TRACE_TERM *t)
 Destructor - delegates to destroy_tracegeom.
int traceterm_run (TRACE_TERM *t, IMODEL *m)
 Extracts allocated and computational index limits from IMODEL input for the RARR (rarray, discrete field) corresponding to the stored index, passes this info to sampletraces.
void traceterm_fprint (TRACE_TERM const *t, FILE *stream)
 Print method - displays internal data of TRACE_TERM, then delegates to fprint_tracegeom.


Function Documentation

int traceterm_construct ( TRACE_TERM t,
PARARRAY par,
int  load,
const char *  hdrkey,
const char *  datakey,
FILE *  stream 
)

Trace handler default constructor.

Calling this function default- constructs the TRACE_TERM argument by delegation to the traceterm_construct function. The load, sampling, and field index flags are reserved, and start and stop time indices given default values (=0). Most important role: implements options for separate header vs. file overwrite. If the hdrkey arg is NULL, or if it is given but the PARARRAY does not contain a value for that key, then the trace headers are assumed to be present in the in- or out-put data file (pointed to by datakey). It is an error for the PARARRAY not to define a value for the key datakey. If load is set then data file must contain trace data. If load is not set (save option, for recording traces) then data file may be empty on on construction.

Parameters:
[out] t - (TRACE_TERM *) trace handler object to be constructed.
[in] par - (PARARRAY *) parameter array containing filenames etc.
[in] load - (int) if set, run method loads data from traces into grid, else saves data from grid into traces.
[in] hdrkey - (const char *) key identifying header file name in parameter table
[in] datakey - (const char *) key identifying data file name in parameter table
[in] stream - (FILE *) verbose output stream
Returns:
0 on successful completion, else error code

int traceterm_init ( TRACE_TERM t,
IMODEL m,
PARARRAY par,
FILE *  stream 
)

Post-construction initialization.

Extracts global and local grid params from IMODEL argument, delegates to init_tracegeom.

Parameters:
[out] t - (TRACE_TERM *) to be initialized
[in] m - (IMODEL *) conveys spatial grid information
[in] par - (PARARRAY *) parameter array containing filenames etc.
[in] stream = (FILE *) verbose output stream
Returns:
0 on successful completion, else error code

int traceterm_destroy ( TRACE_TERM t  ) 

Destructor - delegates to destroy_tracegeom.

Parameters:
[out] t (TRACE_TERM *) to be destroyed
Returns:
0 on successful completion, else error code

int traceterm_run ( TRACE_TERM t,
IMODEL m 
)

Extracts allocated and computational index limits from IMODEL input for the RARR (rarray, discrete field) corresponding to the stored index, passes this info to sampletraces.

Parameters:
[out] t - (TRACE_TERM *) trace data to be sampled
[in] m - (IMODEL *) grid data to be sampled
Returns:
0 on successful completion, else error code

void traceterm_fprint ( TRACE_TERM const *  t,
FILE *  stream 
)

Print method - displays internal data of TRACE_TERM, then delegates to fprint_tracegeom.

Parameters:
[in] t - (TRACE_TERM *) to be printed
[out] stream = (FILE *) verbose output stream


Generated on Thu Dec 6 10:01:15 2012 for IWAVE by  doxygen 1.4.7