source: issm/branches/trunk-jpl-damage/src/mex/InputUpdateFromSolution/InputUpdateFromSolution.cpp@ 11427

Last change on this file since 11427 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.8 KB
Line 
1/*\file InputUpdateFromSolution.c
2*\brief: update elements properties using a solution vector
3*/
4
5#include "./InputUpdateFromSolution.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 Vec solution=NULL;
17
18 /*Boot module: */
19 MODULEBOOT();
20
21 /*checks on arguments on the matlab side: */
22 CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,&InputUpdateFromSolutionUsage);
23
24 /*Input datasets: */
25 FetchMatlabData((DataSet**)&elements,ELEMENTSIN);
26 FetchMatlabData((DataSet**)&nodes,NODESIN);
27 FetchMatlabData((DataSet**)&vertices,VERTICESIN);
28 FetchMatlabData((DataSet**)&loads,LOADSIN);
29 FetchMatlabData((DataSet**)&materials,MATERIALSIN);
30 FetchMatlabData(&parameters,PARAMETERSIN);
31 FetchMatlabData(&solution,SOLUTION);
32
33 /*configure: */
34 elements-> Configure(elements,loads, nodes,vertices, materials,parameters);
35 nodes-> Configure(elements,loads, nodes,vertices, materials,parameters);
36 loads-> Configure(elements, loads, nodes,vertices, materials,parameters);
37
38 /*!Generate internal degree of freedom numbers: */
39 InputUpdateFromSolutionx(elements,nodes,vertices,loads, materials,parameters,solution);
40
41 /*write output datasets: */
42 WriteMatlabData(ELEMENTS,elements);
43 WriteMatlabData(MATERIALS,materials);
44
45 /*Free ressources: */
46 delete elements;
47 delete nodes;
48 delete vertices;
49 delete loads;
50 delete materials;
51 delete parameters;
52 VecFree(&solution);
53
54 /*end module: */
55 MODULEEND();
56}
57
58void InputUpdateFromSolutionUsage(void)
59{
60 _printf_(true,"\n");
61 _printf_(true," usage: [elements,materials] = %s(elements,nodes,vertices,loads,materials,parameters,solution);\n",__FUNCT__);
62 _printf_(true,"\n");
63}
Note: See TracBrowser for help on using the repository browser.