Changeset 4178
- Timestamp:
- 06/23/10 16:49:11 (15 years ago)
- Location:
- issm/trunk/src/c/objects
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/objects/Elements/PentaHook.cpp
r4021 r4178 33 33 /*}}}*/ 34 34 /*FUNCTION PentaHook::InitHookNodes(int numanalyses){{{1*/ 35 void PentaHook::InitHookNodes(int numanalyses){ 36 this->hnodes=(Hook*)xmalloc(numanalyses*sizeof(Hook)); 35 void PentaHook::InitHookNodes(int in_numanalyses){ 36 37 ISSMASSERT(in_numanalyses); 38 39 this->numanalyses=in_numanalyses; 40 this->hnodes=(Hook*)xmalloc(in_numanalyses*sizeof(Hook)); 41 42 for (int i=0;i<in_numanalyses;i++) this->hnodes[i].Init(NULL,0); 37 43 } 38 44 /*}}}*/ -
issm/trunk/src/c/objects/Elements/Tria.cpp
r4175 r4178 55 55 tria_matpar_id=iomodel->numberofelements+1; //refers to the constant material parameters object 56 56 57 this->InitHookNodes(nummodels); this->nodes=NULL;57 this->InitHookNodes(nummodels); this->nodes=NULL; 58 58 this->InitHookMatice(tria_matice_id);this->matice=NULL; 59 59 this->InitHookMatpar(tria_matpar_id);this->matpar=NULL; -
issm/trunk/src/c/objects/Elements/TriaHook.cpp
r4177 r4178 34 34 /*FUNCTION TriaHook::InitHookNodes(int numanalyses){{{1*/ 35 35 void TriaHook::InitHookNodes(int in_numanalyses){ 36 37 ISSMASSERT(in_numanalyses); 38 36 39 this->numanalyses=in_numanalyses; 37 this->hnodes=(Hook*)xmalloc(numanalyses*sizeof(Hook)); 40 this->hnodes=(Hook*)xmalloc(in_numanalyses*sizeof(Hook)); 41 42 for (int i=0;i<in_numanalyses;i++) this->hnodes[i].Init(NULL,0); 38 43 } 39 44 /*}}}*/ -
issm/trunk/src/c/objects/Hook.cpp
r4137 r4178 37 37 void Hook::Init(int* in_ids, int in_num){ 38 38 39 int i; 39 /*Intermediaries*/ 40 int i; 41 42 /*Get number of objects to hook*/ 40 43 this->num=in_num; 41 42 /*Allocate: */ 43 this->objects=(Object**)xmalloc(this->num*sizeof(Object*)); 44 this->ids=(int*)xmalloc(this->num*sizeof(int)); 45 this->offsets=(int*)xmalloc(this->num*sizeof(int)); 46 47 /*Copy ids: */ 48 for (i=0;i<this->num;i++){ 49 this->ids[i]=in_ids[i]; 50 this->objects[i]=NULL; 51 this->offsets[i]=0; 44 45 /*Get out if num=0*/ 46 if (num==0){ 47 /*Empty hook*/ 48 this->ids=NULL; 49 this->objects=NULL; 50 this->offsets=NULL; 51 } 52 else{ 53 /*Allocate: */ 54 this->objects=(Object**)xmalloc(this->num*sizeof(Object*)); 55 this->ids=(int*)xmalloc(this->num*sizeof(int)); 56 this->offsets=(int*)xmalloc(this->num*sizeof(int)); 57 58 /*Copy ids: */ 59 for (i=0;i<this->num;i++){ 60 this->ids[i]=in_ids[i]; 61 this->objects[i]=NULL; 62 this->offsets[i]=0; 63 } 52 64 } 53 65 } … … 213 225 Object* object=NULL; 214 226 int i; 227 228 /*Checks if debugging mode*/ 229 ISSMASSERT(this->num==0 || this->ids!=NULL); 215 230 216 231 for(i=0;i<this->num;i++){
Note:
See TracChangeset
for help on using the changeset viewer.