source: issm/trunk/src/mex/InputScale/InputScale.cpp@ 8910

Last change on this file since 8910 was 8910, checked in by Eric.Larour, 14 years ago

Reorganized io/ directory quite a bit.
Separated Matlab io from the other Disk related io.
Renamed WriteData to WriteMatlabData and FetchData to FetchMatlabData.
Folded WriteParams and FetchParams into FetchMatlabData and WriteMatlabData.

File size: 1.7 KB
Line 
1/*\file InputScale.c
2 *\brief: duplicate input
3 */
4
5#include "./InputScale.h"
6
7void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]){
8
9 /*input datasets: */
10 Elements* elements=NULL;
11 Nodes* nodes=NULL;
12 Vertices* vertices=NULL;
13 Loads* loads=NULL;
14 Materials* materials=NULL;
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: */
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(&parameters,PARAMETERS);
32
33 FetchMatlabData(&enum_type,ENUMTYPE);
34 FetchMatlabData(&scale_factor,SCALEFACTOR);
35
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
41 /*!Call core code: */
42 InputScalex( elements, nodes, vertices, loads, materials,parameters,enum_type, scale_factor);
43
44 /*write output : */
45 WriteMatlabData(ELEMENTSOUT,elements);
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
60void InputScaleUsage(void)
61{
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");
65}
Note: See TracBrowser for help on using the repository browser.