Beispiel #1
0
 public NodePointLoad(AnalysisCase analysisCase, double fx, double fz, double my)
     : base(analysisCase)
 {
     FX = fx;
     FZ = fz;
     MY = my;
 }
Beispiel #2
0
        /// <summary>
        /// Adds a new analysis case to the model.
        /// </summary>
        public AnalysisCase AddAnalysisCase(string name)
        {
            AnalysisCase a = new AnalysisCase(name);
            AnalysisCases.Add(a);

            return a;
        }
Beispiel #3
0
        /// <summary>
        /// Calculates frame internal forces the given load case and global deformation vector.
        /// </summary>
        private void CalculateFrameInternalForces(AnalysisCase analysisCase, Vector <double> deformations)
        {
            analysisCase.FrameInternalForces.Clear();

            foreach (Frame frame in Frames)
            {
                int             i = frame.NodeI.Index;
                int             j = frame.NodeJ.Index;
                Vector <double> globalDeformations = Vector <double> .Build.Dense(6, 0);

                globalDeformations[0] = deformations[i * 3 + 0];
                globalDeformations[1] = deformations[i * 3 + 1];
                globalDeformations[2] = deformations[i * 3 + 2];
                globalDeformations[3] = deformations[j * 3 + 0];
                globalDeformations[4] = deformations[j * 3 + 1];
                globalDeformations[5] = deformations[j * 3 + 2];
                Vector <double>    localDeformations = frame.Transformation.Transpose().Inverse() * globalDeformations;
                Vector <double>    internalForces    = frame.LocalElementStiffness * localDeformations;
                double             ni    = internalForces[0];
                double             vi    = internalForces[1];
                double             mi    = -internalForces[2];
                double             nj    = -internalForces[3];
                double             vj    = -internalForces[4];
                double             mj    = internalForces[5];
                FrameInternalForce force = new FrameInternalForce(frame, ni, vi, mi, nj, vj, mj);
                analysisCase.FrameInternalForces.Add(force);
            }
        }
Beispiel #4
0
        /// <summary>
        /// Adds a new analysis case to the model.
        /// </summary>
        public AnalysisCase AddAnalysisCase(string name)
        {
            AnalysisCase a = new AnalysisCase(name);

            AnalysisCases.Add(a);

            return(a);
        }
Beispiel #5
0
        public FrameTrapezoidalLoad(AnalysisCase analysisCase, double fxi, double fzi, double fxj, double fzj)
            : base(analysisCase)
        {
            FXI = fxi;
            FZI = fzi;

            FXJ = fxj;
            FZJ = fzj;
        }
Beispiel #6
0
        public FrameTrapezoidalLoad(AnalysisCase analysisCase, double fxi, double fzi, double fxj, double fzj)
            : base(analysisCase)
        {
            FXI = fxi;
            FZI = fzi;

            FXJ = fxj;
            FZJ = fzj;
        }
Beispiel #7
0
        /// <summary>
        /// Calculates node deformations for the given load case and deformation vector.
        /// </summary>
        private void CalculateDeformations(AnalysisCase analysisCase, Vector <double> deformations)
        {
            analysisCase.NodeDeformations.Clear();

            for (int i = 0; i < nodes.Count; i++)
            {
                int             j = nodes[i].Index;
                NodeDeformation d = new NodeDeformation(nodes[i], deformations[j * 3], deformations[j * 3 + 1], deformations[j * 3 + 2]);
                analysisCase.NodeDeformations.Add(d);
            }
        }
Beispiel #8
0
 public void SetCoefficient(double coefficient, AnalysisCase analysisCase)
 {
     if (acCoefficients.ContainsKey(analysisCase))
     {
         acCoefficients[analysisCase] = coefficient;
     }
     else
     {
         acCoefficients.Add(analysisCase, coefficient);
     }
 }
