| [4182] | 1 | /*\file OutputResults.c
|
|---|
| 2 | *\brief: output results inside elements, and in femmodel
|
|---|
| 3 | */
|
|---|
| 4 |
|
|---|
| 5 | #include "./OutputResults.h"
|
|---|
| 6 |
|
|---|
| 7 | void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]){
|
|---|
| 8 |
|
|---|
| 9 | /*input datasets: */
|
|---|
| [4215] | 10 | Elements* elements=NULL;
|
|---|
| [4211] | 11 | Nodes* nodes=NULL;
|
|---|
| [4213] | 12 | Vertices* vertices=NULL;
|
|---|
| [4214] | 13 | Loads* loads=NULL;
|
|---|
| [4218] | 14 | Materials* materials=NULL;
|
|---|
| [4182] | 15 | Parameters* parameters=NULL;
|
|---|
| [6372] | 16 | Results* results=NULL;
|
|---|
| [4182] | 17 |
|
|---|
| 18 | /* output datasets: */
|
|---|
| 19 | mxArray* dataref=NULL;
|
|---|
| 20 |
|
|---|
| 21 | /*Boot module: */
|
|---|
| 22 | MODULEBOOT();
|
|---|
| 23 |
|
|---|
| 24 | /*checks on arguments on the matlab side: */
|
|---|
| 25 | CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,&OutputResultsUsage);
|
|---|
| 26 |
|
|---|
| 27 | /*Input datasets: */
|
|---|
| [8910] | 28 | FetchMatlabData((DataSet**)&elements,ELEMENTS);
|
|---|
| 29 | FetchMatlabData((DataSet**)&nodes,NODES);
|
|---|
| 30 | FetchMatlabData((DataSet**)&vertices,VERTICES);
|
|---|
| 31 | FetchMatlabData((DataSet**)&loads,LOADS);
|
|---|
| 32 | FetchMatlabData((DataSet**)&materials,MATERIALS);
|
|---|
| 33 | FetchMatlabData(¶meters,PARAMETERS);
|
|---|
| 34 | FetchMatlabData((DataSet**)&results,RESULTS);
|
|---|
| [4182] | 35 |
|
|---|
| [10522] | 36 | /*results might be NULL, allocate: */
|
|---|
| 37 | if(!results)results=new Results();
|
|---|
| [4306] | 38 |
|
|---|
| [4573] | 39 | /*configure: */
|
|---|
| 40 | elements-> Configure(elements,loads, nodes,vertices, materials,parameters);
|
|---|
| 41 | nodes-> Configure(elements,loads, nodes,vertices, materials,parameters);
|
|---|
| 42 | loads-> Configure(elements, loads, nodes,vertices, materials,parameters);
|
|---|
| 43 |
|
|---|
| [4182] | 44 | /*Call "x" code layer: */
|
|---|
| [11827] | 45 | OutputResultsx(&dataref, elements,nodes,vertices,loads,materials,parameters,results);
|
|---|
| [4182] | 46 |
|
|---|
| 47 | /*write output datasets: */
|
|---|
| 48 | plhs[0]=dataref;
|
|---|
| 49 |
|
|---|
| 50 | /*Free ressources: */
|
|---|
| 51 | delete elements;
|
|---|
| 52 | delete nodes;
|
|---|
| 53 | delete vertices;
|
|---|
| 54 | delete loads;
|
|---|
| 55 | delete materials;
|
|---|
| 56 | delete parameters;
|
|---|
| 57 | delete results;
|
|---|
| 58 |
|
|---|
| 59 | /*end module: */
|
|---|
| 60 | MODULEEND();
|
|---|
| 61 | }
|
|---|
| 62 |
|
|---|
| 63 | void OutputResultsUsage(void)
|
|---|
| 64 | {
|
|---|
| [6412] | 65 | _printf_(true,"\n");
|
|---|
| 66 | _printf_(true," usage: [results] = %s(elements,nodes,vertices,loads,materials,parameters,results);\n",__FUNCT__);
|
|---|
| 67 | _printf_(true,"\n");
|
|---|
| [4182] | 68 | }
|
|---|