#### /work_files/curs/curs/connection.cpp

C++ | 65 lines | 26 code | 9 blank | 30 comment | 0 complexity | b54140a2aa94376140cf4be4fac01ccc MD5 | raw file
``` 1#include <fstream>
2#include <iomanip>
3#include <math.h>
4#include <iostream>
5#include "parabolic_solver.h"
6#include "algorithm.h"
7
8
9const double PI = atan(1.0) * 4.0;
10const double a = 1.0;
11const double b = 0.0;
12const double c = 0.0;
13
14double phi1(double x, double t)
15{
16	  return exp(-1*a*t);
17	//return sin(t);
18	//return (  -exp(-a * a * t) * (cos(b * t) + sin (b*t))  );
19	//return (  exp((c - a*a)*t) * (cos (b * t) + sin (b * t))  );
20}
21
22double phi2(double x, double t)
23{
24	    return -1*exp(-1*a*t);
25	//return -sin(t);
26	//return (  exp(-a * a * t) * (cos(b * t) + sin (b*t))  );
27	//return (  -exp((c - a*a)*t) * (cos (b * t) + sin (b * t))  );
28}
29
30double psi(double x, double t)
31{
32	    return  sin(x);
33	//return 0.0;
34	//return cos (x);
35	//return sin (x);
36}
37
38double f(double x, double t)
39{
40	//return cos (x) * (cos (t)  + sin(t));
41	return 0.0;
42}
43
44
45
46/*
47void main()
48{
49	CParabolicSolver direct_solve;
50	ReverseSolve reverse_solve;
51
52/ *
53	direct_solve.setGrid(10, 10, 0.0, PI, 0.3);
54	direct_solve.setTask(a, b, c, f, 1.0, 0.0, 1.0, 0.0, phi1, phi2, psi);
55	direct_solve.solve_implicit();
56	direct_solve.CheckSolve();* /
57
58
59	int num = direct_solve.GetK();
60	reverse_solve.SetTask(a, b, c, 1.0, 0.0, 1.0, 0.0, PI, 0.003, 0.0, 2, 10);
61	//reverse_solve.SetLayer(direct_solve.GetLayer(num));
62	reverse_solve.GetSolve();
63	reverse_solve.CheckSolve("rev_sol.txt");
64	//reverse_solve.CheckResult(direct_solve.GetTable(),"test.txt");
65}*/
```