[4138] | 1 | /*\file InputToResult.c
|
---|
| 2 | *\brief: duplicate input
|
---|
| 3 | */
|
---|
| 4 |
|
---|
| 5 | #include "./InputToResult.h"
|
---|
| 6 |
|
---|
| 7 | void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]){
|
---|
| 8 |
|
---|
| 9 | /*diverse: */
|
---|
| 10 | int noerr=1;
|
---|
| 11 |
|
---|
| 12 | /*input datasets: */
|
---|
| 13 | DataSet* elements=NULL;
|
---|
[4211] | 14 | Nodes* nodes=NULL;
|
---|
[4138] | 15 | DataSet* vertices=NULL;
|
---|
| 16 | DataSet* loads=NULL;
|
---|
| 17 | DataSet* materials=NULL;
|
---|
| 18 | Parameters* parameters=NULL;
|
---|
| 19 | int enum_type,step;
|
---|
| 20 | double time;
|
---|
| 21 |
|
---|
| 22 | /*Boot module: */
|
---|
| 23 | MODULEBOOT();
|
---|
| 24 |
|
---|
| 25 | /*checks on arguments on the matlab side: */
|
---|
| 26 | CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,&InputToResultUsage);
|
---|
| 27 |
|
---|
| 28 | /*Input datasets: */
|
---|
| 29 | FetchData(&elements,ELEMENTS);
|
---|
[4211] | 30 | FetchData((DataSet**)&nodes,NODES);
|
---|
[4138] | 31 | FetchData(&vertices,VERTICES);
|
---|
| 32 | FetchData(&loads,LOADS);
|
---|
| 33 | FetchData(&materials,MATERIALS);
|
---|
| 34 | FetchParams(¶meters,PARAMETERS);
|
---|
| 35 |
|
---|
| 36 | FetchData(&enum_type,ENUMTYPE);
|
---|
| 37 | FetchData(&step,STEP);
|
---|
| 38 | FetchData(&time,TIME);
|
---|
| 39 |
|
---|
| 40 | /*!Call core code: */
|
---|
| 41 | InputToResultx( elements, nodes, vertices, loads, materials,parameters,enum_type, step,time);
|
---|
| 42 |
|
---|
| 43 | /*write output : */
|
---|
| 44 | WriteData(ELEMENTSOUT,elements);
|
---|
| 45 |
|
---|
| 46 | /*Free ressources: */
|
---|
| 47 | delete elements;
|
---|
| 48 | delete nodes;
|
---|
| 49 | delete vertices;
|
---|
| 50 | delete loads;
|
---|
| 51 | delete materials;
|
---|
| 52 | delete parameters;
|
---|
| 53 |
|
---|
| 54 | /*end module: */
|
---|
| 55 | MODULEEND();
|
---|
| 56 |
|
---|
| 57 | }
|
---|
| 58 |
|
---|
| 59 | void InputToResultUsage(void)
|
---|
| 60 | {
|
---|
| 61 | _printf_("\n");
|
---|
| 62 | _printf_(" usage: [elements] = %s(elements, nodes, vertices, loads, materials, parameters, enum_type,step,time);\n",__FUNCT__);
|
---|
| 63 | _printf_("\n");
|
---|
| 64 | }
|
---|