dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #17730
Re: [Question #102501]: Best way to specify coefficient fields
Question #102501 on DOLFIN changed:
https://answers.launchpad.net/dolfin/+question/102501
Status: Open => Answered
Harish Narayanan proposed the following answer:
Will this work for you? e.g, for inverse of the permeability
k = "1.0/(exp(-(((x[1] - 0.5 - 0.1*sin(10*x[0]))/0.1)*((x[1] - 0.5 - 0.1*sin(10*x[0]))/0.1))) + 1.0)"
kinv11 = Expression(k)
kinv12 = Constant(0.0)
kinv21 = Constant(0.0)
kinv22 = Expression(k)
Kinv = as_matrix(((kinv11, kinv12), (kinv21, kinv22)))
Of course, this needn't be isotropic.
And later on, when defining your weak form, you'll have a term like the
following:
a = inner(v, Kinv*u)*dx
--
You received this question notification because you are a member of
DOLFIN Team, which is an answer contact for DOLFIN.