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
RevLine 
[1881]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"
[1935]12#include "../shared/shared.h"
[3332]13#include "../include/macros.h"
[3417]14#include "./FemModel.h"
[1881]15
[3417]16/*Object constructors, destructors: {{{1:*/
[1881]17FemModel::FemModel(){
18
19 elements=NULL;
20 nodes=NULL;
[3417]21 vertices=NULL;
[1881]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
[3417]38FemModel::FemModel(DataSet* femmodel_elements,DataSet* femmodel_nodes,DataSet* femmodel_vertices, DataSet* femmodel_constraints,DataSet* femmodel_loads,
[2316]39 DataSet* femmodel_materials,DataSet* femmodel_parameters, DofVec* femmodel_partition,DofVec* femmodel_tpartition,DofVec* femmodel_yg,
[1881]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;
[3417]45 vertices=femmodel_vertices;
[1881]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;
[3417]66 delete vertices;
[1881]67 delete loads;
[1935]68 delete constraints;
[1881]69 delete materials;
70 delete parameters;
71
[2316]72 delete partition;
73 delete tpartition;
74 delete yg;
[1881]75 MatFree(&Rmg);
76 delete nodesets;
77 VecFree(&ys);
78 VecFree(&ys0);
79 MatFree(&Gmn);
80
81}
[3417]82/*}}}*/
83/* Object management: {{{1*/
[1881]84void FemModel::Echo(void){
85
86 printf("FemModels echo: \n");
87 printf(" elements: %p\n",elements);
88 printf(" nodes: %p\n",nodes);
[3417]89 printf(" vertices: %p\n",vertices);
[1881]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();
[3417]112 printf(" vertices: \n");
113 vertices->Echo();
[1881]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");
[2316]122 partition->Echo();
[1881]123 printf(" tpartition: \n");
[2316]124 tpartition->Echo();
[1881]125 printf(" yg: \n");
[2316]126 yg->Echo();
[1881]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}
[1935]139int FemModel::GetId(void){
[3332]140 ISSMERROR("not implemented yet!");
[1935]141}
[1881]142
[1935]143int FemModel::MyRank(void){
[3332]144 ISSMERROR("not implemented yet!");
[1935]145}
146
147void FemModel::Marshall(char** pmarshalled_dataset){
[3332]148 ISSMERROR("not implemented yet!");
[1935]149}
150
151int FemModel::MarshallSize(void){
[3332]152 ISSMERROR("not implemented yet!");
[1935]153}
154char* FemModel::GetName(void){
[3332]155 ISSMERROR("not implemented yet!");
[1935]156}
157void FemModel::Demarshall(char** pmarshalled_dataset){
[3332]158 ISSMERROR("not implemented yet!");
[1935]159}
160int FemModel::Enum(void){
[3332]161 ISSMERROR("not implemented yet!");
[1935]162}
163Object* FemModel::copy(void){
[3332]164 ISSMERROR("not implemented yet!");
[1935]165}
166
[2333]167
168int FemModel::FindParam(double* pscalar,char* name){
[1881]169
[2333]170 return parameters->FindParam(pscalar,name);
[1881]171
172}
[2333]173int FemModel::FindParam(int* pinteger,char* name){
174
175 return parameters->FindParam(pinteger,name);
[1881]176
[2333]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
[1881]210/*access to internal data: */
211DataSet* FemModel::get_elements(void){return elements;}
212DataSet* FemModel::get_nodes(void){return nodes ;}
[3417]213DataSet* FemModel::get_vertices(void){return vertices ;}
[1881]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;}
[2316]218DofVec* FemModel::get_partition(void){return partition;}
219DofVec* FemModel::get_tpartition(void){return tpartition;}
220DofVec* FemModel::get_yg(void){return yg;}
[1881]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;}
[3417]226/*}}}*/
Note: See TracBrowser for help on using the repository browser.