Skip to content

PDEAssembles takes a set of partial differential equations and boundary conditions and creates a global assembly M, C, K, f in SparseMatrixCSC format ready for linear system solvers.

License

Notifications You must be signed in to change notification settings

ahojukka5/PDEAssembler.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PDEAssembler.jl

Package assembles a set of discriteized partial differential equations and forms global matrices M, C, K, and right hand side vector f.

using PDEAssembler
using PDEAssembler: get_unit_square, Poisson

field_elements, boundary_elements = get_unit_square()

field_problem = Problem(Poisson, "Poisson problem in 1x1 square", 1)
update!(field_elements, "source", 10.0)
update!(field_elements, "density", 6.0)
add_elements!(field_problem, field_elements)

boundary_problem = Problem(Poisson, "Poisson boundary", 1)
update!(boundary_elements, "fixed u", 0.0)
update!(boundary_elements, "density", 0.0)
add_elements!(boundary_problem, boundary_elements)

problems = (field_problem, boundary_problem)
M, C, K, f = get_global_matrices(problems, 0.0)
u = cholfact(Symmetric(K)) \ full(f)
X = first(problems)("geometry", 0.0)

N = length(u)
x = [X[i][1] for i=1:N]
y = [X[i][2] for i=1:N]

using Plots
surface(x, y, u)

result

About

PDEAssembles takes a set of partial differential equations and boundary conditions and creates a global assembly M, C, K, f in SparseMatrixCSC format ready for linear system solvers.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages