Changeset 14761
- Timestamp:
- 04/25/13 15:25:53 (12 years ago)
- Location:
- issm/trunk-jpl/src/c
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/Container/Elements.cpp
r14476 r14761 47 47 48 48 element=dynamic_cast<Element*>((*object)); 49 element->Configure(elements,loads,nodes, materials,parameters);49 element->Configure(elements,loads,nodes,vertices,materials,parameters); 50 50 51 51 } -
issm/trunk-jpl/src/c/classes/objects/Elements/Element.h
r14650 r14761 27 27 virtual ~Element(){}; 28 28 29 virtual void Configure(Elements* elements,Loads* loads, DataSet* nodes,Materials* materials,Parameters* parameters)=0;29 virtual void Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters)=0; 30 30 virtual void SetCurrentConfiguration(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters)=0; 31 31 virtual void SetwiseNodeConnectivity(int* d_nz,int* o_nz,Node* node,bool* flags,int set1_enum,int set2_enum)=0; -
issm/trunk-jpl/src/c/classes/objects/Elements/Penta.cpp
r14735 r14761 27 27 Penta::Penta(){ 28 28 29 int i; 30 31 this->nodes=NULL; 32 this->material=NULL; 33 this->matpar=NULL; 34 this->verticalneighbors=NULL; 35 this->inputs=NULL; 36 this->parameters=NULL; 37 this->results=NULL; 38 for(i=0;i<3;i++)this->horizontalneighborsids[i]=UNDEF; 29 this->nodes = NULL; 30 this->vertices = NULL; 31 this->material = NULL; 32 this->matpar = NULL; 33 this->verticalneighbors = NULL; 34 this->inputs = NULL; 35 this->parameters = NULL; 36 this->results = NULL; 37 for(int i=0;i<3;i++)this->horizontalneighborsids[i]=UNDEF; 39 38 } 40 39 /*}}}*/ … … 84 83 85 84 /*initialize pointers:*/ 86 this->nodes=NULL; 87 this->material=NULL; 88 this->matpar=NULL; 89 this->verticalneighbors=NULL; 85 this->nodes = NULL; 86 this->vertices = NULL; 87 this->material = NULL; 88 this->matpar = NULL; 89 this->verticalneighbors = NULL; 90 90 } 91 91 /*}}}*/ … … 107 107 penta->hnodes=new Hook*[penta->numanalyses]; 108 108 for(i=0;i<penta->numanalyses;i++)penta->hnodes[i]=(Hook*)this->hnodes[i]->copy(); 109 penta->hvertices=(Hook*)this->hvertices->copy(); 109 110 penta->hmaterial=(Hook*)this->hmaterial->copy(); 110 111 penta->hmatpar=(Hook*)this->hmatpar->copy(); … … 132 133 penta->nodes=xNew<Node*>(6); //we cannot rely on an analysis_counter to tell us which analysis_type we are running, so we just copy the nodes. 133 134 for(i=0;i<6;i++)penta->nodes[i]=this->nodes[i]; 135 penta->vertices=(Vertex**)penta->hvertices->deliverp(); 134 136 penta->material=(Material*)penta->hmaterial->delivers(); 135 137 penta->matpar=(Matpar*)penta->hmatpar->delivers(); … … 373 375 /*}}}*/ 374 376 /*FUNCTION Penta::Configure {{{*/ 375 void Penta::Configure(Elements* elementsin, Loads* loadsin, DataSet* nodesin, Materials* materialsin, Parameters* parametersin){377 void Penta::Configure(Elements* elementsin, Loads* loadsin, Nodes* nodesin,Vertices* verticesin, Materials* materialsin, Parameters* parametersin){ 376 378 377 379 int analysis_counter; … … 386 388 * datasets, using internal ids and offsets hidden in hooks: */ 387 389 if (this->hnodes[analysis_counter]) this->hnodes[analysis_counter]->configure(nodesin); 390 this->hvertices->configure(verticesin); 388 391 this->hmaterial->configure(materialsin); 389 392 this->hmatpar->configure(materialsin); … … 393 396 if (this->hnodes[analysis_counter]) this->nodes=(Node**)this->hnodes[analysis_counter]->deliverp(); 394 397 else this->nodes=NULL; 395 this->material=(Material*)this->hmaterial->delivers(); 396 this->matpar=(Matpar*)this->hmatpar->delivers(); 397 this->verticalneighbors=(Penta**)this->hneighbors->deliverp(); 398 this->vertices = (Vertex**)this->hvertices->deliverp(); 399 this->material = (Material*)this->hmaterial->delivers(); 400 this->matpar = (Matpar*)this->hmatpar->delivers(); 401 this->verticalneighbors = (Penta**)this->hneighbors->deliverp(); 398 402 399 403 /*point parameters to real dataset: */ … … 2849 2853 /*recover nodes, material and matpar: */ 2850 2854 tria->nodes=(Node**)tria->hnodes[analysis_counter]->deliverp(); 2855 tria->vertices=(Vertex**)tria->hvertices->deliverp(); 2851 2856 tria->matpar=(Matpar*)tria->hmatpar->delivers(); 2852 2857 -
issm/trunk-jpl/src/c/classes/objects/Elements/Penta.h
r14650 r14761 34 34 int sid; 35 35 36 Node **nodes; // 6 nodes 36 Node **nodes; // set of nodes 37 Vertex **vertices; // 6 vertices 37 38 Material *material; // 1 material ice 38 39 Matpar *matpar; // 1 material parameter … … 78 79 void ComputeStrainRate(Vector<IssmDouble>* eps); 79 80 void ComputeStressTensor(); 80 void Configure(Elements* elements,Loads* loads, DataSet* nodes,Materials* materials,Parameters* parameters);81 void Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters); 81 82 void SetCurrentConfiguration(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters); 82 83 void SetwiseNodeConnectivity(int* d_nz,int* o_nz,Node* node,bool* flags,int set1_enum,int set2_enum); -
issm/trunk-jpl/src/c/classes/objects/Elements/PentaHook.cpp
r13909 r14761 24 24 PentaHook::PentaHook(){ 25 25 numanalyses=UNDEF; 26 this->hnodes=NULL; 27 this->hmaterial=NULL; 28 this->hmatpar=NULL; 29 this->hneighbors=NULL; 26 this->hnodes = NULL; 27 this->hvertices = NULL; 28 this->hmaterial = NULL; 29 this->hmatpar = NULL; 30 this->hneighbors = NULL; 30 31 } 31 32 /*}}}*/ … … 39 40 } 40 41 delete [] this->hnodes; 42 delete hvertices; 41 43 delete hmaterial; 42 44 delete hmatpar; … … 44 46 } 45 47 /*}}}*/ 46 /*FUNCTION PentaHook::PentaHook(int in_numanalyses,int material_id, int matpar_id){{{*/47 PentaHook::PentaHook(int in_numanalyses,int material_id, IoModel* iomodel){48 /*FUNCTION PentaHook::PentaHook(int in_numanalyses,int element_id, int matpar_id){{{*/ 49 PentaHook::PentaHook(int in_numanalyses,int element_id, IoModel* iomodel){ 48 50 49 51 /*intermediary: */ 50 52 int matpar_id; 53 int material_id; 54 int penta_vertex_ids[3]; 51 55 52 /*retrieve parameters: */56 /*retrieve material_id: */ 53 57 iomodel->Constant(&matpar_id,MeshNumberofelementsEnum); matpar_id++; 54 58 55 this->numanalyses=in_numanalyses; 56 this->hnodes=new Hook*[in_numanalyses]; 57 this->hmaterial=new Hook(&material_id,1); 58 this->hmatpar=new Hook(&matpar_id,1); 59 this->hneighbors=NULL; 59 /*retrive material_id*/ 60 material_id = element_id; 61 62 /*retrieve vertices ids*/ 63 for(int i=0;i<6;i++){ 64 penta_vertex_ids[i]=reCast<int>(iomodel->Data(MeshElementsEnum)[6*(element_id-1)+i]); 65 } 66 67 68 this->numanalyses = in_numanalyses; 69 this->hnodes = new Hook*[in_numanalyses]; 70 this->hvertices = new Hook(&penta_vertex_ids[0],6); 71 this->hmaterial = new Hook(&material_id,1); 72 this->hmatpar = new Hook(&matpar_id,1); 73 this->hneighbors = NULL; 60 74 61 75 //Initialize hnodes as NULL … … 99 113 // do not spawn hmaterial. material will be taken care of by Penta 100 114 triahook->hmaterial=NULL; 115 triahook->hvertices=(Hook*)this->hvertices->Spawn(indices,3); 101 116 triahook->hmatpar=(Hook*)this->hmatpar->copy(); 102 117 } -
issm/trunk-jpl/src/c/classes/objects/Elements/PentaHook.h
r13909 r14761 14 14 public: 15 15 int numanalyses; //number of analysis types 16 Hook **hnodes; // 6 nodes for each analysis type 16 Hook **hnodes; // set of nodes for each analysis type 17 Hook *hvertices; // 6 vertices for each analysis type 17 18 Hook *hmaterial; // 1 ice material 18 19 Hook *hmatpar; // 1 material parameter -
issm/trunk-jpl/src/c/classes/objects/Elements/Tria.cpp
r14757 r14761 31 31 int i; 32 32 33 this->nodes=NULL; 34 this->material=NULL; 35 this->matpar=NULL; 33 this->nodes = NULL; 34 this->vertices = NULL; 35 this->material = NULL; 36 this->matpar = NULL; 36 37 for(i=0;i<3;i++)this->horizontalneighborsids[i]=UNDEF; 37 this->inputs =NULL;38 this->parameters =NULL;39 this->results =NULL;38 this->inputs = NULL; 39 this->parameters = NULL; 40 this->results = NULL; 40 41 41 42 } … … 62 63 63 64 /*initialize pointers:*/ 64 this->nodes=NULL; 65 this->material=NULL; 66 this->matpar=NULL; 65 this->nodes = NULL; 66 this->vertices = NULL; 67 this->material = NULL; 68 this->matpar = NULL; 67 69 68 70 } … … 91 93 tria->hnodes=new Hook*[tria->numanalyses]; 92 94 for(i=0;i<tria->numanalyses;i++)tria->hnodes[i]=(Hook*)this->hnodes[i]->copy(); 95 tria->hvertices=(Hook*)this->hvertices->copy(); 93 96 tria->hmaterial=(Hook*)this->hmaterial->copy(); 94 97 tria->hmatpar=(Hook*)this->hmatpar->copy(); … … 115 118 tria->nodes=xNew<Node*>(3); //we cannot rely on an analysis_counter to tell us which analysis_type we are running, so we just copy the nodes. 116 119 for(i=0;i<3;i++)tria->nodes[i]=this->nodes[i]; 120 tria->vertices=(Vertex**)tria->hvertices->deliverp(); 117 121 tria->material=(Material*)tria->hmaterial->delivers(); 118 122 tria->matpar=(Matpar*)tria->hmatpar->delivers(); … … 887 891 /*}}}*/ 888 892 /*FUNCTION Tria::Configure {{{*/ 889 void Tria::Configure(Elements* elementsin, Loads* loadsin, DataSet* nodesin,Materials* materialsin, Parameters* parametersin){893 void Tria::Configure(Elements* elementsin, Loads* loadsin,Nodes* nodesin,Vertices *verticesin,Materials* materialsin, Parameters* parametersin){ 890 894 891 895 /*go into parameters and get the analysis_counter: */ … … 899 903 * datasets, using internal ids and offsets hidden in hooks: */ 900 904 if(this->hnodes[analysis_counter]) this->hnodes[analysis_counter]->configure(nodesin); 905 this->hvertices->configure(verticesin); 901 906 this->hmaterial->configure(materialsin); 902 907 this->hmatpar->configure(materialsin); … … 905 910 if(this->hnodes[analysis_counter]) this->nodes=(Node**)this->hnodes[analysis_counter]->deliverp(); 906 911 else this->nodes=NULL; 907 this->material=(Material*)this->hmaterial->delivers(); 908 this->matpar=(Matpar*)this->hmatpar->delivers(); 912 this->vertices = (Vertex**)this->hvertices->deliverp(); 913 this->material = (Material*)this->hmaterial->delivers(); 914 this->matpar = (Matpar*)this->hmatpar->delivers(); 909 915 910 916 /*point parameters to real dataset: */ -
issm/trunk-jpl/src/c/classes/objects/Elements/Tria.h
r14757 r14761 32 32 int sid; 33 33 34 Node **nodes; // 3 nodes 34 Node **nodes; // nodes 35 Vertex **vertices; // 3 vertices 35 36 Material *material; // 1 material ice 36 37 Matpar *matpar; // 1 material parameter … … 74 75 void ComputeStrainRate(Vector<IssmDouble>* eps); 75 76 void ComputeStressTensor(); 76 void Configure(Elements* elements,Loads* loads, DataSet* nodes,Materials* materials,Parameters* parameters);77 void Configure(Elements* elements,Loads* loads,Nodes* nodesin,Vertices* verticesin,Materials* materials,Parameters* parameters); 77 78 void SetCurrentConfiguration(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters); 78 79 void SetwiseNodeConnectivity(int* d_nz,int* o_nz,Node* node,bool* flags,int set1_enum,int set2_enum); -
issm/trunk-jpl/src/c/classes/objects/Elements/TriaHook.cpp
r13622 r14761 24 24 TriaHook::TriaHook(){ 25 25 numanalyses=UNDEF; 26 this->hnodes=NULL; 27 this->hmaterial=NULL; 28 this->hmatpar=NULL; 26 this->hnodes = NULL; 27 this->hvertices = NULL; 28 this->hmaterial = NULL; 29 this->hmatpar = NULL; 29 30 } 30 31 /*}}}*/ … … 36 37 if (this->hnodes[i]) delete this->hnodes[i]; 37 38 } 38 delete [] this->hnodes; 39 delete [] hnodes; 40 delete hvertices; 39 41 delete hmaterial; 40 42 delete hmatpar; … … 42 44 } 43 45 /*}}}*/ 44 /*FUNCTION TriaHook::TriaHook(int in_numanalyses,int material_id, int matpar_id){{{*/45 TriaHook::TriaHook(int in_numanalyses,int material_id, IoModel* iomodel){46 /*FUNCTION TriaHook::TriaHook(int in_numanalyses,int element_id, int matpar_id){{{*/ 47 TriaHook::TriaHook(int in_numanalyses,int element_id, IoModel* iomodel){ 46 48 47 49 /*intermediary: */ 48 50 int matpar_id; 51 int material_id; 52 int tria_vertex_ids[3]; 49 53 50 /*retrieve parameters: */54 /*retrieve material_id: */ 51 55 iomodel->Constant(&matpar_id,MeshNumberofelementsEnum); matpar_id++; 52 56 53 this->numanalyses=in_numanalyses; 54 this->hnodes= new Hook*[in_numanalyses]; 55 this->hmaterial=new Hook(&material_id,1); 56 this->hmatpar=new Hook(&matpar_id,1); 57 /*retrive material_id*/ 58 material_id = element_id; 59 60 /*retrieve vertices ids*/ 61 for(int i=0;i<3;i++){ 62 tria_vertex_ids[i]=reCast<int>(iomodel->Data(MeshElementsEnum)[3*(element_id-1)+i]); 63 } 64 65 this->numanalyses = in_numanalyses; 66 this->hnodes = new Hook*[in_numanalyses]; 67 this->hvertices = new Hook(&tria_vertex_ids[0],3); 68 this->hmaterial = new Hook(&material_id,1); 69 this->hmatpar = new Hook(&matpar_id,1); 57 70 58 71 //Initialize hnodes as NULL -
issm/trunk-jpl/src/c/classes/objects/Elements/TriaHook.h
r13623 r14761 12 12 13 13 public: 14 int numanalyses; //number of analysis types 15 Hook** hnodes; // 3 nodes for each analysis type 16 Hook* hmaterial; // 1 ice material 17 Hook* hmatpar; // 1 material parameter 14 int numanalyses; //number of analysis types 15 Hook **hnodes; // nodes for each analysis type 16 Hook *hvertices; // 3 vertices 17 Hook *hmaterial; // 1 ice material 18 Hook *hmatpar; // 1 material parameter 18 19 19 20 /*FUNCTION constructors, destructors {{{*/ -
issm/trunk-jpl/src/c/classes/objects/Loads/Icefront.cpp
r14688 r14761 32 32 this->hnodes=NULL; 33 33 this->nodes= NULL; 34 this->hvertices=NULL; 35 this->vertices= NULL; 34 36 this->helement=NULL; 35 37 this->element= NULL; … … 51 53 int icefront_mparid; 52 54 int icefront_node_ids[NUMVERTICESQUA]; //initialize with largest size 55 int icefront_vertex_ids[NUMVERTICESQUA]; //initialize with largest size 53 56 int icefront_fill; 54 57 … … 74 77 icefront_node_ids[0]=iomodel->nodecounter+reCast<int>(*(iomodel->Data(DiagnosticIcefrontEnum)+segment_width*i+0)); 75 78 icefront_node_ids[1]=iomodel->nodecounter+reCast<int>(*(iomodel->Data(DiagnosticIcefrontEnum)+segment_width*i+1)); 79 icefront_vertex_ids[0]=reCast<int>(*(iomodel->Data(DiagnosticIcefrontEnum)+segment_width*i+0)); 80 icefront_vertex_ids[1]=reCast<int>(*(iomodel->Data(DiagnosticIcefrontEnum)+segment_width*i+1)); 76 81 } 77 82 else if (in_icefront_type==PattynIceFrontEnum || in_icefront_type==StokesIceFrontEnum){ … … 80 85 icefront_node_ids[2]=iomodel->nodecounter+reCast<int>(*(iomodel->Data(DiagnosticIcefrontEnum)+segment_width*i+2)); 81 86 icefront_node_ids[3]=iomodel->nodecounter+reCast<int>(*(iomodel->Data(DiagnosticIcefrontEnum)+segment_width*i+3)); 87 icefront_vertex_ids[0]=reCast<int>(*(iomodel->Data(DiagnosticIcefrontEnum)+segment_width*i+0)); 88 icefront_vertex_ids[1]=reCast<int>(*(iomodel->Data(DiagnosticIcefrontEnum)+segment_width*i+1)); 89 icefront_vertex_ids[2]=reCast<int>(*(iomodel->Data(DiagnosticIcefrontEnum)+segment_width*i+2)); 90 icefront_vertex_ids[3]=reCast<int>(*(iomodel->Data(DiagnosticIcefrontEnum)+segment_width*i+3)); 82 91 } 83 92 else _error_("in_icefront_type " << EnumToStringx(in_icefront_type) << " not supported yet!"); … … 97 106 /*Hooks: */ 98 107 this->hnodes=new Hook(icefront_node_ids,num_nodes); 108 this->hvertices=new Hook(icefront_vertex_ids,num_nodes); 99 109 this->helement=new Hook(&icefront_eid,1); 100 110 this->hmatpar=new Hook(&icefront_mparid,1); … … 106 116 107 117 //parameters and hooked fields: we still can't point to them, they may not even exist. Configure will handle this. 108 this->parameters=NULL; 109 this->nodes= NULL; 110 this->element= NULL; 111 this->matpar= NULL; 118 this->parameters = NULL; 119 this->nodes = NULL; 120 this->vertices = NULL; 121 this->element = NULL; 122 this->matpar = NULL; 112 123 } 113 124 … … 118 129 this->parameters=NULL; 119 130 delete hnodes; 131 delete hvertices; 120 132 delete helement; 121 133 delete hmatpar; … … 130 142 _printLine_(" analysis_type: " << EnumToStringx(analysis_type)); 131 143 hnodes->Echo(); 144 hvertices->Echo(); 132 145 helement->Echo(); 133 146 hmatpar->Echo(); … … 145 158 _printLine_(" analysis_type: " << EnumToStringx(analysis_type)); 146 159 hnodes->DeepEcho(); 160 hvertices->DeepEcho(); 147 161 helement->DeepEcho(); 148 162 hmatpar->DeepEcho(); … … 183 197 184 198 /*now deal with hooks and objects: */ 185 icefront->hnodes=(Hook*)this->hnodes->copy(); 186 icefront->helement=(Hook*)this->helement->copy(); 187 icefront->hmatpar=(Hook*)this->hmatpar->copy(); 199 icefront->hnodes = (Hook*)this->hnodes->copy(); 200 icefront->hvertices = (Hook*)this->hvertices->copy(); 201 icefront->helement = (Hook*)this->helement->copy(); 202 icefront->hmatpar = (Hook*)this->hmatpar->copy(); 188 203 189 204 /*corresponding fields*/ 190 icefront->nodes =(Node**)icefront->hnodes->deliverp(); 191 icefront->element=(Element*)icefront->helement->delivers(); 192 icefront->matpar =(Matpar*)icefront->hmatpar->delivers(); 205 icefront->nodes = (Node**)icefront->hnodes->deliverp(); 206 icefront->vertices = (Vertex**)icefront->hvertices->deliverp(); 207 icefront->element = (Element*)icefront->helement->delivers(); 208 icefront->matpar = (Matpar*)icefront->hmatpar->delivers(); 193 209 194 210 return icefront; … … 204 220 * datasets, using internal ids and offsets hidden in hooks: */ 205 221 hnodes->configure(nodesin); 222 hvertices->configure(verticesin); 206 223 helement->configure(elementsin); 207 224 hmatpar->configure(materialsin); 208 225 209 226 /*Initialize hooked fields*/ 210 this->nodes =(Node**)hnodes->deliverp(); 211 this->element=(Element*)helement->delivers(); 212 this->matpar =(Matpar*)hmatpar->delivers(); 227 this->nodes = (Node**)hnodes->deliverp(); 228 this->vertices = (Vertex**)hvertices->deliverp(); 229 this->element = (Element*)helement->delivers(); 230 this->matpar = (Matpar*)hmatpar->delivers(); 213 231 214 232 /*point parameters to real dataset: */ -
issm/trunk-jpl/src/c/classes/objects/Loads/Icefront.h
r13925 r14761 26 26 27 27 /*hooks: */ 28 Hook* hnodes; 29 Hook* helement; 30 Hook* hmatpar; 28 Hook *hnodes; 29 Hook *hvertices; 30 Hook *helement; 31 Hook *hmatpar; 31 32 32 33 /*Corresponding fields*/ 33 34 Matpar *matpar; 34 35 Node **nodes; 36 Vertex **vertices; 35 37 Element *element; 36 38 37 39 /*inputs and parameters: */ 38 Inputs *inputs;39 Parameters *parameters;40 Inputs *inputs; 41 Parameters *parameters; 40 42 41 43 /*Icefront constructors, destructors: {{{*/ -
issm/trunk-jpl/src/c/classes/objects/Loads/Numericalflux.cpp
r14688 r14761 26 26 /*FUNCTION Numericalflux::Numericalflux(){{{*/ 27 27 Numericalflux::Numericalflux(){ 28 this->inputs=NULL; 29 this->parameters=NULL; 30 this->helement=NULL; 31 this->element=NULL; 32 this->hnodes=NULL; 33 this->nodes=NULL; 28 this->inputs = NULL; 29 this->parameters = NULL; 30 this->helement = NULL; 31 this->element = NULL; 32 this->hnodes = NULL; 33 this->hvertices = NULL; 34 this->nodes = NULL; 34 35 } 35 36 /*}}}*/ … … 48 49 int numericalflux_elem_ids[2]; 49 50 int numericalflux_mparid; 51 int numericalflux_vertex_ids[2]; 50 52 int numericalflux_node_ids[4]; 51 53 int numericalflux_type; … … 83 85 i1=reCast<int>(iomodel->Data(MeshEdgesEnum)[4*i+0]); 84 86 i2=reCast<int>(iomodel->Data(MeshEdgesEnum)[4*i+1]); 85 87 numericalflux_vertex_ids[0]=i1; 88 numericalflux_vertex_ids[1]=i2; 89 90 /*2: Get node ids*/ 86 91 if (numericalflux_type==InternalEnum){ 87 92 … … 126 131 127 132 /*Hooks: */ 128 this->hnodes =new Hook(numericalflux_node_ids,num_nodes); 129 this->helement=new Hook(numericalflux_elem_ids,1); // take only the first element for now 133 this->hnodes =new Hook(numericalflux_node_ids,num_nodes); 134 this->hvertices =new Hook(numericalflux_vertex_ids,2); 135 this->helement =new Hook(numericalflux_elem_ids,1); // take only the first element for now 130 136 131 137 //intialize and add as many inputs per element as requested: … … 145 151 delete helement; 146 152 delete hnodes; 153 delete hvertices; 147 154 } 148 155 /*}}}*/ … … 155 162 _printLine_(" analysis_type: " << EnumToStringx(analysis_type)); 156 163 hnodes->Echo(); 164 hvertices->Echo(); 157 165 helement->Echo(); 158 166 _printLine_(" parameters: " << parameters); … … 167 175 _printLine_(" analysis_type: " << EnumToStringx(analysis_type)); 168 176 hnodes->DeepEcho(); 177 hvertices->DeepEcho(); 169 178 helement->DeepEcho(); 170 179 _printLine_(" parameters"); … … 210 219 211 220 /*now deal with hooks and objects: */ 212 numericalflux->hnodes=(Hook*)this->hnodes->copy(); 213 numericalflux->helement=(Hook*)this->helement->copy(); 221 numericalflux->hnodes = (Hook*)this->hnodes->copy(); 222 numericalflux->hvertices = (Hook*)this->hvertices->copy(); 223 numericalflux->helement = (Hook*)this->helement->copy(); 214 224 215 225 /*corresponding fields*/ 216 numericalflux->nodes =(Node**)numericalflux->hnodes->deliverp(); 217 numericalflux->element=(Element*)numericalflux->helement->delivers(); 226 numericalflux->nodes = (Node**)numericalflux->hnodes->deliverp(); 227 numericalflux->vertices = (Vertex**)numericalflux->hvertices->deliverp(); 228 numericalflux->element = (Element*)numericalflux->helement->delivers(); 218 229 219 230 return numericalflux; … … 228 239 * datasets, using internal ids and offsets hidden in hooks: */ 229 240 hnodes->configure(nodesin); 241 hvertices->configure(verticesin); 230 242 helement->configure(elementsin); 231 243 232 244 /*Initialize hooked fields*/ 233 this->nodes =(Node**)hnodes->deliverp(); 234 this->element=(Element*)helement->delivers(); 245 this->nodes = (Node**)hnodes->deliverp(); 246 this->vertices = (Vertex**)hvertices->deliverp(); 247 this->element = (Element*)helement->delivers(); 235 248 236 249 /*point parameters to real dataset: */ 237 250 this->parameters=parametersin; 238 239 251 } 240 252 /*}}}*/ -
issm/trunk-jpl/src/c/classes/objects/Loads/Numericalflux.h
r13925 r14761 26 26 Hook *helement; 27 27 Hook *hnodes; 28 Hook *hvertices; 28 29 29 30 /*Corresponding fields*/ 30 31 Element *element; 32 Vertex **vertices; 31 33 Node **nodes; 32 34 Parameters *parameters; … … 39 41 /*}}}*/ 40 42 /*Object virtual functions definitions:{{{ */ 41 void Echo();42 void DeepEcho();43 int Id();44 int ObjectEnum();45 Object *copy();43 void Echo(); 44 void DeepEcho(); 45 int Id(); 46 int ObjectEnum(); 47 Object *copy(); 46 48 /*}}}*/ 47 49 /*Update virtual functions resolution: {{{*/ 48 void 49 void 50 void 51 void 52 void 53 void 54 void 55 void 56 void 57 void 58 void 59 void 50 void InputUpdateFromVector(IssmDouble* vector, int name, int type){/*Do nothing*/} 51 void InputUpdateFromVector(int* vector, int name, int type){_error_("Not implemented yet!");} 52 void InputUpdateFromVector(bool* vector, int name, int type){_error_("Not implemented yet!");} 53 void InputUpdateFromMatrixDakota(IssmDouble* matrix, int nrows, int ncols, int name, int type){/*Do nothing*/} 54 void InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type){/*Do nothing*/} 55 void InputUpdateFromVectorDakota(int* vector, int name, int type){_error_("Not implemented yet!");} 56 void InputUpdateFromVectorDakota(bool* vector, int name, int type){_error_("Not implemented yet!");} 57 void InputUpdateFromConstant(IssmDouble constant, int name){/*Do nothing*/}; 58 void InputUpdateFromConstant(int constant, int name){/*Do nothing*/}; 59 void InputUpdateFromConstant(bool constant, int name){_error_("Not implemented yet!");} 60 void InputUpdateFromSolution(IssmDouble* solution){_error_("Not implemented yet!");} 61 void InputUpdateFromIoModel(int index, IoModel* iomodel){_error_("not implemented yet");}; 60 62 /*}}}*/ 61 63 /*Load virtual functions definitions: {{{*/ 62 void 63 void 64 void 65 void 66 void 67 int 68 void 69 bool 70 void 71 void 72 void 73 void 74 bool 64 void Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters); 65 void SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters); 66 void CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs); 67 void CreatePVector(Vector<IssmDouble>* pf); 68 void GetNodesSidList(int* sidlist); 69 int GetNumberOfNodes(void); 70 void CreateJacobianMatrix(Matrix<IssmDouble>* Jff){_error_("Not implemented yet");}; 71 bool IsPenalty(void); 72 void PenaltyCreateJacobianMatrix(Matrix<IssmDouble>* Jff,IssmDouble kmax){_error_("Not implemented yet");}; 73 void PenaltyCreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* kfs, IssmDouble kmax); 74 void PenaltyCreatePVector(Vector<IssmDouble>* pf, IssmDouble kmax); 75 void SetwiseNodeConnectivity(int* d_nz,int* o_nz,Node* node,bool* flags,int set1_enum,int set2_enum); 76 bool InAnalysis(int analysis_type); 75 77 /*}}}*/ 76 78 /*Numericalflux management:{{{*/ 77 void GetNormal(IssmDouble* normal,IssmDouble xyz_list[4][3]);79 void GetNormal(IssmDouble* normal,IssmDouble xyz_list[4][3]); 78 80 ElementMatrix* CreateKMatrixPrognostic(void); 79 81 ElementMatrix* CreateKMatrixPrognosticInternal(void); -
issm/trunk-jpl/src/c/modules/ConfigureObjectsx/ConfigureObjectsx.cpp
r13798 r14761 14 14 15 15 /*Intermediary*/ 16 int i; 16 17 int noerr=1; 17 int i;18 Element* element=NULL;19 Load* load=NULL;20 Node* node=NULL;21 Material* material=NULL;22 18 int configuration_type; 19 Element *element = NULL; 20 Load *load = NULL; 21 Node *node = NULL; 22 Material *material = NULL; 23 23 24 24 /*Get analysis type: */ … … 28 28 for (i=0;i<elements->Size();i++){ 29 29 element=dynamic_cast<Element*>(elements->GetObjectByOffset(i)); 30 element->Configure(elements,loads,nodes, materials,parameters);30 element->Configure(elements,loads,nodes,vertices,materials,parameters); 31 31 } 32 32 if(VerboseMProcessor()) _pprintLine_(" Configuring loads...");
Note:
See TracChangeset
for help on using the changeset viewer.