source: issm/trunk/src/mex/InputToResult/InputToResult.cpp@ 4453

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

Fixed some bugs in DakotaResponses and InputUpdateFromDakota modules.
Took out noerr variable in many of the modules.

File size: 1.8 KB
Line 
1/*\file InputToResult.c
2 *\brief: duplicate input
3 */
4
5#include "./InputToResult.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,step;
17 double time;
18
19 /*Boot module: */
20 MODULEBOOT();
21
22 /*checks on arguments on the matlab side: */
23 //CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,&ContourToMeshUsage); Cant' use it here, as we have variable inputs.
24 if((nlhs!=NLHS) || (nrhs!=7 && nrhs!=9)){
25 InputToResultUsage();
26 ISSMERROR(" usage. See above");
27 }
28
29 /*Input datasets: */
30 FetchData((DataSet**)&elements,ELEMENTS);
31 FetchData((DataSet**)&nodes,NODES);
32 FetchData((DataSet**)&vertices,VERTICES);
33 FetchData((DataSet**)&loads,LOADS);
34 FetchData((DataSet**)&materials,MATERIALS);
35 FetchParams(&parameters,PARAMETERS);
36
37 FetchData(&enum_type,ENUMTYPE);
38
39 if(nrhs==9){
40 FetchData(&step,STEP);
41 FetchData(&time,TIME);
42
43 /*!Call core code: */
44 InputToResultx( elements, nodes, vertices, loads, materials,parameters,enum_type, step,time);
45 }
46 else{
47
48 /*!Call core code: */
49 InputToResultx( elements, nodes, vertices, loads, materials,parameters,enum_type);
50 }
51
52 /*write output : */
53 WriteData(ELEMENTSOUT,elements);
54
55 /*Free ressources: */
56 delete elements;
57 delete nodes;
58 delete vertices;
59 delete loads;
60 delete materials;
61 delete parameters;
62
63 /*end module: */
64 MODULEEND();
65
66}
67
68void InputToResultUsage(void)
69{
70 _printf_("\n");
71 _printf_(" usage: [elements] = %s(elements, nodes, vertices, loads, materials, parameters, enum_type,step,time);\n",__FUNCT__);
72 _printf_(" usage: [elements] = %s(elements, nodes, vertices, loads, materials, parameters, enum_type);\n",__FUNCT__);
73 _printf_("\n");
74}
Note: See TracBrowser for help on using the repository browser.