Beispiel #9
0
        /// <summary>
        /// Calculates support reactions for the given load case and deformation vector.
        /// </summary>
        private void CalculateReactions(AnalysisCase analysisCase, Vector <double> reactions)
        {
            analysisCase.Reactions.Clear();

            for (int i = 0; i < nodes.Count; i++)
            {
                int j = nodes[i].Index;
                if (nodes[i].Restraints != DOF.Free)
                {
                    Reaction r = new Reaction(nodes[i], reactions[j * 3], reactions[j * 3 + 1], reactions[j * 3 + 2]);
                    analysisCase.Reactions.Add(r);
                }
            }
        }
Beispiel #10
0
        /// <summary>
        /// Solves the system for the given load case.
        /// </summary>
        public void Run(AnalysisCase analysisCase)
        {
            AssignNodeIndices();

            if (stiffnessMatrix == null)
            {
                BuildStiffnessMatrix();
            }

            Vector <double> f = GetLoadVector(analysisCase);

            Vector <double> d = restrainedStiffnessMatrix.Solve(f);

            CalculateDeformations(analysisCase, d);

            Vector <double> r = stiffnessMatrix * d;

            CalculateReactions(analysisCase, r);

            CalculateFrameInternalForces(analysisCase, d);
        }
Beispiel #11
0
 private void DrawDeformations(AnalysisCase analysisCase)
 {
     DrawDeformations(analysisCase.NodeDeformations);
 }
Beispiel #12
0
 private void DrawReactions(AnalysisCase analysisCase)
 {
     DrawReactions(analysisCase.Reactions);
 }
Beispiel #13
0
        /// <summary>
        /// Returns the load vector for the given load case.
        /// </summary>
        private Vector<double> GetLoadVector(AnalysisCase analysisCase)
        {
            Vector<double> p = Vector<double>.Build.Dense(nodes.Count * 3, 0);

            // Node loads
            foreach (Node node in nodes)
            {
                foreach (NodeLoad load in node.Loads.FindAll((e) => e.AnalysisCase == analysisCase))
                {
                    if (load is NodePointLoad)
                    {
                        // Applied point loads
                        NodePointLoad pl = (NodePointLoad)load;
                        int i = node.Index;
                        p[i * 3 + 0] += pl.FX;
                        p[i * 3 + 1] += pl.FZ;
                        p[i * 3 + 2] += pl.MY;
                    }
                }
            }

            // Frame loads
            foreach (Frame frame in Frames)
            {
                double l = frame.Length;
                int i = frame.NodeI.Index;
                int j = frame.NodeJ.Index;

                foreach (FrameLoad load in frame.Loads.FindAll((e) => e.AnalysisCase == analysisCase))
                {
                    if (load is FrameUniformLoad)
                    {
                        // Frame fixed-end reactions from frame uniform loads
                        FrameUniformLoad pl = (FrameUniformLoad)load;
                        double fx = pl.FX * l / 2.0;
                        double fz = pl.FZ * l / 2.0;

                        p[i * 3 + 0] += fx;
                        p[i * 3 + 1] += fz;
                        p[i * 3 + 2] += 0; // End moment

                        p[j * 3 + 0] += fx;
                        p[j * 3 + 1] += fz;
                        p[j * 3 + 2] += 0; // End moment
                    }
                    else if (load is FrameTrapezoidalLoad)
                    {
                        // Frame fixed-end reactions from frame trapezoidal loads
                        FrameTrapezoidalLoad pl = (FrameTrapezoidalLoad)load;

                        double fx = (pl.FXI + pl.FXJ) / 2.0 * l / 2.0;
                        double fz = (pl.FZI + pl.FZJ) / 2.0 * l / 2.0;

                        p[i * 3 + 0] += fx;
                        p[i * 3 + 1] += fz;
                        p[i * 3 + 2] += 0; // End moment

                        p[j * 3 + 0] += fx;
                        p[j * 3 + 1] += fz;
                        p[j * 3 + 2] += 0; // End moment
                    }
                }
            }

            // Set restrained node coefficients to 0
            foreach (Node n in nodes)
            {
                if ((n.Restraints & DOF.UX) != DOF.Free)
                    p[n.Index * 3 + 0] = 0;
                if ((n.Restraints & DOF.UZ) != DOF.Free)
                    p[n.Index * 3 + 1] = 0;
                if ((n.Restraints & DOF.RY) != DOF.Free)
                    p[n.Index * 3 + 2] = 0;
            }

            return p;
        }
