VEM Method Module
The vem_method
module implements the Virtual Element Method (VEM).
Available Functions
Main.vem_method.vem
— Functionvem(mesh::Mesh, rhs::Function, boundary_condition::Function; debug::Bool=false, debug_file_path::String="vem_debug_output.md")::Vector{Float64}
Solve a boundary value problem using the Virtual Element Method (VEM) on a given mesh.
Arguments
mesh::Mesh
: A mesh structure containing vertices, elements and boundaries (polygons).rhs::Function
: The right-hand side function of the boundary value problem.boundary_condition::Function
: The function specifying boundary conditions.
Keyword Arguments
debug::Bool
: Iftrue
, generates a detailed debug output in the specified file. Default isfalse
.debug_file_path::String
: The path to the debug output file. Default is"vem_debug_output.md"
.
Returns
u::Vector{Float64}
: A vector containing the solution (degrees of freedom) at each vertex.
Behavior
- Constructs the global stiffness matrix
K
and forcing vectorF
by looping over the mesh elements. - Applies the boundary conditions and solves the system
K * u = F
to compute the solutionu
. - If debugging is enabled, it writes detailed information about the computation process to the specified file.
Example
```julia u = vem(mesh, rhsfunction, boundarycondition_function; debug=true)