KiranRamesh-Aero / UnsteadyFlowSolvers.jl

Solvers for problems involving unsteady fluid flow
MIT License
22 stars 22 forks source link

No method matching error in various notebooks #14

Closed sla23 closed 7 years ago

sla23 commented 7 years ago

There is a "no method matching" error in various notebooks.

The issue is in file UNSflow\src\solvers.jl and is probably caused by a type incompatibility while calling not_in_place (exported from NLsolve) which expects a Function type where immutable data types are passed instead.

A few examples are given below.

1) This error occurs in notebooks UNSflow/examples/LAUTAT_example1.ipynb and UNSflow/Notebooks/3D extensions - notes.ipynb

MethodError: no method matching not_in_place(::UNSflow.KelvinCondition) Closest candidates are: not_in_place(::Function) at INCOGNITO.julia\v0.5\NLsolve\src\differentiable_functions.jl:61 not_in_place(::Function, ::Function) at INCOGNITO.julia\v0.5\NLsolve\src\differentiable_functions.jl:68 not_in_place(::Function, ::Function, ::Function) at INCOGNITO.julia\v0.5\NLsolve\src\differentiable_functions.jl:78

in lautat(::UNSflow.TwoDSurf, ::UNSflow.TwoDFlowField, ::Int64, ::Float64, ::UNSflow.DelVortDef, ::Array{Float64,2}, ::Float64) at INCOGNITO\UNSflow\src\solvers.jl:30 in lautat(::UNSflow.TwoDSurf, ::UNSflow.TwoDFlowField, ::Int64) at INCOGNITO\UNSflow\src\solvers.jl:3

2) The same error also occurs in notebook UNSflow/Notebooks/Typical section test (Tiago).ipynb

MethodError: no method matching not_in_place(::UNSflow.KelvinCondition2DOF) Closest candidates are: not_in_place(::Function) at INCOGNITO.julia\v0.5\NLsolve\src\differentiable_functions.jl:61 not_in_place(::Function, ::Function) at INCOGNITO.julia\v0.5\NLsolve\src\differentiable_functions.jl:68 not_in_place(::Function, ::Function, ::Function) at INCOGNITO.julia\v0.5\NLsolve\src\differentiable_functions.jl:78

in ldvm(::UNSflow.TwoDSurf_2DOF, ::UNSflow.TwoDFlowField, ::Int64, ::Float64, ::UNSflow.DelVortDef, ::Array{Float64,2}, ::Float64) at INCOGNITO\UNSflow\src\solvers.jl:1019 in ldvm(::UNSflow.TwoDSurf_2DOF, ::UNSflow.TwoDFlowField, ::Int64, ::Float64, ::UNSflow.DelVortDef) at INCOGNITO\UNSflow\src\solvers.jl:988

KiranRamesh-Aero commented 7 years ago

Hi,

Here's the fix:

These instructions are good for osx/linux. For a windows computer, just go to the correct location where Julia packages are installed:

cd /home/username/.julia/v0.5/NLsolve/src/

Open differentiable_functions.jl

Find the not_in_place function and change the definition from

function not_in_place(f::Function)

to

function not_in_place(f)

Essentially, the not_in_place defined in NLsolve accepts only functions, but has to be changed to accept any general argument. There is possibly a better workaround.

Let me know if you encounter further issues.