Template for Writing User 4 Functions in C-Plot

What is template.4.c?

template_4.c is a fully functioning example for a C-Plot level 4 user function. It uses C-Plot macros defined in p_funct.h which is included with C-Plot. See ref1.4.c for an example.

Function Specifics:

The program contains four functions:

  1. setup():
    1. Described in the C-Plot user manual.
  2. user4():
    1. Described in the C-Plot user manual. User 4 functions are only executed once, so the template iterates through the points (0 to npts).
  3. myFunc(double x, double y):
    1. The actual function goes here. The example simply doubles the y value of the current C-Plot data.
  4. initParam():
    1. A parameter loading function. This function is not necessary, but may be useful. It reads the file template.dat for the values of two arrays: P and C. Instructions for creating and modifying a template file are included in template.dat and template_4.c.

Michael S Kelley, mkelley@ameslab.gov