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
RevLine 
[4108]1/*\file InputUpdateFromSolution.c
[3694]2*\brief: update elements properties using a solution vector
3*/
4
[4108]5#include "./InputUpdateFromSolution.h"
[3694]6
7void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]){
8
[4453]9 /*input datasets: */
[11708]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;
[3694]17
[4453]18 /*Boot module: */
19 MODULEBOOT();
[3694]20
[4453]21 /*checks on arguments on the matlab side: */
22 CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,&InputUpdateFromSolutionUsage);
[3694]23
[4453]24 /*Input datasets: */
[12004]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);
[3694]32
[4573]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
[4453]38 /*!Generate internal degree of freedom numbers: */
39 InputUpdateFromSolutionx(elements,nodes,vertices,loads, materials,parameters,solution);
[3694]40
[4453]41 /*write output datasets: */
[12004]42 WriteData(ELEMENTS,elements);
43 WriteData(MATERIALS,materials);
[3694]44
[4453]45 /*Free ressources: */
46 delete elements;
47 delete nodes;
48 delete vertices;
49 delete loads;
50 delete materials;
51 delete parameters;
[11708]52 xdelete(&solution);
[3694]53
[4453]54 /*end module: */
55 MODULEEND();
[3694]56}
57
[4108]58void InputUpdateFromSolutionUsage(void)
[3694]59{
[6412]60 _printf_(true,"\n");
61 _printf_(true," usage: [elements,materials] = %s(elements,nodes,vertices,loads,materials,parameters,solution);\n",__FUNCT__);
62 _printf_(true,"\n");
[3694]63}
Note: See TracBrowser for help on using the repository browser.