/***************************************************/ /**** Public Methods ****/ /***************************************************/ public static Edge Edge(ICurve curve, Constraint4DOF constraint = null, string name = "") { return(new Edge { Curve = curve, Constraint = constraint, Name = name }); }
public static Edge Edge(ICurve curve, Constraint4DOF release = null, string name = "") { return(new Edge { Curve = curve, Release = release, Name = name }); }
public static bool IsNull(this Constraint4DOF constraint, string msg = "", [CallerMemberName] string methodName = "Method") { if (constraint == null) { ErrorMessage(methodName, "Constraint4DOF", msg); return(true); } return(false); }
public static string Description(this Constraint4DOF constraint) { string desc = constraint.TranslationX.DofSign() + constraint.TranslationY.DofSign() + constraint.TranslationZ.DofSign() + constraint.RotationX.DofSign(); if (constraint.IsNumericallyDependent()) { desc += $"- {constraint.TranslationalStiffnessX:G3}, {constraint.TranslationalStiffnessY:G3}, {constraint.TranslationalStiffnessZ:G3}, " + $"{constraint.RotationalStiffnessX:G3}"; } return(desc); }
/***************************************************/ /**** 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); }
public static bool IsNumericallyDependent(this Constraint4DOF constraint) { if (constraint.IsNull()) { return(false); } if (constraint.TranslationX.IsNumericallyDependent()) { return(true); } if (constraint.TranslationY.IsNumericallyDependent()) { return(true); } if (constraint.TranslationZ.IsNumericallyDependent()) { return(true); } if (constraint.RotationX.IsNumericallyDependent()) { return(true); } if (constraint.TranslationalStiffnessX != 0) { return(true); } if (constraint.TranslationalStiffnessY != 0) { return(true); } if (constraint.TranslationalStiffnessZ != 0) { return(true); } if (constraint.RotationalStiffnessX != 0) { return(true); } return(false); }
/***************************************************/ /**** 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); }
/***************************************************/ 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); }
/***************************************************/ /**** Public Methods ****/ /***************************************************/ public static Bar ToBar(this IFLine lusasLine, Dictionary <string, Node> nodes, Dictionary <string, Constraint4DOF> supports, HashSet <string> lusasGroups, Dictionary <string, IMaterialFragment> materials, Dictionary <string, ISectionProperty> sections, Dictionary <string, MeshSettings1D> meshes ) { Node startNode = GetNode(lusasLine, 0, nodes); Node endNode = GetNode(lusasLine, 1, nodes); HashSet <string> tags = new HashSet <string>(IsMemberOf(lusasLine, lusasGroups)); List <string> supportAssignments = GetAttributeAssignments(lusasLine, "Support"); Constraint4DOF barConstraint = null; if (!(supportAssignments.Count() == 0)) { supports.TryGetValue(supportAssignments[0], out barConstraint); } Bar bar = new Bar { StartNode = startNode, EndNode = endNode, Tags = tags, Support = barConstraint }; List <string> geometricAssignments = GetAttributeAssignments(lusasLine, "Geometric"); List <string> materialAssignments = GetAttributeAssignments(lusasLine, "Material"); IMaterialFragment lineMaterial; ISectionProperty lineSection; if (!(geometricAssignments.Count() == 0)) { sections.TryGetValue(geometricAssignments[0], out lineSection); if (lineSection != null) { if (!(materialAssignments.Count() == 0)) { materials.TryGetValue(materialAssignments[0], out lineMaterial); if (lineMaterial != null) { lineSection.Material = lineMaterial; } } bar.SectionProperty = lineSection; } } MeshSettings1D lineMesh; List <string> meshSettings = GetAttributeAssignments(lusasLine, "Mesh"); if (!(meshSettings.Count() == 0)) { meshes.TryGetValue(meshSettings[0], out lineMesh); bar.Fragments.Add(lineMesh); } Tuple <bool, double, BarRelease, BarFEAType> barMeshProperties = GetMeshProperties(lusasLine); if (barMeshProperties.Item1) { bar.OrientationAngle = barMeshProperties.Item2; bar.Release = barMeshProperties.Item3; bar.FEAType = barMeshProperties.Item4; } string adapterID = lusasLine.getID().ToString(); bar.SetAdapterId(typeof(LusasId), adapterID); return(bar); }