- Thank you received: 0
Setting a piecewise variable CoefficientFunction
5 years 3 months ago - 5 years 3 months ago #1752
by P. Sh
Setting a piecewise variable CoefficientFunction was created 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
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.
- Guosheng Fu
- Offline
- Elite Member
Less
More
- Thank you received: 6
5 years 3 months ago #1753
by Guosheng Fu
Replied by Guosheng Fu on topic Setting a piecewise variable CoefficientFunction
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
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
Time to create page: 0.096 seconds