/***************************************************/ /**** 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 Methods ****/ /***************************************************/ private List <Constraint4DOF> Read4DOFConstraints(List <string> ids = null) { object[] lusasSupports = d_LusasData.getAttributes("Support"); List <Constraint4DOF> constraints4DOFs = new List <Constraint4DOF>(); for (int i = 0; i < lusasSupports.Count(); i++) { IFSupportStructural lusasSupport = (IFSupportStructural)lusasSupports[i]; Constraint4DOF constraint4DOF = Adapters.Lusas.Convert.ToConstraint4DOF(lusasSupport); if (constraint4DOF != null) { constraints4DOFs.Add(constraint4DOF); } } return(constraints4DOFs); }
/***************************************************/ /**** Public Methods ****/ /***************************************************/ public static Constraint6DOF ToConstraint6DOF(this IFSupportStructural lusasAttribute) { List <string> releaseNames = new List <string> { "U", "V", "W", "THX", "THY", "THZ" }; List <bool> fixity = new List <bool>(); List <double> stiffness = new List <double>(); foreach (string releaseName in releaseNames) { string fixityValue = lusasAttribute.getValue(releaseName); if (fixityValue == "F") { fixity.Add(false); stiffness.Add(0.0); } else if (fixityValue == "R") { fixity.Add(true); stiffness.Add(0.0); } else if (fixityValue == "S") { fixity.Add(false); double stiffnessValue = lusasAttribute.getValue(releaseName + "stiff"); stiffness.Add(stiffnessValue); } } string attributeName = GetName(lusasAttribute); Constraint6DOF constraint6DOF = BH.Engine.Structure.Create.Constraint6DOF( attributeName, fixity, stiffness); int adapterNameId = lusasAttribute.getID(); constraint6DOF.SetAdapterId(typeof(LusasId), adapterNameId); return(constraint6DOF); }