public LayerData(int width, int height, int thickness) { u_var = new Matrix3D(width, height, thickness); v_var = new Matrix3D(width, height, thickness); w_var = new Matrix3D(width, height, thickness); T_var = new Matrix3D(width, height, thickness); Div_var = new Matrix3D(width, height, thickness); this.width = width; this.height = height; this.thickness = thickness; }
public Matrix4D(int width, int height, int thickness, int timeDimension) { this.width = width; this.height = height; this.thickness = thickness; this.timeDimension = timeDimension; this.data = new Matrix3D[timeDimension]; for (int i = 0; i < timeDimension; i++) { data[i] = new Matrix3D(width, height, thickness); } }
public static Matrix3D Error(Matrix3D u, Matrix3D v, Matrix3D w, double dx, double dy, double dz) { Matrix3D result = new Matrix3D(u.Width, u.Height, u.Thickness); for (int i = 1; i < u.Width; i++) { for (int j = 1; j < u.Height; j++) { for (int k = 1; k < u.Thickness; k++) { result[i, j, k] = Math.Abs((u[i, j, k] - u[i - 1, j, k]) / dx + (v[i, j, k] - v[i, j - 1, k]) / dy + (w[i, j, k] - w[i, j, k - 1]) / dz); } } } return result; }
public LayerData(Matrix3D u, Matrix3D v, Matrix3D w, Matrix3D T, Matrix3D Div) { if (u.Width != v.Width || u.Width != w.Width || u.Width != T.Width || u.Width != Div.Width) throw new ArgumentException("Invalid Layer Data, Matrices must have the same size"); if (u.Height != v.Height || u.Height != w.Height || u.Height != T.Height || u.Height != Div.Height) throw new ArgumentException("Invalid Layer Data, Matrices must have the same size"); if (u.Thickness != v.Thickness || u.Thickness != w.Thickness || u.Thickness != T.Thickness || u.Thickness != Div.Thickness) throw new ArgumentException("Invalid Layer Data, Matrices must have the same size"); this.width = u.Width; this.height = u.Height; this.thickness = u.Thickness; this.u_var = u; this.v_var = v; this.w_var = w; this.T_var = T; this.Div_var = Div; }