next up previous contents index
Next: Memory Methods on Explicit Up: Explicit Previous: The Explicit Structure

Domain_Parm

 

The parameter for the Explicit domain are stored in a the Domain_Parm instance domain_parm:

 

#CLASS Domain_Parm : Root {
  /* PRIVATE */
  DOMAIN_PARM_RUL rul;             /* ruler for the domain parameter */
  /* USER */
  int num_parts, max_parts;        /* number and maximum number of parts */
  int *flag;                       /* flag for part orientation */
  int *num_u_lines, *num_v_lines;  /* number of lines in u/v direction */
  int *num_u_sub, *num_v_sub;      /* subdivision in u/v direction */
  SPLINE1D **u_dstrbn, **v_dstrbn; /* line distributions for each part */
  t_fun **u_min, **v_min, **u_max, **v_max;          /* domain functions */
  double **u_min_d, **v_min_d, **u_max_d, **v_max_d; /* domain variables */
};

Usually you don't have to access any of the domain_parm variables, if you want to program your own compute_arg function or "compute-explicit" method you should only use the number of parts (num_parts) and the number of lines (num_u/v_lines) and subdivision (num_u/v_sub) in u- and v-direction.

There are only a few methods on Domain_Parm for memory management and (de)activating the rulers for the minimum/maximum values:

   GRAPE(dparm, "free")()
DOMAIN_PARM * dparm
Delete an instance of class Domain_Parm. All memory if freed using "list-free", the rulers are removed from the manager and deleted. See 5.4.4.1 for details on "delete"/"free".

   tex2html_wrap44892    tex2html_wrap44894
DOMAIN_PARM * dparm
"list-alloc" allocates memory for max_parts domain parts, max_parts therefore has to be set before "list-alloc" is called.

The rulers, t_funs and Splines are not created by "list-alloc", this is usually done by the function g_domain_parm_get_data (see below) which is called by "read-data" while a description file is read. "list-free" removes the rulers from the manager and deletes them before freeing the arrays.

   tex2html_wrap44896    tex2html_wrap44898    tex2html_wrap44900
DOMAIN_PARM * dparm
int state
EXPLICIT * explicit
"set" activates (state == ON) or deactivates (state == OFF) all dparm rulers, "switch-send" toggles their state. "switch-comp-send" is the Explicit counterpart of "switch-send", it just calls this method on explicit-> domain_parm.

There is a utility function for reading the Domain_Parm variables from a description file (see 8.2.5.1 for an example file):

int g_domain_parm_get_data(FILE *fp, EXPLICIT *explicit,
                           char *name, char *path, double *time)
reads in the number and maximum number of parts and allocates memory for them. Then for each part the flag, the number of lines and subdivisions for the u- and v-direction and the formulas for the time-dependent minimum and maximum values of the part are read. These formulas are compiled and evaluated to create splines for the rulers corresponding to the variables. The rulers are added to the manager, their default action is set to "parameter-changed" (see 7.4.1.5) therefore changing a ruler will recompute the surface for the new values.


next up previous contents index
Next: Memory Methods on Explicit Up: Explicit Previous: The Explicit Structure

SFB 256 Universität Bonn and IAM Universität Freiburg

Copyright © by the Sonderforschungsbereich 256 at the Institut für Angewandte Mathematik, Universität Bonn.