/// <summary>
        /// Gets the internal stress at defined location.
        /// tensor is in local coordinate system.
        /// </summary>
        /// <param name="isoLocation">The location for the stress probe in iso coordinates. Order: x,y,z. Maximum bending stress at the shell thickness (z=1.0). Must be withing 0 and 1.</param>
        /// <param name="combination">The load combination.</param>
        /// <param name="probeLocation">The probe location for the stress.</param>
        /// <returns>Stress tensor of flat shell, in local coordination system</returns>
        /// <remarks>
        /// for more info about local coordinate of flat shell see page [72 of 166] (page 81 of pdf) of "Development of Membrane, Plate and Flat Shell Elements in Java" thesis by Kaushalkumar Kansara freely available on the web
        /// </remarks>
        public FlatShellStressTensor GetInternalStress(double[] isoLocation, LoadCombination combination, SectionPoints probeLocation)
        {
            if (isoLocation[2] < 0 || isoLocation[2] > 1.0)
            {
                throw new Exception("z must be between 0 and 1. 0 is the centre of the plate and 1 is on the plate surface. Use the section points to get the top/bottom.")
                      {
                      };
            }
            var helpers = GetHelpers();

            var buf = new FlatShellStressTensor();

            for (var i = 0; i < helpers.Count(); i++)
            {
                if (helpers[i] is Q4MembraneHelper)
                {
                    buf.MembraneTensor = ((Q4MembraneHelper)helpers[i]).GetLocalInternalStress(this, combination, isoLocation).MembraneTensor;
                }
                else if (helpers[i] is DkqHelper)
                {
                    buf.BendingTensor = ((DkqHelper)helpers[i]).GetBendingInternalStress(this, combination, isoLocation).BendingTensor;
                }
            }
            buf.UpdateTotalStress(_section.GetThicknessAt(new double[] { isoLocation[0], isoLocation[1] }) * isoLocation[2], probeLocation);
            return(buf);
        }
Esempio n. 2
0
        /// <summary>
        /// Gets the internal force at <see cref="xi" /> position.
        /// </summary>
        /// <param name="xi">The iso coordinate of desired point (start = -1, mid = 0, end = 1).</param>
        /// <param name="loadCase">The Load case.</param>
        /// <returns></returns>
        /// <remarks>
        /// Will calculate the internal forces of member regarding the <see cref="loadCase" />
        /// </remarks>
        public Force GetExactInternalForceAt(double xi, LoadCase loadCase)
        {
            var approx = GetInternalForceAt(xi, loadCase);

            var buf = new FlatShellStressTensor();

            var helpers = GetHelpers();

            foreach (var load in this.Loads)
            {
                foreach (var helper in helpers)
                {
                    var tns = helper.GetLoadInternalForceAt(this, load, new[] { xi });
                    //buf = buf + tns;
                }
            }

            var buff = new Force();

            var forces = new Vector(buf.MembraneTensor.S11, buf.MembraneTensor.S12, buf.MembraneTensor.S13);
            //Fx, Vy, Vz
            var moments = new Vector(buf.BendingTensor.M11, buf.BendingTensor.M12, buf.BendingTensor.M13);

            //Mx, My, Mz

            return(new Force(forces, moments) + approx);
        }
        /// <inheritdoc/>
        public IEnumerable <Tuple <DoF, double> > GetLocalInternalForceAt(Element targetElement,
                                                                          Displacement[] globalDisplacements, params double[] isoCoords)
        {
            //step 1 : get transformation matrix
            //step 2 : convert globals points to locals
            //step 3 : convert global displacements to locals
            //step 4 : calculate B matrix and D matrix
            //step 5 : M=D*B*U
            //Note : Steps changed...

            var tr = targetElement.GetTransformationManager();

            var locals = tr.TransformGlobalToLocal(globalDisplacements);

            var b = GetBMatrixAt(targetElement, isoCoords);

            var d = GetDMatrixAt(targetElement, isoCoords);

            var u1l = locals[0];
            var u2l = locals[1];
            var u3l = locals[2];

            var uDkt =
                targetElement.MatrixPool.Allocate(new[]
                                                  { u1l.DZ, u1l.RX, u1l.RY, /**/ u2l.DZ, u2l.RX, u2l.RY, /**/ u3l.DZ, u3l.RX, u3l.RY });


            var mDkt = d * b * uDkt; //eq. 32, batoz article

            //var buf = new PlateBendingStressTensor();

            //buf.Mx = mDkt[0, 0];
            //buf.My = mDkt[1, 0];
            //buf.Mxy = mDkt[2, 0];

            //return buf;

            var bTensor = new BendingStressTensor();

            //var buf = new List<Tuple<DoF, double>>();

            bTensor.M11 = mDkt[0, 0];
            bTensor.M22 = mDkt[1, 0];
            bTensor.M21 = bTensor.M12 = mDkt[2, 0];

            var buf = new FlatShellStressTensor(bTensor);

            throw new NotImplementedException();
        }
        /// <summary>
        /// Gets the internal force at defined location.
        /// tensor is in local coordinate system.
        /// </summary>
        /// <param name="localX">The X in local coordinate system (see remarks).</param>
        /// <param name="localY">The Y in local coordinate system (see remarks).</param>
        /// <param name="combination">The load combination.</param>
        /// <returns>Stress tensor of flat shell, in local coordination system</returns>
        /// <remarks>
        /// for more info about local coordinate of flat shell see page [72 of 166] (page 81 of pdf) of "Development of Membrane, Plate and Flat Shell Elements in Java" thesis by Kaushalkumar Kansara freely available on the web
        /// </remarks>
        public FlatShellStressTensor GetInternalForce(double localX, double localY, LoadCombination combination)
        {
            var buf = new FlatShellStressTensor();

            if ((this._behaviour & FlatShellBehaviour.ThinPlate) != 0)
            {
                buf.MembraneTensor = GetMembraneInternalForce(combination);
            }

            if ((this._behaviour & FlatShellBehaviour.Membrane) != 0)
            {
                buf.BendingTensor = GetBendingInternalForce(localX, localY, combination);
            }

            return(buf);
        }
