source: issm/branches/trunk-jpl-damage/src/mex/ConstraintsState/ConstraintsState.cpp@ 11427

Last change on this file since 11427 was 8910, checked in by Eric.Larour, 14 years ago

Reorganized io/ directory quite a bit.
Separated Matlab io from the other Disk related io.
Renamed WriteData to WriteMatlabData and FetchData to FetchMatlabData.
Folded WriteParams and FetchParams into FetchMatlabData and WriteMatlabData.

File size: 1.8 KB
Line 
1/*\file ConstraintsState.c
2 *\brief: set up penalty constraints
3 */
4
5#include "./ConstraintsState.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
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: */
28 FetchMatlabData((DataSet**)&elements,ELEMENTS);
29 FetchMatlabData((DataSet**)&nodes,NODES);
30 FetchMatlabData((DataSet**)&vertices,VERTICES);
31 FetchMatlabData((DataSet**)&loads,LOADSIN);
32 FetchMatlabData((DataSet**)&materials,MATERIALS);
33 FetchMatlabData(&parameters,PARAMETERS);
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: */
44 WriteMatlabData(LOADS,loads);
45 WriteMatlabData(CONVERGED,converged);
46 WriteMatlabData(NUMUNSTABLECONSTRAINTS,num_unstable_constraints);
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
60void 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}
Note: See TracBrowser for help on using the repository browser.