[4138] | 1 | /*\file InputScale.c
|
---|
| 2 | *\brief: duplicate input
|
---|
| 3 | */
|
---|
| 4 |
|
---|
| 5 | #include "./InputScale.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;
|
---|
[4138] | 15 | Parameters* parameters=NULL;
|
---|
| 16 | int enum_type;
|
---|
| 17 | double scale_factor;
|
---|
| 18 |
|
---|
| 19 | /*Boot module: */
|
---|
| 20 | MODULEBOOT();
|
---|
| 21 |
|
---|
| 22 | /*checks on arguments on the matlab side: */
|
---|
| 23 | CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,&InputScaleUsage);
|
---|
| 24 |
|
---|
| 25 | /*Input datasets: */
|
---|
[8910] | 26 | FetchMatlabData((DataSet**)&elements,ELEMENTS);
|
---|
| 27 | FetchMatlabData((DataSet**)&nodes,NODES);
|
---|
| 28 | FetchMatlabData((DataSet**)&vertices,VERTICES);
|
---|
| 29 | FetchMatlabData((DataSet**)&loads,LOADS);
|
---|
| 30 | FetchMatlabData((DataSet**)&materials,MATERIALS);
|
---|
| 31 | FetchMatlabData(¶meters,PARAMETERS);
|
---|
[4138] | 32 |
|
---|
[8910] | 33 | FetchMatlabData(&enum_type,ENUMTYPE);
|
---|
| 34 | FetchMatlabData(&scale_factor,SCALEFACTOR);
|
---|
[4138] | 35 |
|
---|
[4573] | 36 | /*configure: */
|
---|
| 37 | elements-> Configure(elements,loads, nodes,vertices, materials,parameters);
|
---|
| 38 | nodes-> Configure(elements,loads, nodes,vertices, materials,parameters);
|
---|
| 39 | loads-> Configure(elements, loads, nodes,vertices, materials,parameters);
|
---|
| 40 |
|
---|
[4138] | 41 | /*!Call core code: */
|
---|
| 42 | InputScalex( elements, nodes, vertices, loads, materials,parameters,enum_type, scale_factor);
|
---|
| 43 |
|
---|
| 44 | /*write output : */
|
---|
[8910] | 45 | WriteMatlabData(ELEMENTSOUT,elements);
|
---|
[4138] | 46 |
|
---|
| 47 | /*Free ressources: */
|
---|
| 48 | delete elements;
|
---|
| 49 | delete nodes;
|
---|
| 50 | delete vertices;
|
---|
| 51 | delete loads;
|
---|
| 52 | delete materials;
|
---|
| 53 | delete parameters;
|
---|
| 54 |
|
---|
| 55 | /*end module: */
|
---|
| 56 | MODULEEND();
|
---|
| 57 |
|
---|
| 58 | }
|
---|
| 59 |
|
---|
| 60 | void InputScaleUsage(void)
|
---|
| 61 | {
|
---|
[6412] | 62 | _printf_(true,"\n");
|
---|
| 63 | _printf_(true," usage: [elements] = %s(elements, nodes, vertices, loads, materials, parameters, enum_type,scale_factor);\n",__FUNCT__);
|
---|
| 64 | _printf_(true,"\n");
|
---|
[4138] | 65 | }
|
---|