Beispiel #14
0
 public FrameLoad(AnalysisCase analysisCase)
 {
     AnalysisCase = analysisCase;
 }
Beispiel #15
0
 private void DrawFrameShearForces(AnalysisCase analysisCase)
 {
     DrawFrameShearForces(analysisCase.FrameInternalForces);
 }
Beispiel #16
0
        /// <summary>
        /// Calculates frame internal forces the given load case and global deformation vector.
        /// </summary>
        private void CalculateFrameInternalForces(AnalysisCase analysisCase, Vector<double> deformations)
        {
            analysisCase.FrameInternalForces.Clear();

            foreach (Frame frame in Frames)
            {
                int i = frame.NodeI.Index;
                int j = frame.NodeJ.Index;
                Vector<double> globalDeformations = Vector<double>.Build.Dense(6, 0);
                globalDeformations[0] = deformations[i * 3 + 0];
                globalDeformations[1] = deformations[i * 3 + 1];
                globalDeformations[2] = deformations[i * 3 + 2];
                globalDeformations[3] = deformations[j * 3 + 0];
                globalDeformations[4] = deformations[j * 3 + 1];
                globalDeformations[5] = deformations[j * 3 + 2];
                Vector<double> localDeformations = frame.Transformation.Transpose().Inverse() * globalDeformations;
                Vector<double> internalForces = frame.LocalElementStiffness * localDeformations;
                double ni = internalForces[0];
                double vi = internalForces[1];
                double mi = -internalForces[2];
                double nj = -internalForces[3];
                double vj = -internalForces[4];
                double mj = internalForces[5];
                FrameInternalForce force = new FrameInternalForce(frame, ni, vi, mi, nj, vj, mj);
                analysisCase.FrameInternalForces.Add(force);
            }
        }
Beispiel #17
0
 /// <summary>
 /// Adds a new frame trapezoidal load.
 /// </summary>
 public void AddTrapezoidalLoad(AnalysisCase analysisCase, double fxi, double fzi, double fxj, double fzj)
 {
     Loads.Add(new FrameTrapezoidalLoad(analysisCase, fxi, fzi, fxj, fzj));
 }
Beispiel #18
0
 /// <summary>
 /// Adds a new node point load.
 /// </summary>
 public void AddNodePointLoad(AnalysisCase analysisCase, Node node, double fx, double fz, double my)
 {
     node.AddPointLoad(analysisCase, fx, fz, my);
 }
Beispiel #19
0
 /// <summary>
 /// Adds frame self weight load.
 /// </summary>
 public void AddFrameSelfWeight(AnalysisCase analysisCase, Frame frame)
 {
     frame.AddUniformLoad(analysisCase, 0, -frame.WeightPerLength);
 }
Beispiel #20
0
 /// <summary>
 /// Adds a new frame trapezoidal load.
 /// </summary>
 public void AddFrameTrapezoidalLoad(AnalysisCase analysisCase, Frame frame, double fxi, double fzi, double fxj, double fzj)
 {
     frame.AddTrapezoidalLoad(analysisCase, fxi, fzi, fxj, fzj);
 }
