public void SetProcessNode(string op, string text) { //16 1 -0.64289E-02 -0.88362E-02 0.64941E-02 0.10075E-03 -0.16080E-03 0.75179E-02 string temp = text.ToUpper().Trim().TrimEnd().TrimStart().Replace('\t', ' '); int indx = -1; while (temp.IndexOf(" ") != -1) { temp = temp.Replace(" ", " "); } MyStrings mList = new MyStrings(temp, ' '); double dx = 0.0d, dy = 0.0d, dz = 0.0d; try { // 0 1 2 3 4 5 6 7 //16 1 -0.64289E-02 -0.88362E-02 0.64941E-02 0.10075E-03 -0.16080E-03 0.75179E-02 ndisp = new NodeDisplacement(); int index = 0; if (mList.StringList.Count == 8) { nodeNo = mList.GetInt(index); index++; ndisp.Node.NodeNo = nodeNo; ndisp.LoadCase = mList.GetInt(index); index++; ndisp.Tx = mList.GetDouble(index); index++; ndisp.Ty = mList.GetDouble(index); index++; ndisp.Tz = mList.GetDouble(index); index++; ndisp.Rx = mList.GetDouble(index); index++; ndisp.Ry = mList.GetDouble(index); index++; ndisp.Rz = mList.GetDouble(index); index++; nDispCol.Add(ndisp); } else if (mList.StringList.Count == 7) { ndisp.Node.NodeNo = nodeNo; ndisp.LoadCase = mList.GetInt(index); index++; ndisp.Tx = mList.GetDouble(index); index++; ndisp.Ty = mList.GetDouble(index); index++; ndisp.Tz = mList.GetDouble(index); index++; ndisp.Rx = mList.GetDouble(index); index++; ndisp.Ry = mList.GetDouble(index); index++; ndisp.Rz = mList.GetDouble(index); index++; nDispCol.Add(ndisp); } } catch (Exception exx) { } }
private void SET_NodalDisplacement(string text) { NodeDisplacement nd = new NodeDisplacement(); MyStrings mList = new MyStrings(MyStrings.RemoveAllSpaces(text), ' '); int indx = 0; if (mList.Count == 8) { indx = 0; nd.Node.NodeNo = mList.GetInt(indx); indx++; lastNodeNo = nd.Node.NodeNo; nd.LoadCase = mList.GetInt(indx); indx++; maxLoadCase = nd.LoadCase; nd.Tx = mList.GetDouble(indx); indx++; nd.Ty = mList.GetDouble(indx); indx++; nd.Tz = mList.GetDouble(indx); indx++; nd.Rx = mList.GetDouble(indx); indx++; nd.Ry = mList.GetDouble(indx); indx++; nd.Rz = mList.GetDouble(indx); indx++; } else if (mList.Count == 7) { indx = 0; nd.Node.NodeNo = lastNodeNo; nd.LoadCase = mList.GetInt(indx); indx++; maxLoadCase = nd.LoadCase; nd.Tx = mList.GetDouble(indx); indx++; nd.Ty = mList.GetDouble(indx); indx++; nd.Tz = mList.GetDouble(indx); indx++; nd.Rx = mList.GetDouble(indx); indx++; nd.Ry = mList.GetDouble(indx); indx++; nd.Rz = mList.GetDouble(indx); indx++; } #region Calculate Proportionate /**/ double x, y, z, prp, dif; x = y = z = prp = dif = 0.0; if (nd.Tx < nd.Ty && nd.Tx < nd.Tz) { x = nd.Tx; if (x < 1.0d) { dif = 1.0d - x; prp = x / dif; x = 1.0d; y = y * prp; z = z * prp; //nd.Tx = x; //nd.Ty += y; //nd.Tz += z; } } else if (nd.Ty < nd.Tx && nd.Ty < nd.Tz) { y = nd.Ty; if (y < 1.0) { dif = 1.0d - y; prp = y / dif; y = 1.0d; x = x * prp; z = z * prp; //nd.Tx += x; //nd.Ty = y; //nd.Tz += z; } } else if (nd.Tz < nd.Tx && nd.Tz < nd.Ty) { z = nd.Tz; if (z < 1.0d) { dif = 1.0d - z; prp = z / dif; z = 1.0d; y = y * prp; x = x * prp; //nd.Tx += x; //nd.Ty += y; //nd.Tz = z; } } /* * if (nd.Tx > 0.0) * { * nd.Tx += x; * } * else * { * nd.Tx -= x; * } * * if (nd.Ty > 0.0) * { * nd.Ty += y; * } * else * { * nd.Tx -= y; * } * * if (nd.Tz > 0.0) * { * nd.Tz += z; * } * else * { * nd.Tz -= z; * } * /**/ double factor = 1d; nd.Tx = nd.Tx * factor; nd.Ty = nd.Ty * factor; nd.Tz = nd.Tz * factor; #endregion //Chiranjit [2014 08 14] if (nd.Ty > 0) { nd.Ty = nd.Ty * -1; } ndispCol.Add(nd); }