using System;
namespace MES_1
{
public struct Element
{
public int[] ID;
public double[,] LH;
public double[] LP;
public double S;
public double K;
}
}
using System;
using System.Collections.Generic;
namespace MES_1
{
public class Grid
{
public int mh, me;
public Node[] N;
public Element[] E;
public Grid(GlobalData data)
{
this.mh = data.mh;
this.me = data.me;
}
public void Generate_Grid()
{
N = new Node[mh];
E = new Element[me];
}
public void Generate_Node(GlobalData data)
{
double dx = 0;
for (int i = 0; i < mh; i++)
{
N[i].x = dx;
dx = dx + data.l / me;
N[i].status = 0;
if (i == 0)
{
N[i].status = 1;
}
if (i == mh - 1)
{
N[i].status = 2;
}
}
for (int i = 0; i < me; i++)
{
E[i].S = data.s;
E[i].K = data.k;
E[i].LP[0] = 0; //tu wypierdala system.null.reference
E[i].LP[1] = 0; // jak patrze na wartosci zmiennych to te tablice
E[i].ID[0] = i; // wartosc maja null
E[i].ID[1] = i + 1; //cos z inicjalizacja tablic
}
}
public void Generate_LH(GlobalData data)
{
double c;
for (int i = 0; i < me; i++)
{
c = (E[i].S * E[i].K) / (N[E[i].ID[1]].x - N[E[i].ID[0]].x);
E[i].LH[0,0] = c;
E[i].LH[0,1] = -c;
E[i].LH[1,0] = -c;
E[i].LH[1,1] = c;
if (N[E[i].ID[0]].status == 2){
E[i].LH[0,0] += data.alpha * E[i].S;
}
if (N[E[i].ID[1]].status == 2)
{
E[i].LH[1,1] += data.alpha * E[i].S;
}
}
}
public void Generate_LP(GlobalData data)
{
for (int i = 0; i < me; i++)
{
if(N[E[i].ID[0]].status ==1)
{
E[i].LP[0] = data.q * E[i].S;
}
if (N[E[i].ID[1]].status == 1)
{
E[i].LP[1] = data.q * E[i].S;
}
if (N[E[i].ID[0]].status == 2)
{
E[i].LP[0] = -data.alpha * data.t_alpha * E[i].S;
}
if (N[E[i].ID[1]].status == 1)
{
E[i].LP[1] = -data.alpha * data.t_alpha * E[i].S;
}
}
}
}
}
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}