Esempio n. 5
0
        /// <summary>
        /// Gets the internal force at defined location.
        /// tensor is in local coordinate system.
        /// </summary>
        /// <param name="xi">The xi.</param>
        /// <param name="eta">The eta.</param>
        /// <param name="combination">The locad combination.</param>
        /// <returns>Stress tensor of flat shell, in local coordination system</returns>
        /// <remarks>
        /// for more info about local coordinate of flat shell see page [72 of 166] (page 81 of pdf) of "Development of Membrane, Plate and Flat Shell Elements in Java" thesis by Kaushalkumar Kansara freely available on the web
        /// </remarks>
        public FlatShellStressTensor GetInternalForce(double xi, double eta, LoadCombination combination)
        {
            var buf = new FlatShellStressTensor();

            if (_behaviour == FlatShellBehaviour.Membrane || _behaviour == FlatShellBehaviour.ThinShell)
            {
                buf.MembraneTensor = GetMembraneInternalForce(xi, eta, combination);
            }
            ;

            if (_behaviour == FlatShellBehaviour.ThinPlate || _behaviour == FlatShellBehaviour.ThinShell)
            {
                buf.BendingTensor = GetBendingInternalForce(xi, eta, combination);
            }

            return(buf);
        }
Esempio n. 6
0
        public FlatShellStressTensor GetBendingInternalStress(Element targetElement, LoadCombination cmb, params double[] isoCoords)
        {
            var lds = new Displacement[targetElement.Nodes.Length];
            var tr  = targetElement.GetTransformationManager();

            for (var i = 0; i < targetElement.Nodes.Length; i++)
            {
                var globalD = targetElement.Nodes[i].GetNodalDisplacement(cmb);
                var local   = tr.TransformGlobalToLocal(globalD);
                lds[i] = local;
            }

            var b = GetBMatrixAt(targetElement, isoCoords);

            var d = GetDMatrixAt(targetElement, isoCoords);

            var u1l = lds[0];
            var u2l = lds[1];
            var u3l = lds[2];
            var u4l = lds[3];

            var uDkt =
                new Matrix(new[]
                           { u1l.DZ, u1l.RX, u1l.RY, /**/ u2l.DZ, u2l.RX, u2l.RY, /**/ u3l.DZ, u3l.RX, u3l.RY, /**/ u4l.DZ, u4l.RX, u4l.RY });


            var mDkt = d * b * uDkt; //eq. 32, batoz article


            var bTensor = new BendingStressTensor();

            bTensor.M11 = mDkt[0, 0];
            bTensor.M22 = mDkt[1, 0];
            bTensor.M21 = bTensor.M12 = mDkt[2, 0];

            var buf = new FlatShellStressTensor(bTensor);

            return(buf);
        }
