Setting a piecewise variable CoefficientFunction

More
5 years 3 months ago - 5 years 3 months ago #1752 by P. Sh
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
Last edit: 5 years 3 months ago by P. Sh.
More
5 years 3 months ago #1753 by Guosheng Fu
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
More
5 years 3 months ago #1754 by P. Sh
Hi Guosheng,

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

Best,
Danial
Time to create page: 0.096 seconds