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