Exemple #1
0
static int module_desc()
{
	int in_port, out_port, param;

    // MODULE NAME ******************
	char filename[100];
	sprintf(filename, "%s", __FILE__);
	AVSset_module_name(strtok(filename,"."), MODULE_MAPPER);


	// INPUT PORTS ******************
	in_port = AVScreate_input_port("coords",
		"field 3-vector uniform double", REQUIRED);
	in_port = AVScreate_input_port("weights",
		"field 1-vector uniform double", OPTIONAL);
	in_port = AVScreate_input_port("kernel table in",
		"field 1D 1-vector uniform double", OPTIONAL | INVISIBLE);


	// OUTPUT PORTS *****************
	out_port = AVScreate_output_port("weights","field 1-vector uniform double");


	// PARAMETERS *******************
	param = AVSadd_parameter ("iterations", "integer", 1, 1, INT_UNBOUND);
	AVSconnect_widget (param, "typein_integer");

	param = AVSadd_parameter ("supported mtx dia", "integer",EFFECTIVE_MATRIX_DEFAULT, 0, INT_UNBOUND);
	AVSconnect_widget (param, "typein_integer");

	param = AVSadd_float_parameter ("rad fov prod (pix)",0, 0.0, FLOAT_UNBOUND);
	AVSconnect_widget (param, "typein_real");

	param = AVSadd_float_parameter ("osf", 2.1, 1.0, FLOAT_UNBOUND);
	AVSconnect_widget (param, "typein_real");


    /* send function pointer to compute module */
	AVSset_compute_proc((AVS_FNCP)module_compute);

 	//to keep warning suppressed
	param = in_port = out_port = 0;
	in_port = param;
	param = out_port;
	out_port = in_port;

	return(1);
}
Exemple #2
0
/*  BEGIN Module Specification */
static int module_desc()
{

	int in_port, out_port, param;

	/* Name and categorize the module. The name is automatically */
	/* generated by the filename */
	char filename[100];
	sprintf(filename, "%s", __FILE__);
	/* MODULE_DATA MODULE_FILTER MODULE_MAPPER MODULE_RENDER */
	AVSset_module_name(strtok(filename,"."), MODULE_MAPPER);

	/* INPUT PORTS ****************** */
	in_port = AVScreate_input_port("data","field 2-vector double", REQUIRED);

	in_port = AVScreate_input_port("coords","field 3-vector double", REQUIRED);

	in_port = AVScreate_input_port("weighting","field 1-vector double", REQUIRED);

	in_port = AVScreate_input_port("kernel table in","field 1D 1-vector", OPTIONAL | INVISIBLE);
	/* END INPUT PORTS ************** */

	/* OUTPUT PORTS ***************** */
	out_port = AVScreate_output_port("gridded","field double");
	/* END OUTPUT PORTS ************* */

	/* PARAMETERS ******************* */
	param = AVSadd_float_parameter("radius fov prod",DEFAULT_RADIUS_FOV_PRODUCT,0.001,FLOAT_UNBOUND);
	AVSconnect_widget(param, "typein_real");

	param = AVSadd_parameter("width","integer",160,0,INT_UNBOUND);
	AVSconnect_widget(param, "typein_integer");

	param = AVSadd_float_parameter ("OverSampFact", 1., 1., FLOAT_UNBOUND);
	AVSconnect_widget (param, "typein_real");

	param = AVSadd_float_parameter("window length",1.0,.0001,FLOAT_UNBOUND);
	AVSconnect_widget(param, "typein_real");

	param = AVSadd_float_parameter("taper start",0,0,100);
	AVSconnect_widget(param, "typein_real");

	param = AVSadd_float_parameter("taper length",0,0,100);
	AVSconnect_widget(param, "typein_real");

	param = AVSadd_parameter("number threads","integer",8,1,8);
	AVSconnect_widget(param, "typein_integer");

	param = AVSadd_parameter("veclen","integer",2,1,2);
	AVSconnect_widget(param, "typein_integer");

	param = AVSadd_parameter("compute","boolean",0,0,1);
	AVSconnect_widget(param, "toggle");

	/* END PARAMETERS **************** */

    /* send function pointer to compute module */
	AVSset_compute_proc((AVS_FNCP)module_compute);

 	/*to keep warning suppressed */
	param = in_port = out_port = 0;

	return(1);
}
Exemple #3
0
/* *****************************************/
int ucd_Mz_desc()
{

    int in_port, out_port, param;
    extern int ucd_Mz_compute(UCD_structure * ucd, UCD_structure * grid, UCD_structure * *ucd_out, AVSfield_float * *trajectories,
                              float *origin_x, float *origin_y, float *origin_z,
                              int cells_x, int cells_y, int cells_z,
                              float *cell_size,
                              char *velocity,
                              int unsteady,
                              char *velocity_file,
                              int strong_hyperbolicity,
                              int ABC_steady,
                              float *start_time,
                              float *integration_time,
                              int time_intervals,
                              int integ_steps_max, int forward,
                              int smoothing_range,
                              int omit_boundary_cells,
                              int grad_neigh_disabled,
                              int execute);

    AVSset_module_name("ucd Mz", MODULE_FILTER);

    /* Input Port Specifications               */
    in_port = AVScreate_input_port("ucd", "ucd", REQUIRED);
    in_port = AVScreate_input_port("grid", "ucd", OPTIONAL);

    /* Output Port Specifications              */
    out_port = AVScreate_output_port("ucd out", "ucd");
    out_port = AVScreate_output_port("trajectories",
                                     "field 2D 3-space 2-vector irregular float");

    /* Parameter Specifications                */
    param = AVSadd_float_parameter("origin x", 0.0, FLOAT_UNBOUND, FLOAT_UNBOUND);
    AVSconnect_widget(param, "typein_real");

    param = AVSadd_float_parameter("origin y", 0.0, FLOAT_UNBOUND, FLOAT_UNBOUND);
    AVSconnect_widget(param, "typein_real");

    param = AVSadd_float_parameter("origin z", 0.0, FLOAT_UNBOUND, FLOAT_UNBOUND);
    AVSconnect_widget(param, "typein_real");

    param = AVSadd_parameter("cells x", "integer", 10, 1, INT_MAX);
    AVSconnect_widget(param, "typein_integer");

    param = AVSadd_parameter("cells y", "integer", 10, 1, INT_MAX);
    AVSconnect_widget(param, "typein_integer");

    param = AVSadd_parameter("cells z", "integer", 10, 1, INT_MAX);
    AVSconnect_widget(param, "typein_integer");

    param = AVSadd_float_parameter("cell size", 0.01, 0.0, FLOAT_UNBOUND);
    AVSconnect_widget(param, "typein_real");

    param = AVSadd_parameter("velocity", "choice", "", "", ":");
    AVSconnect_widget(param, "choice_browser");

    param = AVSadd_parameter("unsteady", "boolean", 0, 0, 1);
    AVSconnect_widget(param, "toggle");

    param = AVSadd_parameter("velocity file", "string", "", "", ":");
    AVSconnect_widget(param, "browser");

    param = AVSadd_parameter("strong hyperbolicity", "boolean", 0, 0, 1);
    AVSconnect_widget(param, "toggle");

    param = AVSadd_parameter("ABC steady", "boolean", 0, 0, 1);
    AVSconnect_widget(param, "toggle");

    param = AVSadd_float_parameter("start time", 0.0, FLOAT_UNBOUND, FLOAT_UNBOUND);
    AVSconnect_widget(param, "typein_real");

    // per time interval
    param = AVSadd_float_parameter("integration time", 0.1, 0.0, FLOAT_UNBOUND);
    AVSconnect_widget(param, "typein_real");

    param = AVSadd_parameter("time intervals", "integer", 50, 1, INT_MAX);
    AVSconnect_widget(param, "typein_integer");

    // per time interval
    param = AVSadd_parameter("integ steps max", "integer", 100, 1, INT_MAX);
    AVSconnect_widget(param, "typein_integer");

    param = AVSadd_parameter("forward", "boolean", 1, 0, 1);
    AVSconnect_widget(param, "toggle");

    param = AVSadd_parameter("smoothing range", "integer", 1, 1, INT_MAX);
    AVSconnect_widget(param, "typein_integer");

    param = AVSadd_parameter("omit boundary cells", "boolean", 0, 0, 1);
    AVSconnect_widget(param, "toggle");

    param = AVSadd_parameter("grad neigh disabled", "boolean", 1, 0, 1);
    AVSconnect_widget(param, "toggle");

    param = AVSadd_parameter("execute", "boolean", 1, 0, 1);
    AVSconnect_widget(param, "toggle");

    /* compute routine                         */
    AVSset_compute_proc((int (*)())ucd_Mz_compute);

    /* ----> START OF USER-SUPPLIED CODE SECTION #2 (ADDITIONAL SPECIFICATION INFO)*/
    /* <---- END OF USER-SUPPLIED CODE SECTION #2                            */
    return (1);
}