示例#1
0
        private static void TestConsistentMass0()
        {
            IQuadrature2D quadratureForMass = TriangleQuadratureSymmetricGaussian.Order4Points6;

            var materialsAtGaussPoints = new List <ElasticMaterial2D>();

            foreach (GaussPoint gaussPoint in quadratureForMass.IntegrationPoints)
            {
                materialsAtGaussPoints.Add(material0.Clone());
            }
            var tri6 = new ContinuumElement2D(thickness, nodeSet0, InterpolationTri6.UniqueInstance,
                                              TriangleQuadratureSymmetricGaussian.Order2Points3, quadratureForMass,
                                              ExtrapolationGaussTriangular3Points.UniqueInstance,
                                              materialsAtGaussPoints, dynamicMaterial);

            IMatrix M         = tri6.BuildConsistentMassMatrix();
            Matrix  expectedM = Matrix.CreateFromArray(new double[, ]
            {
                { 11.83599396, 0, -1.829621484, 0, -1.968668415, 0, 0.702983761, 0, -6.922261694, 0, 0.623796095, 0, },
                { 0, 11.83599396, 0, -1.829621484, 0, -1.968668415, 0, 0.702983761, 0, -6.922261694, 0, 0.623796095, },
                { -1.829621484, 0, 9.926994738, 0, -1.638252825, 0, -0.618678599, 0, -0.46271906, 0, -7.392556104, 0, },
                { 0, -1.829621484, 0, 9.926994738, 0, -1.638252825, 0, -0.618678599, 0, -0.46271906, 0, -7.392556104, },
                { -1.968668415, 0, -1.638252825, 0, 10.74103411, 0, -7.234180772, 0, 9.35E-02, 0, -0.141678539, 0, },
                { 0, -1.968668415, 0, -1.638252825, 0, 10.74103411, 0, -7.234180772, 0, 9.35E-02, 0, -0.141678539, },
                { 0.702983761, 0, -0.618678599, 0, -7.234180772, 0, 57.86118359, 0, 28.31288493, 0, 29.25347375, 0, },
                { 0, 0.702983761, 0, -0.618678599, 0, -7.234180772, 0, 57.86118359, 0, 28.31288493, 0, 29.25347375, },
                { -6.922261694, 0, -0.46271906, 0, 9.35E-02, 0, 28.31288493, 0, 56.00999156, 0, 28.6296356, 0, },
                { 0, -6.922261694, 0, -0.46271906, 0, 9.35E-02, 0, 28.31288493, 0, 56.00999156, 0, 28.6296356, },
                { 0.623796095, 0, -7.392556104, 0, -0.141678539, 0, 29.25347375, 0, 28.6296356, 0, 58.49121809, 0, },
                { 0, 0.623796095, 0, -7.392556104, 0, -0.141678539, 0, 29.25347375, 0, 28.6296356, 0, 58.49121809, }
            }); // from Abaqus

            Assert.True(M.Equals(expectedM, 1e-3));
        }
示例#2
0
 public Quad4(ElasticMaterial2D material)
 {
     materialsAtGaussPoints = new ElasticMaterial2D[iInt2];
     for (int i = 0; i < iInt2; i++)
     {
         materialsAtGaussPoints[i] = (ElasticMaterial2D)material.Clone();
     }
 }
        public ContinuumElement2D CreateElement(CellType cellType, IReadOnlyList <Node> nodes, double thickness,
                                                ElasticMaterial2D material, DynamicMaterial dynamicProperties)
        {
            int numGPs = integrationsForStiffness[cellType].IntegrationPoints.Count;
            var materialsAtGaussPoints = new ElasticMaterial2D[numGPs];

            for (int gp = 0; gp < numGPs; ++gp)
            {
                materialsAtGaussPoints[gp] = material.Clone();
            }
            return(CreateElement(cellType, nodes, thickness, materialsAtGaussPoints, dynamicProperties));
        }
