source: issm/trunk/src/mex/ComputeBasalStress/ComputeBasalStress.cpp@ 3712

Last change on this file since 3712 was 3712, checked in by Eric.Larour, 15 years ago

Called modules.h instead of issm.h

File size: 1.5 KB
RevLine 
[3530]1/*\file ComputeBasalStress.c
2 *\brief: recover pressure from elements
3 */
4
5#include "./ComputeBasalStress.h"
6
7void 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(&parameters,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
61void 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}
Note: See TracBrowser for help on using the repository browser.