-- FreeFem++ v4.6 (Thu Apr 2 15:47:38 CEST 2020 - git v4.6) Load: lg_fem lg_mesh lg_mesh3 eigenvalue 1 : // heat.edp 2 : // 3 : // Discussion: 4 : // 5 : // Time dependent heat equation with inhomogeneous Dirichlet 6 : // and Neumann flux boundary conditions. 7 : // 8 : // Location: 9 : // 10 : // http://people.sc.fsu.edu/~jburkardt/freefem_src/heat/heat.edp 11 : // 12 : // Modified: 13 : // 14 : // 14 June 2015 15 : // 16 : // Author: 17 : // 18 : // Florian De Vuyst 19 : // 20 : // Reference: 21 : // 22 : // Florian De Vuyst, 23 : // Numerical modeling of transport problems using freefem++ software - 24 : // with examples in biology, CFD, traffic flow and energy transfer, 25 : // HAL id: cel-00842234 26 : // https://cel.archives-ouvertes.fr/cel-00842234 27 : // 28 : // Parameters: 29 : // 30 : // real KAPPA, the thermal conductivity. 31 : // 32 : // real THETA, the initial and boundary temperature. 33 : // 34 : real theta = 20.0; 35 : real kappa = 0.1; 36 : real dt = 0.5; 37 : // 38 : // Boundary. 39 : // 40 : border Gamma1 ( t = 0.0, 2.0 * pi ) { x = cos ( t ); y = sin ( t ); } 41 : border Gamma2 ( t = 0.0, 1.0 ) { x = -0.5 + t; y = - 0.3; } 42 : // 43 : // Define the mesh. 44 : // 45 : mesh Th = buildmesh ( Gamma1 ( 100 ) + Gamma2 ( 60 ) ); 46 : plot ( Th, wait = 1, ps = "heat_mesh.ps" ); 47 : // 48 : // Define the finite element space. 49 : // 50 : fespace Vh ( Th, P1 ); 51 : Vh uh; 52 : Vh uold; 53 : Vh vh; 54 : // 55 : // The solution is taken to be constant at the initial time, 56 : // and at the "previous" timestep. 57 : // 58 : uh = theta; 59 : uold = theta; 60 : // 61 : // Define the weak form of the heat equation. 62 : // 63 : problem heatstep ( uh, vh, solver = LU ) = 64 : int2d ( Th ) ( uh * vh / dt ) 65 : - int2d ( Th ) ( uold * vh / dt ) 66 : + int2d ( Th ) ( kappa * dx ( uh ) * dx ( vh ) 67 : + kappa * dy ( uh ) * dy ( vh ) ) 68 : + int1d ( Th, Gamma1 ) ( kappa * vh ) 69 : + on ( Gamma2, uh = theta ); 70 : // 71 : // Perform 6 timesteps. 72 : // 73 : for ( int it = 1; it <= 6; it++ ) 74 : { 75 : heatstep; 76 : plot ( uh, nbiso = 50, fill = 1, value = 1, wait = 1, 77 : ps = "heat_uh_" + it + ".ps" ); 78 : uold = uh; 79 : } 80 : // 81 : // Terminate. 82 : // 83 : cout << "\n"; 84 : cout << "HEAT:\n"; 85 : cout << " Normal end of execution.\n"; 86 : 87 : sizestack + 1024 =2704 ( 1680 ) -- mesh: Nb of Triangles = 5236, Nb of Vertices 2669 SkyLineMatrix: size pL/pU: 2669 173034 173034 moy=64.831 -- Solve : min 19.7447 max 20 SkyLineMatrix: size pL/pU: 2669 173034 173034 moy=64.831 -- Solve : min 19.5993 max 20 SkyLineMatrix: size pL/pU: 2669 173034 173034 moy=64.831 -- Solve : min 19.4794 max 20 SkyLineMatrix: size pL/pU: 2669 173034 173034 moy=64.831 -- Solve : min 19.3721 max 20 SkyLineMatrix: size pL/pU: 2669 173034 173034 moy=64.831 -- Solve : min 19.2731 max 20 SkyLineMatrix: size pL/pU: 2669 173034 173034 moy=64.831 -- Solve : min 19.1807 max 20 HEAT: Normal end of execution. times: compile 0.004655s, execution 0.432698s, mpirank:0 CodeAlloc : nb ptr 3617, size :478808 mpirank: 0 Ok: Normal End