Beispiel #21
0
        private void DrawFrameLoads(AnalysisCase analysisCase)
        {
            float maxLoadSize = 10 * DimensionOffset;
            float textOffset = 0.5f * TextSize;
            float maxLoad = 0;
            foreach (Frame f in mCurrentSection.AnalysisModel.Frames)
            {
                foreach (FrameLoad load in f.Loads.FindAll((e) => e.AnalysisCase == analysisCase))
                {
                    if (load is FrameUniformLoad)
                    {
                        FrameUniformLoad uniformLoad = load as FrameUniformLoad;
                        maxLoad = (float)Math.Max(maxLoad, Math.Max(Math.Abs(uniformLoad.FX), Math.Abs(uniformLoad.FZ)));
                    }
                    if (load is FrameTrapezoidalLoad)
                    {
                        FrameTrapezoidalLoad trapezoidalLoad = load as FrameTrapezoidalLoad;
                        maxLoad = (float)Math.Max(maxLoad, Math.Max(Math.Abs(trapezoidalLoad.FXI), Math.Abs(trapezoidalLoad.FZI)));
                        maxLoad = (float)Math.Max(maxLoad, Math.Max(Math.Abs(trapezoidalLoad.FXJ), Math.Abs(trapezoidalLoad.FZJ)));
                    }
                }
            }
            foreach (Frame f in mCurrentSection.AnalysisModel.Frames)
            {
                float x1 = (float)f.NodeI.X;
                float y1 = (float)f.NodeI.Z;
                float x2 = (float)f.NodeJ.X;
                float y2 = (float)f.NodeJ.Z;
                float angle = (float)f.Angle * 180 / (float)Math.PI + 90;
                foreach (FrameLoad load in f.Loads.FindAll((e) => e.AnalysisCase == analysisCase))
                {
                    if (load is FrameUniformLoad)
                    {
                        FrameUniformLoad uniformLoad = load as FrameUniformLoad;
                        float loadx1 = x1 - (float)uniformLoad.FX * maxLoadSize / maxLoad;
                        float loady1 = y1 - (float)uniformLoad.FZ * maxLoadSize / maxLoad;
                        float loadx2 = x2 - (float)uniformLoad.FX * maxLoadSize / maxLoad;
                        float loady2 = y2 - (float)uniformLoad.FZ * maxLoadSize / maxLoad;
                        SimpleCAD.Polygon poly = new SimpleCAD.Polygon(new PointF[] { new PointF(x1, y1), new PointF(x2, y2), new PointF(loadx2, loady2), new PointF(loadx1, loady1) });
                        poly.OutlineStyle = new SimpleCAD.OutlineStyle(DimensionColor);
                        poly.FillStyle = new SimpleCAD.FillStyle(ShadingColor);
                        Model.Add(poly);

                        SimpleCAD.Text text = new SimpleCAD.Text(loadx1, loady1, uniformLoad.FX.ToString("0.0") + ", " + uniformLoad.FZ.ToString("0.0"), TextSize);
                        text.HorizontalAlignment = StringAlignment.Near;
                        text.VerticalAlignment = StringAlignment.Center;
                        text.Rotation = angle;
                        text.FontFamily = Font.Name;
                        text.OutlineStyle = new SimpleCAD.OutlineStyle(DimensionColor);
                        Model.Add(text);
                    }
                    if (load is FrameTrapezoidalLoad)
                    {
                        FrameTrapezoidalLoad trapezoidalLoad = load as FrameTrapezoidalLoad;
                        float loadx1 = x1 - (float)trapezoidalLoad.FXI * maxLoadSize / maxLoad;
                        float loady1 = y1 - (float)trapezoidalLoad.FZI * maxLoadSize / maxLoad;
                        float loadx2 = x2 - (float)trapezoidalLoad.FXJ * maxLoadSize / maxLoad;
                        float loady2 = y2 - (float)trapezoidalLoad.FZJ * maxLoadSize / maxLoad;
                        SimpleCAD.Polygon poly = new SimpleCAD.Polygon(new PointF[] { new PointF(x1, y1), new PointF(x2, y2), new PointF(loadx2, loady2), new PointF(loadx1, loady1) });
                        poly.OutlineStyle = new SimpleCAD.OutlineStyle(DimensionColor);
                        poly.FillStyle = new SimpleCAD.FillStyle(ShadingColor);
                        Model.Add(poly);

                        SimpleCAD.Text textI = new SimpleCAD.Text(loadx1, loady1, trapezoidalLoad.FXI.ToString("0.0") + ", " + trapezoidalLoad.FZI.ToString("0.0"), TextSize);
                        textI.HorizontalAlignment = StringAlignment.Near;
                        textI.VerticalAlignment = StringAlignment.Center;
                        textI.Rotation = angle;
                        textI.FontFamily = Font.Name;
                        textI.OutlineStyle = new SimpleCAD.OutlineStyle(DimensionColor);
                        Model.Add(textI);

                        SimpleCAD.Text textJ = new SimpleCAD.Text(loadx2, loady2, trapezoidalLoad.FXJ.ToString("0.0") + ", " + trapezoidalLoad.FZJ.ToString("0.0"), TextSize);
                        textJ.HorizontalAlignment = StringAlignment.Near;
                        textJ.VerticalAlignment = StringAlignment.Center;
                        textJ.Rotation = angle;
                        textJ.FontFamily = Font.Name;
                        textJ.OutlineStyle = new SimpleCAD.OutlineStyle(DimensionColor);
                        Model.Add(textJ);
                    }
                }
            }
        }
