| [4108] | 1 | /*\file InputUpdateFromSolution.c
|
|---|
| [3694] | 2 | *\brief: update elements properties using a solution vector
|
|---|
| 3 | */
|
|---|
| 4 |
|
|---|
| [4108] | 5 | #include "./InputUpdateFromSolution.h"
|
|---|
| [3694] | 6 |
|
|---|
| 7 | void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]){
|
|---|
| 8 |
|
|---|
| [4453] | 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;
|
|---|
| [11684] | 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: */
|
|---|
| [8910] | 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(¶meters,PARAMETERSIN);
|
|---|
| 31 | FetchMatlabData(&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: */
|
|---|
| [8910] | 42 | WriteMatlabData(ELEMENTS,elements);
|
|---|
| 43 | WriteMatlabData(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;
|
|---|
| [11684] | 52 | delete solution;
|
|---|
| [3694] | 53 |
|
|---|
| [4453] | 54 | /*end module: */
|
|---|
| 55 | MODULEEND();
|
|---|
| [3694] | 56 | }
|
|---|
| 57 |
|
|---|
| [4108] | 58 | void 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 | }
|
|---|