[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 | /*diverse: */
|
---|
| 10 | int noerr=1;
|
---|
| 11 |
|
---|
| 12 | /*input datasets: */
|
---|
[4215] | 13 | Elements* elements=NULL;
|
---|
[4211] | 14 | Nodes* nodes=NULL;
|
---|
[4213] | 15 | Vertices* vertices=NULL;
|
---|
[4214] | 16 | Loads* loads=NULL;
|
---|
[4218] | 17 | Materials* materials=NULL;
|
---|
[3712] | 18 | Parameters* parameters=NULL;
|
---|
[3530] | 19 | int numberofnodes;
|
---|
| 20 |
|
---|
| 21 | /* output datasets: */
|
---|
| 22 | Vec sigma_g=NULL;
|
---|
| 23 |
|
---|
| 24 | /*Boot module: */
|
---|
| 25 | MODULEBOOT();
|
---|
| 26 |
|
---|
| 27 | /*checks on arguments on the matlab side: */
|
---|
| 28 | CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,&ComputeBasalStressUsage);
|
---|
| 29 |
|
---|
| 30 | /*Input datasets: */
|
---|
[4215] | 31 | FetchData((DataSet**)&elements,ELEMENTS);
|
---|
[4211] | 32 | FetchData((DataSet**)&nodes,NODES);
|
---|
[4213] | 33 | FetchData((DataSet**)&vertices,VERTICES);
|
---|
[4214] | 34 | FetchData((DataSet**)&loads,LOADS);
|
---|
[4218] | 35 | FetchData((DataSet**)&materials,MATERIALS);
|
---|
[3530] | 36 | FetchParams(¶meters,PARAMETERS);
|
---|
| 37 |
|
---|
| 38 | /*!Generate internal degree of freedom numbers: */
|
---|
[4404] | 39 | ComputeBasalStressx(&sigma_g, elements,nodes,vertices,loads,materials,parameters);
|
---|
[3530] | 40 |
|
---|
| 41 | /*write output datasets: */
|
---|
| 42 | WriteData(SIGMA,sigma_g);
|
---|
| 43 |
|
---|
| 44 | /*Free ressources: */
|
---|
| 45 | delete nodes;
|
---|
| 46 | delete vertices;
|
---|
| 47 | delete elements;
|
---|
| 48 | delete materials;
|
---|
| 49 | delete loads;
|
---|
| 50 | delete parameters;
|
---|
| 51 | VecFree(&sigma_g);
|
---|
| 52 |
|
---|
| 53 | /*end module: */
|
---|
| 54 | MODULEEND();
|
---|
| 55 | }
|
---|
| 56 |
|
---|
| 57 | void ComputeBasalStressUsage(void) {
|
---|
| 58 | printf("\n");
|
---|
[3712] | 59 | printf(" usage: [p_g] = %s(elements, nodes, vertices, loads, materials, params);\n",__FUNCT__);
|
---|
[3530] | 60 | printf("\n");
|
---|
| 61 | }
|
---|