Changeset 4003
- Timestamp:
- 06/02/10 18:21:45 (15 years ago)
- Location:
- issm/trunk/src
- Files:
-
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/DataSet/DataSet.cpp
r4002 r4003 908 908 /*}}}*/ 909 909 /*FUNCTION DataSet::NumberOfRgbs{{{1*/ 910 int DataSet::NumberOfRgbs( ){910 int DataSet::NumberOfRgbs(int analysis_type){ 911 911 912 912 vector<Object*>::iterator object; … … 919 919 if((*object)->Enum()==RgbEnum){ //we assume uniqueness of all Rgbs, no error checking here. 920 920 921 count++;922 921 rgb=(Rgb*)(*object); 922 if(rgb->InAnalysis(analysis_type))count++ 923 923 } 924 924 } … … 974 974 } 975 975 /*}}}*/ 976 /*FUNCTION DataSet::SetupSpcs{{{1*/ 977 void DataSet::SetupSpcs(DataSet* nodes,Vec yg,int analysis_type){ 978 979 vector<Object*>::iterator object; 980 Spc* spc=NULL; 981 Node* node=NULL; 982 983 int nodeid; 984 int dof; 985 double value; 986 987 for ( object=objects.begin() ; object < objects.end(); object++ ){ 988 989 /*Check this is a single point constraint (spc): */ 990 if((*object)->Enum()==SpcEnum){ 991 992 spc=(Spc*)(*object); 993 994 if(spc->InAnalysis(analysis_type)){ 995 996 /*Ok, this object is a constraint. Get the nodeid from the node it applies to: */ 997 nodeid=spc->GetNodeId(); 998 dof=spc->GetDof(); 999 value=spc->GetValue(); 1000 1001 /*Now, chase through nodes and find the corect node: */ 1002 node=(Node*)nodes->GetObjectById(NULL,nodeid); 1003 1004 /*Apply constraint: */ 1005 if(node){ //in case the spc is dealing with a node on another cpu 1006 node->ApplyConstraint(yg,dof,value); 1007 } 1008 } 1009 1010 } 1011 } 1012 1013 /*Assemble yg: */ 1014 VecAssemblyBegin(yg); 1015 VecAssemblyEnd(yg); 1016 } 1017 /*}}}*/ 976 1018 /*FUNCTION DataSet::SetupMpcs{{{1*/ 977 void DataSet::SetupMpcs(Mat Rmg,DataSet* nodes ){1019 void DataSet::SetupMpcs(Mat Rmg,DataSet* nodes,int analysis_type){ 978 1020 979 1021 vector<Object*>::iterator object; … … 996 1038 /*Check this is a single point constraint (spc): */ 997 1039 if((*object)->Enum()==RgbEnum){ //we assume uniqueness of all Rgbs, no error checking here. 998 999 /*we found an rgb, increment counter, so that row index for Rmg is up to date: */ 1000 count++; 1040 1001 1041 rgb=(Rgb*)(*object); 1002 1003 1004 nodeid1=rgb->GetNodeId1(); 1005 nodeid2=rgb->GetNodeId2(); 1006 dof=rgb->GetDof(); 1007 1008 /*For this rgb, find the nodes that go with it: */ 1009 node1=(Node*)nodes->GetObjectById(NULL,nodeid1); 1010 node2=(Node*)nodes->GetObjectById(NULL,nodeid2); 1011 1012 if ((node1 && !node2) || (!node1 && node2)){ 1013 /*we are missing one node, not good!*/ 1014 ISSMERROR("%s%p%s%p"," in Rgb, missing one node. node1: ",node1," node2: ",node2); 1015 } 1016 1017 if(!node1 && !node2){ 1018 /*That's ok, this Rgb can't find those nodes, so leave them alone. They are probably not on this 1019 * cpu!*/ 1020 } 1021 else{ 1022 /*Ok, this cpu owns both nodes. Put dof for node1 into m set, unless it is already there, 1023 * in which case node2 gets into the m set: */ 1024 if(node1->DofIsInMSet(dof-1)){ 1025 node2->DofInMSet(dof-1); 1042 if(rgb->InAnalysis(analysis_type)){ 1043 1044 /*we found an rgb, increment counter, so that row index for Rmg is up to date: */ 1045 count++; 1046 1047 1048 nodeid1=rgb->GetNodeId1(); 1049 nodeid2=rgb->GetNodeId2(); 1050 dof=rgb->GetDof(); 1051 1052 /*For this rgb, find the nodes that go with it: */ 1053 node1=(Node*)nodes->GetObjectById(NULL,nodeid1); 1054 node2=(Node*)nodes->GetObjectById(NULL,nodeid2); 1055 1056 if ((node1 && !node2) || (!node1 && node2)){ 1057 /*we are missing one node, not good!*/ 1058 ISSMERROR("%s%p%s%p"," in Rgb, missing one node. node1: ",node1," node2: ",node2); 1059 } 1060 1061 if(!node1 && !node2){ 1062 /*That's ok, this Rgb can't find those nodes, so leave them alone. They are probably not on this 1063 * cpu!*/ 1026 1064 } 1027 1065 else{ 1028 node1->DofInMSet(dof-1); 1066 /*Ok, this cpu owns both nodes. Put dof for node1 into m set, unless it is already there, 1067 * in which case node2 gets into the m set: */ 1068 if(node1->DofIsInMSet(dof-1)){ 1069 node2->DofInMSet(dof-1); 1070 } 1071 else{ 1072 node1->DofInMSet(dof-1); 1073 } 1074 1075 /*Plug values into Rmg. We essentially want dofs from node1 and node2 to be the 1076 *same: */ 1077 dof1=node1->GetDof(dof-1); //matlab indexing 1078 dof2=node2->GetDof(dof-1); //matlab indexing 1079 1080 MatSetValue(Rmg,count,dof1,1.0,INSERT_VALUES); 1081 MatSetValue(Rmg,count,dof2,-1.0,INSERT_VALUES); 1082 1029 1083 } 1030 1031 /*Plug values into Rmg. We essentially want dofs from node1 and node2 to be the1032 *same: */1033 dof1=node1->GetDof(dof-1); //matlab indexing1034 dof2=node2->GetDof(dof-1); //matlab indexing1035 1036 MatSetValue(Rmg,count,dof1,1.0,INSERT_VALUES);1037 MatSetValue(Rmg,count,dof2,-1.0,INSERT_VALUES);1038 1039 1084 } 1040 1085 } 1041 1086 } 1042 }1043 /*}}}*/1044 /*FUNCTION DataSet::SetupSpcs{{{1*/1045 void DataSet::SetupSpcs(DataSet* nodes,Vec yg,int analysis_type){1046 1047 vector<Object*>::iterator object;1048 Spc* spc=NULL;1049 Node* node=NULL;1050 1051 int nodeid;1052 int dof;1053 double value;1054 1055 for ( object=objects.begin() ; object < objects.end(); object++ ){1056 1057 /*Check this is a single point constraint (spc): */1058 if((*object)->Enum()==SpcEnum){1059 1060 spc=(Spc*)(*object);1061 1062 /*Ok, this object is a constraint. Get the nodeid from the node it applies to: */1063 nodeid=spc->GetNodeId();1064 dof=spc->GetDof();1065 value=spc->GetValue();1066 1067 /*Now, chase through nodes and find the corect node: */1068 node=(Node*)nodes->GetObjectById(NULL,nodeid);1069 1070 /*Apply constraint: */1071 if(node){ //in case the spc is dealing with a node on another cpu1072 node->ApplyConstraint(yg,dof,value);1073 }1074 1075 }1076 }1077 1078 /*Assemble yg: */1079 VecAssemblyBegin(yg);1080 VecAssemblyEnd(yg);1081 1087 } 1082 1088 /*}}}*/ -
issm/trunk/src/c/DataSet/DataSet.h
r4002 r4003 60 60 int NumberOfRgbs(); 61 61 void SetupSpcs(DataSet* nodes,Vec yg,int analysis_type); 62 void SetupMpcs(Mat Rmg,DataSet* nodes );62 void SetupMpcs(Mat Rmg,DataSet* nodes,int analysis_type); 63 63 void FlagNodeSets(Vec pv_g, Vec pv_m, Vec pv_n, Vec pv_f, Vec pv_s); 64 64 void clear(); -
issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateConstraintsDiagnosticHoriz.cpp
r4002 r4003 44 44 45 45 if ((int)iomodel->spcvelocity[6*i+0] | (int)iomodel->gridonhutter[i]) 46 constraints->AddObject(new Spc(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,1,*(iomodel->spcvelocity+6*i+3)/iomodel->yts )); //add count'th spc, on node i+1, setting dof 1 to vx.46 constraints->AddObject(new Spc(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,1,*(iomodel->spcvelocity+6*i+3)/iomodel->yts,DiagnosticHorizAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx. 47 47 48 48 count++; 49 49 50 50 if ((int)iomodel->spcvelocity[6*i+1] | (int)iomodel->gridonhutter[i]) 51 constraints->AddObject(new Spc(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,2,*(iomodel->spcvelocity+6*i+4)/iomodel->yts )); //add count'th spc, on node i+1, setting dof 2 to vy51 constraints->AddObject(new Spc(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,2,*(iomodel->spcvelocity+6*i+4)/iomodel->yts,DiagnosticHorizAnalysisEnum)); //add count'th spc, on node i+1, setting dof 2 to vy 52 52 53 53 count++; … … 73 73 node2=(int)*(iomodel->penalties+iomodel->numlayers*i+j)+iomodel->nodecounter; 74 74 75 constraints->AddObject(new Rgb(iomodel->constraintcounter+count+1,node1,node2,1 )); //add count'th Rgb on dof 1 between node1 and node275 constraints->AddObject(new Rgb(iomodel->constraintcounter+count+1,node1,node2,1,DiagnosticHorizAnalysisEnum)); //add count'th Rgb on dof 1 between node1 and node2 76 76 77 77 count++; 78 78 79 constraints->AddObject(new Rgb(iomodel->constraintcounter+count+1,node1,node2,2) ); //add count'th Rgb on dof 1 between node1 and node279 constraints->AddObject(new Rgb(iomodel->constraintcounter+count+1,node1,node2,2),DiagnosticHorizAnalysisEnum); //add count'th Rgb on dof 1 between node1 and node2 80 80 81 81 } -
issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateLoadsDiagnosticHoriz.cpp
r4002 r4003 56 56 57 57 /*Create and add load: */ 58 loads->AddObject(new Icefront(iomodel->loadcounter+count+1,i,iomodel ));58 loads->AddObject(new Icefront(iomodel->loadcounter+count+1,i,iomodel,DiagnosticHorizAnalysisEnum)); 59 59 count++; 60 60 … … 79 79 if(iomodel->my_elements[(int)*(iomodel->riftinfo+RIFTINFOSIZE*i+2)]){ 80 80 81 loads->AddObject(new Riftfront(iomodel->loadcounter+count+1,i,iomodel ));81 loads->AddObject(new Riftfront(iomodel->loadcounter+count+1,i,iomodel,DiagnosticHorizAnalysisEnum)); 82 82 count++; 83 83 } -
issm/trunk/src/c/modules/MpcNodesx/MpcNodesx.cpp
r3913 r4003 10 10 #include "../../EnumDefinitions/EnumDefinitions.h" 11 11 12 int MpcNodesx( Mat* pRmg, DataSet* nodes,DataSet* constraints ){12 int MpcNodesx( Mat* pRmg, DataSet* nodes,DataSet* constraints,int analysis_type){ 13 13 14 14 int i; … … 28 28 29 29 /*First, recover number of dofs from nodes: */ 30 numberofdofs=nodes->NumberOfDofs( );30 numberofdofs=nodes->NumberOfDofs(analysis_type); 31 31 32 32 /*Get number of equations from number of constraints: */ 33 numberofequations=constraints->NumberOfRgbs( );33 numberofequations=constraints->NumberOfRgbs(analysis_type); 34 34 35 35 if(numberofequations){ … … 41 41 42 42 /*Now, go through constraints, and update the nodes and the constraint vector at the same time: */ 43 constraints->SetupMpcs(Rmg,nodes );43 constraints->SetupMpcs(Rmg,nodes,analysis_type); 44 44 45 45 /*Assemble matrix: */ -
issm/trunk/src/c/modules/MpcNodesx/MpcNodesx.h
r3913 r4003 10 10 11 11 /* local prototypes: */ 12 int MpcNodesx( Mat* pRmg, DataSet* nodes,DataSet* constraints );12 int MpcNodesx( Mat* pRmg, DataSet* nodes,DataSet* constraints,int analysis_type); 13 13 14 14 #endif /* _MPCNODESX_H */ -
issm/trunk/src/c/modules/SpcNodesx/SpcNodesx.cpp
r4002 r4003 28 28 29 29 /*Now, go through constraints, and update the nodes and the constraint vector at the same time: */ 30 constraints->SetupSpcs(nodes,yg );30 constraints->SetupSpcs(nodes,yg,analysis_type); 31 31 32 32 /*Specify numentries: */ -
issm/trunk/src/c/objects/Constraints/Rgb.cpp
r3775 r4003 25 25 /*}}}1*/ 26 26 /*FUNCTION Rgb::creation {{{1*/ 27 Rgb::Rgb(int rgb_id,int rgb_nodeid1,int rgb_nodeid2, int rgb_dof ){27 Rgb::Rgb(int rgb_id,int rgb_nodeid1,int rgb_nodeid2, int rgb_dof,int rgb_analysis_type){ 28 28 29 29 id=rgb_id; … … 31 31 nodeid2=rgb_nodeid2; 32 32 dof=rgb_dof; 33 analysis_type=rgb_analysis_type; 33 34 34 35 return; … … 62 63 memcpy(marshalled_dataset,&nodeid2,sizeof(nodeid2));marshalled_dataset+=sizeof(nodeid2); 63 64 memcpy(marshalled_dataset,&dof,sizeof(dof));marshalled_dataset+=sizeof(dof); 65 memcpy(marshalled_dataset,&analysis_type,sizeof(analysis_type));marshalled_dataset+=sizeof(analysis_type); 64 66 65 67 *pmarshalled_dataset=marshalled_dataset; … … 74 76 sizeof(nodeid2)+ 75 77 sizeof(dof)+ 78 sizeof(analysis_type)+ 76 79 sizeof(int); //sizeof(int) for enum type 77 80 } … … 92 95 memcpy(&nodeid2,marshalled_dataset,sizeof(nodeid2));marshalled_dataset+=sizeof(nodeid2); 93 96 memcpy(&dof,marshalled_dataset,sizeof(dof));marshalled_dataset+=sizeof(dof); 97 memcpy(&analysis_type,marshalled_dataset,sizeof(analysis_type));marshalled_dataset+=sizeof(analysis_type); 94 98 95 99 /*return: */ … … 113 117 printf(" nodeid2: %i\n",nodeid2); 114 118 printf(" dof: %i\n",dof); 119 printf(" analysis_type: %s\n",EnumAsString(analysis_type)); 115 120 return; 116 121 } … … 124 129 printf(" nodeid2: %i\n",nodeid2); 125 130 printf(" dof: %i\n",dof); 131 printf(" analysis_type: %s\n",EnumAsString(analysis_type)); 126 132 return; 127 133 } … … 160 166 } 161 167 /*}}}1*/ 168 /*FUNCTION Rgb::InAnalysis(int analysis_type){{{1*/ 169 bool Rgb::InAnalysis(int in_analysis_type){ 170 if (in_analysis_type=this->analysis_type)return true; 171 else return false; 172 } 173 /*}}}*/ 174 -
issm/trunk/src/c/objects/Constraints/Rgb.h
r3751 r4003 19 19 int nodeid2; 20 20 int dof; /*!component*/ 21 int analysis_type; 21 22 22 23 public: 23 24 24 25 Rgb(); 25 Rgb(int rgb_id,int rgb_nodeid1,int rgb_nodeid2, int rgb_dof );26 Rgb(int rgb_id,int rgb_nodeid1,int rgb_nodeid2, int rgb_dof,int analysis_type); 26 27 ~Rgb(); 27 28 … … 49 50 int GetDof(); 50 51 Object* copy(); 52 bool InAnalysis(int analysis_type); 53 51 54 52 55 }; -
issm/trunk/src/c/objects/Constraints/Spc.cpp
r3775 r4003 26 26 /*}}}1*/ 27 27 /*FUNCTION Spc::creation {{{1*/ 28 Spc::Spc(int spc_sid,int spc_nodeid, int spc_dof,double spc_value ){28 Spc::Spc(int spc_sid,int spc_nodeid, int spc_dof,double spc_value,int spc_analysis_type){ 29 29 30 30 sid=spc_sid; … … 32 32 dof=spc_dof; 33 33 value=spc_value; 34 analysis_type=spc_analysis_type; 34 35 35 36 return; … … 63 64 memcpy(marshalled_dataset,&dof,sizeof(dof));marshalled_dataset+=sizeof(dof); 64 65 memcpy(marshalled_dataset,&value,sizeof(value));marshalled_dataset+=sizeof(value); 66 memcpy(marshalled_dataset,&analysis_type,sizeof(analysis_type));marshalled_dataset+=sizeof(analysis_type); 65 67 66 68 *pmarshalled_dataset=marshalled_dataset; … … 71 73 int Spc::MarshallSize(){ 72 74 73 return sizeof(sid)+sizeof(nodeid)+sizeof(dof)+sizeof(value)+sizeof(int); //sizeof(int) for enum type 75 return sizeof(sid) 76 +sizeof(nodeid) 77 +sizeof(dof) 78 +sizeof(value) 79 +sizeof(analysis_type) 80 +sizeof(int); //sizeof(int) for enum type 74 81 } 75 82 /*}}}1*/ … … 89 96 memcpy(&dof,marshalled_dataset,sizeof(dof));marshalled_dataset+=sizeof(dof); 90 97 memcpy(&value,marshalled_dataset,sizeof(value));marshalled_dataset+=sizeof(value); 98 memcpy(&analysis_type,marshalled_dataset,sizeof(analysis_type));marshalled_dataset+=sizeof(analysis_type); 91 99 92 100 /*return: */ … … 110 118 printf(" dof: %i\n",dof); 111 119 printf(" value: %g\n",value); 120 printf(" analysis_type: %s\n",EnumAsString(analysis_type)); 112 121 return; 113 122 } … … 124 133 printf(" dof: %i\n",dof); 125 134 printf(" value: %g\n",value); 135 printf(" analysis_type: %s\n",EnumAsString(analysis_type)); 126 136 return; 127 137 } … … 159 169 } 160 170 /*}}}1*/ 171 /*FUNCTION Spc::InAnalysis(int analysis_type){{{1*/ 172 bool Spc::InAnalysis(int in_analysis_type){ 173 if (in_analysis_type=this->analysis_type)return true; 174 else return false; 175 } 176 /*}}}*/ 177 -
issm/trunk/src/c/objects/Constraints/Spc.h
r3751 r4003 19 19 int dof; /*!component*/ 20 20 double value; /*value*/ 21 int analysis_type; 21 22 22 23 public: 23 24 24 25 Spc(); 25 Spc(int sid,int nodeid, int dof,double value );26 Spc(int sid,int nodeid, int dof,double value,int analysis_type); 26 27 ~Spc(); 27 28 … … 45 46 void UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");} 46 47 void UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");} 48 void UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");} 49 bool InAnalysis(int analysis_type); 47 50 48 void UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");}49 51 50 52 -
issm/trunk/src/c/objects/Elements/Penta.cpp
r3984 r4003 232 232 penta->InitHookNodes(this->nummodels); 233 233 for(i=0;i<this->nummodels;i++)penta->hnodes[i].copy(&this->hnodes[i]); 234 penta->hnodes.copy(&this->hnodes);235 234 penta->hmatice.copy(&this->hmatice); 236 235 penta->hmatpar.copy(&this->hmatpar); -
issm/trunk/src/c/objects/Elements/Tria.cpp
r3984 r4003 222 222 tria->InitHookNodes(this->nummodels); 223 223 for(i=0;i<this->nummodels;i++)tria->hnodes[i].copy(&this->hnodes[i]); 224 tria->hnodes.copy(&this->hnodes);225 224 tria->hmatice.copy(&this->hmatice); 226 225 tria->hmatpar.copy(&this->hmatpar); … … 229 228 tria->nodes=(Node**)xmalloc(3*sizeof(Node*)); //we cannot rely on an analysis_counter to tell us which analysis_type we are running, so we just copy the nodes. 230 229 for(i=0;i<3;i++)tria->nodes[i]=this->nodes[i]; 231 tria->nodes=(Node**)tria->hnodes.deliverp();232 230 tria->matice=(Matice*)tria->hmatice.delivers(); 233 231 tria->matpar=(Matpar*)tria->hmatpar.delivers(); -
issm/trunk/src/c/objects/FemModel.cpp
r4002 r4003 131 131 132 132 _printf_(" create rigid body constraints:\n"); 133 MpcNodesx( &Rmg[analysis_counter], nodes,constraints );133 MpcNodesx( &Rmg[analysis_counter], nodes,constraints,analysis_counter); 134 134 135 135 _printf_(" create node sets:\n"); -
issm/trunk/src/c/objects/Loads/Icefront.cpp
r3863 r4003 26 26 } 27 27 /*}}}*/ 28 /*FUNCTION Icefront::Icefront(int id, int* node_ids, int numnodes, int element_id, int matpar_id){{{1*/ 29 Icefront::Icefront(int icefront_id,int* icefront_node_ids, int icefront_numnodes, int icefront_element_id, int icefront_matpar_id): 30 hnodes(icefront_node_ids,icefront_numnodes), 31 helement(&icefront_element_id,1), 32 hmatpar(&icefront_matpar_id,1) 33 { 34 35 /*all the initialization has been done by the initializer, just fill in the id : */ 36 this->id=icefront_id; 37 this->parameters=NULL; 38 this->inputs=new Inputs(); 39 40 } 41 /*}}}*/ 42 /*FUNCTION Icefront::Icefront(int id, Hook* hnodes, Hook* helement, Hook* hmatpar, Parameters* parameters, Inputs* icefront_inputs) {{{1*/ 43 Icefront::Icefront(int icefront_id,Hook* icefront_hnodes, Hook* icefront_helement, Hook* icefront_hmatpar, Parameters* icefront_parameters, Inputs* icefront_inputs): 44 hnodes(icefront_hnodes), 45 helement(icefront_helement), 46 hmatpar(icefront_hmatpar) 47 { 48 49 /*all the initialization has been done by the initializer, just fill in the id: */ 50 this->id=icefront_id; 51 if(icefront_inputs){ 52 this->inputs=(Inputs*)icefront_inputs->Copy(); 53 } 54 else{ 55 this->inputs=new Inputs(); 56 } 57 /*point parameters: */ 58 this->parameters=icefront_parameters; 59 } 60 /*}}}*/ 61 /*FUNCTION Icefront::Icefront(int id, int i, IoModel* iomodel) {{{1*/ 62 Icefront::Icefront(int icefront_id,int i, IoModel* iomodel){ 28 /*FUNCTION Icefront::Icefront(int id, int i, IoModel* iomodel,int analysis_type) {{{1*/ 29 Icefront::Icefront(int icefront_id,int i, IoModel* iomodel,int in_analysis_type){ 63 30 64 31 int segment_width; … … 114 81 /*Ok, we have everything to build the object: */ 115 82 this->id=icefront_id; 83 this->analysis_type=in_analysis_type; 116 84 117 85 /*Hooks: */ … … 130 98 131 99 100 /*}}}*/ 101 /*FUNCTION Icefront::copy {{{1*/ 102 Object* Icefront::copy() { 103 104 Icefront* icefront=NULL; 105 106 icefront=new Icefront(); 107 108 /*copy fields: */ 109 icefront->id=this->id; 110 icefront->analysis=this->analysis; 111 if(this->inputs){ 112 icefront->inputs=(Inputs*)this->inputs->Copy(); 113 } 114 else{ 115 icefront->inputs=new Inputs(); 116 } 117 /*point parameters: */ 118 icefront->parameters=this->parameters; 119 120 /*now deal with hooks and objects: */ 121 icefront->hnodes.copy(&this->hnodes); 122 icefront->helement.copy(&this->helement); 123 icefront->hmatpar.copy(&this->hmatpar); 124 125 /*recover objects: */ 126 icefront->nodes=(Node**)icefront->hnodes.deliverp(); 127 icefront->element=(Element*)icefront->helement.delivers(); 128 icefront->matpar=(Matpar*)icefront->hmatpar.delivers(); 129 130 return icefront; 131 132 } 132 133 /*}}}*/ 133 134 /*FUNCTION Icefront::~Icefront() {{{1*/ … … 152 153 } 153 154 /*}}}*/ 154 /*FUNCTION Icefront::copy {{{1*/155 Object* Icefront::copy() {156 return new Icefront(this->id,&this->hnodes,&this->helement,&this->hmatpar,this->parameters,this->inputs);157 }158 /*}}}*/159 155 /*FUNCTION Icefront::DeepEcho{{{1*/ 160 156 void Icefront::DeepEcho(void){ … … 162 158 printf("Icefront:\n"); 163 159 printf(" id: %i\n",id); 160 printf(" analysis_type: %s\n",EnumAsString(analysis_type)); 164 161 hnodes.DeepEcho(); 165 162 helement.DeepEcho(); … … 184 181 185 182 memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id); 183 memcpy(&analysis_type,marshalled_dataset,sizeof(analysis_type));marshalled_dataset+=sizeof(analysis_type); 186 184 187 185 /*demarshall hooks: */ … … 205 203 printf("Icefront:\n"); 206 204 printf(" id: %i\n",id); 205 printf(" analysis_type: %s\n",EnumAsString(analysis_type)); 207 206 hnodes.Echo(); 208 207 helement.Echo(); … … 243 242 /*marshall Icefront data: */ 244 243 memcpy(marshalled_dataset,&id,sizeof(id));marshalled_dataset+=sizeof(id); 244 memcpy(marshalled_dataset,&analysis_type,sizeof(analysis_type));marshalled_dataset+=sizeof(analysis_type); 245 245 246 246 /*Marshall hooks: */ … … 266 266 267 267 return sizeof(id) 268 +sizeof(analysis_type) 268 269 +hnodes.MarshallSize() 269 270 +helement.MarshallSize() … … 1384 1385 } 1385 1386 /*}}}*/ 1387 /*FUNCTION Icefront::InAnalysis(int analysis_type){{{1*/ 1388 bool Icefront::InAnalysis(int in_analysis_type){ 1389 if (in_analysis_type=this->analysis_type)return true; 1390 else return false; 1391 } 1392 /*}}}*/ 1393 -
issm/trunk/src/c/objects/Loads/Icefront.h
r3863 r4003 22 22 public: 23 23 int id; 24 int analysis_type; 24 25 25 26 /*hooks: */ … … 34 35 /*constructors: {{{1*/ 35 36 Icefront(); 36 Icefront(int icefront_id,int* icefront_node_ids, int icefront_numnodes, int icefront_element_id,int icefront_matpar_id); 37 Icefront(int icefront_id, Hook* icefront_hnodes, Hook* icefront_helement, Hook* icefront_hmatpar, Parameters* parameters, Inputs* icefront_inputs); 38 Icefront(int icefront_id,int i, IoModel* iomodel); 37 Icefront(int icefront_id,int i, IoModel* iomodel,int analysis_type); 39 38 ~Icefront(); 39 Object* copy(); 40 40 /*}}}*/ 41 41 /*object management: {{{1*/ 42 42 void Configure(DataSet* elementsin,DataSet* loadsin,DataSet* nodesin,DataSet* verticesin,DataSet* materialsin,Parameters* parametersin); 43 Object* copy();44 43 void DeepEcho(); 45 44 void Demarshall(char** pmarshalled_dataset); … … 56 55 void UpdateInputsFromConstant(int constant, int name); 57 56 void UpdateInputsFromConstant(bool constant, int name); 57 void UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type); 58 bool InAnalysis(int analysis_type); 58 59 59 void UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type);60 60 61 61 -
issm/trunk/src/c/objects/Loads/Riftfront.cpp
r3913 r4003 27 27 } 28 28 /*}}}*/ 29 /*FUNCTION Riftfront::Riftfront(int id, int* node_ids, int matice_id, int matpar_id){{{1*/ 30 Riftfront::Riftfront(int riftfront_id,int* riftfront_node_ids, int riftfront_matpar_id): 31 hnodes(riftfront_node_ids,2), 32 hmatpar(&riftfront_matpar_id,1) 33 { 34 35 /*all the initialization has been done by the initializer, just fill in the id: */ 36 this->id=riftfront_id; 37 this->parameters=NULL; 38 this->inputs=new Inputs(); 39 40 } 41 /*}}}*/ 42 /*FUNCTION Riftfront::Riftfront(int id, Hook* hnodes, Hook* hmatice, Hook* hmatpar, Parameters* parameters, Inputs* riftfront_inputs) {{{1*/ 43 Riftfront::Riftfront(int riftfront_id,Hook* riftfront_hnodes, Hook* riftfront_hmatpar, Parameters* riftfront_parameters, Inputs* riftfront_inputs): 44 hnodes(riftfront_hnodes), 45 hmatpar(riftfront_hmatpar) 46 { 47 48 /*all the initialization has been done by the initializer, just fill in the id: */ 49 this->id=riftfront_id; 50 if(riftfront_inputs){ 51 this->inputs=(Inputs*)riftfront_inputs->Copy(); 52 } 53 else{ 54 this->inputs=new Inputs(); 55 } 56 /*point parameters: */ 57 this->parameters=riftfront_parameters; 58 } 59 /*}}}*/ 60 /*FUNCTION Riftfront::Riftfront(int id, int i, IoModel* iomodel){{{1*/ 61 Riftfront::Riftfront(int riftfront_id,int i, IoModel* iomodel){ 29 /*FUNCTION Riftfront::Riftfront(int id, int i, IoModel* iomodel,int analysis_type){{{1*/ 30 Riftfront::Riftfront(int riftfront_id,int i, IoModel* iomodel,int riftfront_analysis_type){ 62 31 63 32 /*data: */ … … 83 52 /*id: */ 84 53 this->id=riftfront_id; 54 this->analysis_type=riftfront_analysis_type; 85 55 86 56 /*hooks: */ … … 124 94 } 125 95 /*}}}1*/ 96 /*FUNCTION Riftfront::copy {{{1*/ 97 Object* Riftfront::copy() { 98 99 Riftfront* riftfront=NULL; 100 101 riftfront=new Riftfront(); 102 103 /*copy fields: */ 104 riftfront->id=this->id; 105 riftfront->analysis=this->analysis; 106 if(this->inputs){ 107 riftfront->inputs=(Inputs*)this->inputs->Copy(); 108 } 109 else{ 110 riftfront->inputs=new Inputs(); 111 } 112 /*point parameters: */ 113 riftfront->parameters=this->parameters; 114 115 /*now deal with hooks and objects: */ 116 riftfront->hnodes.copy(&this->hnodes); 117 riftfront->helement.copy(&this->helement); 118 riftfront->hmatpar.copy(&this->hmatpar); 119 120 /*recover objects: */ 121 riftfront->nodes=(Node**)riftfront->hnodes.deliverp(); 122 riftfront->element=(Element*)riftfront->helement.delivers(); 123 riftfront->matpar=(Matpar*)riftfront->hmatpar.delivers(); 124 125 return riftfront; 126 127 } 128 /*}}}*/ 126 129 /*FUNCTION Riftfront::~Riftfront(){{{1*/ 127 130 Riftfront::~Riftfront(){ … … 132 135 133 136 /*Object marshall*/ 134 /*FUNCTION Riftfront::copy {{{1*/135 Object* Riftfront::copy() {136 return new Riftfront(*this);137 }138 /*}}}1*/139 137 /*FUNCTION Riftfront::Configure {{{1*/ 140 138 void Riftfront::Configure(DataSet* elementsin,DataSet* loadsin,DataSet* nodesin,DataSet* verticesin,DataSet* materialsin,Parameters* parametersin){ … … 155 153 printf("Riftfront:\n"); 156 154 printf(" id: %i\n",id); 155 printf(" analysis_type: %s\n",EnumAsString(analysis_type)); 157 156 hnodes.DeepEcho(); 158 157 hmatpar.DeepEcho(); … … 176 175 177 176 memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id); 177 memcpy(&analysis_type,marshalled_dataset,sizeof(analysis_type));marshalled_dataset+=sizeof(analysis_type); 178 178 179 memcpy(&active,marshalled_dataset,sizeof(active));marshalled_dataset+=sizeof(active); 179 180 memcpy(&normal,marshalled_dataset,sizeof(normal));marshalled_dataset+=sizeof(normal); … … 233 234 234 235 /*marshall Riftfront data: */ 235 memcpy(marshalled_dataset,&id,sizeof(id));marshalled_dataset+=sizeof(id); 236 memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id); 237 memcpy(marshalled_dataset,&analysis_type,sizeof(analysis_type));marshalled_dataset+=sizeof(analysis_type); 238 236 239 memcpy(marshalled_dataset,&active,sizeof(active));marshalled_dataset+=sizeof(active); 237 240 memcpy(marshalled_dataset,&normal,sizeof(normal));marshalled_dataset+=sizeof(normal); … … 265 268 266 269 return sizeof(id) 270 +sizeof(analysis_type) 271 267 272 +sizeof(active) 268 273 +sizeof(normal) … … 929 934 } 930 935 /*}}}1*/ 936 /*FUNCTION Riftfront::InAnalysis(int analysis_type){{{1*/ 937 bool Riftfront::InAnalysis(int in_analysis_type){ 938 if (in_analysis_type=this->analysis_type)return true; 939 else return false; 940 } 941 /*}}}*/ 942 -
issm/trunk/src/c/objects/Loads/Riftfront.h
r3751 r4003 22 22 public: 23 23 int id; 24 int analysis_type; 24 25 25 26 Hook hnodes; //2 nodes … … 44 45 /*constructors,destructors: {{{1*/ 45 46 Riftfront(); 46 Riftfront(int riftfront_id,int* riftfront_node_ids, int riftfront_matpar_id); 47 Riftfront(int riftfront_id,Hook* riftfront_hnodes, Hook* riftfront_hmatpar, Parameters* parameters, Inputs* riftfront_inputs); 48 Riftfront(int riftfront_id,int i, IoModel* iomodel); 47 Riftfront(int riftfront_id,int i, IoModel* iomodel,int analysis_type); 49 48 ~Riftfront(); 50 49 /*}}}*/ … … 66 65 void UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");} 67 66 void UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");} 67 void UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");} 68 bool InAnalysis(int analysis_type); 68 69 69 void UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");}70 70 71 71 -
issm/trunk/src/mex/MpcNodes/MpcNodes.cpp
r2333 r4003 14 14 DataSet* nodes=NULL; 15 15 DataSet* constraints=NULL; 16 int analysis_type; 16 17 17 18 /* output datasets: */ … … 27 28 FetchData(&nodes,NODESIN); 28 29 FetchData(&constraints,CONSTRAINTS); 30 FetchData(&analysis_type,ANALYSISTYPE); 29 31 30 32 /*!Generate internal degree of freedom numbers: */ 31 MpcNodesx( &Rmg, nodes,constraints );33 MpcNodesx( &Rmg, nodes,constraints,analysis_type); 32 34 33 35 /*write output datasets: */ -
issm/trunk/src/mex/MpcNodes/MpcNodes.h
r3913 r4003 21 21 #define NODESIN (mxArray*)prhs[0] 22 22 #define CONSTRAINTS (mxArray*)prhs[1] 23 #define ANALYSISTYPE (mxArray*)prhs[2] 23 24 24 25 /* serial output macros: */ … … 30 31 #define NLHS 2 31 32 #undef NRHS 32 #define NRHS 233 #define NRHS 3 33 34 34 35 -
issm/trunk/src/mex/SpcNodes/SpcNodes.cpp
r2333 r4003 14 14 DataSet* nodes=NULL; 15 15 DataSet* constraints=NULL; 16 int analysis_type; 16 17 17 18 /* output datasets: */ … … 27 28 FetchData(&nodes,NODESIN); 28 29 FetchData(&constraints,CONSTRAINTS); 30 FetchData(&analysis_type,ANALYSISTYPE); 29 31 30 32 /*!Generate internal degree of freedom numbers: */ 31 SpcNodesx( &yg, nodes,constraints );33 SpcNodesx( &yg, nodes,constraints,analysis_type); 32 34 33 35 /*write output datasets: */ -
issm/trunk/src/mex/SpcNodes/SpcNodes.h
r3913 r4003 21 21 #define NODESIN (mxArray*)prhs[0] 22 22 #define CONSTRAINTS (mxArray*)prhs[1] 23 #define ANALYSISTYPE (mxArray*)prhs[2] 23 24 24 25 /* serial output macros: */ … … 30 31 #define NLHS 2 31 32 #undef NRHS 32 #define NRHS 233 #define NRHS 3 33 34 34 35
Note:
See TracChangeset
for help on using the changeset viewer.