示例#4
0
        private static void TestConsistentMass0()
        {
            // reduced integration rule - bad idea
            IQuadrature2D quadratureForMass      = GaussLegendre2D.GetQuadratureWithOrder(1, 1);
            var           materialsAtGaussPoints = new List <ElasticMaterial2D>();

            foreach (GaussPoint gaussPoint in quadratureForMass.IntegrationPoints)
            {
                materialsAtGaussPoints.Add(material0.Clone());
            }
            var quad4 = new ContinuumElement2D(thickness, nodeSet1, InterpolationQuad4.UniqueInstance,
                                               GaussLegendre2D.GetQuadratureWithOrder(2, 2), quadratureForMass,
                                               ExtrapolationGaussLegendre2x2.UniqueInstance, materialsAtGaussPoints, dynamicMaterial);
            IMatrix M = quad4.BuildConsistentMassMatrix();

            Matrix expectedM = Matrix.CreateFromArray(new double[, ]
            {
                { 1, 0, 1, 0, 1, 0, 1, 0 },
                { 0, 1, 0, 1, 0, 1, 0, 1 },
                { 1, 0, 1, 0, 1, 0, 1, 0 },
                { 0, 1, 0, 1, 0, 1, 0, 1 },
                { 1, 0, 1, 0, 1, 0, 1, 0 },
                { 0, 1, 0, 1, 0, 1, 0, 1 },
                { 1, 0, 1, 0, 1, 0, 1, 0 },
                { 0, 1, 0, 1, 0, 1, 0, 1 }
            });
            double lengthX = nodeSet1[1].X - nodeSet1[0].X;
            double lengthY = nodeSet1[2].Y - nodeSet1[1].Y;

            // For some reason , only half the thickness is used for Quad4 elements, as shown in Fig. 31.9. Therefore the
            // coefficient 1/16 (full thickness) became 1/32 (half thickness). Here 1/16 is used.
            double scalar = dynamicMaterial.Density * thickness * lengthX * lengthY / 16.0;

            expectedM.ScaleIntoThis(scalar);

            Assert.True(M.Equals(expectedM, 1e-10));
        }
示例#5
0
        private static void TestConsistentMassParametric(IReadOnlyList <Node> nodeSet, IQuadrature2D quadratureForMass,
                                                         bool reducedQuadrature)
        {
            var materialsAtGaussPoints = new List <IContinuumMaterial2D>();

            foreach (GaussPoint gaussPoint in quadratureForMass.IntegrationPoints)
            {
                materialsAtGaussPoints.Add(material0.Clone());
            }
            var tri3 = new ContinuumElement2D(thickness, nodeSet, InterpolationTri3.UniqueInstance,
                                              TriangleQuadratureSymmetricGaussian.Order1Point1, quadratureForMass,
                                              ExtrapolationGaussTriangular1Point.UniqueInstance,
                                              materialsAtGaussPoints, dynamicMaterial);
            IMatrix M = tri3.BuildConsistentMassMatrix();

            // Reference: http://kis.tu.kielce.pl/mo/COLORADO_FEM/colorado/IFEM.Ch31.pdf, (eq 31.27)
            Matrix expectedM = Matrix.CreateFromArray(new double[, ]
            {
                { 2, 0, 1, 0, 1, 0 },
                { 0, 2, 0, 1, 0, 1 },
                { 1, 0, 2, 0, 1, 0 },
                { 0, 1, 0, 2, 0, 1 },
                { 1, 0, 1, 0, 2, 0 },
                { 0, 1, 0, 1, 0, 2 }
            });
            double area   = CalcTriangleArea(nodeSet);
            double scalar = dynamicMaterial.Density * thickness * area / 12.0;

            expectedM.ScaleIntoThis(scalar);

            if (reducedQuadrature)
            {
                Assert.False(M.Equals(expectedM, 1e-10));
            }
            else
            {
                Assert.True(M.Equals(expectedM, 1e-10));
            }
        }
