Index: ../trunk-jpl/src/c/Container/Elements.cpp =================================================================== --- ../trunk-jpl/src/c/Container/Elements.cpp (revision 14760) +++ ../trunk-jpl/src/c/Container/Elements.cpp (revision 14761) @@ -46,7 +46,7 @@ for ( object=objects.begin() ; object < objects.end(); object++ ){ element=dynamic_cast((*object)); - element->Configure(elements,loads,nodes,materials,parameters); + element->Configure(elements,loads,nodes,vertices,materials,parameters); } Index: ../trunk-jpl/src/c/modules/ConfigureObjectsx/ConfigureObjectsx.cpp =================================================================== --- ../trunk-jpl/src/c/modules/ConfigureObjectsx/ConfigureObjectsx.cpp (revision 14760) +++ ../trunk-jpl/src/c/modules/ConfigureObjectsx/ConfigureObjectsx.cpp (revision 14761) @@ -13,13 +13,13 @@ int ConfigureObjectsx( Elements* elements, Loads* loads, Nodes* nodes, Vertices* vertices, Materials* materials,Parameters* parameters){ /*Intermediary*/ + int i; int noerr=1; - int i; - Element* element=NULL; - Load* load=NULL; - Node* node=NULL; - Material* material=NULL; int configuration_type; + Element *element = NULL; + Load *load = NULL; + Node *node = NULL; + Material *material = NULL; /*Get analysis type: */ parameters->FindParam(&configuration_type,ConfigurationTypeEnum); @@ -27,7 +27,7 @@ if(VerboseMProcessor()) _pprintLine_(" Configuring elements..."); for (i=0;iSize();i++){ element=dynamic_cast(elements->GetObjectByOffset(i)); - element->Configure(elements,loads,nodes,materials,parameters); + element->Configure(elements,loads,nodes,vertices,materials,parameters); } if(VerboseMProcessor()) _pprintLine_(" Configuring loads..."); for (i=0;iSize();i++){ Index: ../trunk-jpl/src/c/classes/objects/Loads/Icefront.h =================================================================== --- ../trunk-jpl/src/c/classes/objects/Loads/Icefront.h (revision 14760) +++ ../trunk-jpl/src/c/classes/objects/Loads/Icefront.h (revision 14761) @@ -25,18 +25,20 @@ int analysis_type; /*hooks: */ - Hook* hnodes; - Hook* helement; - Hook* hmatpar; + Hook *hnodes; + Hook *hvertices; + Hook *helement; + Hook *hmatpar; /*Corresponding fields*/ Matpar *matpar; Node **nodes; + Vertex **vertices; Element *element; /*inputs and parameters: */ - Inputs* inputs; - Parameters* parameters; + Inputs *inputs; + Parameters *parameters; /*Icefront constructors, destructors: {{{*/ Icefront(); Index: ../trunk-jpl/src/c/classes/objects/Loads/Numericalflux.cpp =================================================================== --- ../trunk-jpl/src/c/classes/objects/Loads/Numericalflux.cpp (revision 14760) +++ ../trunk-jpl/src/c/classes/objects/Loads/Numericalflux.cpp (revision 14761) @@ -25,12 +25,13 @@ /*Numericalflux constructors and destructor*/ /*FUNCTION Numericalflux::Numericalflux(){{{*/ Numericalflux::Numericalflux(){ - this->inputs=NULL; - this->parameters=NULL; - this->helement=NULL; - this->element=NULL; - this->hnodes=NULL; - this->nodes=NULL; + this->inputs = NULL; + this->parameters = NULL; + this->helement = NULL; + this->element = NULL; + this->hnodes = NULL; + this->hvertices = NULL; + this->nodes = NULL; } /*}}}*/ /*FUNCTION Numericalflux::Numericalflux(int id, int i, IoModel* iomodel, int analysis_type) {{{*/ @@ -47,6 +48,7 @@ /*numericalflux constructor data: */ int numericalflux_elem_ids[2]; int numericalflux_mparid; + int numericalflux_vertex_ids[2]; int numericalflux_node_ids[4]; int numericalflux_type; @@ -82,7 +84,10 @@ /*1: Get vertices ids*/ i1=reCast(iomodel->Data(MeshEdgesEnum)[4*i+0]); i2=reCast(iomodel->Data(MeshEdgesEnum)[4*i+1]); + numericalflux_vertex_ids[0]=i1; + numericalflux_vertex_ids[1]=i2; + /*2: Get node ids*/ if (numericalflux_type==InternalEnum){ /*Now, we must get the nodes of the 4 nodes located on the edge*/ @@ -125,8 +130,9 @@ this->analysis_type=in_analysis_type; /*Hooks: */ - this->hnodes =new Hook(numericalflux_node_ids,num_nodes); - this->helement=new Hook(numericalflux_elem_ids,1); // take only the first element for now + this->hnodes =new Hook(numericalflux_node_ids,num_nodes); + this->hvertices =new Hook(numericalflux_vertex_ids,2); + this->helement =new Hook(numericalflux_elem_ids,1); // take only the first element for now //intialize and add as many inputs per element as requested: this->inputs=new Inputs(); @@ -144,6 +150,7 @@ this->parameters=NULL; delete helement; delete hnodes; + delete hvertices; } /*}}}*/ @@ -154,6 +161,7 @@ _printLine_(" id: " << id); _printLine_(" analysis_type: " << EnumToStringx(analysis_type)); hnodes->Echo(); + hvertices->Echo(); helement->Echo(); _printLine_(" parameters: " << parameters); _printLine_(" inputs: " << inputs); @@ -166,6 +174,7 @@ _printLine_(" id: " << id); _printLine_(" analysis_type: " << EnumToStringx(analysis_type)); hnodes->DeepEcho(); + hvertices->DeepEcho(); helement->DeepEcho(); _printLine_(" parameters"); if(parameters) @@ -209,12 +218,14 @@ numericalflux->parameters=this->parameters; /*now deal with hooks and objects: */ - numericalflux->hnodes=(Hook*)this->hnodes->copy(); - numericalflux->helement=(Hook*)this->helement->copy(); + numericalflux->hnodes = (Hook*)this->hnodes->copy(); + numericalflux->hvertices = (Hook*)this->hvertices->copy(); + numericalflux->helement = (Hook*)this->helement->copy(); /*corresponding fields*/ - numericalflux->nodes =(Node**)numericalflux->hnodes->deliverp(); - numericalflux->element=(Element*)numericalflux->helement->delivers(); + numericalflux->nodes = (Node**)numericalflux->hnodes->deliverp(); + numericalflux->vertices = (Vertex**)numericalflux->hvertices->deliverp(); + numericalflux->element = (Element*)numericalflux->helement->delivers(); return numericalflux; } @@ -227,15 +238,16 @@ /*Take care of hooking up all objects for this element, ie links the objects in the hooks to their respective * datasets, using internal ids and offsets hidden in hooks: */ hnodes->configure(nodesin); + hvertices->configure(verticesin); helement->configure(elementsin); /*Initialize hooked fields*/ - this->nodes =(Node**)hnodes->deliverp(); - this->element=(Element*)helement->delivers(); + this->nodes = (Node**)hnodes->deliverp(); + this->vertices = (Vertex**)hvertices->deliverp(); + this->element = (Element*)helement->delivers(); /*point parameters to real dataset: */ this->parameters=parametersin; - } /*}}}*/ /*FUNCTION Numericalflux::SetCurrentConfiguration {{{*/ Index: ../trunk-jpl/src/c/classes/objects/Loads/Numericalflux.h =================================================================== --- ../trunk-jpl/src/c/classes/objects/Loads/Numericalflux.h (revision 14760) +++ ../trunk-jpl/src/c/classes/objects/Loads/Numericalflux.h (revision 14761) @@ -25,9 +25,11 @@ /*Hooks*/ Hook *helement; Hook *hnodes; + Hook *hvertices; /*Corresponding fields*/ Element *element; + Vertex **vertices; Node **nodes; Parameters *parameters; Inputs *inputs; @@ -38,43 +40,43 @@ ~Numericalflux(); /*}}}*/ /*Object virtual functions definitions:{{{ */ - void Echo(); - void DeepEcho(); - int Id(); - int ObjectEnum(); - Object* copy(); + void Echo(); + void DeepEcho(); + int Id(); + int ObjectEnum(); + Object *copy(); /*}}}*/ /*Update virtual functions resolution: {{{*/ - void InputUpdateFromVector(IssmDouble* vector, int name, int type){/*Do nothing*/} - void InputUpdateFromVector(int* vector, int name, int type){_error_("Not implemented yet!");} - void InputUpdateFromVector(bool* vector, int name, int type){_error_("Not implemented yet!");} - void InputUpdateFromMatrixDakota(IssmDouble* matrix, int nrows, int ncols, int name, int type){/*Do nothing*/} - void InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type){/*Do nothing*/} - void InputUpdateFromVectorDakota(int* vector, int name, int type){_error_("Not implemented yet!");} - void InputUpdateFromVectorDakota(bool* vector, int name, int type){_error_("Not implemented yet!");} - void InputUpdateFromConstant(IssmDouble constant, int name){/*Do nothing*/}; - void InputUpdateFromConstant(int constant, int name){/*Do nothing*/}; - void InputUpdateFromConstant(bool constant, int name){_error_("Not implemented yet!");} - void InputUpdateFromSolution(IssmDouble* solution){_error_("Not implemented yet!");} - void InputUpdateFromIoModel(int index, IoModel* iomodel){_error_("not implemented yet");}; + void InputUpdateFromVector(IssmDouble* vector, int name, int type){/*Do nothing*/} + void InputUpdateFromVector(int* vector, int name, int type){_error_("Not implemented yet!");} + void InputUpdateFromVector(bool* vector, int name, int type){_error_("Not implemented yet!");} + void InputUpdateFromMatrixDakota(IssmDouble* matrix, int nrows, int ncols, int name, int type){/*Do nothing*/} + void InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type){/*Do nothing*/} + void InputUpdateFromVectorDakota(int* vector, int name, int type){_error_("Not implemented yet!");} + void InputUpdateFromVectorDakota(bool* vector, int name, int type){_error_("Not implemented yet!");} + void InputUpdateFromConstant(IssmDouble constant, int name){/*Do nothing*/}; + void InputUpdateFromConstant(int constant, int name){/*Do nothing*/}; + void InputUpdateFromConstant(bool constant, int name){_error_("Not implemented yet!");} + void InputUpdateFromSolution(IssmDouble* solution){_error_("Not implemented yet!");} + void InputUpdateFromIoModel(int index, IoModel* iomodel){_error_("not implemented yet");}; /*}}}*/ /*Load virtual functions definitions: {{{*/ - void Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters); - void SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters); - void CreateKMatrix(Matrix* Kff, Matrix* Kfs); - void CreatePVector(Vector* pf); - void GetNodesSidList(int* sidlist); - int GetNumberOfNodes(void); - void CreateJacobianMatrix(Matrix* Jff){_error_("Not implemented yet");}; - bool IsPenalty(void); - void PenaltyCreateJacobianMatrix(Matrix* Jff,IssmDouble kmax){_error_("Not implemented yet");}; - void PenaltyCreateKMatrix(Matrix* Kff, Matrix* kfs, IssmDouble kmax); - void PenaltyCreatePVector(Vector* pf, IssmDouble kmax); - void SetwiseNodeConnectivity(int* d_nz,int* o_nz,Node* node,bool* flags,int set1_enum,int set2_enum); - bool InAnalysis(int analysis_type); + void Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters); + void SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters); + void CreateKMatrix(Matrix* Kff, Matrix* Kfs); + void CreatePVector(Vector* pf); + void GetNodesSidList(int* sidlist); + int GetNumberOfNodes(void); + void CreateJacobianMatrix(Matrix* Jff){_error_("Not implemented yet");}; + bool IsPenalty(void); + void PenaltyCreateJacobianMatrix(Matrix* Jff,IssmDouble kmax){_error_("Not implemented yet");}; + void PenaltyCreateKMatrix(Matrix* Kff, Matrix* kfs, IssmDouble kmax); + void PenaltyCreatePVector(Vector* pf, IssmDouble kmax); + void SetwiseNodeConnectivity(int* d_nz,int* o_nz,Node* node,bool* flags,int set1_enum,int set2_enum); + bool InAnalysis(int analysis_type); /*}}}*/ /*Numericalflux management:{{{*/ - void GetNormal(IssmDouble* normal,IssmDouble xyz_list[4][3]); + void GetNormal(IssmDouble* normal,IssmDouble xyz_list[4][3]); ElementMatrix* CreateKMatrixPrognostic(void); ElementMatrix* CreateKMatrixPrognosticInternal(void); ElementMatrix* CreateKMatrixPrognosticBoundary(void); Index: ../trunk-jpl/src/c/classes/objects/Loads/Icefront.cpp =================================================================== --- ../trunk-jpl/src/c/classes/objects/Loads/Icefront.cpp (revision 14760) +++ ../trunk-jpl/src/c/classes/objects/Loads/Icefront.cpp (revision 14761) @@ -31,6 +31,8 @@ this->hnodes=NULL; this->nodes= NULL; + this->hvertices=NULL; + this->vertices= NULL; this->helement=NULL; this->element= NULL; this->hmatpar=NULL; @@ -50,6 +52,7 @@ int icefront_eid; int icefront_mparid; int icefront_node_ids[NUMVERTICESQUA]; //initialize with largest size + int icefront_vertex_ids[NUMVERTICESQUA]; //initialize with largest size int icefront_fill; /*find parameters: */ @@ -73,12 +76,18 @@ if (in_icefront_type==MacAyeal2dIceFrontEnum || in_icefront_type==MacAyeal3dIceFrontEnum){ icefront_node_ids[0]=iomodel->nodecounter+reCast(*(iomodel->Data(DiagnosticIcefrontEnum)+segment_width*i+0)); icefront_node_ids[1]=iomodel->nodecounter+reCast(*(iomodel->Data(DiagnosticIcefrontEnum)+segment_width*i+1)); + icefront_vertex_ids[0]=reCast(*(iomodel->Data(DiagnosticIcefrontEnum)+segment_width*i+0)); + icefront_vertex_ids[1]=reCast(*(iomodel->Data(DiagnosticIcefrontEnum)+segment_width*i+1)); } else if (in_icefront_type==PattynIceFrontEnum || in_icefront_type==StokesIceFrontEnum){ icefront_node_ids[0]=iomodel->nodecounter+reCast(*(iomodel->Data(DiagnosticIcefrontEnum)+segment_width*i+0)); icefront_node_ids[1]=iomodel->nodecounter+reCast(*(iomodel->Data(DiagnosticIcefrontEnum)+segment_width*i+1)); icefront_node_ids[2]=iomodel->nodecounter+reCast(*(iomodel->Data(DiagnosticIcefrontEnum)+segment_width*i+2)); icefront_node_ids[3]=iomodel->nodecounter+reCast(*(iomodel->Data(DiagnosticIcefrontEnum)+segment_width*i+3)); + icefront_vertex_ids[0]=reCast(*(iomodel->Data(DiagnosticIcefrontEnum)+segment_width*i+0)); + icefront_vertex_ids[1]=reCast(*(iomodel->Data(DiagnosticIcefrontEnum)+segment_width*i+1)); + icefront_vertex_ids[2]=reCast(*(iomodel->Data(DiagnosticIcefrontEnum)+segment_width*i+2)); + icefront_vertex_ids[3]=reCast(*(iomodel->Data(DiagnosticIcefrontEnum)+segment_width*i+3)); } else _error_("in_icefront_type " << EnumToStringx(in_icefront_type) << " not supported yet!"); @@ -96,6 +105,7 @@ /*Hooks: */ this->hnodes=new Hook(icefront_node_ids,num_nodes); + this->hvertices=new Hook(icefront_vertex_ids,num_nodes); this->helement=new Hook(&icefront_eid,1); this->hmatpar=new Hook(&icefront_mparid,1); @@ -105,10 +115,11 @@ this->inputs->AddInput(new IntInput(IceFrontTypeEnum,in_icefront_type)); //parameters and hooked fields: we still can't point to them, they may not even exist. Configure will handle this. - this->parameters=NULL; - this->nodes= NULL; - this->element= NULL; - this->matpar= NULL; + this->parameters = NULL; + this->nodes = NULL; + this->vertices = NULL; + this->element = NULL; + this->matpar = NULL; } /*}}}*/ @@ -117,6 +128,7 @@ delete inputs; this->parameters=NULL; delete hnodes; + delete hvertices; delete helement; delete hmatpar; } @@ -129,6 +141,7 @@ _printLine_(" id: " << id); _printLine_(" analysis_type: " << EnumToStringx(analysis_type)); hnodes->Echo(); + hvertices->Echo(); helement->Echo(); hmatpar->Echo(); _printLine_(" parameters: " << parameters); @@ -144,6 +157,7 @@ _printLine_(" id: " << id); _printLine_(" analysis_type: " << EnumToStringx(analysis_type)); hnodes->DeepEcho(); + hvertices->DeepEcho(); helement->DeepEcho(); hmatpar->DeepEcho(); _printLine_(" parameters: " << parameters); @@ -182,14 +196,16 @@ icefront->parameters=this->parameters; /*now deal with hooks and objects: */ - icefront->hnodes=(Hook*)this->hnodes->copy(); - icefront->helement=(Hook*)this->helement->copy(); - icefront->hmatpar=(Hook*)this->hmatpar->copy(); + icefront->hnodes = (Hook*)this->hnodes->copy(); + icefront->hvertices = (Hook*)this->hvertices->copy(); + icefront->helement = (Hook*)this->helement->copy(); + icefront->hmatpar = (Hook*)this->hmatpar->copy(); /*corresponding fields*/ - icefront->nodes =(Node**)icefront->hnodes->deliverp(); - icefront->element=(Element*)icefront->helement->delivers(); - icefront->matpar =(Matpar*)icefront->hmatpar->delivers(); + icefront->nodes = (Node**)icefront->hnodes->deliverp(); + icefront->vertices = (Vertex**)icefront->hvertices->deliverp(); + icefront->element = (Element*)icefront->helement->delivers(); + icefront->matpar = (Matpar*)icefront->hmatpar->delivers(); return icefront; @@ -203,13 +219,15 @@ /*Take care of hooking up all objects for this element, ie links the objects in the hooks to their respective * datasets, using internal ids and offsets hidden in hooks: */ hnodes->configure(nodesin); + hvertices->configure(verticesin); helement->configure(elementsin); hmatpar->configure(materialsin); /*Initialize hooked fields*/ - this->nodes =(Node**)hnodes->deliverp(); - this->element=(Element*)helement->delivers(); - this->matpar =(Matpar*)hmatpar->delivers(); + this->nodes = (Node**)hnodes->deliverp(); + this->vertices = (Vertex**)hvertices->deliverp(); + this->element = (Element*)helement->delivers(); + this->matpar = (Matpar*)hmatpar->delivers(); /*point parameters to real dataset: */ this->parameters=parametersin; Index: ../trunk-jpl/src/c/classes/objects/Elements/Element.h =================================================================== --- ../trunk-jpl/src/c/classes/objects/Elements/Element.h (revision 14760) +++ ../trunk-jpl/src/c/classes/objects/Elements/Element.h (revision 14761) @@ -26,7 +26,7 @@ virtual ~Element(){}; - virtual void Configure(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters)=0; + virtual void Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters)=0; virtual void SetCurrentConfiguration(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters)=0; virtual void SetwiseNodeConnectivity(int* d_nz,int* o_nz,Node* node,bool* flags,int set1_enum,int set2_enum)=0; virtual void CreateKMatrix(Matrix* Kff, Matrix* Kfs)=0; Index: ../trunk-jpl/src/c/classes/objects/Elements/Tria.cpp =================================================================== --- ../trunk-jpl/src/c/classes/objects/Elements/Tria.cpp (revision 14760) +++ ../trunk-jpl/src/c/classes/objects/Elements/Tria.cpp (revision 14761) @@ -30,13 +30,14 @@ int i; - this->nodes=NULL; - this->material=NULL; - this->matpar=NULL; + this->nodes = NULL; + this->vertices = NULL; + this->material = NULL; + this->matpar = NULL; for(i=0;i<3;i++)this->horizontalneighborsids[i]=UNDEF; - this->inputs=NULL; - this->parameters=NULL; - this->results=NULL; + this->inputs = NULL; + this->parameters = NULL; + this->results = NULL; } /*}}}*/ @@ -61,9 +62,10 @@ this->results=new Results(); /*initialize pointers:*/ - this->nodes=NULL; - this->material=NULL; - this->matpar=NULL; + this->nodes = NULL; + this->vertices = NULL; + this->material = NULL; + this->matpar = NULL; } /*}}}*/ @@ -90,6 +92,7 @@ tria->numanalyses=this->numanalyses; tria->hnodes=new Hook*[tria->numanalyses]; for(i=0;inumanalyses;i++)tria->hnodes[i]=(Hook*)this->hnodes[i]->copy(); + tria->hvertices=(Hook*)this->hvertices->copy(); tria->hmaterial=(Hook*)this->hmaterial->copy(); tria->hmatpar=(Hook*)this->hmatpar->copy(); @@ -114,6 +117,7 @@ /*recover objects: */ tria->nodes=xNew(3); //we cannot rely on an analysis_counter to tell us which analysis_type we are running, so we just copy the nodes. for(i=0;i<3;i++)tria->nodes[i]=this->nodes[i]; + tria->vertices=(Vertex**)tria->hvertices->deliverp(); tria->material=(Material*)tria->hmaterial->delivers(); tria->matpar=(Matpar*)tria->hmatpar->delivers(); @@ -886,7 +890,7 @@ } /*}}}*/ /*FUNCTION Tria::Configure {{{*/ -void Tria::Configure(Elements* elementsin, Loads* loadsin, DataSet* nodesin, Materials* materialsin, Parameters* parametersin){ +void Tria::Configure(Elements* elementsin, Loads* loadsin,Nodes* nodesin,Vertices *verticesin,Materials* materialsin, Parameters* parametersin){ /*go into parameters and get the analysis_counter: */ int analysis_counter; @@ -898,14 +902,16 @@ /*Take care of hooking up all objects for this element, ie links the objects in the hooks to their respective * datasets, using internal ids and offsets hidden in hooks: */ if(this->hnodes[analysis_counter]) this->hnodes[analysis_counter]->configure(nodesin); + this->hvertices->configure(verticesin); this->hmaterial->configure(materialsin); this->hmatpar->configure(materialsin); /*Now, go pick up the objects inside the hooks: */ if(this->hnodes[analysis_counter]) this->nodes=(Node**)this->hnodes[analysis_counter]->deliverp(); else this->nodes=NULL; - this->material=(Material*)this->hmaterial->delivers(); - this->matpar=(Matpar*)this->hmatpar->delivers(); + this->vertices = (Vertex**)this->hvertices->deliverp(); + this->material = (Material*)this->hmaterial->delivers(); + this->matpar = (Matpar*)this->hmatpar->delivers(); /*point parameters to real dataset: */ this->parameters=parametersin; Index: ../trunk-jpl/src/c/classes/objects/Elements/TriaHook.cpp =================================================================== --- ../trunk-jpl/src/c/classes/objects/Elements/TriaHook.cpp (revision 14760) +++ ../trunk-jpl/src/c/classes/objects/Elements/TriaHook.cpp (revision 14761) @@ -23,9 +23,10 @@ /*FUNCTION TriaHook::TriaHook(){{{*/ TriaHook::TriaHook(){ numanalyses=UNDEF; - this->hnodes=NULL; - this->hmaterial=NULL; - this->hmatpar=NULL; + this->hnodes = NULL; + this->hvertices = NULL; + this->hmaterial = NULL; + this->hmatpar = NULL; } /*}}}*/ /*FUNCTION TriaHook::~TriaHook(){{{*/ @@ -35,26 +36,38 @@ for(i=0;inumanalyses;i++){ if (this->hnodes[i]) delete this->hnodes[i]; } - delete [] this->hnodes; + delete [] hnodes; + delete hvertices; delete hmaterial; delete hmatpar; } /*}}}*/ -/*FUNCTION TriaHook::TriaHook(int in_numanalyses,int material_id, int matpar_id){{{*/ -TriaHook::TriaHook(int in_numanalyses,int material_id, IoModel* iomodel){ +/*FUNCTION TriaHook::TriaHook(int in_numanalyses,int element_id, int matpar_id){{{*/ +TriaHook::TriaHook(int in_numanalyses,int element_id, IoModel* iomodel){ /*intermediary: */ int matpar_id; + int material_id; + int tria_vertex_ids[3]; - /*retrieve parameters: */ + /*retrieve material_id: */ iomodel->Constant(&matpar_id,MeshNumberofelementsEnum); matpar_id++; - this->numanalyses=in_numanalyses; - this->hnodes= new Hook*[in_numanalyses]; - this->hmaterial=new Hook(&material_id,1); - this->hmatpar=new Hook(&matpar_id,1); + /*retrive material_id*/ + material_id = element_id; + /*retrieve vertices ids*/ + for(int i=0;i<3;i++){ + tria_vertex_ids[i]=reCast(iomodel->Data(MeshElementsEnum)[3*(element_id-1)+i]); + } + + this->numanalyses = in_numanalyses; + this->hnodes = new Hook*[in_numanalyses]; + this->hvertices = new Hook(&tria_vertex_ids[0],3); + this->hmaterial = new Hook(&material_id,1); + this->hmatpar = new Hook(&matpar_id,1); + //Initialize hnodes as NULL for(int i=0;inumanalyses;i++){ this->hnodes[i]=NULL; Index: ../trunk-jpl/src/c/classes/objects/Elements/Tria.h =================================================================== --- ../trunk-jpl/src/c/classes/objects/Elements/Tria.h (revision 14760) +++ ../trunk-jpl/src/c/classes/objects/Elements/Tria.h (revision 14761) @@ -31,7 +31,8 @@ int id; int sid; - Node **nodes; // 3 nodes + Node **nodes; // nodes + Vertex **vertices; // 3 vertices Material *material; // 1 material ice Matpar *matpar; // 1 material parameter int horizontalneighborsids[3]; @@ -73,7 +74,7 @@ void ComputeBasalStress(Vector* sigma_b); void ComputeStrainRate(Vector* eps); void ComputeStressTensor(); - void Configure(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters); + void Configure(Elements* elements,Loads* loads,Nodes* nodesin,Vertices* verticesin,Materials* materials,Parameters* parameters); void SetCurrentConfiguration(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters); void SetwiseNodeConnectivity(int* d_nz,int* o_nz,Node* node,bool* flags,int set1_enum,int set2_enum); void CreateKMatrix(Matrix* Kff, Matrix* Kfs); Index: ../trunk-jpl/src/c/classes/objects/Elements/TriaHook.h =================================================================== --- ../trunk-jpl/src/c/classes/objects/Elements/TriaHook.h (revision 14760) +++ ../trunk-jpl/src/c/classes/objects/Elements/TriaHook.h (revision 14761) @@ -11,10 +11,11 @@ class TriaHook{ public: - int numanalyses; //number of analysis types - Hook** hnodes; // 3 nodes for each analysis type - Hook* hmaterial; // 1 ice material - Hook* hmatpar; // 1 material parameter + int numanalyses; //number of analysis types + Hook **hnodes; // nodes for each analysis type + Hook *hvertices; // 3 vertices + Hook *hmaterial; // 1 ice material + Hook *hmatpar; // 1 material parameter /*FUNCTION constructors, destructors {{{*/ TriaHook(); Index: ../trunk-jpl/src/c/classes/objects/Elements/Penta.cpp =================================================================== --- ../trunk-jpl/src/c/classes/objects/Elements/Penta.cpp (revision 14760) +++ ../trunk-jpl/src/c/classes/objects/Elements/Penta.cpp (revision 14761) @@ -26,16 +26,15 @@ /*FUNCTION Penta::Penta(){{{*/ Penta::Penta(){ - int i; - - this->nodes=NULL; - this->material=NULL; - this->matpar=NULL; - this->verticalneighbors=NULL; - this->inputs=NULL; - this->parameters=NULL; - this->results=NULL; - for(i=0;i<3;i++)this->horizontalneighborsids[i]=UNDEF; + this->nodes = NULL; + this->vertices = NULL; + this->material = NULL; + this->matpar = NULL; + this->verticalneighbors = NULL; + this->inputs = NULL; + this->parameters = NULL; + this->results = NULL; + for(int i=0;i<3;i++)this->horizontalneighborsids[i]=UNDEF; } /*}}}*/ /*FUNCTION Penta::~Penta(){{{*/ @@ -83,10 +82,11 @@ this->results=new Results(); /*initialize pointers:*/ - this->nodes=NULL; - this->material=NULL; - this->matpar=NULL; - this->verticalneighbors=NULL; + this->nodes = NULL; + this->vertices = NULL; + this->material = NULL; + this->matpar = NULL; + this->verticalneighbors = NULL; } /*}}}*/ /*FUNCTION Penta::copy {{{*/ @@ -106,6 +106,7 @@ penta->numanalyses=this->numanalyses; penta->hnodes=new Hook*[penta->numanalyses]; for(i=0;inumanalyses;i++)penta->hnodes[i]=(Hook*)this->hnodes[i]->copy(); + penta->hvertices=(Hook*)this->hvertices->copy(); penta->hmaterial=(Hook*)this->hmaterial->copy(); penta->hmatpar=(Hook*)this->hmatpar->copy(); penta->hneighbors=(Hook*)this->hneighbors->copy(); @@ -131,6 +132,7 @@ /*recover objects: */ penta->nodes=xNew(6); //we cannot rely on an analysis_counter to tell us which analysis_type we are running, so we just copy the nodes. for(i=0;i<6;i++)penta->nodes[i]=this->nodes[i]; + penta->vertices=(Vertex**)penta->hvertices->deliverp(); penta->material=(Material*)penta->hmaterial->delivers(); penta->matpar=(Matpar*)penta->hmatpar->delivers(); penta->verticalneighbors=(Penta**)penta->hneighbors->deliverp(); @@ -372,7 +374,7 @@ } /*}}}*/ /*FUNCTION Penta::Configure {{{*/ -void Penta::Configure(Elements* elementsin, Loads* loadsin, DataSet* nodesin, Materials* materialsin, Parameters* parametersin){ +void Penta::Configure(Elements* elementsin, Loads* loadsin, Nodes* nodesin,Vertices* verticesin, Materials* materialsin, Parameters* parametersin){ int analysis_counter; @@ -385,6 +387,7 @@ /*Take care of hooking up all objects for this element, ie links the objects in the hooks to their respective * datasets, using internal ids and offsets hidden in hooks: */ if (this->hnodes[analysis_counter]) this->hnodes[analysis_counter]->configure(nodesin); + this->hvertices->configure(verticesin); this->hmaterial->configure(materialsin); this->hmatpar->configure(materialsin); this->hneighbors->configure(elementsin); @@ -392,9 +395,10 @@ /*Now, go pick up the objects inside the hooks: */ if (this->hnodes[analysis_counter]) this->nodes=(Node**)this->hnodes[analysis_counter]->deliverp(); else this->nodes=NULL; - this->material=(Material*)this->hmaterial->delivers(); - this->matpar=(Matpar*)this->hmatpar->delivers(); - this->verticalneighbors=(Penta**)this->hneighbors->deliverp(); + this->vertices = (Vertex**)this->hvertices->deliverp(); + this->material = (Material*)this->hmaterial->delivers(); + this->matpar = (Matpar*)this->hmatpar->delivers(); + this->verticalneighbors = (Penta**)this->hneighbors->deliverp(); /*point parameters to real dataset: */ this->parameters=parametersin; @@ -2848,6 +2852,7 @@ /*recover nodes, material and matpar: */ tria->nodes=(Node**)tria->hnodes[analysis_counter]->deliverp(); + tria->vertices=(Vertex**)tria->hvertices->deliverp(); tria->matpar=(Matpar*)tria->hmatpar->delivers(); return tria; Index: ../trunk-jpl/src/c/classes/objects/Elements/PentaHook.cpp =================================================================== --- ../trunk-jpl/src/c/classes/objects/Elements/PentaHook.cpp (revision 14760) +++ ../trunk-jpl/src/c/classes/objects/Elements/PentaHook.cpp (revision 14761) @@ -23,10 +23,11 @@ /*FUNCTION PentaHook::PentaHook(){{{*/ PentaHook::PentaHook(){ numanalyses=UNDEF; - this->hnodes=NULL; - this->hmaterial=NULL; - this->hmatpar=NULL; - this->hneighbors=NULL; + this->hnodes = NULL; + this->hvertices = NULL; + this->hmaterial = NULL; + this->hmatpar = NULL; + this->hneighbors = NULL; } /*}}}*/ /*FUNCTION PentaHook::~PentaHook(){{{*/ @@ -38,26 +39,39 @@ if (this->hnodes[i]) delete this->hnodes[i]; } delete [] this->hnodes; + delete hvertices; delete hmaterial; delete hmatpar; delete hneighbors; } /*}}}*/ -/*FUNCTION PentaHook::PentaHook(int in_numanalyses,int material_id, int matpar_id){{{*/ -PentaHook::PentaHook(int in_numanalyses,int material_id, IoModel* iomodel){ +/*FUNCTION PentaHook::PentaHook(int in_numanalyses,int element_id, int matpar_id){{{*/ +PentaHook::PentaHook(int in_numanalyses,int element_id, IoModel* iomodel){ /*intermediary: */ int matpar_id; + int material_id; + int penta_vertex_ids[3]; - /*retrieve parameters: */ + /*retrieve material_id: */ iomodel->Constant(&matpar_id,MeshNumberofelementsEnum); matpar_id++; - this->numanalyses=in_numanalyses; - this->hnodes=new Hook*[in_numanalyses]; - this->hmaterial=new Hook(&material_id,1); - this->hmatpar=new Hook(&matpar_id,1); - this->hneighbors=NULL; + /*retrive material_id*/ + material_id = element_id; + /*retrieve vertices ids*/ + for(int i=0;i<6;i++){ + penta_vertex_ids[i]=reCast(iomodel->Data(MeshElementsEnum)[6*(element_id-1)+i]); + } + + + this->numanalyses = in_numanalyses; + this->hnodes = new Hook*[in_numanalyses]; + this->hvertices = new Hook(&penta_vertex_ids[0],6); + this->hmaterial = new Hook(&material_id,1); + this->hmatpar = new Hook(&matpar_id,1); + this->hneighbors = NULL; + //Initialize hnodes as NULL for(int i=0;inumanalyses;i++){ this->hnodes[i]=NULL; @@ -98,6 +112,7 @@ } // do not spawn hmaterial. material will be taken care of by Penta triahook->hmaterial=NULL; + triahook->hvertices=(Hook*)this->hvertices->Spawn(indices,3); triahook->hmatpar=(Hook*)this->hmatpar->copy(); } /*}}}*/ Index: ../trunk-jpl/src/c/classes/objects/Elements/Penta.h =================================================================== --- ../trunk-jpl/src/c/classes/objects/Elements/Penta.h (revision 14760) +++ ../trunk-jpl/src/c/classes/objects/Elements/Penta.h (revision 14761) @@ -33,7 +33,8 @@ int id; int sid; - Node **nodes; // 6 nodes + Node **nodes; // set of nodes + Vertex **vertices; // 6 vertices Material *material; // 1 material ice Matpar *matpar; // 1 material parameter Penta **verticalneighbors; // 2 neighbors: first one under, second one above @@ -77,7 +78,7 @@ void ComputeBasalStress(Vector* sigma_b); void ComputeStrainRate(Vector* eps); void ComputeStressTensor(); - void Configure(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters); + void Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters); void SetCurrentConfiguration(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters); void SetwiseNodeConnectivity(int* d_nz,int* o_nz,Node* node,bool* flags,int set1_enum,int set2_enum); void CreateKMatrix(Matrix* Kff, Matrix* Kfs); Index: ../trunk-jpl/src/c/classes/objects/Elements/PentaHook.h =================================================================== --- ../trunk-jpl/src/c/classes/objects/Elements/PentaHook.h (revision 14760) +++ ../trunk-jpl/src/c/classes/objects/Elements/PentaHook.h (revision 14761) @@ -13,7 +13,8 @@ public: int numanalyses; //number of analysis types - Hook **hnodes; // 6 nodes for each analysis type + Hook **hnodes; // set of nodes for each analysis type + Hook *hvertices; // 6 vertices for each analysis type Hook *hmaterial; // 1 ice material Hook *hmatpar; // 1 material parameter Hook *hneighbors; // 2 elements, first down, second up