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

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

Updates for vertices on all modules.

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