Changeset 4369
- Timestamp:
- 06/30/10 16:05:31 (15 years ago)
- Location:
- issm/trunk/src/c/objects
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/objects/Elements/Penta.cpp
r4367 r4369 996 996 997 997 /*Do nothing if we don't find it: */ 998 if(!input) 998 if(!input)return; 999 999 1000 1000 /*Constrain input using cm_min and cm_max: */ … … 1045 1045 /*Make a copy of the original input: */ 1046 1046 original=(Input*)this->inputs->GetInput(original_enum); 1047 if(!original)ISSMERROR(" could not find old input with enum: %s",EnumAsString(original_enum));1048 1047 copy=(Input*)original->copy(); 1049 1048 … … 1062 1061 /*Make a copy of the original input: */ 1063 1062 input=(Input*)this->inputs->GetInput(enum_type); 1064 if(!input)ISSMERROR(" could not find old input with enum: %s",EnumAsString(enum_type));1065 1063 1066 1064 /*Scale: */ … … 1765 1763 1766 1764 int i; 1765 int analysis_counter; 1766 1767 /*go into parameters and get the analysis_counter: */ 1768 this->parameters->FindParam(&analysis_counter,AnalysisCounterEnum); 1767 1769 1768 1770 /*out of grids g0,g1 and g2 from Penta, build a tria element: */ … … 1787 1789 tria->results=tria_results; 1788 1790 tria->parameters=tria_parameters; 1791 this->SpawnTriaHook(dynamic_cast<TriaHook*>(tria),&indices[0]); 1792 1793 /*recover nodes, matice and matpar: */ 1794 this->nodes=(Node**)this->hnodes[analysis_counter].deliverp(); 1795 this->matice=(Matice*)this->hmatice.delivers(); 1796 this->matpar=(Matpar*)this->hmatpar.delivers(); 1789 1797 1790 /*now deal with nodes, matice and matpar: */1791 tria->nodes=(Node**)xmalloc(3*sizeof(Node*));1792 for(i=0;i<3;i++)tria->nodes[i]=this->nodes[indices[i]];1793 tria->matice=this->matice;1794 tria->matpar=this->matpar;1795 1796 1798 return tria; 1797 1799 } -
issm/trunk/src/c/objects/Elements/PentaHook.cpp
r4236 r4369 62 62 } 63 63 /*}}}*/ 64 /*FUNCTION PentaHook::SpawnTriaHook(TriaHook* triahook,int* indices);{{{1*/ 65 void PentaHook::SpawnTriaHook(TriaHook* triahook,int* indices){ 66 67 int i; 68 int zero=0; 69 70 triahook->numanalyses=this->numanalyses; 71 triahook->hnodes=new Hook[this->numanalyses]; 72 73 for(i=0;i<this->numanalyses;i++){ 74 this->hnodes[i].Spawn(&triahook->hnodes[i],indices,3); 75 } 76 77 this->hmatice.copy(&triahook->hmatice); 78 this->hmatpar.copy(&triahook->hmatpar); 79 } 80 /*}}}*/ -
issm/trunk/src/c/objects/Elements/PentaHook.h
r4249 r4369 7 7 8 8 class Hook; 9 class TriaHook; 9 10 10 11 class PentaHook{ … … 25 26 void InitHookMatpar(int matpar_id); 26 27 void InitHookNeighbors(int* element_ids); 28 void SpawnTriaHook(TriaHook* triahook,int* indices); 27 29 /*}}}*/ 28 29 30 }; 30 31 -
issm/trunk/src/c/objects/Hook.cpp
r4248 r4369 363 363 /*}}}*/ 364 364 /*FUNCTION Hook::Spawn{{{1*/ 365 Hook* Hook::Spawn(int* indices, int numindices){ 366 367 int i; 368 Object** subobjects=NULL; 369 int subnum; 370 int* suboffsets=NULL; 371 int* subids=NULL; 365 void Hook::Spawn(Hook* spawnedhook, int* indices, int numindices){ 366 367 int i; 372 368 373 369 /*go pickup the correct objects, ids and offsets :*/ 374 subnum=numindices; 375 if(subnum<1) ISSMERROR("Trying to spawn an empty ElementProperties!"); 376 377 subobjects=(Object**)xmalloc(subnum*sizeof(Object*)); 378 subids=(int*)xmalloc(subnum*sizeof(int)); 379 suboffsets=(int*)xmalloc(subnum*sizeof(int)); 380 381 for(i=0;i<subnum;i++){ 382 subobjects[i]=this->objects[indices[i]]; 383 subids[i]=this->ids[indices[i]]; 384 suboffsets[i]=this->offsets[indices[i]]; 385 } 386 387 return new Hook(subobjects,subids,suboffsets,subnum); 388 } 389 /*}}}*/ 370 spawnedhook->num=numindices; 371 if(spawnedhook->num<1) ISSMERROR("Trying to spawn an empty ElementProperties!"); 372 373 spawnedhook->objects=(Object**)xmalloc(spawnedhook->num*sizeof(Object*)); 374 spawnedhook->ids=(int*)xmalloc(spawnedhook->num*sizeof(int)); 375 spawnedhook->offsets=(int*)xmalloc(spawnedhook->num*sizeof(int)); 376 377 for(i=0;i<spawnedhook->num;i++){ 378 spawnedhook->objects[i]=this->objects[indices[i]]; 379 spawnedhook->ids[i]=this->ids[indices[i]]; 380 spawnedhook->offsets[i]=this->offsets[indices[i]]; 381 } 382 } 383 /*}}}*/ -
issm/trunk/src/c/objects/Hook.h
r4248 r4369 46 46 Object** deliverp(void); //deliver all objects 47 47 void configure(DataSet* dataset); 48 Hook* Spawn(int* indices, int numindices);48 void Spawn(Hook* spawnedhook, int* indices, int numindices); 49 49 Object** GetObjects(void); 50 50 int* Ids(void);
Note:
See TracChangeset
for help on using the changeset viewer.