Changeset 9002 for issm/trunk/src/c/modules/SpcNodesx/SpcNodesx.cpp
- Timestamp:
- 07/15/11 08:49:34 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/modules/SpcNodesx/SpcNodesx.cpp
r8303 r9002 10 10 #include "../../EnumDefinitions/EnumDefinitions.h" 11 11 12 void SpcNodesx(Nodes* nodes,Constraints* constraints, int analysis_type){12 void SpcNodesx(Nodes* nodes,Constraints* constraints,Parameters* parameters, int analysis_type){ 13 13 14 14 int i; 15 Node* node=NULL;16 int nodeid;17 int dof;18 double value;15 16 for(i=0;i<constraints->Size();i++){ 17 18 Constraint* constraint=(Constraint*)constraints->GetObjectByOffset(i); 19 19 20 for(i=0;i<constraints->Size();i++){ 20 /*Check this constraint belongs to this analysis: */ 21 if(constraint->InAnalysis(analysis_type)){ 21 22 22 Object* object=(Object*)constraints->GetObjectByOffset(i); 23 24 /*Check constraints is a single point constraint (spc): */ 25 if(object->Enum()==SpcEnum){ 26 27 Spc* spc=(Spc*)object; 28 29 if(spc->InAnalysis(analysis_type)){ 30 31 /*Ok, constraints object is a constraint. Get the nodeid from the node it applies to: */ 32 nodeid=spc->GetNodeId(); 33 dof=spc->GetDof(); 34 value=spc->GetValue(); 35 36 /*Now, chase through nodes and find the corect node: */ 37 node=(Node*)nodes->GetObjectById(NULL,nodeid); 38 39 /*Apply constraint: */ 40 if(node){ //in case the spc is dealing with a node on another cpu 41 node->ApplyConstraint(dof,value); 42 } 43 } 44 23 /*Ok, apply constraint onto corresponding node: */ 24 constraint->ConstrainNode(nodes,parameters); 45 25 } 46 26 }
Note:
See TracChangeset
for help on using the changeset viewer.