-- FreeFem++ v4.14 (mer. 06 mars 2024 16:59:04 CET - git v4.14-1-g2b2052ae) file : heat.edp 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 : // Licensing: 9 : // 10 : // This code is distributed under the MIT license. 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 : cout << "\n"; 39 : cout << "heat():\n"; 40 : cout << " FreeFem++ version.\n"; 41 : cout << " Solve the time dependent heat equation with inh ... : omogeneous\n"; 42 : cout << " Dirichlet and Neumann flux boundary conditions. ... : \n"; 43 : // 44 : // Boundary. 45 : // 46 : border Gamma1 ( t = 0.0, 2.0 * pi ) { x = cos ( t ); y = sin ( t ); } 47 : border Gamma2 ( t = 0.0, 1.0 ) { x = -0.5 + t; y = - 0.3; } 48 : // 49 : // Define the mesh. 50 : // 51 : mesh Th = buildmesh ( Gamma1 ( 100 ) + Gamma2 ( 60 ) ); 52 : plot ( Th, wait = true, ps = "heat_mesh.ps" ); 53 : // 54 : // Define the finite element space. 55 : // 56 : fespace Vh ( Th, P1 ); 57 : Vh uh; 58 : Vh uold; 59 : Vh vh; 60 : // 61 : // The solution is taken to be constant at the initial time, 62 : // and at the "previous" timestep. 63 : // 64 : uh = theta; 65 : uold = theta; 66 : // 67 : // Define the weak form of the heat equation. 68 : // 69 : problem heatstep ( uh, vh, solver = LU ) = 70 : int2d ( Th ) ( uh * vh / dt ) 71 : - int2d ( Th ) ( uold * vh / dt ) 72 : + int2d ( Th ) ( kappa * dx ( uh ) * dx ( vh ) 73 : + kappa * dy ( uh ) * dy ( vh ) ) 74 : + int1d ( Th, Gamma1 ) ( kappa * vh ) 75 : + on ( Gamma2, uh = theta ); 76 : // 77 : // Perform 6 timesteps. 78 : // 79 : for ( int it = 1; it <= 6; it++ ) 80 : { 81 : heatstep; 82 : plot ( uh, nbiso = 50, fill = true, value = true, wait = true, 83 : ps = "heat_uh_" + it + ".ps" ); 84 : uold = uh; 85 : } 86 : // 87 : // Terminate. 88 : // 89 : cout << "\n"; 90 : cout << "heat():\n"; 91 : cout << " Normal end of execution.\n"; 92 : 93 : exit ( 0 ); 94 : 95 : sizestack + 1024 =2704 ( 1680 ) heat(): FreeFem++ version. Solve the time dependent heat equation with inhomogeneous Dirichlet and Neumann flux boundary conditions. -- 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. current line = 93 exit(0) err code 0 , mpirank 0 CodeAlloc : nb ptr 3996, size :527112 mpirank: 0 Ok: Normal End