- Timestamp:
- 05/26/10 12:15:23 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/modules/InputToResultx/InputToResultx.cpp
r3938 r3956 13 13 void InputToResultx(Result** presult,DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* loads, DataSet* materials,Parameters* parameters,int enum_type,int id, double time, int step){ 14 14 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 15 32 int i,j,count; 16 33 … … 21 38 double* patches=NULL; //build a matrix of patch information, corresponding to the input with name enum_type 22 39 int patch_numrows,patch_numcols; 40 int max_vertices; 41 int max_nodes; 23 42 24 43 /*First, get elements*/ … … 26 45 27 46 /*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+ 29 53 30 54 /*Allocate matrix: */ … … 39 63 40 64 /*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); 42 66 43 67 /*Create result object embedding patches: */ … … 48 72 49 73 } 74 75 76 77
Note:
See TracChangeset
for help on using the changeset viewer.