Finite Element Discretization

MeGraPDE.finite_element_solverFunction
finite_element_solver(TP::EllipticTestProblem, J::Int; solver = "backslash")

Solve elliptic test problem 'TP' using a finite element discretiation with maximum step size 2^(-'J').

The backslach operator is used as a default solver for the semidiscretized system. Set solver = "multigrid" to apply multigrid solver.

finite_element_solver(TP::TPGeneralizedHeat, T::Number, J::Int; solver = "multigrid")

Solve generalized heat equation test problem 'TP' at time 'T' using a finite element discretiation with maximum step size 2^(-'J') followed by CN-MGM.

MeGraPDE.fe_discretizationFunction
fe_discretization(TP::EllipticTestProblem, J::Int; mass_aprox = false)

Compute finite element discretization of elliptic test problem 'TP' with step size 'J'.

fe_discretization(TP::TPGeneralizedHeat, J::Int; mass_aprox = false)

Compute finite element discretization of generalized heat equation 'TP' with step size 2^(-'J').

MeGraPDE.fe_matricesFunction
fe_matrices(Γ::MetricGraph, h_max::Number; mass_approx = false)

Assemble finite element mass and stiffness matrix.

Set mass_approx = true to use mass matrix approximation via Trapezoidal rule.

fe_matrices(Γ::EquilateralMetricGraph, h_max::Number; mass_approx = false)

When called for equilateral graphs, apply uniform discretization on each edge.

MeGraPDE.fe_rhsFunction
fe_rhs(Γ::MetricGraph, rhs::Vector{Function}, h_max::Number)

Return discretized right-hand side rhs with maximum step size h_max on each edge.

fe_rhs(Γ::EquilateralMetricGraph, rhs::Vector{Function}, h_max::Number)

Simplified version for equilateral graphs.

MeGraPDE.fe_errorFunction
fe_error(Γ::MetricGraph, u_fe::Vector, u::Vector{Function}, u_deriv::Vector{Function}, Nx_vec::Vector)

Compute L2 and H^1 error of the finite element solution with coefficients ufe with respect to exact solution u with derivative u_deriv.

fe_error(Γ::EquilateralMetricGraph, u_fe::Vector, u::Vector{Function}, u_deriv::Vector{Function})

Equilateral version.

fe_error(TP::EllipticTestProblem, u_fe::Vector)

Compute L2 and H^1 error of the finite element solution with coefficients 'ufe' with respect to exact solution 'TP.u' with derivative 'TP.u_deriv'.