public Heterogeneous_Grid_Medium(int Air_Choice, double[, ,] Pa, double[, ,] TC, double[, ,] hr, bool EdgeCorrection, VoxelGrid_PolyRefractive V) { VdimX = V.Xdim; VdimY = V.Ydim; VdimZ = V.Zdim; Hare.Geometry.Point min = V.MinPt; MinX = min.x; MinY = min.y; MinZ = min.z; Xdom = Pa.GetLength(0); Ydom = Pa.GetLength(1); Zdom = Pa.GetLength(2); XYTot = Xdom * Ydom; Atten_Coef = new double[Xdom * Ydom * Zdom][]; C_Sound = new double[Xdom * Ydom * Zdom]; rho = new double[Xdom * Ydom * Zdom]; Zmed = new double[Xdom * Ydom * Zdom]; Spectrum = new MathNet.Numerics.Interpolation.CubicSpline[Xdom * Ydom * Zdom]; for (int x = 0; x < Xdom; x++) { for (int y = 0; y < Ydom; y++) { for (int z = 0; z < Zdom; z++) { int code = XYTot * z + Ydom * x + y; Atten_Coef[code] = Calculate_Attenuation(Air_Choice, Pa[x, y, z], TC[x, y, z], hr[x, y, z], EdgeCorrection); rho[code] = Calculate_Density(TC[x, y, z], Pa[x, y, z], hr[x, y, z]);//TODO - check input C_Sound[code] = Utilities.AcousticalMath.SoundSpeed(TC[x, y, z] - 273.15); Zmed[code] = rho[code] * C_Sound[code]; //TODO: Is TC termperature in Celsius, or Kelvins? ISO9613_1_Spline(TC[x, y, z], Pa[x, y, z], hr[x, y, z], code); } } } }
public Heterogeneous_Grid_Medium(int Air_Choice, double[, ,] Pa, double[, ,] TC, double[, ,] hr, bool EdgeCorrection, VoxelGrid_PolyRefractive V) { VdimX = V.Xdim; VdimY = V.Ydim; VdimZ = V.Zdim; Hare.Geometry.Point min = V.MinPt; MinX = min.x; MinY = min.y; MinZ = min.z; Xdom = Pa.GetLength(0); Ydom = Pa.GetLength(1); Zdom = Pa.GetLength(2); XYTot = Xdom * Ydom; Atten_Coef = new double[Xdom * Ydom * Zdom][]; C_Sound = new double[Xdom * Ydom * Zdom]; rho = new double[Xdom * Ydom * Zdom]; Zmed = new double[Xdom * Ydom * Zdom]; Spectrum = new MathNet.Numerics.Interpolation.CubicSpline[Xdom * Ydom * Zdom]; for (int x = 0; x < Xdom; x++) { for (int y = 0; y < Ydom; y++) { for(int z = 0; z < Zdom; z++) { int code = XYTot * z + Ydom * x + y; Atten_Coef[code] = Calculate_Attenuation(Air_Choice, Pa[x,y,z], TC[x,y,z], hr[x,y,z], EdgeCorrection); rho[code] = Calculate_Density(TC[x,y,z], Pa[x,y,z], hr[x,y,z]);//TODO - check input C_Sound[code] = Utilities.AcousticalMath.SoundSpeed(TC[x,y,z] - 273.15); Zmed[code] = rho[code] * C_Sound[code]; //TODO: Is TC termperature in Celsius, or Kelvins? ISO9613_1_Spline(TC[x,y,z], Pa[x,y,z], hr[x,y,z], code); } } } }