Esempio n. 7
0
        /// <inheritdoc/>
        public IEnumerable <Tuple <DoF, double> > GetLoadInternalForceAt(Element targetElement, Load load,
                                                                         double[] isoLocation)
        {
            var buf = new FlatShellStressTensor();

            var tr = targetElement.GetTransformationManager();

            var br = targetElement as BarElement;

            var endForces = GetLocalEquivalentNodalLoads(targetElement, load);


            var v0 =
                endForces[0].Fx;

            v0 = -v0;

            var to = Iso2Local(targetElement, isoLocation)[0];

            //var xi = isoLocation[0];

            #region uniform & trapezoid

            if (load is UniformLoad || load is PartialTrapezoidalLoad)
            {
                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);
                    }

                    xi0    = -1;
                    xi1    = 1;
                    degree = 0;
                }
                else
                {
                    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.StarIsoLocations[0];
                    xi1    = tld.EndIsoLocations[0];
                    degree = 1;
                }

                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_ = new Matrix(new double[] { df });

                            return(buf_);
                        }, 0, to, gpt);

                        integral = intgV.Integrate();
                    }

                    var f_i = integral[0, 0];

                    var memb = buf.MembraneTensor;
                    var bnd  = buf.BendingTensor;

                    var v = memb.S11 = -(f_i + v0);

                    buf.MembraneTensor = memb;
                    buf.BendingTensor  = bnd;

                    //return buf;
                }
            }



            #endregion

            throw new NotImplementedException();
        }
Esempio n. 8
0
        /// <summary>
        /// Gets the internal force at <see cref="xi" /> position.
        /// </summary>
        /// <param name="xi">The iso coordinate of desired point (start = -1, mid = 0, end = 1).</param>
        /// <param name="loadCase">The Load case.</param>
        /// <returns></returns>
        /// <remarks>
        /// Will calculate the internal forces of member regarding the <see cref="loadCase" />
        /// </remarks>
        public Force GetInternalForceAt(double xi, LoadCase loadCase)
        {
            var buf = new FlatShellStressTensor();

            var helpers = GetHelpers();

            var lds = new Displacement[this.Nodes.Length];
            var tr  = this.GetTransformationManager();

            for (var i = 0; i < Nodes.Length; i++)
            {
                var globalD = Nodes[i].GetNodalDisplacement(loadCase);
                var local   = tr.TransformGlobalToLocal(globalD);
                lds[i] = local;
            }

            //var buff = new Force();

            var frc = new Vector(); //forcec
            var mnt = new Vector(); //moment


            foreach (var helper in helpers)
            {
                var tns = helper.GetLocalInternalForceAt(this, lds, new[] { xi });

                foreach (var tuple in tns)
                {
                    switch (tuple.Item1)
                    {
                    case DoF.Dx:
                        frc.X += tuple.Item2;
                        break;

                    case DoF.Dy:
                        frc.Y += tuple.Item2;
                        break;

                    case DoF.Dz:
                        frc.Z += tuple.Item2;
                        break;

                    case DoF.Rx:
                        mnt.X += tuple.Item2;
                        break;

                    case DoF.Ry:
                        mnt.Y += tuple.Item2;
                        break;

                    case DoF.Rz:
                        mnt.Z += tuple.Item2;
                        break;

                    default:
                        throw new ArgumentOutOfRangeException();
                    }
                }
                //buf = buf + tns;
            }



            var forces = new Vector(buf.MembraneTensor.S11, buf.MembraneTensor.S12, buf.MembraneTensor.S13);
            //Fx, Vy, Vz
            var moments = new Vector(buf.BendingTensor.M11, buf.BendingTensor.M12, buf.BendingTensor.M13);

            //Mx, My, Mz

            return(new Force(frc, mnt));
        }