source: issm/trunk/src/c/objects/FemModel.cpp@ 2316

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

Started switching to new DofVec framework.
partition, tpartition and now yg are dofvecs.

File size: 5.4 KB
Line 
1/*!\file FemModel.c
2 * \brief: implementation of the FemModel object
3 */
4
5#ifdef HAVE_CONFIG_H
6 #include "config.h"
7#else
8#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
9#endif
10
11#include "./FemModel.h"
12#include "stdio.h"
13#include "../shared/shared.h"
14
15FemModel::FemModel(){
16
17 elements=NULL;
18 nodes=NULL;
19 constraints=NULL;
20 loads=NULL;
21 materials=NULL;
22 parameters=NULL;
23
24 partition=NULL;
25 tpartition=NULL;
26 yg=NULL;
27 Rmg=NULL;
28 nodesets=NULL;
29 ys=NULL;
30 ys0=NULL;
31 Gmn=NULL;
32
33}
34
35FemModel::FemModel(DataSet* femmodel_elements,DataSet* femmodel_nodes,DataSet* femmodel_constraints,DataSet* femmodel_loads,
36 DataSet* femmodel_materials,DataSet* femmodel_parameters, DofVec* femmodel_partition,DofVec* femmodel_tpartition,DofVec* femmodel_yg,
37 Mat femmodel_Rmg,Mat femmodel_Gmn,NodeSets* femmodel_nodesets,Vec femmodel_ys,Vec femmodel_ys0){
38
39
40 elements=femmodel_elements;
41 nodes=femmodel_nodes;
42 constraints=femmodel_constraints;
43 loads=femmodel_loads;
44 materials=femmodel_materials;
45 parameters=femmodel_parameters;
46
47 partition=femmodel_partition;
48 tpartition=femmodel_tpartition;
49 yg=femmodel_yg;
50 Rmg=femmodel_Rmg;
51 nodesets=femmodel_nodesets;
52 ys=femmodel_ys;
53 ys0=femmodel_ys0;
54 Gmn=femmodel_Gmn;
55
56}
57
58FemModel::~FemModel(){
59
60 delete elements;
61 delete nodes;
62 delete loads;
63 delete constraints;
64 delete materials;
65 delete parameters;
66
67 delete partition;
68 delete tpartition;
69 delete yg;
70 MatFree(&Rmg);
71 delete nodesets;
72 VecFree(&ys);
73 VecFree(&ys0);
74 MatFree(&Gmn);
75
76}
77
78#undef __FUNCT__
79#define __FUNCT__ "FemModel::Echo"
80
81void FemModel::Echo(void){
82
83 printf("FemModels echo: \n");
84 printf(" elements: %p\n",elements);
85 printf(" nodes: %p\n",nodes);
86 printf(" loads: %p\n",loads);
87 printf(" materials: %p\n",materials);
88 printf(" parameters: %p\n",parameters);
89
90 printf(" partition: %p\n",partition);
91 printf(" tpartition: %p\n",tpartition);
92 printf(" yg: %p\n",yg);
93 printf(" Rmg: %p\n",Rmg);
94 printf(" nodesets: %p\n",nodesets);
95 printf(" ys: %p\n",ys);
96 printf(" ys0: %p\n",ys0);
97 printf(" Gmn: %p\n",Gmn);
98
99}
100#undef __FUNCT__
101#define __FUNCT__ "FemModel::DeepEcho"
102
103void FemModel::DeepEcho(void){
104
105 printf("FemModels echo: \n");
106 printf(" elements: \n");
107 elements->Echo();
108 printf(" nodes: \n");
109 nodes->Echo();
110 printf(" loads: \n");
111 nodes->Echo();
112 printf(" materials: \n");
113 nodes->Echo();
114 printf(" parameters: \n");
115 nodes->Echo();
116
117 printf(" partition: \n");
118 partition->Echo();
119 printf(" tpartition: \n");
120 tpartition->Echo();
121 printf(" yg: \n");
122 yg->Echo();
123 printf(" Rmg: \n");
124 MatView(Rmg,PETSC_VIEWER_STDOUT_WORLD);
125 printf(" nodesets: \n");
126 nodesets->Echo();
127 printf(" ys: \n");
128 VecView(ys,PETSC_VIEWER_STDOUT_WORLD);
129 printf(" ys0: \n");
130 VecView(ys0,PETSC_VIEWER_STDOUT_WORLD);
131 printf(" Gmn: \n");
132 MatView(Gmn,PETSC_VIEWER_STDOUT_WORLD);
133
134}
135#undef __FUNCT__
136#define __FUNCT__ "FemModel::GetId"
137int FemModel::GetId(void){
138 throw ErrorException(__FUNCT__,exprintf("%s%s",__FUNCT__," error message: not implemented yet!"));
139}
140
141#undef __FUNCT__
142#define __FUNCT__ "FemModel::MyRank"
143int FemModel::MyRank(void){
144 throw ErrorException(__FUNCT__,exprintf("%s%s",__FUNCT__," error message: not implemented yet!"));
145}
146
147#undef __FUNCT__
148#define __FUNCT__ "FemModel::Marshall"
149void FemModel::Marshall(char** pmarshalled_dataset){
150 throw ErrorException(__FUNCT__,exprintf("%s%s",__FUNCT__," error message: not implemented yet!"));
151}
152
153#undef __FUNCT__
154#define __FUNCT__ "FemModel::MarshallSize"
155int FemModel::MarshallSize(void){
156 throw ErrorException(__FUNCT__,exprintf("%s%s",__FUNCT__," error message: not implemented yet!"));
157}
158#undef __FUNCT__
159#define __FUNCT__ "FemModel::GetName"
160char* FemModel::GetName(void){
161 throw ErrorException(__FUNCT__,exprintf("%s%s",__FUNCT__," error message: not implemented yet!"));
162}
163#undef __FUNCT__
164#define __FUNCT__ "FemModel::Demarshall"
165void FemModel::Demarshall(char** pmarshalled_dataset){
166 throw ErrorException(__FUNCT__,exprintf("%s%s",__FUNCT__," error message: not implemented yet!"));
167}
168#undef __FUNCT__
169#define __FUNCT__ "FemModel::Enum"
170int FemModel::Enum(void){
171 throw ErrorException(__FUNCT__,exprintf("%s%s",__FUNCT__," error message: not implemented yet!"));
172}
173#undef __FUNCT__
174#define __FUNCT__ "FemModel::copy"
175Object* FemModel::copy(void){
176 throw ErrorException(__FUNCT__,exprintf("%s%s",__FUNCT__," error message: not implemented yet!"));
177}
178
179#undef __FUNCT__
180#define __FUNCT__ "FemModel::FindParam"
181int FemModel::FindParam(void* pparameter,char* parametername){
182
183 return parameters->FindParam(pparameter,parametername);
184
185}
186
187/*access to internal data: */
188DataSet* FemModel::get_elements(void){return elements;}
189DataSet* FemModel::get_nodes(void){return nodes ;}
190DataSet* FemModel::get_constraints(void){return constraints ;}
191DataSet* FemModel::get_loads(void){return loads;}
192DataSet* FemModel::get_materials(void){return materials;}
193DataSet* FemModel::get_parameters(void){return parameters;}
194DofVec* FemModel::get_partition(void){return partition;}
195DofVec* FemModel::get_tpartition(void){return tpartition;}
196DofVec* FemModel::get_yg(void){return yg;}
197Mat FemModel::get_Rmg(void){return Rmg;}
198NodeSets* FemModel::get_nodesets(void){return nodesets;}
199Vec FemModel::get_ys(void){return ys;}
200Vec FemModel::get_ys0(void){return ys0;}
201Mat FemModel::get_Gmn(void){return Gmn;}
Note: See TracBrowser for help on using the repository browser.