// laplace_circle.edp // // Discussion: // // Solve the Poisson equation on the unit disk. // // Robin boundary conditions are applied. // // Licensing: // // This code is distributed under the MIT license. // // Modified: // // 01 October 2024 // // Author: // // Original FreeFem++ version by Florian De Vuyst. // This version by John Burkardt. // // Reference: // // Numerical modeling of transport problems using freefem++ software - // with examples in biology, CFD, traffic flow and energy transfer, // HAL id: cel-00842234 // https://cel.archives-ouvertes.fr/cel-00842234 // cout << "\n"; cout << "laplace_circle():\n"; cout << " FreeFem++ version:\n"; cout << " Solve the Laplace equation inside the unit circle.\n"; real epsilon = 1.0E-02; // // Define the region. // border domega ( t = 0.0, 2.0 * pi ) { x = cos(t); y = sin(t); } // // Mesh the region. // mesh Th = buildmesh ( domega ( 100 ) ); // // Plot the mesh. // plot ( Th, wait = true, ps = "laplace_circle_mesh.ps" ); // // Define the finite element space. // fespace Vh ( Th, P1 ); Vh uh; Vh vh; func f = 1.0; real cpu1 = clock ( ); solve poisson ( uh, vh, solver = LU ) = int2d ( Th ) ( dx ( uh ) * dx ( vh ) + dy ( uh ) * dy ( vh ) ) + int1d ( Th, domega ) ( epsilon * uh * vh ) - int2d ( Th ) ( f * vh ); real cpu2 = clock ( ); cout << " CPU seconds = " << cpu2 - cpu1 << "\n"; // // Plot the solution. // plot ( uh, nbiso = 50, fill = false, value = 1.0, wait = true, ps = "laplace_circle_uh.ps" ); // // Terminate. // cout << "\n"; cout << "laplace_circle():\n"; cout << " Normal end of execution.\n"; exit ( 0 );