// laplace.edp // // Discussion: // // Solve the Poisson equation on the unit disk. // // Robin boundary conditions are applied. // // Location: // // http://people.sc.fsu.edu/~jburkardt/freefem_src/laplace/laplace.edp // // Licensing: // // This code is distributed under the MIT license. // // Modified: // // 19 August 2015 // // Author: // // Florian De Vuyst // // 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:\n"; cout << " FreeFem++ version:\n"; cout << " Solve the Laplace equation in the unit disk.\n"; real epsilon = 1.0E-02; // // Define the region. // border domega ( t = 0.0, 2.0 * pi ) { x = cos(t); y = sin(t); } mesh Th = buildmesh ( domega ( 100 ) ); plot ( Th, wait = true, ps = "laplace_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 ( uh, nbiso = 50, fill = false, value = 1.0, wait = true, ps = "laplace_uh.ps" ); // // Terminate. // cout << "\n"; cout << "laplace:\n"; cout << " Normal end of execution.\n"; exit ( 0 );