public void AddConstraint(XNode node, StructuralDof dof, double displacement) { // TODO: This should be done more efficiently than O(N) if (!nodes.Contains(node)) { throw new ArgumentException("There is no such node"); } constraints[node, dof] = displacement; }
//TODO: Should I use the node's id instead? In a UI class, I probably should. public void AddNodalLoad(XNode node, StructuralDof dof, double magnitude) { // TODO: This should be done more efficiently than O(N) if (!nodes.Contains(node)) { throw new ArgumentException("There is no such node"); } loads[node, dof] = magnitude; }
// Would it be faster to return the Dictionary<StandardDofType, int> for consecutive accesses of the dofs of this node? // Dictionary's Read operation is supposed to be O(1), but still... public int GetStandardDofOf(XNode node, StructuralDof dofType) { return(standardDofs[node, dofType]); }
public int GetConstrainedDofOf(XNode node, StructuralDof dofType) { return(constrainedDofs[node, dofType]); }
public NodalLoad(Node node, StructuralDof dofType, double value) { this.Node = node; this.DofType = dofType; this.Value = value; }