예제 #1
0
        /// <summary>
        /// Integrates the shear force along intersection of element with defined plane.
        /// </summary>
        /// <param name="element">The element.</param>
        /// <param name="plane">The plane.</param>
        /// <returns>Integrated force</returns>
        public static Force IntegrateNormalForce(this TriangleFlatShell element, Plane plane, LoadCombination cmb)
        {
            //step 1: does intersect?
            //step 2: get a tensor (no matter where, this is constant stress)
            //step 3: find rotation amount for tensors
            //step 4: rotate tensors
            //step 5: integrate forces

            if (!DoesIntersects(element, plane))
                return Force.Zero;

            var intersection = GetIntersection(element, plane);

            //step 2
            var tensor = element.GetInternalForce(0, 0, cmb);

            //step 3
            var t = element.GetTransformationMatrix().Transpose(); //transpose of t
            var nLocal = (Vector)(t * plane.Normal.ToMatrix()).ToPoint();//project of N to local element coord system
            var theta = Math.Atan2(nLocal.Y, nLocal.X) - Math.PI / 2;

            //step 4
            var rotatedTensor = MembraneStressTensor.Rotate(tensor.MembraneTensor, theta);

            // shear direction
            var shearLocalDirection = new Vector(Math.Cos(theta), Math.Sin(theta), 0);//direction of shear force in local element coord system, which is vector I rotated by amount theta
            var shearGlobalDirection = (Vector)(t.Transpose() * shearLocalDirection.ToMatrix()).ToPoint();

            var fShearAmount = rotatedTensor.Txy * element.Thickness * intersection.Length;//shear force

            var shearForce = fShearAmount * shearGlobalDirection.GetUnit();

            return new Force(shearForce, Vector.Zero);
        }
예제 #2
0
        /// <summary>
        /// Rotates the define local stress tensor into direction of plane.
        /// </summary>
        /// <param name="shell">The shell.</param>
        /// <param name="localStressTensor">The local stress tensor.</param>
        /// <param name="targetPlane">The target plane.</param>
        /// <returns>
        /// Rotated tensor
        /// </returns>
        /// <exception cref="System.NotImplementedException"></exception>
        public static MembraneStressTensor RotateTensor(this TriangleFlatShell shell, MembraneStressTensor localStressTensor, Plane targetPlane)
        {
            var t = shell.GetTransformationMatrix().Transpose();

            var plane = targetPlane;

            var nLocal = (Vector)(t * plane.Normal.ToMatrix()).ToPoint();//project of N to local element coord system

            var theta = Math.Atan2(nLocal.Y, nLocal.X) - Math.PI / 2;

            var buf = MembraneStressTensor.Rotate(localStressTensor, theta);

            return buf;
        }
예제 #3
0
        public static Tuple<Force,Point> GetTotalForce(this TriangleFlatShell element, Plane plane, int n)
        {
            //step 1: find intersection points
            //step 2: find tensors at intersection points
            //step 3: find rotation amount for tensors
            //step 4: rotate tensors
            //step 5: integrate forces

            //step 1
            var globalPoints = GetIntersectionPoints(element, plane, n);

            if (!globalPoints.Any())
                return new Tuple<Force, Point>();

            var t = element.GetTransformationMatrix().Transpose(); //transpose of t
            var locals = globalPoints.Select(i => (t * i.ToMatrix()).ToPoint()).ToArray();

            //step 2
            var tensors = GeTensorsAtIntersection(element, plane, n);
            var memTensors = tensors.Select(i => i.MembraneTensor).ToList();
            var bendTensors = tensors.Select(i => i.BendingTensor).ToList();

            //step 3
            var nLocal = (Vector)(t * plane.Normal.ToMatrix()).ToPoint();//project of N to local element coord system

            var theta = Math.Atan2(nLocal.Y, nLocal.X) - Math.PI/2;

            //step 4
            var rTensors = tensors.Select(i => MembraneStressTensor.Rotate(i.MembraneTensor, theta)).ToList();

            var avg = rTensors.Aggregate((i, j) => i + j);

            avg = MembraneStressTensor.Multiply(avg, 1.0 / tensors.Length);

            var length = (globalPoints.First() - globalPoints.Last()).Length;

            var fShearAmount = avg.Txy * element.Thickness * length;//shear force
            var fCompAmount = avg.Sy * element.Thickness * length;//compressive force

            // shear dirction
            var shearLocalDirection = new Vector(Math.Cos(theta), Math.Sin(theta), 0);//direction of shear force in local element coord system, which is vector I rotated by amount theta
            var shearGlobalDirection = (Vector) (t.Transpose()*shearLocalDirection.ToMatrix()).ToPoint();

            //compressive direction
            var compLocalDirection = new Vector(-Math.Sin(theta), Math.Cos(theta), 0);//direction of shear force in local element coord system, which is vector I rotated by amount theta
            var compGlobalDirection = (Vector)(t.Transpose() * compLocalDirection.ToMatrix()).ToPoint();


            var shearForce = fShearAmount*shearGlobalDirection.GetUnit();
            var compForce = fCompAmount*compGlobalDirection.GetUnit();

            var totForce = shearForce + compForce;

            var bufFrc = new Force(totForce, Vector.Zero);
            var loc = globalPoints.Aggregate((i, j) => (Point)((Vector)i + (Vector)j));

            loc.X /= globalPoints.Length;
            loc.Y /= globalPoints.Length;
            loc.Z /= globalPoints.Length;

            return new Tuple<Force, Point>(bufFrc, loc);
            //return bufFrc;
        }