There is a program written in the pros. Solves the heat equation using the finite element method. And displays the result in gnuplot - as a picture. Tn is random. In the code below, the function responsible for the derivation of boundary conditions is given.

double BoundaryFunc(double x, double y){ double T1 = 1.5; double T2 = 0.5; double T3 = 2.5; double T4 = 1.0; if(x == 1) return T1 * cos(x*y); if(x == -1) return T2 * cos(x*y); if(y == 1) return T3 * cos(x+y); if(y == -1) return T4 * cos(xy);} 

It is necessary to change the function so that the output is influenced by the unit vector of the external normal to the surface. If you need I can throw off all the code.

  • "single vector of external normal to the surface" - to the surface of what? - Igor
  • The body (or part thereof). - Ivan Baybuz
  • Fine! Where in your function is the surface of the "body"? Do you have a three-dimensional task? - Igor
  • This is the case; points are calculated on the basis of boundary conditions. This is all stored in the matrix. The matrix is ​​output to a file, and gnuplot works with it and displays the result in the following form: dropbox.com/s/d5z9zd4az17tqqw/fem_new.png?dl=0 - Ivan Baybuz
  • Something Your picture does not correspond to the code - Igor

0