Beispiel #22
0
 /// <summary>
 /// Adds a new frame trapezoidal load.
 /// </summary>
 public void AddTrapezoidalLoad(AnalysisCase analysisCase, double fxi, double fzi, double fxj, double fzj)
 {
     Loads.Add(new FrameTrapezoidalLoad(analysisCase, fxi, fzi, fxj, fzj));
 }
Beispiel #23
0
 /// <summary>
 /// Adds a new frame uniform load.
 /// </summary>
 public void AddUniformLoad(AnalysisCase analysisCase, double fx, double fz)
 {
     Loads.Add(new FrameUniformLoad(analysisCase, fx, fz));
 }
Beispiel #24
0
 private void DrawNodeLoads(AnalysisCase analysisCase)
 {
     float textOffset = 0.5f * TextSize;
     foreach (Node n in mCurrentSection.AnalysisModel.Nodes)
     {
         foreach (NodeLoad load in n.Loads.FindAll((e) => e.AnalysisCase == analysisCase))
         {
             if (load is NodePointLoad)
             {
                 NodePointLoad pointLoad = load as NodePointLoad;
                 string loadText = pointLoad.FX.ToString("0") + ", " + pointLoad.FZ.ToString("0") + ", " + pointLoad.MY.ToString("0");
                 SimpleCAD.Text text = new SimpleCAD.Text((float)n.X + textOffset / 2, (float)n.Z + textOffset / 2, loadText, TextSize);
                 text.FontFamily = Font.Name;
                 text.OutlineStyle = new SimpleCAD.OutlineStyle(DimensionColor);
                 Model.Add(text);
             }
         }
     }
 }
Beispiel #25
0
 /// <summary>
 /// Adds frame self weight load.
 /// </summary>
 public void AddFrameSelfWeight(AnalysisCase analysisCase, Frame frame)
 {
     frame.AddUniformLoad(analysisCase, 0, -frame.WeightPerLength);
 }
Beispiel #26
0
 public FrameUniformLoad(AnalysisCase analysisCase, double fx, double fz)
     : base(analysisCase)
 {
     FX = fx;
     FZ = fz;
 }
Beispiel #27
0
 public NodePointLoad(AnalysisCase analysisCase, double fx, double fz, double my)
     : base(analysisCase)
 {
     FX = fx;
     FZ = fz;
     MY = my;
 }
