Setting a piecewise variable CoefficientFunction

Hi,
I have a question about setting a piecewise variable CoefficientFunction. I know that it is possible for piecewise constant coefficients as follows:

" domain_values = {‘inner’: 3.7, ‘outer’: 1}
values_list = [domain_values[mat]
for mat in mesh.GetMaterials()]
cf = CoefficientFunction(values_list)
Draw(cf, mesh, ‘piecewise’) "

But I don’t know that this way works for piecewise variable coefficients. Is it possible?
I was wondering if someone would possibly share his/her knowledge with me in this regard. Thanks.

Best,
Danial

Hi Danial,

I think you can simply change the first line as
domain_values = {‘inner’: fun1, ‘outer’: fun2}
where fun1 and fun2 are two coefficient functions.

Best,
Guosheng

Hi Guosheng,

Thank you very much for your quick reply and your helpful answer.

Best,
Danial