/// <summary>
        /// Analyses the stiffness matrix for warnings.
        /// </summary>
        /// <param name="mtx">The MTX.</param>
        /// <param name="map">The map.</param>
        /// <param name="currentCase">The current load case which error is with it.</param>
        /// <remarks>
        /// Only searches for zero elements on matrix diagonal
        /// </remarks>
        private void AnalyseStiffnessMatrixForWarnings(ZoneDevidedMatrix mtx, DofMappingManager map,
                                                       LoadCase currentCase)
        {
            var cs = mtx.ReleasedReleasedPart;

            var n = cs.ColumnCount;

            var t = new bool[n]; //true if i'th diagonal member nonzero, false if diagonal member zero!

            for (var i = 0; i < n; i++)
            {
                var st = cs.ColumnPointers[i];
                var en = cs.ColumnPointers[i + 1];

                var col = i;

                for (var j = st; j < en; j++)
                {
                    var row = cs.RowIndices[j];
                    //var val = cs.Values[j];

                    if (row == col)
                    {
                        t[row] = true;
                    }
                }
            }

            for (var i = 0; i < n; i++)
            {
                if (t[i])
                {
                    continue;
                }

                var globalDofNum = map.RMap1[map.RMap2[i]];

                var nodeNum = globalDofNum / 6;
                var dof     = (DoF)(globalDofNum % 6);

                var rec = TraceRecords.GetRecord(30000, parent.Nodes[nodeNum].Label);

                rec.TargetIdentifier = string.Format(
                    "{0} DoF on node #{1} for load case with [name = '{2}'] and [nature = {3}]", dof, nodeNum,
                    currentCase.CaseName, currentCase.LoadType);

                parent.Trace.Write(rec);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Checks the model for warnings.
        /// </summary>
        /// <param name="model">The model.</param>
        public void CheckModel(Model model)
        {
            for (var i = 0; i < model.Elements.Count; i++)
            {
                var elementIdentifier = string.Format("{0}'th element in Model.Elements", i);

                if (model.Elements[i] is FrameElement2Node)
                {
                    var elm = model.Elements[i] as FrameElement2Node;
                    if (elm.Label != null)
                    {
                        elementIdentifier = elm.Label;
                    }

                    //10000
                    if (elm.Geometry != null && elm.UseOverridedProperties)
                    {
                        var rec = TraceRecords.GetRecord(10000, elementIdentifier);
                        model.Trace.Write(rec);
                    }


                    //10010
                    if (elm.Geometry == null && (elm.A == 0 || elm.Iy == 0 || elm.Iz == 0))
                    {
                        var rec = TraceRecords.GetRecord(10010, elementIdentifier);
                        model.Trace.Write(rec);
                    }


                    //10020
                    if (elm.ConsiderShearDeformation && elm.Geometry == null && (elm.Ay == 0 || elm.Az == 0))
                    {
                        var rec = TraceRecords.GetRecord(10020, elementIdentifier);
                        model.Trace.Write(rec);
                    }

                    //10100
                    if (elm.G == 0 || elm.E == 0)
                    {
                        var rec = TraceRecords.GetRecord(10100, elementIdentifier);
                        model.Trace.Write(rec);
                    }
                }


                if (model.Elements[i] is TrussElement2Node)
                {
                    var elm = model.Elements[i] as TrussElement2Node;
                    if (elm.Label != null)
                    {
                        elementIdentifier = elm.Label;
                    }

                    //10000
                    if (elm.Geometry != null && elm.UseOverridedProperties)
                    {
                        var rec = TraceRecords.GetRecord(10000, elementIdentifier);
                        model.Trace.Write(rec);
                    }


                    //10010
                    if (elm.Geometry == null && (elm.A == 0))
                    {
                        var rec = TraceRecords.GetRecord(10010, elementIdentifier);
                        model.Trace.Write(rec);
                    }


                    //10100
                    if (elm.E == 0)
                    {
                        var rec = TraceRecords.GetRecord(10100, elementIdentifier);
                        model.Trace.Write(rec);
                    }
                }
            }
        }