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