The safe_unwrap function leaves complex defined variables wraped. This can lead to breakages if the terms are assumed to be unwraped. (e.g. the use of operation in the chain_flatten_array_variables function). Below is a simple test.
using Symbolics
using PDEBase
@variables r c::Complex
println(typeof(r))
println(typeof(PDEBase.safe_unwrap(r)))
println()
println(typeof(c))
println(typeof(PDEBase.safe_unwrap(c)))
The output I get is
Num
SymbolicUtils.BasicSymbolic{Real}
Complex{Num}
Complex{Num}
The unwrap function in Symbolics returns a ComplexTerm.
The safe_unwrap function leaves complex defined variables wraped. This can lead to breakages if the terms are assumed to be unwraped. (e.g. the use of
operationin thechain_flatten_array_variablesfunction). Below is a simple test.The output I get is
The
unwrapfunction inSymbolicsreturns aComplexTerm.