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

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

Massive temporary commit: redesign to include vertices (for galerkin discontinous), to simplify ModelProcessor.

File size: 5.3 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 "stdio.h"
12#include "../shared/shared.h"
13#include "../include/macros.h"
14#include "./FemModel.h"
15
16/*Object constructors, destructors: {{{1:*/
17FemModel::FemModel(){
18
19 elements=NULL;
20 nodes=NULL;
21 vertices=NULL;
22 constraints=NULL;
23 loads=NULL;
24 materials=NULL;
25 parameters=NULL;
26
27 partition=NULL;
28 tpartition=NULL;
29 yg=NULL;
30 Rmg=NULL;
31 nodesets=NULL;
32 ys=NULL;
33 ys0=NULL;
34 Gmn=NULL;
35
36}
37
38FemModel::FemModel(DataSet* femmodel_elements,DataSet* femmodel_nodes,DataSet* femmodel_vertices, DataSet* femmodel_constraints,DataSet* femmodel_loads,
39 DataSet* femmodel_materials,DataSet* femmodel_parameters, DofVec* femmodel_partition,DofVec* femmodel_tpartition,DofVec* femmodel_yg,
40 Mat femmodel_Rmg,Mat femmodel_Gmn,NodeSets* femmodel_nodesets,Vec femmodel_ys,Vec femmodel_ys0){
41
42
43 elements=femmodel_elements;
44 nodes=femmodel_nodes;
45 vertices=femmodel_vertices;
46 constraints=femmodel_constraints;
47 loads=femmodel_loads;
48 materials=femmodel_materials;
49 parameters=femmodel_parameters;
50
51 partition=femmodel_partition;
52 tpartition=femmodel_tpartition;
53 yg=femmodel_yg;
54 Rmg=femmodel_Rmg;
55 nodesets=femmodel_nodesets;
56 ys=femmodel_ys;
57 ys0=femmodel_ys0;
58 Gmn=femmodel_Gmn;
59
60}
61
62FemModel::~FemModel(){
63
64 delete elements;
65 delete nodes;
66 delete vertices;
67 delete loads;
68 delete constraints;
69 delete materials;
70 delete parameters;
71
72 delete partition;
73 delete tpartition;
74 delete yg;
75 MatFree(&Rmg);
76 delete nodesets;
77 VecFree(&ys);
78 VecFree(&ys0);
79 MatFree(&Gmn);
80
81}
82/*}}}*/
83/* Object management: {{{1*/
84void FemModel::Echo(void){
85
86 printf("FemModels echo: \n");
87 printf(" elements: %p\n",elements);
88 printf(" nodes: %p\n",nodes);
89 printf(" vertices: %p\n",vertices);
90 printf(" loads: %p\n",loads);
91 printf(" materials: %p\n",materials);
92 printf(" parameters: %p\n",parameters);
93
94 printf(" partition: %p\n",partition);
95 printf(" tpartition: %p\n",tpartition);
96 printf(" yg: %p\n",yg);
97 printf(" Rmg: %p\n",Rmg);
98 printf(" nodesets: %p\n",nodesets);
99 printf(" ys: %p\n",ys);
100 printf(" ys0: %p\n",ys0);
101 printf(" Gmn: %p\n",Gmn);
102
103}
104
105void FemModel::DeepEcho(void){
106
107 printf("FemModels echo: \n");
108 printf(" elements: \n");
109 elements->Echo();
110 printf(" nodes: \n");
111 nodes->Echo();
112 printf(" vertices: \n");
113 vertices->Echo();
114 printf(" loads: \n");
115 nodes->Echo();
116 printf(" materials: \n");
117 nodes->Echo();
118 printf(" parameters: \n");
119 nodes->Echo();
120
121 printf(" partition: \n");
122 partition->Echo();
123 printf(" tpartition: \n");
124 tpartition->Echo();
125 printf(" yg: \n");
126 yg->Echo();
127 printf(" Rmg: \n");
128 MatView(Rmg,PETSC_VIEWER_STDOUT_WORLD);
129 printf(" nodesets: \n");
130 nodesets->Echo();
131 printf(" ys: \n");
132 VecView(ys,PETSC_VIEWER_STDOUT_WORLD);
133 printf(" ys0: \n");
134 VecView(ys0,PETSC_VIEWER_STDOUT_WORLD);
135 printf(" Gmn: \n");
136 MatView(Gmn,PETSC_VIEWER_STDOUT_WORLD);
137
138}
139int FemModel::GetId(void){
140 ISSMERROR("not implemented yet!");
141}
142
143int FemModel::MyRank(void){
144 ISSMERROR("not implemented yet!");
145}
146
147void FemModel::Marshall(char** pmarshalled_dataset){
148 ISSMERROR("not implemented yet!");
149}
150
151int FemModel::MarshallSize(void){
152 ISSMERROR("not implemented yet!");
153}
154char* FemModel::GetName(void){
155 ISSMERROR("not implemented yet!");
156}
157void FemModel::Demarshall(char** pmarshalled_dataset){
158 ISSMERROR("not implemented yet!");
159}
160int FemModel::Enum(void){
161 ISSMERROR("not implemented yet!");
162}
163Object* FemModel::copy(void){
164 ISSMERROR("not implemented yet!");
165}
166
167
168int FemModel::FindParam(double* pscalar,char* name){
169
170 return parameters->FindParam(pscalar,name);
171
172}
173int FemModel::FindParam(int* pinteger,char* name){
174
175 return parameters->FindParam(pinteger,name);
176
177}
178
179int FemModel::FindParam(char** pstring,char* name){
180
181 return parameters->FindParam(pstring,name);
182
183}
184
185int FemModel::FindParam(char*** pstringarray,int* pM,char* name){
186
187 return parameters->FindParam(pstringarray,pM,name);
188
189}
190
191int FemModel::FindParam(double** pdoublearray,int* pM,int* pN,char* name){
192
193 return parameters->FindParam(pdoublearray,pM,pN,name);
194
195}
196
197int FemModel::FindParam(Vec* pvec,char* name){
198
199 return parameters->FindParam(pvec,name);
200
201}
202
203int FemModel::FindParam(Mat* pmat,char* name){
204
205 return parameters->FindParam(pmat,name);
206
207}
208
209
210/*access to internal data: */
211DataSet* FemModel::get_elements(void){return elements;}
212DataSet* FemModel::get_nodes(void){return nodes ;}
213DataSet* FemModel::get_vertices(void){return vertices ;}
214DataSet* FemModel::get_constraints(void){return constraints ;}
215DataSet* FemModel::get_loads(void){return loads;}
216DataSet* FemModel::get_materials(void){return materials;}
217DataSet* FemModel::get_parameters(void){return parameters;}
218DofVec* FemModel::get_partition(void){return partition;}
219DofVec* FemModel::get_tpartition(void){return tpartition;}
220DofVec* FemModel::get_yg(void){return yg;}
221Mat FemModel::get_Rmg(void){return Rmg;}
222NodeSets* FemModel::get_nodesets(void){return nodesets;}
223Vec FemModel::get_ys(void){return ys;}
224Vec FemModel::get_ys0(void){return ys0;}
225Mat FemModel::get_Gmn(void){return Gmn;}
226/*}}}*/
Note: See TracBrowser for help on using the repository browser.