static void Main(string[] args) { int N = 100; Array3D <double> array3D = new Array3D <double>(N, N, N); for (int i = 0; i < N; i++) { for (int j = 0; j < N; j++) { for (int k = 0; k < N; k++) { array3D[i, j, k] = 666; } } } string str = "Hello World"; InputForTemp3D input = new InputForTemp3D(); input.InputMessage = str; input.C = 3; input.Tau = 0.001; input.H = 0.1; input.TimeSteps = 100; input.U = array3D; ServiceClient client = new ServiceClient(); OutputForTemp3D output = client.CalculateTemp3D(input); Console.WriteLine(output.OutputMessage); Console.ReadKey(); }
private void Calculate() { InputForTemp3D inputForTemp3D = new InputForTemp3D(); inputForTemp3D.C = a; inputForTemp3D.Tau = tau; inputForTemp3D.H = H; inputForTemp3D.U = U; inputForTemp3D.TimeSteps = frequency; ServiceClient client = new ServiceClient(); OutputForTemp3D output = client.CalculateTemp3D(inputForTemp3D); U = output.U; }
OutputForTemp3D IService.CalculateTemp3D(InputForTemp3D input) { OutputForTemp3D result = new OutputForTemp3D(); result.U = new Array3D <double>(input.U.XLength, input.U.YLength, input.U.ZLength); try { Array3D <double> u = input.U; u = NewMathLib.HeatFlow.CalcNewT3D(u, input.C, input.H, input.Tau, input.TimeSteps); result.U = u; result.OutputMessage = "Calculations are correct"; } catch (Exception e) { result.OutputMessage = e.Message.ToString(); } return(result); }