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

Last change on this file since 6412 was 6412, checked in by Mathieu Morlighem, 14 years ago

moved ISSMERROR to _error_, ISSMASSERT to _assert_ and ISSMPRINTF to _printf_

File size: 1.6 KB
RevLine 
[4138]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: */
[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: */
[4215]26 FetchData((DataSet**)&elements,ELEMENTS);
[4211]27 FetchData((DataSet**)&nodes,NODES);
[4213]28 FetchData((DataSet**)&vertices,VERTICES);
[4214]29 FetchData((DataSet**)&loads,LOADS);
[4218]30 FetchData((DataSet**)&materials,MATERIALS);
[4138]31 FetchParams(&parameters,PARAMETERS);
32
33 FetchData(&enum_type,ENUMTYPE);
34 FetchData(&scale_factor,SCALEFACTOR);
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 : */
45 WriteData(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{
[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}
Note: See TracBrowser for help on using the repository browser.