ISAAR.MSolve.FEM.Tests/Elements/Quad4.cs
/// <summary>
/// Consistent mass matrix with less integration points than nodes (just for testing, do not do that).
/// The reference solution can be found from http://kis.tu.kielce.pl/mo/COLORADO_FEM/colorado/IFEM.Ch31.pdf, (eq 31.29a) 
/// </summary>
Consistent mass matrix with less integration points than nodes (just for testing, do not do that).
Consistent mass matrix with less integration points than nodes ( just for testing do not do that ) .
[Fact]
        private static void TestConsistentMass0()
        {
            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;
            double scalar = dynamicMaterial.Density * thickness * lengthX * lengthY / 16.0;
            expectedM.ScaleIntoThis(scalar);
            Assert.True(M.Equals(expectedM, 1e-10));
        }
[ Fact ] private static void TestConsistentMass0 ( ) { 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 ; double scalar = dynamicMaterial . Density * thickness * lengthX * lengthY / 16.0 ; expectedM . ScaleIntoThis ( scalar ) ; Assert . True ( M . Equals ( expectedM , 1e-10 ) ) ; }
Consistent mass matrix with less integration points than nodes (just for testing, do not do that).
Consistent mass matrix with less integration points than nodes ( just for testing do not do that ) .
// reduced integration rule - bad idea // 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.