Beispiel #28
0
        public void Update()
        {
            MinNodeDeformations.Clear();
            MinReactions.Clear();
            MinFrameInternalForces.Clear();

            MaxNodeDeformations.Clear();
            MaxReactions.Clear();
            MaxFrameInternalForces.Clear();

            if (IsEnvelope)
            {
                HasEnvelopeValues = true;
            }

            foreach (KeyValuePair <AnalysisCase, double> pair in acCoefficients)
            {
                AnalysisCase analysisCase = pair.Key;
                double       coefficient  = pair.Value;
                if (IsEnvelope)
                {
                    MinNodeDeformations    = MinNodeDeformations.Min(analysisCase.NodeDeformations.Multiply(coefficient));
                    MinReactions           = MinReactions.Min(analysisCase.Reactions.Multiply(coefficient));
                    MinFrameInternalForces = MinFrameInternalForces.Min(analysisCase.FrameInternalForces.Multiply(coefficient));

                    MaxNodeDeformations    = MaxNodeDeformations.Max(analysisCase.NodeDeformations.Multiply(coefficient));
                    MaxReactions           = MaxReactions.Max(analysisCase.Reactions.Multiply(coefficient));
                    MaxFrameInternalForces = MaxFrameInternalForces.Max(analysisCase.FrameInternalForces.Multiply(coefficient));
                }
                else
                {
                    MinNodeDeformations    = MinNodeDeformations.MultiplyAndAdd(coefficient, analysisCase.NodeDeformations);
                    MinReactions           = MinReactions.MultiplyAndAdd(coefficient, analysisCase.Reactions);
                    MinFrameInternalForces = MinFrameInternalForces.MultiplyAndAdd(coefficient, analysisCase.FrameInternalForces);

                    MaxNodeDeformations    = MaxNodeDeformations.MultiplyAndAdd(coefficient, analysisCase.NodeDeformations);
                    MaxReactions           = MaxReactions.MultiplyAndAdd(coefficient, analysisCase.Reactions);
                    MaxFrameInternalForces = MaxFrameInternalForces.MultiplyAndAdd(coefficient, analysisCase.FrameInternalForces);
                }
            }

            foreach (KeyValuePair <Combination, double> pair in coCoefficients)
            {
                Combination combination = pair.Key;
                double      coefficient = pair.Value;
                combination.Update();
                if (IsEnvelope || combination.HasEnvelopeValues)
                {
                    HasEnvelopeValues = true;

                    MinNodeDeformations    = MinNodeDeformations.Min(combination.MinNodeDeformations.Multiply(coefficient));
                    MinReactions           = MinReactions.Min(combination.MinReactions.Multiply(coefficient));
                    MinFrameInternalForces = MinFrameInternalForces.Min(combination.MinFrameInternalForces.Multiply(coefficient));

                    MaxNodeDeformations    = MaxNodeDeformations.Max(combination.MaxNodeDeformations.Multiply(coefficient));
                    MaxReactions           = MaxReactions.Max(combination.MaxReactions.Multiply(coefficient));
                    MaxFrameInternalForces = MaxFrameInternalForces.Max(combination.MaxFrameInternalForces.Multiply(coefficient));
                }
                else
                {
                    MinNodeDeformations    = MinNodeDeformations.MultiplyAndAdd(coefficient, combination.MinNodeDeformations);
                    MinReactions           = MinReactions.MultiplyAndAdd(coefficient, combination.MinReactions);
                    MinFrameInternalForces = MinFrameInternalForces.MultiplyAndAdd(coefficient, combination.MinFrameInternalForces);

                    MaxNodeDeformations    = MaxNodeDeformations.MultiplyAndAdd(coefficient, combination.MaxNodeDeformations);
                    MaxReactions           = MaxReactions.MultiplyAndAdd(coefficient, combination.MaxReactions);
                    MaxFrameInternalForces = MaxFrameInternalForces.MultiplyAndAdd(coefficient, combination.MaxFrameInternalForces);
                }
            }
        }
Beispiel #29
0
 private void DrawFrameMoments(AnalysisCase analysisCase)
 {
     DrawFrameMoments(analysisCase.FrameInternalForces);
 }
