public void Connect_Grid(Acoustic_Compact_FDTD.Node[][][] Frame, AABB Bounds, double dx, double _tmax, double dt, int no_of_Layers) { no_of_samples = (int)Math.Ceiling(_tmax/1000 / dt); tmax = _tmax; for (int i = 0; i < Loc.Length; i++) { recording[i] = new double[no_of_samples]; int X = (int)Math.Floor((Loc[i].X - Bounds.Min_PT.x) * Utilities.Numerics.rt2 / (2 * dx)) + no_of_Layers; int Y = (int)Math.Floor((Loc[i].Y - Bounds.Min_PT.y) / (2 * dx)) + no_of_Layers; int Z = (int)Math.Floor((Loc[i].Z - Bounds.Min_PT.z) / (2 * dx)) + no_of_Layers; RecNode[i] = Frame[X][Y][Z]; } }
public void Connect_Grid(Acoustic_Compact_FDTD.Node[][][] Frame, AABB Bounds, double dx, double dy, double dz, double _tmax, double _dt, int no_of_Layers) { tmax = _tmax / 1000; dt = _dt; SrcNode = new Acoustic_Compact_FDTD.Node[Loc.Length]; for (int i = 0; i < Loc.Length; i++) { int X = (int)Math.Floor((Loc[i].X - Bounds.Min_PT.x) / (2 * dx / Math.Sqrt(2))) + (int)(no_of_Layers) - 1; int Y = (int)Math.Floor((Loc[i].Y - Bounds.Min_PT.y) / (2 * dy)) + no_of_Layers / 2; int Z = (int)Math.Floor((Loc[i].Z - Bounds.Min_PT.z) / (2 * dz)) + no_of_Layers / 2; SrcNode[i] = Frame[X][Y][Z]; } Generate_Signal(); }