Changeset 4248 for issm/trunk/src/c/objects/Loads/Icefront.cpp
- Timestamp:
- 06/26/10 12:30:21 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/objects/Loads/Icefront.cpp
r4232 r4248 19 19 /*}}}*/ 20 20 21 /* Object constructors and destructor*/21 /*Icefront constructors and destructor*/ 22 22 /*FUNCTION Icefront::Icefront() {{{1*/ 23 23 Icefront::Icefront(){ … … 99 99 100 100 /*}}}*/ 101 /*FUNCTION Icefront::copy {{{1*/102 Object* Icefront::copy() {103 104 Icefront* icefront=NULL;105 106 icefront=new Icefront();107 108 /*copy fields: */109 icefront->id=this->id;110 icefront->analysis_type=this->analysis_type;111 if(this->inputs){112 icefront->inputs=(Inputs*)this->inputs->Copy();113 }114 else{115 icefront->inputs=new Inputs();116 }117 /*point parameters: */118 icefront->parameters=this->parameters;119 120 /*now deal with hooks and objects: */121 icefront->hnodes.copy(&this->hnodes);122 icefront->helement.copy(&this->helement);123 icefront->hmatpar.copy(&this->hmatpar);124 125 return icefront;126 127 }128 /*}}}*/129 101 /*FUNCTION Icefront::~Icefront() {{{1*/ 130 102 Icefront::~Icefront(){ … … 134 106 /*}}}*/ 135 107 136 /*Object marshall*/ 137 /*FUNCTION Icefront::Configure {{{1*/ 138 void Icefront::Configure(Elements* elementsin,Loads* loadsin,DataSet* nodesin,Vertices* verticesin,Materials* materialsin,Parameters* parametersin){ 139 140 /*Take care of hooking up all objects for this element, ie links the objects in the hooks to their respective 141 * datasets, using internal ids and offsets hidden in hooks: */ 142 hnodes.configure(nodesin); 143 helement.configure(elementsin); 144 hmatpar.configure(materialsin); 145 146 /*point parameters to real dataset: */ 147 this->parameters=parametersin; 148 } 149 /*}}}*/ 150 /*FUNCTION Icefront::DeepEcho{{{1*/ 151 void Icefront::DeepEcho(void){ 152 153 printf("Icefront:\n"); 154 printf(" id: %i\n",id); 155 printf(" analysis_type: %s\n",EnumAsString(analysis_type)); 156 hnodes.DeepEcho(); 157 helement.DeepEcho(); 158 hmatpar.DeepEcho(); 159 printf(" parameters\n"); 160 parameters->DeepEcho(); 161 printf(" inputs\n"); 162 inputs->DeepEcho(); 163 } 164 /*}}}*/ 165 /*FUNCTION Icefront::Demarshall {{{1*/ 166 void Icefront::Demarshall(char** pmarshalled_dataset){ 167 168 char* marshalled_dataset=NULL; 169 int i; 170 171 /*recover marshalled_dataset: */ 172 marshalled_dataset=*pmarshalled_dataset; 173 174 /*this time, no need to get enum type, the pointer directly points to the beginning of the 175 *object data (thanks to DataSet::Demarshall):*/ 176 memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id); 177 memcpy(&analysis_type,marshalled_dataset,sizeof(analysis_type));marshalled_dataset+=sizeof(analysis_type); 178 179 /*demarshall hooks: */ 180 hnodes.Demarshall(&marshalled_dataset); 181 helement.Demarshall(&marshalled_dataset); 182 hmatpar.Demarshall(&marshalled_dataset); 183 184 /*demarshall inputs: */ 185 inputs=(Inputs*)DataSetDemarshallRaw(&marshalled_dataset); 186 187 /*parameters: may not exist even yet, so let Configure handle it: */ 188 this->parameters=NULL; 189 190 /*return: */ 191 *pmarshalled_dataset=marshalled_dataset; 192 return; 193 } 194 /*}}}*/ 108 /*Object virtual functions definitions:*/ 195 109 /*FUNCTION Icefront::Echo {{{1*/ 196 110 void Icefront::Echo(void){ … … 207 121 } 208 122 /*}}}*/ 209 /*FUNCTION Icefront::Enum {{{1*/ 210 int Icefront::Enum(void){ 211 212 return IcefrontEnum; 213 123 /*FUNCTION Icefront::DeepEcho{{{1*/ 124 void Icefront::DeepEcho(void){ 125 126 printf("Icefront:\n"); 127 printf(" id: %i\n",id); 128 printf(" analysis_type: %s\n",EnumAsString(analysis_type)); 129 hnodes.DeepEcho(); 130 helement.DeepEcho(); 131 hmatpar.DeepEcho(); 132 printf(" parameters\n"); 133 parameters->DeepEcho(); 134 printf(" inputs\n"); 135 inputs->DeepEcho(); 214 136 } 215 137 /*}}}*/ 216 138 /*FUNCTION Icefront::Id {{{1*/ 217 139 int Icefront::Id(void){ return id; } 140 /*}}}*/ 141 /*FUNCTION Icefront::MyRank {{{1*/ 142 int Icefront::MyRank(void){ 143 extern int my_rank; 144 return my_rank; 145 } 218 146 /*}}}*/ 219 147 /*FUNCTION Icefront::Marshall {{{1*/ … … 268 196 } 269 197 /*}}}*/ 270 /*FUNCTION Icefront::MyRank {{{1*/ 271 int Icefront::MyRank(void){ 272 extern int my_rank; 273 return my_rank; 274 } 275 /*}}}*/ 276 277 /*Object functions*/ 198 /*FUNCTION Icefront::Demarshall {{{1*/ 199 void Icefront::Demarshall(char** pmarshalled_dataset){ 200 201 char* marshalled_dataset=NULL; 202 int i; 203 204 /*recover marshalled_dataset: */ 205 marshalled_dataset=*pmarshalled_dataset; 206 207 /*this time, no need to get enum type, the pointer directly points to the beginning of the 208 *object data (thanks to DataSet::Demarshall):*/ 209 memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id); 210 memcpy(&analysis_type,marshalled_dataset,sizeof(analysis_type));marshalled_dataset+=sizeof(analysis_type); 211 212 /*demarshall hooks: */ 213 hnodes.Demarshall(&marshalled_dataset); 214 helement.Demarshall(&marshalled_dataset); 215 hmatpar.Demarshall(&marshalled_dataset); 216 217 /*demarshall inputs: */ 218 inputs=(Inputs*)DataSetDemarshallRaw(&marshalled_dataset); 219 220 /*parameters: may not exist even yet, so let Configure handle it: */ 221 this->parameters=NULL; 222 223 /*return: */ 224 *pmarshalled_dataset=marshalled_dataset; 225 return; 226 } 227 /*}}}*/ 228 /*FUNCTION Icefront::Enum {{{1*/ 229 int Icefront::Enum(void){ 230 231 return IcefrontEnum; 232 233 } 234 /*}}}*/ 235 /*FUNCTION Icefront::copy {{{1*/ 236 Object* Icefront::copy() { 237 238 Icefront* icefront=NULL; 239 240 icefront=new Icefront(); 241 242 /*copy fields: */ 243 icefront->id=this->id; 244 icefront->analysis_type=this->analysis_type; 245 if(this->inputs){ 246 icefront->inputs=(Inputs*)this->inputs->Copy(); 247 } 248 else{ 249 icefront->inputs=new Inputs(); 250 } 251 /*point parameters: */ 252 icefront->parameters=this->parameters; 253 254 /*now deal with hooks and objects: */ 255 icefront->hnodes.copy(&this->hnodes); 256 icefront->helement.copy(&this->helement); 257 icefront->hmatpar.copy(&this->hmatpar); 258 259 return icefront; 260 261 } 262 /*}}}*/ 263 264 /*Load virtual functions definitions:*/ 265 /*FUNCTION Icefront::Configure {{{1*/ 266 void Icefront::Configure(Elements* elementsin,Loads* loadsin,Nodes* nodesin,Vertices* verticesin,Materials* materialsin,Parameters* parametersin){ 267 268 /*Take care of hooking up all objects for this element, ie links the objects in the hooks to their respective 269 * datasets, using internal ids and offsets hidden in hooks: */ 270 hnodes.configure(nodesin); 271 helement.configure(elementsin); 272 hmatpar.configure(materialsin); 273 274 /*point parameters to real dataset: */ 275 this->parameters=parametersin; 276 } 277 /*}}}*/ 278 278 /*FUNCTION Icefront::CreateKMatrix {{{1*/ 279 279 void Icefront::CreateKMatrix(Mat Kgg){ … … 307 307 } 308 308 /*}}}*/ 309 /*FUNCTION Icefront::PenaltyCreateKMatrix {{{1*/ 310 void Icefront::PenaltyCreateKMatrix(Mat Kgg,double kmax){ 311 /*do nothing: */ 312 } 313 /*}}}*/ 314 /*FUNCTION Icefront::PenaltyCreatePVector{{{1*/ 315 void Icefront::PenaltyCreatePVector(Vec pg,double kmax){ 316 /*do nothing: */ 317 } 318 /*}}}*/ 319 /*FUNCTION Icefront::InAnalysis(int analysis_type){{{1*/ 320 bool Icefront::InAnalysis(int in_analysis_type){ 321 if (in_analysis_type==this->analysis_type)return true; 322 else return false; 323 } 324 /*}}}*/ 325 326 /*Update virtual functions definitions:*/ 327 /*FUNCTION Icefront::InputUpdateFromVector(double* vector, int name, int type) {{{1*/ 328 void Icefront::InputUpdateFromVector(double* vector, int name, int type){ 329 /*Nothing updated yet*/ 330 } 331 /*}}}*/ 332 /*FUNCTION Icefront::InputUpdateFromVector(int* vector, int name, int type) {{{1*/ 333 void Icefront::InputUpdateFromVector(int* vector, int name, int type){ 334 /*Nothing updated yet*/ 335 } 336 /*}}}*/ 337 /*FUNCTION Icefront::InputUpdateFromVector(bool* vector, int name, int type) {{{1*/ 338 void Icefront::InputUpdateFromVector(bool* vector, int name, int type){ 339 /*Nothing updated yet*/ 340 } 341 /*}}}*/ 342 /*FUNCTION Icefront::InputUpdateFromConstant(double constant, int name) {{{1*/ 343 void Icefront::InputUpdateFromConstant(double constant, int name){ 344 /*Nothing updated yet*/ 345 } 346 /*}}}*/ 347 /*FUNCTION Icefront::InputUpdateFromConstant(int constant, int name) {{{1*/ 348 void Icefront::InputUpdateFromConstant(int constant, int name){ 349 /*Nothing updated yet*/ 350 } 351 /*}}}*/ 352 /*FUNCTION Icefront::InputUpdateFromConstant(bool constant, int name) {{{1*/ 353 void Icefront::InputUpdateFromConstant(bool constant, int name){ 354 /*Nothing updated yet*/ 355 } 356 /*}}}*/ 357 /*FUNCTION Icefront::InputUpdateFromSolution(double* solution) {{{1*/ 358 void Icefront::InputUpdateFromSolution(double* solution){ 359 /*Nothing updated yet*/ 360 } 361 /*}}}*/ 362 363 /*Icefront numerics: */ 309 364 /*FUNCTION Icefront::CreatePVectorDiagnosticHoriz {{{1*/ 310 365 void Icefront::CreatePVectorDiagnosticHoriz( Vec pg){ … … 725 780 *pnumberofdofspernode=numberofdofspernode; 726 781 727 }728 /*}}}*/729 /*FUNCTION Icefront::PenaltyCreateKMatrix {{{1*/730 void Icefront::PenaltyCreateKMatrix(Mat Kgg,double kmax){731 /*do nothing: */732 }733 /*}}}*/734 /*FUNCTION Icefront::PenaltyCreatePVector{{{1*/735 void Icefront::PenaltyCreatePVector(Vec pg,double kmax){736 /*do nothing: */737 782 } 738 783 /*}}}*/ … … 1332 1377 } 1333 1378 /*}}}*/ 1334 /*FUNCTION Icefront::InputUpdateFromVector(double* vector, int name, int type) {{{1*/1335 void Icefront::InputUpdateFromVector(double* vector, int name, int type){1336 /*Nothing updated yet*/1337 }1338 /*}}}*/1339 /*FUNCTION Icefront::InputUpdateFromVector(int* vector, int name, int type) {{{1*/1340 void Icefront::InputUpdateFromVector(int* vector, int name, int type){1341 /*Nothing updated yet*/1342 }1343 /*}}}*/1344 /*FUNCTION Icefront::InputUpdateFromVector(bool* vector, int name, int type) {{{1*/1345 void Icefront::InputUpdateFromVector(bool* vector, int name, int type){1346 /*Nothing updated yet*/1347 }1348 /*}}}*/1349 /*FUNCTION Icefront::InputUpdateFromConstant(double constant, int name) {{{1*/1350 void Icefront::InputUpdateFromConstant(double constant, int name){1351 /*Nothing updated yet*/1352 }1353 /*}}}*/1354 /*FUNCTION Icefront::InputUpdateFromConstant(int constant, int name) {{{1*/1355 void Icefront::InputUpdateFromConstant(int constant, int name){1356 /*Nothing updated yet*/1357 }1358 /*}}}*/1359 /*FUNCTION Icefront::InputUpdateFromConstant(bool constant, int name) {{{1*/1360 void Icefront::InputUpdateFromConstant(bool constant, int name){1361 /*Nothing updated yet*/1362 }1363 /*}}}*/1364 /*FUNCTION Icefront::InputUpdateFromSolution(double* solution) {{{1*/1365 void Icefront::InputUpdateFromSolution(double* solution){1366 /*Nothing updated yet*/1367 }1368 /*}}}*/1369 /*FUNCTION Icefront::InAnalysis(int analysis_type){{{1*/1370 bool Icefront::InAnalysis(int in_analysis_type){1371 if (in_analysis_type==this->analysis_type)return true;1372 else return false;1373 }1374 /*}}}*/1375
Note:
See TracChangeset
for help on using the changeset viewer.