Ejemplo n.º 1
0
        private void comboBoxAnguloDir_SelectedIndexChanged(object sender, EventArgs e)
        {
            int             quantidadeElementos  = Convert.ToInt32(numericUpDownQuantidadeElementos.Value);
            List <double[]> elementosGraficoBase = new List <double[]>();

            for (int i = 1; i <= quantidadeElementos; i++)
            {
                Control[] control1    = this.Controls.Find("comboBoxAnguloE" + i.ToString(), true);
                ComboBox  comboBox    = control1[0] as ComboBox;
                Control[] control2    = this.Controls.Find("comboBoxAnguloDirE" + i.ToString(), true);
                ComboBox  comboBoxDir = control2[0] as ComboBox;

                if (comboBox.Text == string.Empty)
                {
                    return;
                }

                double anguloConvertido = comboBoxDir.Text == "-" ? -Convert.ToInt32(comboBox.Text) : Convert.ToInt32(comboBox.Text);

                if (comboBox.Text != string.Empty)
                {
                    elementosGraficoBase.Add(new double[] { 0.0, anguloConvertido });
                }
            }
            FormGrafico graf = new FormGrafico(quantidadeElementos, elementosGraficoBase);

            graf.defineGrafico(chart1);
        }
Ejemplo n.º 2
0
        private void buttonCalculaMatrizRigidezElementoEmCoordenadasLocais_Click(object sender, EventArgs e)
        {
            quantidadeNos        = Convert.ToInt32(textBoxQuantidadeNos.Text);
            grausLiberdadeGlobal = quantidadeNos * 3;
            quantidadeElementos  = Convert.ToInt32(numericUpDownQuantidadeElementos.Value);

            inicializaVetoresElementosLocais(grausLiberdadeGlobal, quantidadeElementos);
            inicializaMatrizGlobalEstrutura(grausLiberdadeGlobal, quantidadeElementos);

            double[][] inverse = MatrixUtil.MatrixInverse(defineMatrizEstruturaComCondicoesDeContorno(matrizGlobalEstrutura, quantidadeNos, grausLiberdadeGlobal));
            if (inverse == null)
            {
                MessageBox.Show("Matriz não pode ser invertida.");
                return;
            }
            double[,] matrizInversaGlobalDaEstrutura = MatrixUtil.MatrixReConverter(inverse);
            Console.WriteLine(MatrixUtil.MatrixAsString(matrizInversaGlobalDaEstrutura));

            inicializaVetorCargasExternas(matrizInversaGlobalDaEstrutura.GetLength(1), quantidadeNos);
            defineVetoresDeslocRotGlobalPeloNo(MatrixUtil.multiplicacaoMatrizComVetor(matrizInversaGlobalDaEstrutura, vetorCargasExternas, "VETOR DE DESLOCAMENTO E GIROS - GLOBAL"), quantidadeElementos, grausLiberdadeGlobal);
            aplicandoDeslocamentosLocaisElementos(quantidadeElementos);
            aplicandoDeslocamentosInternosElementos(quantidadeElementos);
            //subtracaoEsforcosIntVetorCargasEle(vetoresEsforcosInternosElem, vetor);

            FormGrafico graf = new FormGrafico(elementosGraficoDEC, elementosGraficoDMF, elementosGraficoDMT, quantidadeElementos,
                                               elementosGraficoBase, vetoresDeslocGiroGlobalElem, vetoresEsforcosInternosElem);

            inverse = null;

            graf.Show();
        }