Ejemplo n.º 1
0
        public AuxiliaryStatesTensors ComputeTensorsAt(CartesianPoint globalIntegrationPoint,
                                                       TipCoordinateSystem tipCoordinateSystem)
        {
            // Common calculations
            PolarPoint2D polarCoordinates =
                tipCoordinateSystem.TransformPointGlobalCartesianToLocalPolar(globalIntegrationPoint);
            var commonValues = new CommonValues(polarCoordinates.R, polarCoordinates.Theta);

            // Displacement field derivatives
            Matrix2by2   displacementGradientMode1, displacementGradientMode2;
            TipJacobians polarJacobians = tipCoordinateSystem.CalculateJacobiansAt(polarCoordinates);

            ComputeDisplacementDerivatives(polarJacobians, commonValues,
                                           out displacementGradientMode1, out displacementGradientMode2);

            // Strains
            Tensor2D strainTensorMode1 = ComputeStrainTensor(displacementGradientMode1);
            Tensor2D strainTensorMode2 = ComputeStrainTensor(displacementGradientMode2);

            // Stresses
            Tensor2D stressTensorMode1, stressTensorMode2;

            ComputeStressTensors(commonValues, out stressTensorMode1, out stressTensorMode2);

            return(new AuxiliaryStatesTensors(displacementGradientMode1, displacementGradientMode2,
                                              strainTensorMode1, strainTensorMode2, stressTensorMode1, stressTensorMode2));
        }
Ejemplo n.º 2
0
            public EvaluatedFunction2D EvaluateAllAt(PolarPoint2D point, TipJacobians jacobian)
            {
                double sqrtR        = Math.Sqrt(point.R);
                double cosThetaHalf = Math.Cos(point.Theta / 2.0);
                double sinThetaHalf = Math.Sin(point.Theta / 2.0);

                double value         = sqrtR * cosThetaHalf;
                var    gradientPolar = Vector2.Create(0.5 / sqrtR * cosThetaHalf, -0.5 * sqrtR * sinThetaHalf);

                Vector2 gradientGlobal = jacobian.TransformScalarFieldDerivativesLocalPolarToGlobalCartesian(gradientPolar);

                return(new EvaluatedFunction2D(value, gradientGlobal));
            }
Ejemplo n.º 3
0
        private void ComputeDisplacementDerivatives(TipJacobians polarJacobians, CommonValues val,
                                                    out Matrix2by2 displacementGradientMode1, out Matrix2by2 displacementGradientMode2)
        {
            // Temporary values and derivatives of the differentiated quantities. See documentation for their derivation.
            double E   = material.HomogeneousYoungModulus;
            double v   = material.HomogeneousPoissonRatio;
            double vEq = material.HomogeneousEquivalentPoissonRatio;
            double k   = (3.0 - vEq) / (1.0 + vEq);
            double a   = (1.0 + v) / (E * Math.Sqrt(2.0 * Math.PI));
            double b   = val.sqrtR;
            double b_r = 0.5 / val.sqrtR;

            // Mode 1
            {
                // Temporary values that differ between the 2 modes
                double c1       = val.cosThetaOver2 * (k - val.cosTheta);
                double c2       = val.sinThetaOver2 * (k - val.cosTheta);
                double c1_theta = -0.5 * c2 + val.cosThetaOver2 * val.sinTheta;
                double c2_theta = 0.5 * c1 + val.sinThetaOver2 * val.sinTheta;

                // The vector field derivatives w.r.t. to the local polar coordinates.
                // The vector components refer to the local cartesian system though.
                var polarGradient = Matrix2by2.CreateFromArray(
                    new double[, ] {
                    { a *b_r *c1, a *b *c1_theta }, { a *b_r *c2, a *b *c2_theta }
                });
                // The vector field derivatives w.r.t. to the local cartesian coordinates.
                displacementGradientMode1 =
                    polarJacobians.TransformVectorFieldDerivativesLocalPolarToLocalCartesian(polarGradient);
            }

            // Mode 2
            {
                double paren1   = 2.0 + k + val.cosTheta;
                double paren2   = 2.0 - k - val.cosTheta;
                double c1       = val.sinThetaOver2 * paren1;
                double c2       = val.cosThetaOver2 * paren2;
                double c1_theta = 0.5 * val.cosThetaOver2 * paren1 - val.sinThetaOver2 * val.sinTheta;
                double c2_theta = -0.5 * val.sinThetaOver2 * paren2 + val.cosThetaOver2 * val.sinTheta;

                // The vector field derivatives w.r.t. to the local polar coordinates.
                // The vector components refer to the local cartesian system though.
                var polarGradient = Matrix2by2.CreateFromArray(
                    new double[, ] {
                    { a *b_r *c1, a *b *c1_theta }, { a *b_r *c2, a *b *c2_theta }
                });
                // The vector field derivatives w.r.t. to the local cartesian coordinates.
                displacementGradientMode2 =
                    polarJacobians.TransformVectorFieldDerivativesLocalPolarToLocalCartesian(polarGradient);
            }
        }
        public EvaluatedFunction2D[] EvaluateAllAt(NaturalPoint point, XContinuumElement2D element,
                                                   EvalInterpolation2D interpolation)
        {
            PolarPoint2D polarPoint = TipSystem.TransformPointGlobalCartesianToLocalPolar(
                interpolation.TransformPointNaturalToGlobalCartesian());
            TipJacobians tipJacobians = TipSystem.CalculateJacobiansAt(polarPoint);

            var enrichments = new EvaluatedFunction2D[enrichmentFunctions.Count];

            for (int i = 0; i < enrichments.Length; ++i)
            {
                enrichments[i] = enrichmentFunctions[i].EvaluateAllAt(polarPoint, tipJacobians);
            }
            return(enrichments);
        }