Beispiel #30
0
 /// <summary>
 /// Adds a new frame uniform load.
 /// </summary>
 public void AddFrameUniformLoad(AnalysisCase analysisCase, Frame frame, double fx, double fz)
 {
     frame.AddUniformLoad(analysisCase, fx, fz);
 }
Beispiel #31
0
 public NodeLoad(AnalysisCase analysisCase)
 {
     AnalysisCase = analysisCase;
 }
Beispiel #32
0
 /// <summary>
 /// Adds a new node point load.
 /// </summary>
 public void AddPointLoad(AnalysisCase analysisCase, double fx, double fz, double my)
 {
     Loads.Add(new NodePointLoad(analysisCase, fx, fz, my));
 }
Beispiel #33
0
 /// <summary>
 /// Adds a new frame uniform load.
 /// </summary>
 public void AddFrameUniformLoad(AnalysisCase analysisCase, Frame frame, double fx, double fz)
 {
     frame.AddUniformLoad(analysisCase, fx, fz);
 }
Beispiel #34
0
 /// <summary>
 /// Adds a new frame uniform load.
 /// </summary>
 public void AddUniformLoad(AnalysisCase analysisCase, double fx, double fz)
 {
     Loads.Add(new FrameUniformLoad(analysisCase, fx, fz));
 }
Beispiel #35
0
        /// <summary>
        /// Solves the system for the given load case.
        /// </summary>
        public void Run(AnalysisCase analysisCase)
        {
            AssignNodeIndices();

            if (stiffnessMatrix == null)
            {
                BuildStiffnessMatrix();
            }

            Vector<double> f = GetLoadVector(analysisCase);

            Vector<double> d = restrainedStiffnessMatrix.Solve(f);
            CalculateDeformations(analysisCase, d);

            Vector<double> r = stiffnessMatrix * d;
            CalculateReactions(analysisCase, r);

            CalculateFrameInternalForces(analysisCase, d);
        }
Beispiel #36
0
 /// <summary>
 /// Adds a new frame trapezoidal load.
 /// </summary>
 public void AddFrameTrapezoidalLoad(AnalysisCase analysisCase, Frame frame, double fxi, double fzi, double fxj, double fzj)
 {
     frame.AddTrapezoidalLoad(analysisCase, fxi, fzi, fxj, fzj);
 }
Beispiel #37
0
 public NodeLoad(AnalysisCase analysisCase)
 {
     AnalysisCase = analysisCase;
 }
Beispiel #38
0
 /// <summary>
 /// Adds a new node point load.
 /// </summary>
 public void AddNodePointLoad(AnalysisCase analysisCase, Node node, double fx, double fz, double my)
 {
     node.AddPointLoad(analysisCase, fx, fz, my);
 }
Beispiel #39
0
 public FrameLoad(AnalysisCase analysisCase)
 {
     AnalysisCase = analysisCase;
 }
Beispiel #40
0
        /// <summary>
        /// Calculates node deformations for the given load case and deformation vector.
        /// </summary>
        private void CalculateDeformations(AnalysisCase analysisCase, Vector<double> deformations)
        {
            analysisCase.NodeDeformations.Clear();

            for (int i = 0; i < nodes.Count; i++)
            {
                int j = nodes[i].Index;
                NodeDeformation d = new NodeDeformation(nodes[i], deformations[j * 3], deformations[j * 3 + 1], deformations[j * 3 + 2]);
                analysisCase.NodeDeformations.Add(d);
            }
        }
Beispiel #41
0
 public FrameUniformLoad(AnalysisCase analysisCase, double fx, double fz)
     : base(analysisCase)
 {
     FX = fx;
     FZ = fz;
 }
