[8404] | 1 | /*\file ConstraintsState.c
|
---|
| 2 | *\brief: set up penalty constraints
|
---|
| 3 | */
|
---|
| 4 |
|
---|
| 5 | #include "./ConstraintsState.h"
|
---|
| 6 |
|
---|
| 7 | void 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 |
|
---|
| 17 | /*output: */
|
---|
| 18 | int converged;
|
---|
| 19 | int num_unstable_constraints;
|
---|
| 20 |
|
---|
| 21 | /*Boot module: */
|
---|
| 22 | MODULEBOOT();
|
---|
| 23 |
|
---|
| 24 | /*checks on arguments on the matlab side: */
|
---|
| 25 | CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,&ConstraintsStateUsage);
|
---|
| 26 |
|
---|
| 27 | /*Input datasets: */
|
---|
[12004] | 28 | FetchData((DataSet**)&elements,ELEMENTS);
|
---|
| 29 | FetchData((DataSet**)&nodes,NODES);
|
---|
| 30 | FetchData((DataSet**)&vertices,VERTICES);
|
---|
| 31 | FetchData((DataSet**)&loads,LOADSIN);
|
---|
| 32 | FetchData((DataSet**)&materials,MATERIALS);
|
---|
| 33 | FetchData(¶meters,PARAMETERS);
|
---|
[8404] | 34 |
|
---|
| 35 | /*configure: */
|
---|
| 36 | elements-> Configure(elements,loads, nodes,vertices, materials,parameters);
|
---|
| 37 | nodes-> Configure(elements,loads, nodes,vertices, materials,parameters);
|
---|
| 38 | loads-> Configure(elements, loads, nodes,vertices, materials,parameters);
|
---|
| 39 |
|
---|
| 40 | /*!Generate internal degree of freedom numbers: */
|
---|
| 41 | ConstraintsStatex(&converged, &num_unstable_constraints, elements,nodes,vertices, loads,materials,parameters);
|
---|
| 42 |
|
---|
| 43 | /*write output datasets: */
|
---|
[12004] | 44 | WriteData(LOADS,loads);
|
---|
| 45 | WriteData(CONVERGED,converged);
|
---|
| 46 | WriteData(NUMUNSTABLECONSTRAINTS,num_unstable_constraints);
|
---|
[8404] | 47 |
|
---|
| 48 | /*Free ressources: */
|
---|
| 49 | delete elements;
|
---|
| 50 | delete nodes;
|
---|
| 51 | delete vertices;
|
---|
| 52 | delete loads;
|
---|
| 53 | delete materials;
|
---|
| 54 | delete parameters;
|
---|
| 55 |
|
---|
| 56 | /*end module: */
|
---|
| 57 | MODULEEND();
|
---|
| 58 | }
|
---|
| 59 |
|
---|
| 60 | void ConstraintsStateUsage(void)
|
---|
| 61 | {
|
---|
| 62 | _printf_(true,"\n");
|
---|
| 63 | _printf_(true," usage: [loads, constraints_converged, num_unstable_constraints] = %s(elements,nodes,vertices,loads,materials,params);\n",__FUNCT__);
|
---|
| 64 | _printf_(true,"\n");
|
---|
| 65 | }
|
---|