plugin_src/temp_plugin.c.tmp File Reference

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "crusde_api.h"
Include dependency graph for temp_plugin.c.tmp:

Functions

const char * get_name ()
const char * get_version ()
const char * get_authors ()
const char * get_description ()
PluginCategory get_category ()
void register_parameter ()
 Register parameters this Plugin claims from the input.
void register_output_fields ()
 Allocate an output field of size (lat*lon) with the framework.
void init ()
 Initialize members that depend on registered values.
void run ()
 Start the processing of this plugin.
void clear ()
 Clean-up before this plug-in gets unloaded.
double get_value_at (int x, int y, int t)
 Returns the value at Point(x,y) at a specific time t.

Variables

double first_parameter
 brief description of first parameter (must be double!) [physical unit]
double second_parameter
 brief description of 2nd parameter (must be double!) [physical unit]
double * internal_value
 brief description about what's stored here
int x_pos
int y_pos_ z_pos
 positions of the respective values in the output array

Detailed Description

This is a template documenting the plug-in functionality of GFLC and suggested to use when implementing new plugins. This file can be compiled to an object file as it is (well, you might want to rename it before doing that: gcc -c -I../ temp_plugin.c). This should help you understand that any compiler errors are yours ;).

The sequence in which the functions are called from the main program is as follows:

  1. register_parameter()
  2. init()
  3. run() or get_value_at(), depends on plug-in type
  4. clear()

Function Documentation

void clear (  ) 

Clean-up before this plug-in gets unloaded.

This is the place to undo any dynamic ressource binding that has been done by this plug-in during init() or anywhere else during its lifetime. Freeing the ressources is vital to the performance of the simulator.

References free(), and internal_value.

const char* get_authors (  ) 
PluginCategory get_category (  ) 
const char* get_description (  ) 
const char* get_name (  ) 
double get_value_at ( int  x,
int  y,
int  t 
)

Returns the value at Point(x,y) at a specific time t.

This function is vital for Green and Load Plugins.

Parameters:
x The x-Coordinate of the wanted value.
y The y-Coordinate of the wanted value.
t The time-Coordinate of the wanted value (set to GFLC_NO_TIME in non-temporal modeling environment).
Returns:
The value found at Point[t][y][x]

References internal_value, and NO_TIME.

const char* get_version (  ) 
void init (  ) 

Initialize members that depend on registered values.

This function must not be called before register_parameter() unless none of the necessary values depends on parameters provided by the user, which are only set after they have been registered. This function is called some time after register_parameter().

See also:
register_parameter()

References first_parameter, internal_value, and second_parameter.

void register_output_fields (  ) 

Allocate an output field of size (lat*lon) with the framework.

It calls crusde_register_output_field() as many times as indices are to be registered. The assigned index in the output field is saved to an address that must be provided as a parameter to crusde_register_output_field() Furthermore, it must be said what type of field (X_FIELD|Y_FIELD|Z_FIELD|ADD_FIELD) is to be registered using crusde_register_output_field().

References crusde_register_output_field(), X_FIELD, x_pos, Y_FIELD, y_pos, Z_FIELD, and z_pos.

void register_parameter (  ) 

Register parameters this Plugin claims from the input.

This function is called right after loading of the Plug-in. It calls register_green_param() defined in crusde_api.h to register references to parameters this Green's function will need to operate properly. For command line use the order of registration in this function defines the identification of parameters in the command line string (i.e. './green -GfirstRegistered/secondRegistered/...'). In case an XML is used to configure the experiment, the reference to this parameter will be identified by the string passed as second argument to register_green_param().

See also:
crusde_register_param_double()

References crusde_register_param_double(), first_parameter, get_category(), and second_parameter.

void run (  ) 

Start the processing of this plugin.

This function is only called for Kernel Plug-ins. It can be omitted for any other Plug-in type.


Variable Documentation

brief description of first parameter (must be double!) [physical unit]

Referenced by init(), and register_parameter().

double* internal_value

brief description about what's stored here

Referenced by clear(), get_value_at(), and init().

brief description of 2nd parameter (must be double!) [physical unit]

Referenced by init(), and register_parameter().

int x_pos
int y_pos_ z_pos

positions of the respective values in the output array


Generated on Tue Feb 16 15:18:28 2010 for CrusDe by  doxygen 1.6.1-20091004