Beispiel #42
0
        /// <summary>
        /// Calculates support reactions for the given load case and deformation vector.
        /// </summary>
        private void CalculateReactions(AnalysisCase analysisCase, Vector<double> reactions)
        {
            analysisCase.Reactions.Clear();

            for (int i = 0; i < nodes.Count; i++)
            {
                int j = nodes[i].Index;
                if (nodes[i].Restraints != DOF.Free)
                {
                    Reaction r = new Reaction(nodes[i], reactions[j * 3], reactions[j * 3 + 1], reactions[j * 3 + 2]);
                    analysisCase.Reactions.Add(r);
                }
            }
        }
Beispiel #43
0
 /// <summary>
 /// Adds a new node point load.
 /// </summary>
 public void AddPointLoad(AnalysisCase analysisCase, double fx, double fz, double my)
 {
     Loads.Add(new NodePointLoad(analysisCase, fx, fz, my));
 }
Beispiel #44
0
        /// <summary>
        /// Returns the load vector for the given load case.
        /// </summary>
        private Vector <double> GetLoadVector(AnalysisCase analysisCase)
        {
            Vector <double> p = Vector <double> .Build.Dense(nodes.Count * 3, 0);

            // Node loads
            foreach (Node node in nodes)
            {
                foreach (NodeLoad load in node.Loads.FindAll((e) => e.AnalysisCase == analysisCase))
                {
                    if (load is NodePointLoad)
                    {
                        // Applied point loads
                        NodePointLoad pl = (NodePointLoad)load;
                        int           i  = node.Index;
                        p[i * 3 + 0] += pl.FX;
                        p[i * 3 + 1] += pl.FZ;
                        p[i * 3 + 2] += pl.MY;
                    }
                }
            }

            // Frame loads
            foreach (Frame frame in Frames)
            {
                double l = frame.Length;
                int    i = frame.NodeI.Index;
                int    j = frame.NodeJ.Index;

                foreach (FrameLoad load in frame.Loads.FindAll((e) => e.AnalysisCase == analysisCase))
                {
                    if (load is FrameUniformLoad)
                    {
                        // Frame fixed-end reactions from frame uniform loads
                        FrameUniformLoad pl = (FrameUniformLoad)load;
                        double           fx = pl.FX * l / 2.0;
                        double           fz = pl.FZ * l / 2.0;

                        p[i * 3 + 0] += fx;
                        p[i * 3 + 1] += fz;
                        p[i * 3 + 2] += 0; // End moment

                        p[j * 3 + 0] += fx;
                        p[j * 3 + 1] += fz;
                        p[j * 3 + 2] += 0; // End moment
                    }
                    else if (load is FrameTrapezoidalLoad)
                    {
                        // Frame fixed-end reactions from frame trapezoidal loads
                        FrameTrapezoidalLoad pl = (FrameTrapezoidalLoad)load;

                        double fx = (pl.FXI + pl.FXJ) / 2.0 * l / 2.0;
                        double fz = (pl.FZI + pl.FZJ) / 2.0 * l / 2.0;

                        p[i * 3 + 0] += fx;
                        p[i * 3 + 1] += fz;
                        p[i * 3 + 2] += 0; // End moment

                        p[j * 3 + 0] += fx;
                        p[j * 3 + 1] += fz;
                        p[j * 3 + 2] += 0; // End moment
                    }
                }
            }

            // Set restrained node coefficients to 0
            foreach (Node n in nodes)
            {
                if ((n.Restraints & DOF.UX) != DOF.Free)
                {
                    p[n.Index * 3 + 0] = 0;
                }
                if ((n.Restraints & DOF.UZ) != DOF.Free)
                {
                    p[n.Index * 3 + 1] = 0;
                }
                if ((n.Restraints & DOF.RY) != DOF.Free)
                {
                    p[n.Index * 3 + 2] = 0;
                }
            }

            return(p);
        }
Beispiel #45
0
 public void SetCoefficient(double coefficient, AnalysisCase analysisCase)
 {
     if (acCoefficients.ContainsKey(analysisCase))
         acCoefficients[analysisCase] = coefficient;
     else
         acCoefficients.Add(analysisCase, coefficient);
 }