source: issm/trunk/src/mex/SystemMatrices/SystemMatrices.cpp@ 3715

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

Serial compiles

File size: 1.9 KB
Line 
1/*\file SystemMatrices.c
2 *\brief: build system matrices (stiffness matrix, loads vector)
3 */
4
5#include "./SystemMatrices.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;
18 Parameters* parameters=NULL;
19 int kflag,pflag;
20 int connectivity;
21 int numberofdofspernode;
22 int analysis_type;
23 int sub_analysis_type;
24
25 /* output datasets: */
26 Mat Kgg=NULL;
27 Vec pg=NULL;
28
29 /*Boot module: */
30 MODULEBOOT();
31
32 /*checks on arguments on the matlab side: */
33 CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,&SystemMatricesUsage);
34
35 /*Input datasets: */
36 FetchData(&elements,ELEMENTS);
37 FetchData(&nodes,NODES);
38 FetchData(&vertices,VERTICES);
39 FetchData(&loads,LOADS);
40 FetchData(&materials,MATERIALS);
41 FetchParams(&parameters,PARAMETERS);
42
43 /*parameters: */
44 parameters->FindParam(&kflag,KflagEnum);
45 parameters->FindParam(&pflag,PflagEnum);
46 parameters->FindParam(&connectivity,ConnectivityEnum);
47 parameters->FindParam(&numberofdofspernode,NumberOfDofsPerNodeEnum);
48
49 FetchData(&analysis_type,ANALYSIS);
50 FetchData(&sub_analysis_type,SUBANALYSIS);
51
52 /*!Generate internal degree of freedom numbers: */
53 SystemMatricesx(&Kgg, &pg,elements,nodes,vertices,loads,materials,parameters,kflag,pflag,connectivity,numberofdofspernode,analysis_type,sub_analysis_type);
54
55 /*write output datasets: */
56 WriteData(KGG,Kgg);
57 WriteData(PG,pg);
58
59
60 /*Free ressources: */
61 delete elements;
62 delete nodes;
63 delete vertices;
64 delete loads;
65 delete materials;
66 delete parameters;
67 MatFree(&Kgg);
68 VecFree(&pg);
69
70 /*end module: */
71 MODULEEND();
72}
73
74void SystemMatricesUsage(void)
75{
76 _printf_("\n");
77 _printf_(" usage: [Kgg,pg] = %s(elements,nodes,vertices,loads,materials,params,analysis_type);\n",__FUNCT__);
78 _printf_("\n");
79}
Note: See TracBrowser for help on using the repository browser.