Changeset 15372 for issm/trunk-jpl/src/c/classes/Elements/ElementHook.cpp
- Timestamp:
- 06/30/13 17:32:20 (12 years ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/Elements/ElementHook.cpp
r15364 r15372 1 /*!\file PentaHook.c2 * \brief: implementation of the PentaHook object1 /*!\file ElementHook.c 2 * \brief: implementation of the ElementHook object 3 3 */ 4 4 … … 16 16 17 17 /*Object constructors and destructor*/ 18 /*FUNCTION PentaHook::PentaHook(){{{*/19 PentaHook::PentaHook(){18 /*FUNCTION ElementHook::ElementHook(){{{*/ 19 ElementHook::ElementHook(){ 20 20 numanalyses=UNDEF; 21 21 this->hnodes = NULL; … … 26 26 } 27 27 /*}}}*/ 28 /*FUNCTION PentaHook::~PentaHook(){{{*/29 PentaHook::~PentaHook(){28 /*FUNCTION ElementHook::~ElementHook(){{{*/ 29 ElementHook::~ElementHook(){ 30 30 31 31 int i; … … 41 41 } 42 42 /*}}}*/ 43 /*FUNCTION PentaHook::PentaHook(int in_numanalyses,int element_id, int matpar_id){{{*/44 PentaHook::PentaHook(int in_numanalyses,int element_id,IoModel* iomodel){43 /*FUNCTION ElementHook::ElementHook(int in_numanalyses,int element_id, int numvertices,IoModel* iomodel){{{*/ 44 ElementHook::ElementHook(int in_numanalyses,int element_id,int numvertices,IoModel* iomodel){ 45 45 46 46 /*intermediary: */ 47 47 int matpar_id; 48 48 int material_id; 49 int penta_vertex_ids[6];50 49 51 50 /*retrieve material_id: */ 52 51 iomodel->Constant(&matpar_id,MeshNumberofelementsEnum); matpar_id++; 53 52 54 /*retri ve material_id*/53 /*retrieve material_id*/ 55 54 material_id = element_id; 56 55 57 56 /*retrieve vertices ids*/ 58 for(int i=0;i<6;i++){ 59 penta_vertex_ids[i]=reCast<int>(iomodel->Data(MeshElementsEnum)[6*(element_id-1)+i]); 57 int* vertex_ids = xNew<int>(numvertices); 58 for(int i=0;i<numvertices;i++){ 59 vertex_ids[i]=reCast<int>(iomodel->Data(MeshElementsEnum)[(element_id-1)*numvertices+i]); 60 60 } 61 61 62 62 this->numanalyses = in_numanalyses; 63 63 this->hnodes = new Hook*[in_numanalyses]; 64 this->hvertices = new Hook(& penta_vertex_ids[0],6);64 this->hvertices = new Hook(&vertex_ids[0],numvertices); 65 65 this->hmaterial = new Hook(&material_id,1); 66 66 this->hmatpar = new Hook(&matpar_id,1); 67 67 this->hneighbors = NULL; 68 68 69 / /Initialize hnodes as NULL69 /*Initialize hnodes as NULL*/ 70 70 for(int i=0;i<this->numanalyses;i++){ 71 71 this->hnodes[i]=NULL; 72 72 } 73 73 74 /*Clean up*/ 75 xDelete<int>(vertex_ids); 76 74 77 } 75 78 /*}}}*/ 76 79 77 /*FUNCTION PentaHook::SetHookNodes{{{*/78 void PentaHook::SetHookNodes(int* node_ids,int analysis_counter){79 this->hnodes[analysis_counter]= new Hook(node_ids, 6);80 /*FUNCTION ElementHook::SetHookNodes{{{*/ 81 void ElementHook::SetHookNodes(int* node_ids,int numnodes,int analysis_counter){ 82 this->hnodes[analysis_counter]= new Hook(node_ids,numnodes); 80 83 } 81 84 /*}}}*/ 82 /*FUNCTION PentaHook::InitHookNeighbors{{{*/83 void PentaHook::InitHookNeighbors(int* element_ids){85 /*FUNCTION ElementHook::InitHookNeighbors{{{*/ 86 void ElementHook::InitHookNeighbors(int* element_ids){ 84 87 this->hneighbors=new Hook(element_ids,2); 85 86 88 } 87 89 /*}}}*/ 88 /*FUNCTION PentaHook::SpawnTriaHook{{{*/89 void PentaHook::SpawnTriaHook(TriaHook* triahook,int* indices){90 /*FUNCTION ElementHook::SpawnTriaHook{{{*/ 91 void ElementHook::SpawnTriaHook(ElementHook* triahook,int* indices){ 90 92 91 93 int i;
Note:
See TracChangeset
for help on using the changeset viewer.