Beispiel #1
0
        // Set nodal equivalent of distributed face load to evec.
        // surLd - object describing element face load;
        // returns loaded element face
        // or -1 (loaded nodes do not match elem face)
        public override int equivFaceLoad(ElemFaceLoad surLd)
        {
            // Shape functons
            double[] an = new double[2];
            // Derivatives of shape functions
            double[] xin = new double[2];

            for (int i = 0; i < 8; i++)
            {
                evec[i] = 0.0;
            }
            int loadedFace = surLd.rearrange(faceInd, ind);

            if (loadedFace == -1)
            {
                return(-1);
            }

            // Gauss integration loop
            for (int ip = 0; ip < gf.nIntPoints; ip++)
            {
                ShapeLin2D.shapeDerivFace(gf.xii[ip], an, xin);
                double p  = r = 0.0;
                double xs = 0.0;
                double ys = 0.0;
                for (int i = 0; i < 2; i++)
                {
                    p += an[i] * surLd.forceAtNodes[i];
                    int j = faceInd[loadedFace][i];
                    r  += an[i] * xy[j][0];
                    xs += xin[i] * xy[j][0];
                    ys += xin[i] * xy[j][1];
                }
                double dl = Math.Sqrt(xs * xs + ys * ys);
                double ds = dl;
                if (FeModel.stressState == FeModel.StrStates.axisym)
                {
                    ds *= 2.0 * Math.PI * r;
                }
                double p1, p2;
                // direction=0 - normal load, =1,2 - along axes x,y
                if (surLd.direction == 0 && ds > 0.0)
                {
                    p1 = p * ys / dl;
                    p2 = -p * xs / dl;
                }
                else if (surLd.direction == 1)
                {
                    p1 = p; p2 = 0;
                }
                else
                {
                    p1 = 0; p2 = p;
                }

                for (int i = 0; i < 2; i++)
                {
                    int j = faceInd[loadedFace][i];
                    evec[2 * j]     += an[i] * p1 * ds * gf.wi[ip] * this.t;
                    evec[2 * j + 1] += an[i] * p2 * ds * gf.wi[ip] * this.t;
                    // Console.WriteLine(2*j);
                }
            }
            return(loadedFace);
        }