next up previous contents
Next: Adding variables and commands Up: Programmer's manual Previous: Programmer's manual

Subsections

Data structures, control flags and macros

The user data structures and the macros for accessing them are defined in magproblem.h, the control flags and their macros in mag.h.

Elements

Each element can contain information about the error which was estimated for this element. Whenever a new element is created (function CreateElement in memory.c), heap space is allocated for the user data structure. For the magnetization problem this is one variable of type COORD (cf. misc/misc.h), which stores the estimated error. However, there is no ``default'' error for a new element. Therefore it is marked to contain no valid error. The indicator for this property is the first bit of the element's control word. If it is set (1) the error is valid, if it is cleared (0) the error is not valid. Then the value of the error can be imported using the imperror command (cf. section 2.6), which automatically sets the corresponding bit in the control word. The latter is done by the macro SET_ERROR_OK. ERROR_OK can be used to determine the current status and RESET_ERROR_OK to reset the error bit. The error itself can be accessed by the ERROR macro.

Vertices

In the user data structure of each vertex a magnetization vector can be stored if a magnetization problem is initialized. The third bit of the control word indicates if the values for the magnetization vector are valid or not. There are three macros SET_SOL_OK, RESET_SOL_OK and SOL_OK They work analogously to the corresponding macros for an element's error. The three components of the magnetization vector are accessible by the macros M1, M2 and M3. All geometrical and numerical data belonging to one vertex are stored in its data structure. Therefore vertex and node are used equivalently. On the contrary, Bey's convection-diffusion problem of AGM 3D does distinguish between nodes and vertices: Geometrical and graphical information is stored in the vertices' data structure whereas numerical data are contained in the nodes' data structure.


next up previous contents
Next: Adding variables and commands Up: Programmer's manual Previous: Programmer's manual
Werner Scholz
10/30/1998