示例#6
0
        private static void TestConsistentMass0()
        {
            IQuadrature2D quadratureForMass = GaussLegendre2D.GetQuadratureWithOrder(3, 3);

            var materialsAtGaussPoints = new List <ElasticMaterial2D>();

            foreach (GaussPoint gaussPoint in quadratureForMass.IntegrationPoints)
            {
                materialsAtGaussPoints.Add(material0.Clone());
            }
            var quad8 = new ContinuumElement2D(thickness, nodeSet0, InterpolationQuad8.UniqueInstance,
                                               GaussLegendre2D.GetQuadratureWithOrder(3, 3), quadratureForMass,
                                               ExtrapolationGaussLegendre3x3.UniqueInstance,
                                               materialsAtGaussPoints, dynamicMaterial);

            IMatrix M         = quad8.BuildConsistentMassMatrix();
            Matrix  expectedM = Matrix.CreateFromArray(new double[, ]
            {
                { 9.115245555556, 0.000000000000, 1.881383333333, 0.000000000000, 3.914882222222, 0.000000000000, 2.417800000000, 0.000000000000, -7.376906666667, 0.000000000000, -11.056637777778, 0.000000000000, -9.104604444445, 0.000000000000, -7.444940000000, 0.000000000000 },
                { 0.000000000000, 9.115245555556, 0.000000000000, 1.881383333333, 0.000000000000, 3.914882222222, 0.000000000000, 2.417800000000, 0.000000000000, -7.376906666667, 0.000000000000, -11.056637777778, 0.000000000000, -9.104604444445, 0.000000000000, -7.444940000000 },
                { 1.881383333333, 0.000000000000, 9.727545555556, 0.000000000000, 2.239866666667, 0.000000000000, 3.841615555556, 0.000000000000, -6.727973333334, 0.000000000000, -6.701806666667, 0.000000000000, -9.031337777778, 0.000000000000, -11.077571111111, 0.000000000000 },
                { 0.000000000000, 1.881383333333, 0.000000000000, 9.727545555556, 0.000000000000, 2.239866666667, 0.000000000000, 3.841615555556, 0.000000000000, -6.727973333334, 0.000000000000, -6.701806666667, 0.000000000000, -9.031337777778, 0.000000000000, -11.077571111111 },
                { 3.914882222222, 0.000000000000, 2.239866666667, 0.000000000000, 7.681312222222, 0.000000000000, 2.776283333333, 0.000000000000, -11.082804444445, 0.000000000000, -8.784673333334, 0.000000000000, -6.832640000000, 0.000000000000, -11.150837777778, 0.000000000000 },
                { 0.000000000000, 3.914882222222, 0.000000000000, 2.239866666667, 0.000000000000, 7.681312222222, 0.000000000000, 2.776283333333, 0.000000000000, -11.082804444445, 0.000000000000, -8.784673333334, 0.000000000000, -6.832640000000, 0.000000000000, -11.150837777778 },
                { 2.417800000000, 0.000000000000, 3.841615555556, 0.000000000000, 2.776283333333, 0.000000000000, 7.581878888889, 0.000000000000, -11.009537777778, 0.000000000000, -10.983371111111, 0.000000000000, -6.895440000000, 0.000000000000, -8.941673333334, 0.000000000000 },
                { 0.000000000000, 2.417800000000, 0.000000000000, 3.841615555556, 0.000000000000, 2.776283333333, 0.000000000000, 7.581878888889, 0.000000000000, -11.009537777778, 0.000000000000, -10.983371111111, 0.000000000000, -6.895440000000, 0.000000000000, -8.941673333334 },
                { -7.376906666667, 0.000000000000, -6.727973333334, 0.000000000000, -11.082804444445, 0.000000000000, -11.009537777778, 0.000000000000, 45.023413333334, 0.000000000000, 28.692622222223, 0.000000000000, 20.114142222223, 0.000000000000, 28.734488888889, 0.000000000000 },
                { 0.000000000000, -7.376906666667, 0.000000000000, -6.727973333334, 0.000000000000, -11.082804444445, 0.000000000000, -11.009537777778, 0.000000000000, 45.023413333334, 0.000000000000, 28.692622222223, 0.000000000000, 20.114142222223, 0.000000000000, 28.734488888889 },
                { -11.056637777778, 0.000000000000, -6.701806666667, 0.000000000000, -8.784673333334, 0.000000000000, -10.983371111111, 0.000000000000, 28.692622222223, 0.000000000000, 48.215746666667, 0.000000000000, 24.589688888889, 0.000000000000, 22.134208888889, 0.000000000000 },
                { 0.000000000000, -11.056637777778, 0.000000000000, -6.701806666667, 0.000000000000, -8.784673333334, 0.000000000000, -10.983371111111, 0.000000000000, 28.692622222223, 0.000000000000, 48.215746666667, 0.000000000000, 24.589688888889, 0.000000000000, 22.134208888889 },
                { -9.104604444445, 0.000000000000, -9.031337777778, 0.000000000000, -6.832640000000, 0.000000000000, -6.895440000000, 0.000000000000, 20.114142222223, 0.000000000000, 24.589688888889, 0.000000000000, 28.821013333334, 0.000000000000, 24.924622222223, 0.000000000000 },
                { 0.000000000000, -9.104604444445, 0.000000000000, -9.031337777778, 0.000000000000, -6.832640000000, 0.000000000000, -6.895440000000, 0.000000000000, 20.114142222223, 0.000000000000, 24.589688888889, 0.000000000000, 28.821013333334, 0.000000000000, 24.924622222223 },
                { -7.444940000000, 0.000000000000, -11.077571111111, 0.000000000000, -11.150837777778, 0.000000000000, -8.941673333334, 0.000000000000, 28.734488888889, 0.000000000000, 22.134208888889, 0.000000000000, 24.924622222223, 0.000000000000, 49.869480000000, 0.000000000000 },
                { 0.000000000000, -7.444940000000, 0.000000000000, -11.077571111111, 0.000000000000, -11.150837777778, 0.000000000000, -8.941673333334, 0.000000000000, 28.734488888889, 0.000000000000, 22.134208888889, 0.000000000000, 24.924622222223, 0.000000000000, 49.869480000000 }
            }); // from Abaqus

            Assert.True(M.Equals(expectedM, 1e-10));
        }