Skip to content

Commit

Permalink
Added solve(op::LinearFEOperator) with default solver
Browse files Browse the repository at this point in the history
  • Loading branch information
fverdugo committed Aug 29, 2019
1 parent b1bf517 commit 5c1caa8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
6 changes: 6 additions & 0 deletions src/FESpaces/FEOperators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,12 @@ function solve!(uh::FEFunctionLike,s::LinearFESolver,o::LinearFEOperator,ns::Num
solve!(x,ns,A,b)
end

function solve(op::LinearFEOperator)
ls = LUSolver()
solver = LinearFESolver(ls)
solve(solver,op)
end

"""
Struct representing a nonlinear FE Operator
"""
Expand Down
11 changes: 2 additions & 9 deletions test/FESpacesTests/VectorValuedFEOperatorsTests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -112,18 +112,11 @@ a_elast(v,u) = inner( ε(v), σ(ε(u)) )
b(v) = inner(v,bfield)
t_Ω = AffineFETerm(a_elast,b,trian,quad)

# Define Assembler
assem = SparseMatrixAssembler(V,U)

# Define the FEOperator
op = LinearFEOperator(V,U,assem,t_Ω)

# Define the FESolver
ls = LUSolver()
solver = LinearFESolver(ls)
op = LinearFEOperator(V,U,t_Ω)

# Solve!
uh = solve(solver,op)
uh = solve(op)

# Define exact solution and error
u = CellField(trian,ufun)
Expand Down

0 comments on commit 5c1caa8

Please sign in to comment.