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: */
|
---|
13 | Elements* elements=NULL;
|
---|
14 | Nodes* nodes=NULL;
|
---|
15 | Vertices* vertices=NULL;
|
---|
16 | Loads* loads=NULL;
|
---|
17 | Materials* materials=NULL;
|
---|
18 | Parameters* parameters=NULL;
|
---|
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: */
|
---|
31 | FetchData((DataSet**)&elements,ELEMENTS);
|
---|
32 | FetchData((DataSet**)&nodes,NODES);
|
---|
33 | FetchData((DataSet**)&vertices,VERTICES);
|
---|
34 | FetchData((DataSet**)&loads,LOADS);
|
---|
35 | FetchData((DataSet**)&materials,MATERIALS);
|
---|
36 | FetchParams(¶meters,PARAMETERS);
|
---|
37 |
|
---|
38 | /*!Generate internal degree of freedom numbers: */
|
---|
39 | ComputeBasalStressx(&sigma_g, elements,nodes,vertices,loads,materials,parameters);
|
---|
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");
|
---|
59 | printf(" usage: [p_g] = %s(elements, nodes, vertices, loads, materials, params);\n",__FUNCT__);
|
---|
60 | printf("\n");
|
---|
61 | }
|
---|