public My_IsotropicGasMiracleDummy(My_IsotropicGas parent, bool boundarytype = false, double[] cond = null) { this.parent = parent; Vel = new VelDummy(); //cond - плотность давление масса скорость (x,y) isboundary = boundarytype; if (cond != null) { Ro = cond[0]; P = cond[1]; M = cond[2]; Vel.X = cond[3]; Vel.Y = cond[4]; E = P / (0.4 * Ro); } }
private static List <My_IsotropicGas> ConstructBountPart(double boundaryDensity) { List <My_IsotropicGas> WallParticles = new List <My_IsotropicGas>(); foreach (var side in My_Sph2D.boundaries) { Vector2D vector = side.Item2 - side.Item1; int partN = Convert.ToInt32((Math.Abs(vector.GetLength())) * boundaryDensity); double xstep = vector.X / partN; double ystep = vector.Y / partN; for (int i = 0; i < partN; ++i) { My_IsotropicGas a = new My_IsotropicGas(1, 1, true); a.X = side.Item1.X + i * xstep; a.Y = side.Item1.Y + i * ystep; WallParticles.Add(a); } } return(WallParticles); }