Ignore:
Timestamp:
05/26/10 12:15:23 (15 years ago)
Author:
Eric.Larour
Message:

New results API

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/modules/InputToResultx/InputToResultx.cpp

    r3938 r3956  
    1313void InputToResultx(Result** presult,DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* loads, DataSet* materials,Parameters* parameters,int enum_type,int id, double time, int step){
    1414
     15        /*We are going to extract from the inputs, the results desired, and create a table
     16         * of patch information, that will hold, for each element that computed the result that
     17         * we desire, the id of the element, the interpolation type, the vertices ids, and the values
     18         * at the nodes (could be different from the vertices). This will be used for visualization purposed.
     19         * For example, we could build the following patch table, for velocities:
     20         *
     21         * 1 P0  1 2       4.5 NaN  NaN (constant on a beam element)
     22         * 2 P1  1 3 4     4.5 3.2  2.5  (linear values on a tria element)
     23         * 3 P0  1 5 4     5.5 NaN  NaN  (contant on a tria element)
     24         * ... etc ...
     25         *
     26         * So what do we need to build the table: the maximum number of vertices included in the table,
     27         * and the maximum number of nodal values, as well as the number of rows. Once we have that,
     28         * we ask the elements to fill their own row in the table, by looping on the elememnts.
     29         * Finally, we include the table in a Result object, that will be used by the OutputResults
     30         * module to write to disk: */
     31
    1532        int i,j,count;
    1633
     
    2138        double* patches=NULL; //build a matrix of patch information, corresponding to the input with  name enum_type
    2239        int     patch_numrows,patch_numcols;
     40        int     max_vertices;
     41        int     max_nodes;
    2342
    2443        /*First, get elements*/
     
    2645
    2746        /*Figure out size of patches matrix: */
    28         PatchesSize(elements,&patch_numrows, &patch_numcols,enum_type);
     47        PatchesSize(elements,&patch_numrows, &max_vertices, &max_nodes, enum_type);
     48
     49        patch_numcols=1+ //element id
     50                          1+ //interpolation type
     51                                  max_vertices+ //vertices
     52                                  max_nodes; //values+
    2953
    3054        /*Allocate matrix: */
     
    3963
    4064        /*Now, go through elements, their inputs with the correct enum_type, and fill the patches: */
    41         InputToPatches(elements,patches,patch_numrows,patch_numcols);
     65        InputToPatches(elements,patches,patch_numrows,max_vertices,enum_type);
    4266
    4367        /*Create result object embedding patches: */
     
    4872
    4973}
     74
     75
     76
     77
Note: See TracChangeset for help on using the changeset viewer.