Changeset 18388
- Timestamp:
- 08/14/14 13:35:15 (11 years ago)
- Location:
- issm/trunk-jpl/src/c/classes/Constraints
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified issm/trunk-jpl/src/c/classes/Constraints/Constraint.h ¶
r18344 r18388 23 23 virtual void PenaltyDofAndValue(int* dof,IssmDouble* value,Nodes* nodes,Parameters* parameters)=0; 24 24 virtual bool InAnalysis(int analysis_type)=0; 25 virtual void ActivatePenaltyMethod(void)=0; 25 26 26 27 }; -
TabularUnified issm/trunk-jpl/src/c/classes/Constraints/Constraints.cpp ¶
r18064 r18388 12 12 13 13 #include "./Constraints.h" 14 #include "./Constraint.h" 14 15 #include "../../shared/shared.h" 15 16 #include "../../toolkits/toolkits.h" … … 34 35 } 35 36 /*}}}*/ 37 void Constraints::ActivatePenaltyMethod(int in_analysis){/*{{{*/ 38 39 for(int i=0;i<this->Size();i++){ 40 Constraint* constraint=(Constraint*)this->GetObjectByOffset(i); 41 if(constraint->InAnalysis(in_analysis)){ 42 constraint->ActivatePenaltyMethod(); 43 } 44 } 45 46 } 47 /*}}}*/ -
TabularUnified issm/trunk-jpl/src/c/classes/Constraints/Constraints.h ¶
r18064 r18388 27 27 28 28 /*numerics*/ 29 int NumberOfConstraints(void); 29 int NumberOfConstraints(void); 30 void ActivatePenaltyMethod(int in_analysis); 30 31 31 32 }; -
TabularUnified issm/trunk-jpl/src/c/classes/Constraints/SpcDynamic.cpp ¶
r18237 r18388 20 20 SpcDynamic::SpcDynamic(int spc_sid,int spc_nodeid, int spc_dof,int spc_analysis_type){/*{{{*/ 21 21 22 sid=spc_sid; 23 nodeid=spc_nodeid; 24 dof=spc_dof; 25 value=0; 26 analysis_type=spc_analysis_type; 27 isset=false; 22 sid = spc_sid; 23 nodeid = spc_nodeid; 24 dof = spc_dof; 25 value = 0; 26 analysis_type = spc_analysis_type; 27 isset = false; 28 penalty = false; 28 29 29 30 return; … … 78 79 79 80 /*Constraint virtual functions definitions: */ 81 void SpcDynamic::ActivatePenaltyMethod(void){/*{{{*/ 82 this->penalty = true; 83 } 84 /*}}}*/ 80 85 bool SpcDynamic::InAnalysis(int in_analysis_type){/*{{{*/ 81 86 if (in_analysis_type==this->analysis_type) return true; -
TabularUnified issm/trunk-jpl/src/c/classes/Constraints/SpcDynamic.h ¶
r18344 r18388 14 14 15 15 private: 16 int sid; /*! id, to track it*/ 17 int nodeid; /*!node id*/ 18 int dof; /*!component*/ 19 IssmDouble value; /*value*/ 20 bool isset; 21 int analysis_type; 16 int sid; /*! id, to track it */ 17 int nodeid; /*!node id */ 18 int dof; /*!component */ 19 IssmDouble value; /*value */ 20 bool isset; 21 int analysis_type; 22 bool penalty; /*Is this a penalty constraint */ 22 23 23 24 public: 24 25 25 /*SpcDynamic constructors, destructors :{{{*/26 /*SpcDynamic constructors, destructors*/ 26 27 SpcDynamic(); 27 28 SpcDynamic(int sid,int nodeid, int dof,int analysis_type); 28 29 ~SpcDynamic(); 29 /*}}}*/ 30 /*Object virtual functions definitions:{{{ */ 31 void Echo(); 32 void DeepEcho(); 33 int Id(); 34 int ObjectEnum(); 35 Object* copy(); 36 /*}}}*/ 37 /*Constraint virtual functions definitions: {{{*/ 38 void ConstrainNode(Nodes* nodes,Parameters* parameters); 39 bool InAnalysis(int analysis_type); 40 void PenaltyDofAndValue(int* dof,IssmDouble* value,Nodes* nodes,Parameters* parameters){_error_("not implemented yet");}; 41 /*}}}*/ 42 /*SpcDynamic management:{{{ */ 43 int GetNodeId(); 44 int GetDof(); 30 31 /*Object virtual functions definitions*/ 32 void Echo(); 33 void DeepEcho(); 34 int Id(); 35 int ObjectEnum(); 36 Object *copy(); 37 38 /*Constraint virtual functions definitions*/ 39 void ConstrainNode(Nodes* nodes,Parameters* parameters); 40 bool InAnalysis(int analysis_type); 41 void ActivatePenaltyMethod(void); 42 void PenaltyDofAndValue(int* dof,IssmDouble* value,Nodes* nodes,Parameters* parameters){_error_("not implemented yet");}; 43 44 /*SpcDynamic management*/ 45 int GetNodeId(); 46 int GetDof(); 45 47 IssmDouble GetValue(); 46 void SetDynamicConstraint(Nodes* nodes,IssmDouble *yg_serial); 47 /*}}}*/ 48 void SetDynamicConstraint(Nodes *nodes,IssmDouble *yg_serial); 48 49 49 50 }; -
TabularUnified issm/trunk-jpl/src/c/classes/Constraints/SpcStatic.cpp ¶
r18237 r18388 25 25 value = spc_value; 26 26 analysis_type = spc_analysis_type; 27 penalty = false; 27 28 28 29 return; … … 80 81 81 82 /*Constraint virtual functions definitions: */ 83 void SpcStatic::ActivatePenaltyMethod(void){/*{{{*/ 84 this->penalty = true; 85 } 86 /*}}}*/ 82 87 bool SpcStatic::InAnalysis(int in_analysis_type){/*{{{*/ 83 88 if (in_analysis_type==this->analysis_type) return true; -
TabularUnified issm/trunk-jpl/src/c/classes/Constraints/SpcStatic.h ¶
r18344 r18388 14 14 15 15 private: 16 int sid; /*! id, to track it*/ 17 int nodeid; /*!node id*/ 18 int dof; /*!component*/ 19 IssmDouble value; /*value*/ 20 int analysis_type; 16 int sid; /*! id, to track it */ 17 int nodeid; /*!node id */ 18 int dof; /*!component */ 19 IssmDouble value; /*value */ 20 int analysis_type; 21 bool penalty; /*Is this a penalty constraint */ 21 22 22 23 public: … … 35 36 /*}}}*/ 36 37 /*Constraint virtual functions definitions: {{{*/ 38 void ActivatePenaltyMethod(void); 37 39 void ConstrainNode(Nodes* nodes,Parameters* parameters); 38 40 bool InAnalysis(int analysis_type); -
TabularUnified issm/trunk-jpl/src/c/classes/Constraints/SpcTransient.cpp ¶
r18344 r18388 28 28 SpcTransient::SpcTransient(int spc_sid,int spc_nodeid, int spc_dof,int spc_nsteps, IssmDouble* spc_times, IssmDouble* spc_values,int spc_analysis_type){/*{{{*/ 29 29 30 penalty = false;31 sid = spc_sid;32 nodeid = spc_nodeid;33 dof = spc_dof;34 nsteps = spc_nsteps;30 penalty = false; 31 sid = spc_sid; 32 nodeid = spc_nodeid; 33 dof = spc_dof; 34 nsteps = spc_nsteps; 35 35 if(spc_nsteps){ 36 36 values = xNew<IssmDouble>(spc_nsteps); … … 87 87 88 88 /*Constraint virtual functions definitions:*/ 89 void SpcTransient::ActivatePenaltyMethod(void){/*{{{*/ 90 this->penalty = true; 91 } 92 /*}}}*/ 89 93 bool SpcTransient::InAnalysis(int in_analysis_type){/*{{{*/ 90 94 -
TabularUnified issm/trunk-jpl/src/c/classes/Constraints/SpcTransient.h ¶
r18344 r18388 14 14 15 15 private: 16 bool penalty; /*Is this a penalty constraint */17 16 int sid; /* id, to track it */ 18 17 int nodeid; /*node id */ … … 22 21 int nsteps; /*number of time steps */ 23 22 int analysis_type; 23 bool penalty; /*Is this a penalty constraint */ 24 24 25 25 public: … … 38 38 /*}}}*/ 39 39 /*Constraint virtual functions definitions: {{{*/ 40 void ActivatePenaltyMethod(void); 40 41 void ConstrainNode(Nodes* nodes,Parameters* parameters); 41 42 bool InAnalysis(int analysis_type);
Note:
See TracChangeset
for help on using the changeset viewer.