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

Last change on this file since 12004 was 12004, checked in by cborstad, 13 years ago

merged trunk-jpl into trunk-jpl-damage through revision 11990

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 Vector *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 FetchData((DataSet**)&elements,ELEMENTSIN);
26 FetchData((DataSet**)&nodes,NODESIN);
27 FetchData((DataSet**)&vertices,VERTICESIN);
28 FetchData((DataSet**)&loads,LOADSIN);
29 FetchData((DataSet**)&materials,MATERIALSIN);
30 FetchData(&parameters,PARAMETERSIN);
31 FetchData(&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 WriteData(ELEMENTS,elements);
43 WriteData(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 xdelete(&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.