Changeset 15583
- Timestamp:
- 07/24/13 13:53:00 (12 years ago)
- Location:
- issm/trunk-jpl/src/c
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/Node.cpp
r15567 r15583 22 22 } 23 23 /*}}}*/ 24 /*FUNCTION Node::Node(int node_id,int node_sid,int io_index, IoModel* iomodel,int analysis_type ) {{{*/25 Node::Node(int node_id,int node_sid,int io_index, IoModel* iomodel,int analysis_type ){24 /*FUNCTION Node::Node(int node_id,int node_sid,int io_index, IoModel* iomodel,int analysis_type,int approximation) {{{*/ 25 Node::Node(int node_id,int node_sid,int io_index, IoModel* iomodel,int analysis_type,int in_approximation){ 26 26 27 27 /*Intermediary*/ 28 28 int k,l; 29 29 int gsize; 30 int node_type;31 30 32 31 /*id: */ … … 40 39 41 40 /*indexing:*/ 42 node_type = reCast<int>(iomodel->Data(FlowequationVertexEquationEnum)[io_index]); 43 DistributeNumDofs(&this->indexing,analysis_type,node_type); //number of dofs per node 41 DistributeNumDofs(&this->indexing,analysis_type,in_approximation); //number of dofs per node 44 42 gsize=this->indexing.gsize; 45 43 46 44 if(analysis_type==DiagnosticHorizAnalysisEnum) 47 this->approximation= reCast<int>(node_type);45 this->approximation=in_approximation; 48 46 else 49 47 this->approximation=0; … … 55 53 if(iomodel->Data(MaskVertexongroundediceEnum)) 56 54 this->inputs->AddInput(new BoolInput(MaskVertexongroundediceEnum,reCast<bool>(iomodel->Data(MaskVertexongroundediceEnum)[io_index]))); 57 if(analysis_type==DiagnosticHorizAnalysisEnum)58 this->approximation=reCast<int>(node_type);59 55 /*set single point constraints: */ 60 56 … … 77 73 _assert_(iomodel->Data(MeshVertexonbedEnum)); 78 74 _assert_(iomodel->Data(FlowequationVertexEquationEnum)); 79 if( node_type==SSAApproximationEnum && !reCast<int>(iomodel->Data(MeshVertexonbedEnum)[io_index])){75 if(in_approximation==SSAApproximationEnum && !reCast<int>(iomodel->Data(MeshVertexonbedEnum)[io_index])){ 80 76 this->Deactivate(); 81 77 } 82 if( node_type==L1L2ApproximationEnum && !reCast<int>(iomodel->Data(MeshVertexonbedEnum)[io_index])){78 if(in_approximation==L1L2ApproximationEnum && !reCast<int>(iomodel->Data(MeshVertexonbedEnum)[io_index])){ 83 79 this->Deactivate(); 84 80 } 85 if( node_type==SSAHOApproximationEnum && reCast<int>(iomodel->Data(FlowequationBorderSSAEnum)[io_index])){81 if(in_approximation==SSAHOApproximationEnum && reCast<int>(iomodel->Data(FlowequationBorderSSAEnum)[io_index])){ 86 82 if(!reCast<int>(iomodel->Data(MeshVertexonbedEnum)[io_index])){ 87 83 this->Deactivate(); 88 84 } 89 85 } 90 if( node_type==SSAFSApproximationEnum && reCast<int>(iomodel->Data(FlowequationBorderSSAEnum)[io_index])){86 if(in_approximation==SSAFSApproximationEnum && reCast<int>(iomodel->Data(FlowequationBorderSSAEnum)[io_index])){ 91 87 if(!reCast<int>(iomodel->Data(MeshVertexonbedEnum)[io_index])){ 92 88 for(k=1;k<=2;k++) this->FreezeDof(k); … … 95 91 } 96 92 /*spc all nodes on SIA*/ 97 if( node_type==SIAApproximationEnum){93 if(in_approximation==SIAApproximationEnum){ 98 94 this->Deactivate(); 99 95 } … … 105 101 _assert_(iomodel->Data(FlowequationVertexEquationEnum)); 106 102 /*Constrain all nodes that are not SIA*/ 107 if(reCast<int>( node_type)!=SIAApproximationEnum){103 if(reCast<int>(in_approximation)!=SIAApproximationEnum){ 108 104 this->Deactivate(); 109 105 } … … 143 139 144 140 _printf_("Node:\n"); 145 _printf_(" id : " << id << "\n");141 _printf_(" id : " << id << "\n"); 146 142 _printf_(" sid: " << sid << "\n"); 147 143 _printf_(" analysis_type: " << EnumToStringx(analysis_type) << "\n"); 144 _printf_(" approximation: " << EnumToStringx(approximation) << "\n"); 148 145 indexing.Echo(); 149 _printf_(" inputs: 146 _printf_(" inputs: " << inputs << "\n"); 150 147 151 148 } … … 451 448 * to a fixed value during computations. */ 452 449 450 if(dof>=this->indexing.gsize){ 451 printf("dof spc = %i\n",dof); 452 this->Echo(); 453 } 453 454 _assert_(dof<this->indexing.gsize); 454 455 -
issm/trunk-jpl/src/c/classes/Node.h
r15535 r15583 11 11 #include "../shared/shared.h" 12 12 #include "./DofIndexing.h" 13 #include "./Update.h" 13 14 class Inputs; 14 15 class Hook; … … 20 21 class ElementVector; 21 22 class ElementMatrix; 22 #include "Update.h"23 23 /*}}}*/ 24 24 … … 38 38 IssmDouble coord_system[3][3]; 39 39 40 /*Node constructors, destructors {{{*/40 /*Node constructors, destructors*/ 41 41 Node(); 42 Node(int node_id,int node_sid,int io_index, IoModel* iomodel,int analysis_type );42 Node(int node_id,int node_sid,int io_index, IoModel* iomodel,int analysis_type,int approximation_in); 43 43 ~Node(); 44 /*}}}*/ 45 /*Object virtual functions definitions: {{{*/44 45 /*Object virtual functions definitions:*/ 46 46 void Echo(); 47 47 void DeepEcho(); 48 48 int Id(); 49 49 int ObjectEnum(); 50 Object *copy() 51 /*}}}*/ 52 /*Update virtual functions definitions: {{{*/50 Object *copy(){_error_("Not implemented yet (similar to Elements)"); }; 51 52 /*Update virtual functions definitions:*/ 53 53 void InputUpdateFromVector(IssmDouble* vector, int name, int type); 54 54 void InputUpdateFromVector(int* vector, int name, int type); … … 63 63 void InputUpdateFromSolution(IssmDouble* solution){_error_("Not implemented yet!");} 64 64 void InputUpdateFromIoModel(int index, IoModel* iomodel){_error_("Not implemented yet!");} 65 /*}}}*/ 66 /*Node numerical routines {{{*/65 66 /*Node numerical routines*/ 67 67 void CreateNodalConstraints(Vector<IssmDouble>* ys); 68 68 void SetCurrentConfiguration(DataSet* nodes,Vertices* vertices); … … 97 97 void UpdateCloneDofs(int* alltruerows,int ncols,int setenum); 98 98 void SetClone(int* minranks); 99 /*}}}*/100 99 }; 101 100 -
issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateNodes.cpp
r15533 r15583 9 9 #include "./ModelProcessorx.h" 10 10 11 void CreateNodes(Nodes** pnodes, IoModel* iomodel,int analysis,int finite_element ){11 void CreateNodes(Nodes** pnodes, IoModel* iomodel,int analysis,int finite_element,int approximation){ 12 12 13 13 /*Intermediaries*/ … … 26 26 for(i=0;i<iomodel->numberofvertices;i++){ 27 27 if(iomodel->my_vertices[i]){ 28 nodes->AddObject(new Node(iomodel->nodecounter+i+1,i,i,iomodel,analysis ));28 nodes->AddObject(new Node(iomodel->nodecounter+i+1,i,i,iomodel,analysis,approximation)); 29 29 } 30 30 } … … 36 36 for(j=0;j<3;j++){ 37 37 if(my_nodes[3*i+j]){ 38 nodes->AddObject(new Node(iomodel->nodecounter+3*i+j+1,iomodel->nodecounter+3*i+j,iomodel->elements[+3*i+j]-1,iomodel,analysis ));38 nodes->AddObject(new Node(iomodel->nodecounter+3*i+j+1,iomodel->nodecounter+3*i+j,iomodel->elements[+3*i+j]-1,iomodel,analysis,approximation)); 39 39 40 40 } … … 48 48 for(i=0;i<iomodel->numberofvertices;i++){ 49 49 if(iomodel->my_vertices[i]){ 50 nodes->AddObject(new Node(iomodel->nodecounter+i+1,i,i,iomodel,analysis ));50 nodes->AddObject(new Node(iomodel->nodecounter+i+1,i,i,iomodel,analysis,approximation)); 51 51 } 52 52 } 53 53 for(i=0;i<iomodel->numberofedges;i++){ 54 54 if(my_edges[i]){ 55 nodes->AddObject(new Node(iomodel->nodecounter+iomodel->numberofvertices+i+1,iomodel->numberofvertices+i,0,iomodel,analysis ));55 nodes->AddObject(new Node(iomodel->nodecounter+iomodel->numberofvertices+i+1,iomodel->numberofvertices+i,0,iomodel,analysis,approximation)); 56 56 } 57 57 } … … 59 59 60 60 case MINIcondensedEnum: 61 _assert_(approximation==FSApproximationEnum); 61 62 /*P1 velocity*/ 62 63 for(i=0;i<iomodel->numberofvertices;i++){ 63 64 if(iomodel->my_vertices[i]){ 64 nodes->AddObject(new Node(iomodel->nodecounter+i+1,i,i,iomodel,analysis ));65 nodes->AddObject(new Node(iomodel->nodecounter+i+1,i,i,iomodel,analysis,approximation)); 65 66 } 66 67 } … … 68 69 for(i=0;i<iomodel->numberofvertices;i++){ 69 70 if(iomodel->my_vertices[i]){ 70 nodes->AddObject(new Node(iomodel->nodecounter+iomodel->numberofvertices+i+1,i,i,iomodel,analysis ));71 nodes->AddObject(new Node(iomodel->nodecounter+iomodel->numberofvertices+i+1,i,i,iomodel,analysis,approximation)); 71 72 } 72 73 } -
issm/trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateNodesDiagnosticHoriz.cpp
r15564 r15583 12 12 13 13 /*Intermediary*/ 14 bool isSSA,isL1L2,isHO,isFS;15 int finiteelementssa;14 bool isSSA,isL1L2,isHO,isFS,iscoupling; 15 int temp,finiteelement=-1,approximation=-1; 16 16 17 17 /*Fetch parameters: */ … … 20 20 iomodel->Constant(&isHO,FlowequationIsHOEnum); 21 21 iomodel->Constant(&isFS,FlowequationIsFSEnum); 22 iomodel->Constant(&finiteelementssa,FlowequationFeSSAEnum);23 22 24 /*Now, is the flag macayaealHO on? otherwise, do nothing:*/23 /*Now, check that we have non SIA elements */ 25 24 if(!isSSA & !isL1L2 & !isHO & !isFS) return; 26 25 27 /*Create nodes: */ 28 iomodel->FetchData(9,MeshVertexonbedEnum,MeshVertexonsurfaceEnum,FlowequationBorderSSAEnum,FlowequationBorderFSEnum, 29 MaskVertexongroundediceEnum,MaskVertexonfloatingiceEnum,MaskVertexonwaterEnum,FlowequationVertexEquationEnum,DiagnosticReferentialEnum); 30 if(finiteelementssa==0){ 31 CreateNodes(pnodes,iomodel,DiagnosticHorizAnalysisEnum,P1Enum); 32 } 33 else if(finiteelementssa==1){ 34 CreateNodes(pnodes,iomodel,DiagnosticHorizAnalysisEnum,P2Enum); 26 /*Do we have coupling*/ 27 if( (isSSA?1.:0.) + (isL1L2?1.:0.) + (isHO?1.:0.) + (isFS?1.:0.) >1.) 28 iscoupling = true; 29 else 30 iscoupling = false; 31 32 /*If no coupling, call Regular CreateNodes, else, use P1 elements only*/ 33 if(!iscoupling){ 34 35 /*Get finite element type*/ 36 if(isSSA){ 37 approximation=SSAApproximationEnum; 38 iomodel->Constant(&temp,FlowequationFeSSAEnum); 39 switch(temp){ 40 case 0 : finiteelement = P1Enum; break; 41 case 1 : finiteelement = P2Enum; break; 42 default: _error_("finite element "<<temp<<" not supported"); 43 } 44 } 45 else if(isL1L2){ 46 approximation = L1L2ApproximationEnum; 47 finiteelement = P1Enum; 48 } 49 else if(isHO){ 50 approximation = HOApproximationEnum; 51 finiteelement = P1Enum; 52 } 53 else if(isFS){ 54 approximation = FSApproximationEnum; 55 finiteelement = P1Enum; 56 } 57 58 iomodel->FetchData(9,MeshVertexonbedEnum,MeshVertexonsurfaceEnum,FlowequationBorderSSAEnum,FlowequationBorderFSEnum, 59 MaskVertexongroundediceEnum,MaskVertexonfloatingiceEnum,MaskVertexonwaterEnum,FlowequationVertexEquationEnum,DiagnosticReferentialEnum); 60 CreateNodes(pnodes,iomodel,DiagnosticHorizAnalysisEnum,finiteelement,approximation); 61 iomodel->DeleteData(9,MeshVertexonbedEnum,MeshVertexonsurfaceEnum,FlowequationBorderSSAEnum,FlowequationBorderFSEnum, 62 MaskVertexongroundediceEnum,MaskVertexonfloatingiceEnum,MaskVertexonwaterEnum,FlowequationVertexEquationEnum,DiagnosticReferentialEnum); 35 63 } 36 64 else{ 37 _error_("finite element not supported yet"); 65 /*Coupling: we are going to create P1 Elements only*/ 66 67 /*First create nodes*/ 68 Nodes* nodes=*pnodes; 69 if(!nodes) nodes = new Nodes(); 70 71 iomodel->FetchData(9,MeshVertexonbedEnum,MeshVertexonsurfaceEnum,FlowequationBorderSSAEnum,FlowequationBorderFSEnum, 72 MaskVertexongroundediceEnum,MaskVertexonfloatingiceEnum,MaskVertexonwaterEnum,FlowequationVertexEquationEnum,DiagnosticReferentialEnum); 73 for(int i=0;i<iomodel->numberofvertices;i++){ 74 if(iomodel->my_vertices[i]){ 75 nodes->AddObject(new Node(iomodel->nodecounter+i+1,i,i,iomodel,DiagnosticHorizAnalysisEnum,reCast<int>(iomodel->Data(FlowequationVertexEquationEnum)[i]))); 76 } 77 } 78 iomodel->DeleteData(9,MeshVertexonbedEnum,MeshVertexonsurfaceEnum,FlowequationBorderSSAEnum,FlowequationBorderFSEnum, 79 MaskVertexongroundediceEnum,MaskVertexonfloatingiceEnum,MaskVertexonwaterEnum,FlowequationVertexEquationEnum,DiagnosticReferentialEnum); 80 81 /*Assign output pointer: */ 82 *pnodes=nodes; 38 83 } 39 iomodel->DeleteData(9,MeshVertexonbedEnum,MeshVertexonsurfaceEnum,FlowequationBorderSSAEnum,FlowequationBorderFSEnum,40 MaskVertexongroundediceEnum,MaskVertexonfloatingiceEnum,MaskVertexonwaterEnum,FlowequationVertexEquationEnum,DiagnosticReferentialEnum);41 84 } -
issm/trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHutter/CreateNodesDiagnosticHutter.cpp
r15564 r15583 18 18 if(!isSIA) return; 19 19 20 iomodel->FetchData(6,MeshVertexonbedEnum,MeshVertexonsurfaceEnum,MaskVertexongroundediceEnum,MaskVertexonfloatingiceEnum,FlowequationVertexEquationEnum,MaskVertexonwaterEnum); 21 CreateNodes(pnodes,iomodel,DiagnosticSIAAnalysisEnum,P1Enum); 22 iomodel->DeleteData(6,MeshVertexonbedEnum,MeshVertexonsurfaceEnum,MaskVertexongroundediceEnum,MaskVertexonfloatingiceEnum,FlowequationVertexEquationEnum,MaskVertexonwaterEnum); 20 /*First create nodes*/ 21 Nodes* nodes=*pnodes; 22 if(!nodes) nodes = new Nodes(); 23 24 iomodel->FetchData(9,MeshVertexonbedEnum,MeshVertexonsurfaceEnum,FlowequationBorderSSAEnum,FlowequationBorderFSEnum, 25 MaskVertexongroundediceEnum,MaskVertexonfloatingiceEnum,MaskVertexonwaterEnum,FlowequationVertexEquationEnum,DiagnosticReferentialEnum); 26 for(int i=0;i<iomodel->numberofvertices;i++){ 27 if(iomodel->my_vertices[i]){ 28 nodes->AddObject(new Node(iomodel->nodecounter+i+1,i,i,iomodel,DiagnosticSIAAnalysisEnum,reCast<int>(iomodel->Data(FlowequationVertexEquationEnum)[i]))); 29 } 30 } 31 iomodel->DeleteData(9,MeshVertexonbedEnum,MeshVertexonsurfaceEnum,FlowequationBorderSSAEnum,FlowequationBorderFSEnum, 32 MaskVertexongroundediceEnum,MaskVertexonfloatingiceEnum,MaskVertexonwaterEnum,FlowequationVertexEquationEnum,DiagnosticReferentialEnum); 33 34 /*Assign output pointer: */ 35 *pnodes=nodes; 23 36 } -
issm/trunk-jpl/src/c/modules/ModelProcessorx/ModelProcessorx.h
r15564 r15583 23 23 void CreateParametersHydrologyDCEfficient(Parameters** pparameters,IoModel* iomodel,int solution_type,int analysis_type); 24 24 void UpdateElementsAndMaterialsControl(Elements* elements,Materials* materials, IoModel* iomodel); 25 void CreateNodes(Nodes** pnodes, IoModel* iomodel,int analysis,int finite_element );25 void CreateNodes(Nodes** pnodes, IoModel* iomodel,int analysis,int finite_element,int approximation=NoneApproximationEnum); 26 26 27 27 /*Creation of fem datasets: specialised drivers: */
Note:
See TracChangeset
for help on using the changeset viewer.