[3530] | 1 | /*\file ComputeBasalStress.c
|
---|
| 2 | *\brief: recover pressure from elements
|
---|
| 3 | */
|
---|
| 4 |
|
---|
| 5 | #include "./ComputeBasalStress.h"
|
---|
| 6 |
|
---|
| 7 | void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]){
|
---|
| 8 |
|
---|
| 9 | /*input datasets: */
|
---|
[4215] | 10 | Elements* elements=NULL;
|
---|
[4211] | 11 | Nodes* nodes=NULL;
|
---|
[4213] | 12 | Vertices* vertices=NULL;
|
---|
[4214] | 13 | Loads* loads=NULL;
|
---|
[4218] | 14 | Materials* materials=NULL;
|
---|
[3712] | 15 | Parameters* parameters=NULL;
|
---|
[3530] | 16 | int numberofnodes;
|
---|
| 17 |
|
---|
| 18 | /* output datasets: */
|
---|
| 19 | Vec sigma_g=NULL;
|
---|
| 20 |
|
---|
| 21 | /*Boot module: */
|
---|
| 22 | MODULEBOOT();
|
---|
| 23 |
|
---|
| 24 | /*checks on arguments on the matlab side: */
|
---|
| 25 | CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,&ComputeBasalStressUsage);
|
---|
| 26 |
|
---|
| 27 | /*Input datasets: */
|
---|
[8910] | 28 | FetchMatlabData((DataSet**)&elements,ELEMENTS);
|
---|
| 29 | FetchMatlabData((DataSet**)&nodes,NODES);
|
---|
| 30 | FetchMatlabData((DataSet**)&vertices,VERTICES);
|
---|
| 31 | FetchMatlabData((DataSet**)&loads,LOADS);
|
---|
| 32 | FetchMatlabData((DataSet**)&materials,MATERIALS);
|
---|
| 33 | FetchMatlabData(¶meters,PARAMETERS);
|
---|
[3530] | 34 |
|
---|
[4573] | 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 |
|
---|
[3530] | 40 | /*!Generate internal degree of freedom numbers: */
|
---|
[4404] | 41 | ComputeBasalStressx(&sigma_g, elements,nodes,vertices,loads,materials,parameters);
|
---|
[3530] | 42 |
|
---|
| 43 | /*write output datasets: */
|
---|
[8910] | 44 | WriteMatlabData(SIGMA,sigma_g);
|
---|
[3530] | 45 |
|
---|
| 46 | /*Free ressources: */
|
---|
| 47 | delete nodes;
|
---|
| 48 | delete vertices;
|
---|
| 49 | delete elements;
|
---|
| 50 | delete materials;
|
---|
| 51 | delete loads;
|
---|
| 52 | delete parameters;
|
---|
| 53 | VecFree(&sigma_g);
|
---|
| 54 |
|
---|
| 55 | /*end module: */
|
---|
| 56 | MODULEEND();
|
---|
| 57 | }
|
---|
| 58 |
|
---|
| 59 | void ComputeBasalStressUsage(void) {
|
---|
| 60 | printf("\n");
|
---|
[3712] | 61 | printf(" usage: [p_g] = %s(elements, nodes, vertices, loads, materials, params);\n",__FUNCT__);
|
---|
[3530] | 62 | printf("\n");
|
---|
| 63 | }
|
---|