コード例 #1
0
 /// <summary>
 /// The caller (usually the interpolation class) assumes responsibility for matching the nodes to the shape function
 /// derivatives.
 /// </summary>
 /// <param name="nodes">The nodes used for the interpolation.</param>
 /// <param name="naturalCoordinates">The shape function derivatives at a specific integration point.</param>
 public IsoparametricJacobian3D(IReadOnlyList <INode> nodes, Matrix naturalDerivatives)
 {
     DirectMatrix = CalculateJacobianMatrix(nodes, naturalDerivatives);
     (InverseMatrix, DirectDeterminant) = DirectMatrix.InvertAndDeterminant();
     //(InverseMatrix, DirectDeterminant) = InvertAndDeterminant(DirectMatrix);
     if (DirectDeterminant < determinantTolerance)
     {
         throw new ArgumentException("Jacobian determinant is negative or under the allowed tolerance"
                                     + $" ({DirectDeterminant} < {determinantTolerance}). Check the order of nodes or the element geometry.");
     }
 }
コード例 #2
0
        private const double determinantTolerance = 1E-10; // This needs to be in a static settings class.

        /// <summary>
        /// The caller (usually the interpolation class) assumes responsibility for matching the nodes to the shape function
        /// derivatives.
        /// </summary>
        /// <param name="nodes">The nodes used for the interpolation.</param>
        /// <param name="naturalDerivatives">The shape function derivatives at a specific integration point.</param>
        public IsoparametricJacobian2D(IReadOnlyList <Node> nodes, Matrix naturalDerivatives)
        {
            // The original matrix is not stored. Only the inverse and the determinant
            DirectMatrix = CalculateJacobianMatrix(nodes, naturalDerivatives);
            (InverseMatrix, DirectDeterminant) = DirectMatrix.InvertAndDeterminant();
            DirectDeterminant = Math.Abs(DirectDeterminant);
            //(InverseMatrix, DirectDeterminant) = InvertAndDeterminant(DirectMatrix);
            //if (DirectDeterminant < determinantTolerance)
            //{
            //    throw new ArgumentException("Jacobian determinant is negative or under the allowed tolerance"
            //        + $" ({DirectDeterminant} < {determinantTolerance}). Check the order of nodes or the element geometry.");
            //}
        }
コード例 #3
0
 public IsoparametricJacobian3D(double[][] deformedStateNodeCoordinates, Matrix naturalDerivatives, bool CalculateInverseAndDetereminant)
 {
     DirectMatrix = CalculateJacobianMatrix(deformedStateNodeCoordinates, naturalDerivatives);
     if (CalculateInverseAndDetereminant)
     {
         (InverseMatrix, DirectDeterminant) = DirectMatrix.InvertAndDeterminant();
         //(InverseMatrix, DirectDeterminant) = InvertAndDeterminant(DirectMatrix);
         if (DirectDeterminant < determinantTolerance)
         {
             throw new ArgumentException("Jacobian determinant is negative or under the allowed tolerance"
                                         + $" ({DirectDeterminant} < {determinantTolerance}). Check the order of nodes or the element geometry.");
         }
     }
 }