[4098] | 1 | /*\file InputControlConstrain.c
|
---|
| 2 | *\brief: update elements properties using an input vector
|
---|
| 3 | */
|
---|
[1] | 4 |
|
---|
[4098] | 5 | #include "./InputControlConstrain.h"
|
---|
[1] | 6 |
|
---|
| 7 | void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]){
|
---|
| 8 |
|
---|
[4098] | 9 | /*diverse: */
|
---|
| 10 | int noerr = 1;
|
---|
[1] | 11 |
|
---|
[4098] | 12 | /*input datasets: */
|
---|
| 13 | DataSet *elements = NULL;
|
---|
[4211] | 14 | Nodes *nodes = NULL;
|
---|
[4098] | 15 | DataSet *vertices = NULL;
|
---|
| 16 | DataSet *loads = NULL;
|
---|
| 17 | DataSet *materials = NULL;
|
---|
| 18 | Parameters *parameters = NULL;
|
---|
| 19 | int control_type;
|
---|
| 20 | double cm_min;
|
---|
| 21 | double cm_max;
|
---|
[1] | 22 |
|
---|
[4098] | 23 | /*Boot module: */
|
---|
| 24 | MODULEBOOT();
|
---|
[1] | 25 |
|
---|
[4098] | 26 | /*checks on arguments on the matlab side: */
|
---|
| 27 | CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,&InputControlConstrainUsage);
|
---|
[1] | 28 |
|
---|
[4098] | 29 | /*Input datasets: */
|
---|
| 30 | FetchData(&elements,ELEMENTSIN);
|
---|
[4211] | 31 | FetchData((DataSet**)&nodes,NODESIN);
|
---|
[4098] | 32 | FetchData(&vertices,VERTICESIN);
|
---|
| 33 | FetchData(&loads,LOADSIN);
|
---|
| 34 | FetchData(&materials,MATERIALSIN);
|
---|
| 35 | FetchParams(¶meters,PARAMETERSIN);
|
---|
| 36 | FetchData(&control_type,CONTROLTYPE);
|
---|
| 37 | FetchData(&cm_min,CMMIN);
|
---|
| 38 | FetchData(&cm_max,CMMAX);
|
---|
[1] | 39 |
|
---|
[4098] | 40 | /*call "x" code layer*/
|
---|
| 41 | InputControlConstrainx(elements,nodes,vertices,loads, materials,parameters,control_type,cm_min,cm_max);
|
---|
[2333] | 42 |
|
---|
[4098] | 43 | /*write output datasets: */
|
---|
| 44 | WriteData(ELEMENTS,elements);
|
---|
| 45 | WriteData(NODES,nodes);
|
---|
| 46 | WriteData(VERTICES,vertices);
|
---|
| 47 | WriteData(LOADS,loads);
|
---|
| 48 | WriteData(MATERIALS,materials);
|
---|
| 49 | WriteParams(PARAMETERS,parameters);
|
---|
[1] | 50 |
|
---|
[4098] | 51 | /*Free ressources: */
|
---|
| 52 | delete elements;
|
---|
| 53 | delete nodes;
|
---|
| 54 | delete vertices;
|
---|
| 55 | delete loads;
|
---|
| 56 | delete materials;
|
---|
| 57 | delete parameters;
|
---|
[1] | 58 |
|
---|
[4098] | 59 | /*end module: */
|
---|
| 60 | MODULEEND();
|
---|
[1] | 61 | }
|
---|
| 62 |
|
---|
[4098] | 63 | void InputControlConstrainUsage(void)
|
---|
[1] | 64 | {
|
---|
| 65 | _printf_("\n");
|
---|
[4098] | 66 | _printf_(" usage: [elements,nodes,vertices,loads,materials,parameters] = %s(elements,nodes,vertices,loads,materials,parameters,control_type,cm_min,cm_max);\n",__FUNCT__);
|
---|
[1] | 67 | _printf_("\n");
|
---|
| 68 | }
|
---|