/***************************************************/ /**** Public Methods ****/ /***************************************************/ public static Constraint4DOF ToConstraint4DOF(this IFSupportStructural lusasAttribute) { List <string> releaseNames = new List <string> { "U", "V", "W", "THX" }; List <DOFType> fixity = new List <DOFType>(); List <double> stiffness = new List <double>(); foreach (string releaseName in releaseNames) { string fixityValue = lusasAttribute.getValue(releaseName); if (fixityValue == "F") { fixity.Add(DOFType.Free); stiffness.Add(0.0); } else if (fixityValue == "R") { fixity.Add(DOFType.Fixed); stiffness.Add(0.0); } else if (fixityValue == "S") { fixity.Add(DOFType.Spring); double stiffnessValue = lusasAttribute.getValue(releaseName + "stiff"); stiffness.Add(stiffnessValue); } } string attributeName = GetName(lusasAttribute); Constraint4DOF constraint4DOF = new Constraint4DOF { Name = attributeName }; constraint4DOF.TranslationX = fixity[0]; constraint4DOF.TranslationY = fixity[1]; constraint4DOF.TranslationZ = fixity[2]; constraint4DOF.RotationX = fixity[3]; constraint4DOF.RotationalStiffnessX = stiffness[0]; constraint4DOF.TranslationalStiffnessX = stiffness[1]; constraint4DOF.TranslationalStiffnessX = stiffness[2]; constraint4DOF.TranslationalStiffnessX = stiffness[3]; int adapterNameId = lusasAttribute.getID(); constraint4DOF.SetAdapterId(typeof(LusasId), adapterNameId); return(constraint4DOF); }
/***************************************************/ private IFAttribute CreateSupport(Constraint4DOF constraint) { if (!Engine.Adapters.Lusas.Query.CheckIllegalCharacters(constraint.DescriptionOrName())) { return(null); } IFAttribute lusasSupport = null; if (d_LusasData.existsAttribute("Support", constraint.DescriptionOrName())) { lusasSupport = d_LusasData.getAttribute("Support", constraint.DescriptionOrName()); } else { lusasSupport = d_LusasData.createSupportStructural(constraint.DescriptionOrName()); List <string> releaseNames = new List <string> { "U", "V", "W", "THX" }; List <double> stiffness = new List <double> { constraint.TranslationalStiffnessX, constraint.TranslationalStiffnessY, constraint.TranslationalStiffnessZ, constraint.RotationalStiffnessX }; List <DOFType> fixities = new List <DOFType> { constraint.TranslationX, constraint.TranslationY, constraint.TranslationZ, constraint.RotationX }; for (int i = 0; i < releaseNames.Count(); i++) { if (fixities[i] == DOFType.Fixed) { lusasSupport.setValue(releaseNames[i], "R"); } else if (stiffness[i] == 0) { lusasSupport.setValue(releaseNames[i], "F"); } else { lusasSupport.setValue(releaseNames[i], "S"); lusasSupport.setValue(releaseNames[i] + "stiff", stiffness[i]); } } } if (lusasSupport != null) { int adapterIdName = lusasSupport.getID(); constraint.SetAdapterId(typeof(LusasId), adapterIdName); return(lusasSupport); } return(null); }