public Force[] GetLocalEquivalentNodalLoads(Element targetElement, ElementalLoad load) { throw new NotImplementedException(); }
public Displacement GetLoadDisplacementAt(Element targetElement, ElementalLoad load, double[] isoLocation) { throw new NotImplementedException(); }
public override Force[] GetGlobalEquivalentNodalLoads(ElementalLoad load) { var helpers = GetHelpers(); var buf = new Force[nodes.Length]; var t = GetTransformationManager(); foreach (var helper in helpers) { var forces = helper.GetLocalEquivalentNodalLoads(this, load); for (var i = 0; i < buf.Length; i++) { buf[i] = buf[i] + forces[i]; } } for (var i = 0; i < buf.Length; i++) { buf[i] = t.TransformLocalToGlobal(buf[i]); } return(buf); /* * if (load is UniformLoadForPlanarElements) * { * //lumped approach is used as used in several references * var ul = load as UniformLoadForPlanarElements; * * var u = new Vector(); * * u.X = ul.Ux; * u.Y = ul.Uy; * u.Z = ul.Uz; * * if (ul.CoordinationSystem == CoordinationSystem.Local) * { * var trans = GetTransformationManager(); * u = trans.TransformLocalToGlobal(u); //local to global * } * * if (_behavior == PlateElementBehaviour.Membrane) * u.Z = 0;//remove one for plate bending * * if (_behavior == PlateElementBehaviour.Bending) * u.Y = u.X = 0;//remove those for membrane * * * var area = CalcUtil.GetTriangleArea(nodes[0].Location, nodes[1].Location, nodes[2].Location); * * var f = u * (area / 3.0); * var frc = new Force(f, Vector.Zero); * return new[] { frc, frc, frc }; * }*/ throw new NotImplementedException(); }
public IEnumerable <Tuple <DoF, double> > GetLoadInternalForceAt(Element targetElement, ElementalLoad load, double[] isoLocation) { throw new NotImplementedException(); }
public override Force[] GetGlobalEquivalentNodalLoads(ElementalLoad load) { return(new Force[2]); }
public GeneralStressTensor GetLoadStressAt(Element targetElement, ElementalLoad load, double[] isoLocation) { throw new NotImplementedException(); }
public IEnumerable <Tuple <DoF, double> > GetLoadInternalForceAt(Element targetElement, ElementalLoad load, double[] isoLocation) { var buff = new List <Tuple <DoF, double> >(); //var buf = new FlatShellStressTensor(); var tr = targetElement.GetTransformationManager(); var br = targetElement as BarElement; var endForces = GetLocalEquivalentNodalLoads(targetElement, load); var n = targetElement.Nodes.Length; for (var i = 0; i < n; i++) { endForces[i] = -endForces[i]; } #region 2,1 (due to inverse of equivalent nodal loads) Force ends;//internal force in x=0 due to inverse of equivalent nodal loads will store in this variable, { var xi_s = new double[br.Nodes.Length]; //xi loc of each force var x_s = new double[br.Nodes.Length]; //x loc of each force for (var i = 0; i < xi_s.Length; i++) { var x_i = targetElement.Nodes[i].Location - targetElement.Nodes[0].Location; var xi_i = br.LocalCoordsToIsoCoords(x_i.Length)[0]; xi_s[i] = xi_i; x_s[i] = x_i.X; } ends = new Force();//sum of moved end forces to destination for (var i = 0; i < n; i++) { if (xi_s[i] < isoLocation[0]) { var frc_i = endForces[i];// new Force(); ends += frc_i.Move(new Point(x_s[i], 0, 0), Point.Origins); } } } #endregion if (load is UniformLoad || load is PartialNonUniformLoad) { return(new List <Tuple <DoF, double> >()); } #region concentrated if (load is ConcentratedLoad) { var cns = load as ConcentratedLoad; var xi = isoLocation[0]; var targetX = br.IsoCoordsToLocalCoords(xi)[0]; var frc = Force.Zero; if (cns.ForceIsoLocation.Xi < xi) { frc = cns.Force; } if (cns.CoordinationSystem == CoordinationSystem.Global) { frc = tr.TransformGlobalToLocal(frc); } var frcX = br.IsoCoordsToLocalCoords(cns.ForceIsoLocation.Xi)[0]; frc = frc.Move(new Point(frcX, 0, 0), new Point(0, 0, 0)); if (br.StartReleaseCondition.RX == DofConstraint.Released) { frc.Mx = 0; } frc = frc.Move(new Point(0, 0, 0), new Point(targetX, 0, 0)); var movedEnds = ends.Move(new Point(0, 0, 0), new Point(targetX, 0, 0)); var f2 = frc + movedEnds; f2 *= -1; buff.Add(Tuple.Create(DoF.Rx, f2.Mx)); return(buff); } #endregion throw new NotImplementedException(); }
///<inheritdoc/> public override Force[] GetGlobalEquivalentNodalLoads(ElementalLoad load) { throw new NotImplementedException(); }
public Force[] GetLocalEquivalentNodalLoads(Element targetElement, ElementalLoad load) { var tr = targetElement.GetTransformationManager(); #region uniform & trapezoid if (load is UniformLoad || load is PartialNonUniformLoad) { Func <double, double> magnitude; Vector localDir; double xi0, xi1; int degree;//polynomial degree of magnitude function #region inits if (load is UniformLoad) { var uld = (load as UniformLoad); magnitude = (xi => uld.Magnitude); localDir = uld.Direction; if (uld.CoordinationSystem == CoordinationSystem.Global) { localDir = tr.TransformGlobalToLocal(localDir); } localDir = localDir.GetUnit(); xi0 = -1; xi1 = 1; degree = 0; } else if (load is PartialNonUniformLoad) { var uld = (load as PartialNonUniformLoad); magnitude = (xi => uld.GetMagnitudeAt(targetElement, new IsoPoint(xi))); localDir = uld.Direction; if (uld.CoordinationSystem == CoordinationSystem.Global) { localDir = tr.TransformGlobalToLocal(localDir); } localDir = localDir.GetUnit(); xi0 = uld.StartLocation.Xi; xi1 = uld.EndLocation.Xi; degree = uld.SeverityFunction.Degree[0];// Coefficients.Length; } else { throw new NotImplementedException(); } localDir = localDir.GetUnit(); #endregion { var nOrd = GetNMaxOrder(targetElement).Max(); var gpt = (nOrd + degree) / 2 + 1;//gauss point count var intg = GaussianIntegrator.CreateFor1DProblem(xi => { var shp = GetNMatrixAt(targetElement, xi, 0, 0); var q__ = magnitude(xi); var j = GetJMatrixAt(targetElement, xi, 0, 0); shp.Scale(j.Determinant()); var q_ = localDir * q__; shp.Scale(q_.X); return(shp); }, xi0, xi1, gpt); var res = intg.Integrate(); var localForces = new Force[2]; var fx0 = res[0, 0]; var fx1 = res[0, 1]; localForces[0] = new Force(fx0, 0, 0, 0, 0, 0); localForces[1] = new Force(fx1, 0, 0, 0, 0, 0); return(localForces); } } #endregion if (load is ConcentratedLoad) { var cns = load as ConcentratedLoad; var shapes = this.GetNMatrixAt(targetElement, cns.ForceIsoLocation.Xi); var localForce = cns.Force; if (cns.CoordinationSystem == CoordinationSystem.Global) { localForce = tr.TransformGlobalToLocal(localForce); } shapes.Scale(localForce.Fx); var fxs = shapes.Row(0); var n = targetElement.Nodes.Length; var buf = new Force[n]; for (var i = 0; i < n; i++) { buf[i] = new Force(fxs[i], 0, 0, 0, 0, 0); } return(buf); } throw new NotImplementedException(); }
/// <inheritdoc/> public IEnumerable <Tuple <DoF, double> > GetLoadInternalForceAt(Element targetElement, ElementalLoad load, double[] isoLocation) { var buff = new List <Tuple <DoF, double> >(); //var buf = new FlatShellStressTensor(); var tr = targetElement.GetTransformationManager(); var br = targetElement as BarElement; var endForces = GetLocalEquivalentNodalLoads(targetElement, load); var n = targetElement.Nodes.Length; for (var i = 0; i < n; i++) { endForces[i] = -endForces[i]; } #region 2,1 (due to inverse of equivalent nodal loads) Force ends;//internal force in x=0 due to inverse of equivalent nodal loads will store in this variable, { var xi_s = new double[br.Nodes.Length]; //xi loc of each force var x_s = new double[br.Nodes.Length]; //x loc of each force for (var i = 0; i < xi_s.Length; i++) { var x_i = targetElement.Nodes[i].Location - targetElement.Nodes[0].Location; var xi_i = br.LocalCoordsToIsoCoords(x_i.Length)[0]; xi_s[i] = xi_i; x_s[i] = x_i.X; } ends = new Force();//sum of moved end forces to destination for (var i = 0; i < n; i++) { if (xi_s[i] <= isoLocation[0]) { var frc_i = endForces[i];// new Force(); ends += frc_i.Move(new Point(x_s[i], 0, 0), Point.Origins); } } } #endregion var to = Iso2Local(targetElement, isoLocation)[0]; //var xi = isoLocation[0]; #region uniform & trapezoid if (load is UniformLoad || load is PartialNonUniformLoad) { Func <double, double> magnitude; Vector localDir; double xi0; int degree;//polynomial degree of magnitude function #region inits if (load is UniformLoad) { var uld = (load as UniformLoad); magnitude = (xi => uld.Magnitude); localDir = uld.Direction; if (uld.CoordinationSystem == CoordinationSystem.Global) { localDir = tr.TransformGlobalToLocal(localDir); } localDir = localDir.GetUnit(); xi0 = -1; //xi1 = to; degree = 0; } else if (load is PartialNonUniformLoad) { var uld = (load as PartialNonUniformLoad); magnitude = (xi => uld.GetMagnitudeAt(targetElement, new IsoPoint(xi))); localDir = uld.Direction; if (uld.CoordinationSystem == CoordinationSystem.Global) { localDir = tr.TransformGlobalToLocal(localDir); } localDir = localDir.GetUnit(); xi0 = uld.StartLocation.Xi; to = Math.Min(to, uld.EndLocation.Xi); degree = uld.SeverityFunction.Degree[0]; } else { throw new NotImplementedException(); } localDir = localDir.GetUnit(); #endregion { var nOrd = 0; // GetNMaxOrder(targetElement).Max(); var gpt = (nOrd + degree) / 2 + 1; //gauss point count Matrix integral; if (isoLocation[0] < xi0) { integral = new Matrix(2, 1); } else { var intgV = GaussianIntegrator.CreateFor1DProblem(x => { var xi = Local2Iso(targetElement, x)[0]; var q__ = magnitude(xi); var q_ = localDir * q__; var df = q_.X; var buf_ = Matrix.OfVector(new double[] { df }); return(buf_); }, 0, to, gpt); integral = intgV.Integrate(); } var X = Iso2Local(targetElement, isoLocation)[0]; var f_i = integral[0, 0]; var f = new Force(); f.Fx = f_i; //this block is commented to fix the issue #48 on github //when this block is commented out, then issue 48 is fixed { //if (br.StartReleaseCondition.DX == DofConstraint.Released) // f_i = 0; } var f2 = f + ends; f2 = f2.Move(new Point(0, 0, 0), new Point(X, 0, 0)); f2 *= -1; /* * var movedEnds = ends.Move(new Point(), new Point());//no need to move as it is truss without moments * var fMoved = new Force(f_i, 00, 00, 0, 0, 0); * * var ft = movedEnds + fMoved; */ //ft *= -1; buff.Add(Tuple.Create(DoF.Dx, f2.Fx)); } return(buff); } #endregion #region concentrated if (load is ConcentratedLoad) { var cns = load as ConcentratedLoad; var xi = isoLocation[0]; var targetX = br.IsoCoordsToLocalCoords(xi)[0]; var frc = Force.Zero; if (cns.ForceIsoLocation.Xi < xi) { frc = cns.Force; } if (cns.CoordinationSystem == CoordinationSystem.Global) { frc = tr.TransformGlobalToLocal(frc); } var frcX = br.IsoCoordsToLocalCoords(cns.ForceIsoLocation.Xi)[0]; frc = frc.Move(new Point(frcX, 0, 0), new Point(0, 0, 0)); frc = frc.Move(new Point(0, 0, 0), new Point(targetX, 0, 0)); var movedEnds = ends.Move(new Point(0, 0, 0), new Point(targetX, 0, 0)); var f2 = frc + movedEnds; f2 *= -1; buff.Add(Tuple.Create(DoF.Dx, f2.Fx)); return(buff); } #endregion throw new NotImplementedException(); }
/// <inheritdoc/> public IEnumerable <Tuple <DoF, double> > GetLoadInternalForceAt(Element targetElement, ElementalLoad load, double[] isoLocation) { var n = targetElement.Nodes.Length; var buff = new List <Tuple <DoF, double> >(); var tr = targetElement.GetTransformationManager(); var br = targetElement as BarElement; var endForces = GetLocalEquivalentNodalLoads(targetElement, load); for (var i = 0; i < n; i++) { endForces[i] = -endForces[i];//(2,1) section } #region 2,1 (due to inverse of equivalent nodal loads) Force ends;//internal force in x=0 due to inverse of equivalent nodal loads will store in this variable, { var xi_s = new double[br.Nodes.Length]; //xi loc of each force var x_s = new double[br.Nodes.Length]; //x loc of each force for (var i = 0; i < xi_s.Length; i++) { var x_i = targetElement.Nodes[i].Location - targetElement.Nodes[0].Location; var xi_i = br.LocalCoordsToIsoCoords(x_i.Length)[0]; xi_s[i] = xi_i; x_s[i] = x_i.X; } ends = new Force();//sum of moved end forces to destination for (var i = 0; i < n; i++) { if (xi_s[i] < isoLocation[0]) { var frc_i = endForces[i];// new Force(); ends += frc_i.Move(new Point(x_s[i], 0, 0), Point.Origins); } } } #endregion var to = Iso2Local(targetElement, isoLocation)[0]; #region uniform & trapezoid, uses integration method if (load is UniformLoad) { Func <double, double> magnitude; Vector localDir; double xi0, xi1; int degree;//polynomial degree of magnitude function #region inits if (load is UniformLoad || load is PartialNonUniformLoad) { var uld = (load as UniformLoad); magnitude = (xi => uld.Magnitude); localDir = uld.Direction; if (uld.CoordinationSystem == CoordinationSystem.Global) { localDir = tr.TransformGlobalToLocal(localDir); } localDir = localDir.GetUnit(); xi0 = -1; xi1 = 1; degree = 0; } else { /** / * var tld = (load as PartialNonUniformLoad); * * magnitude = (xi => (load as PartialNonUniformLoad).GetMagnitudesAt(xi, 0, 0)[0]); * localDir = tld.Direction; * * if (tld.CoordinationSystem == CoordinationSystem.Global) * localDir = tr.TransformGlobalToLocal(localDir); * * xi0 = tld.StartLocation[0]; * xi1 = tld.EndLocation[0]; * degree = 1; * /**/ throw new NotImplementedException(); } localDir = localDir.GetUnit(); #endregion { var nOrd = 0; // GetNMaxOrder(targetElement).Max(); var gpt = (nOrd + degree) / 2 + 3; //gauss point count Matrix integral; double i0 = 0, i1 = 0;//span for integration var xi_t = isoLocation[0]; #region span of integration { if (xi_t < xi0) { i0 = i1 = xi0; } if (xi_t > xi1) { i0 = xi0; i1 = xi1; } if (xi_t < xi1 && xi_t > xi0) { i0 = xi0; i1 = xi_t; } } #endregion #region integration { if (i1 == i0) { integral = new Matrix(2, 1); } else { var x0 = br.IsoCoordsToLocalCoords(i0)[0]; var x1 = br.IsoCoordsToLocalCoords(i1)[0]; var intgV = GaussianIntegrator.CreateFor1DProblem(xx => { //var xi = Local2Iso(targetElement, x)[0]; //var j = GetJMatrixAt(targetElement, xi); var xi = br.LocalCoordsToIsoCoords(xx)[0]; var q__ = magnitude(xi); var q_ = localDir * q__; double df, dm; if (this._direction == BeamDirection.Y) { df = q_.Z; dm = -q_.Z * xx; } else { df = q_.Y; dm = q_.Y * xx; } var buf_ = new Matrix(new double[] { df, dm }); return(buf_); }, x0, x1, gpt); integral = intgV.Integrate(); } } #endregion var v_i = integral[0, 0]; var m_i = integral[1, 0]; var frc = new Force(); var x = Iso2Local(targetElement, isoLocation)[0]; var f = new Force(); if (this._direction == BeamDirection.Y) { f.Fz = v_i; f.My = m_i;//negative is taken into account earlier } else { f.Fy = v_i; f.Mz = m_i; } //f = f.Move(new Point(0, 0, 0), new Point(x, 0, 0)); //frc = frc + ends; //var movedEnds = ends.Move(new Point(0, 0, 0), new Point(x, 0, 0)); if (br.StartReleaseCondition.DY == DofConstraint.Released) { f.Fy = 0; } if (br.StartReleaseCondition.DZ == DofConstraint.Released) { f.Fz = 0; } if (br.StartReleaseCondition.RY == DofConstraint.Released) { f.My = 0; } if (br.StartReleaseCondition.RZ == DofConstraint.Released) { f.Mz = 0; } var f2 = f + ends; f2 = f2.Move(new Point(0, 0, 0), new Point(x, 0, 0)); f2 *= -1; if (_direction == BeamDirection.Y) { buff.Add(Tuple.Create(DoF.Ry, f2.My)); buff.Add(Tuple.Create(DoF.Dz, f2.Fz)); } else { buff.Add(Tuple.Create(DoF.Rz, f2.Mz)); buff.Add(Tuple.Create(DoF.Dy, f2.Fy)); } return(buff); } } #endregion #region concentrated if (load is ConcentratedLoad) { var cns = load as ConcentratedLoad; var xi = isoLocation[0]; var targetX = br.IsoCoordsToLocalCoords(xi)[0]; var frc = Force.Zero; if (cns.ForceIsoLocation.Xi < xi) { frc = cns.Force; } if (cns.CoordinationSystem == CoordinationSystem.Global) { frc = tr.TransformGlobalToLocal(frc); } var frcX = br.IsoCoordsToLocalCoords(cns.ForceIsoLocation.Xi)[0]; frc = frc.Move(new Point(frcX, 0, 0), new Point(0, 0, 0)); frc = frc.Move(new Point(0, 0, 0), new Point(targetX, 0, 0)); var movedEnds = ends.Move(new Point(0, 0, 0), new Point(targetX, 0, 0)); var f2 = frc + movedEnds; // f2 *= -1; if (_direction == BeamDirection.Y) { buff.Add(Tuple.Create(DoF.Ry, f2.My)); buff.Add(Tuple.Create(DoF.Dz, f2.Fz)); } else { buff.Add(Tuple.Create(DoF.Rz, f2.Mz)); buff.Add(Tuple.Create(DoF.Dy, f2.Fy)); } return(buff); } #endregion throw new NotImplementedException(); }
public Force[] GetLocalEquivalentNodalLoads(Element targetElement, ElementalLoad load) { var bar = targetElement as BarElement; var n = bar.Nodes.Length; //https://www.quora.com/How-should-I-perform-element-forces-or-distributed-forces-to-node-forces-translation-in-the-beam-element var tr = targetElement.GetTransformationManager(); #region uniform & trapezoid if (load is UniformLoad) { Func <double, double> magnitude; Vector localDir; double xi0, xi1; int degree;//polynomial degree of magnitude function #region inits if (load is UniformLoad) { var uld = (load as UniformLoad); magnitude = (xi => uld.Magnitude); localDir = uld.Direction; if (uld.CoordinationSystem == CoordinationSystem.Global) { localDir = tr.TransformGlobalToLocal(localDir); } localDir = localDir.GetUnit(); xi0 = -1; xi1 = 1; degree = 0; } else { throw new NotImplementedException(); /* * var tld = (load as PartialTrapezoidalLoad); * * magnitude = (xi => (load as PartialTrapezoidalLoad).GetMagnitudesAt(xi, 0, 0)[0]); * localDir = tld.Direction; * * if (tld.CoordinationSystem == CoordinationSystem.Global) * localDir = tr.TransformGlobalToLocal(localDir); * * xi0 = tld.StartLocation[0]; * xi1 = tld.EndLocation[0]; * degree = 1; */ } localDir = localDir.GetUnit(); #endregion { var nOrd = GetNMaxOrder(targetElement).Max(); var gpt = (nOrd + degree) / 2 + 1;//gauss point count var intg = GaussianIntegrator.CreateFor1DProblem(xi => { var shp = GetNMatrixAt(targetElement, xi, 0, 0); /* * if (_direction == BeamDirection.Y) * { * for (var i = 0; i < shp.ColumnCount; i++) * { * if (i % 2 == 1) * shp.MultiplyColumnByConstant(i, -1); * } * }*/ var q__ = magnitude(xi); var j = GetJMatrixAt(targetElement, xi, 0, 0); shp.MultiplyByConstant(j.Determinant()); var q_ = localDir * q__; if (this._direction == BeamDirection.Y) { shp.MultiplyByConstant(q_.Z); } else { shp.MultiplyByConstant(q_.Y); } return(shp); }, xi0, xi1, gpt); var res = intg.Integrate(); var localForces = new Force[2]; if (this._direction == BeamDirection.Y) { var fz0 = res[0, 0]; var my0 = res[0, 1]; var fz1 = res[0, 2]; var my1 = res[0, 3]; localForces[0] = new Force(0, 0, fz0, 0, my0, 0); localForces[1] = new Force(0, 0, fz1, 0, my1, 0); } else { var fy0 = res[0, 0]; var mz0 = res[0, 1]; var fy1 = res[0, 2]; var mz1 = res[0, 3]; localForces[0] = new Force(0, fy0, 0, 0, 0, mz0); localForces[1] = new Force(0, fy1, 0, 0, 0, mz1); } return(localForces); } } #endregion #region ConcentratedLoad if (load is ConcentratedLoad) { var cl = load as ConcentratedLoad; var localforce = cl.Force; if (cl.CoordinationSystem == CoordinationSystem.Global) { localforce = tr.TransformGlobalToLocal(localforce); } var buf = new Force[n]; var ns = GetNMatrixAt(targetElement, cl.ForceIsoLocation.Xi); /* * if (_direction == BeamDirection.Y) * for (var i = 0; i < ns.ColumnCount; i++) * if (i % 2 == 1) * ns.MultiplyColumnByConstant(i, -1); */ var j = GetJMatrixAt(targetElement, cl.ForceIsoLocation.Xi); var detJ = j.Determinant(); ns.MultiplyRowByConstant(1, 1 / detJ); ns.MultiplyRowByConstant(2, 1 / (detJ * detJ)); ns.MultiplyRowByConstant(3, 1 / (detJ * detJ * detJ)); for (var i = 0; i < n; i++) { var node = bar.Nodes[i]; var fi = new Force(); var ni = ns[0, 2 * i]; var mi = ns[0, 2 * i + 1]; var nip = ns[1, 2 * i]; var mip = ns[1, 2 * i + 1]; if (this._direction == BeamDirection.Z) { fi.Fy += localforce.Fy * ni; //concentrated force fi.Mz += localforce.Fy * mi; //concentrated force fi.Fy += localforce.Mz * nip; //concentrated moment fi.Mz += localforce.Mz * mip; //concentrated moment } else { fi.Fz += localforce.Fz * ni; //concentrated force fi.My += localforce.Fz * mi; //concentrated force fi.Fz += localforce.My * nip; //concentrated moment fi.My += localforce.My * -mip; //concentrated moment } buf[i] = fi; } return(buf); } #endregion throw new NotImplementedException(); }
/// <inheritdoc/> public Displacement GetLoadDisplacementAt(Element targetElement, ElementalLoad load, double[] isoLocation) { var n = this.GetNMatrixAt(targetElement, isoLocation); throw new NotImplementedException(); }