dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #18859
[Question #120032]: passing BC to NonlinearProblem
New question #120032 on DOLFIN:
https://answers.launchpad.net/dolfin/+question/120032
We have a multifield problem setup using assemble(...) and solve(....), which we are planning to rephrase as a NonlinearProblem class object as follows:
class MechTransportEquation(NonlinearProblem):
def __init__(self, a, L, bcs, boundary_subdomains):
NonlinearProblem.__init__(self)
self.L = L
self.a = a
self.reset_sparsity = False
self.bcs = bcs
self.boundary_subdomains = boundary_subdomains
self.ffc_opt = {"quadrature_degree": 2, "optimize": True, "eliminate_zeros": True, "precompute_ip_const": True}
def F(self, b, x):
assemble(self.L, tensor=b)
def J(self, A, x):
assemble(self.a, tensor=A, reset_sparsity=self.reset_sparsity)
Usually I setup the essential BC as a DirichletBC object. (say bc1 = DirichletBC(U.sub(4), dirl, bott) ). So the best way would be passing bc1 as an argument during MechTransportEquation initialization. Now, my questions are:
1) Does NonlinearProblem class accept objects of DirichletBC directly, or should we pass the BC values and respective BC domains seperately.
2) What do the bcs, boundary_subdomains members of the NonlinearProblem class mean. Are they the BC values and respective BC domains?. If so how can I specify the subspace on which this BC is being applied (i.e, like the first argument to DirichletBC).
--Shiva
--
You received this question notification because you are a member of
DOLFIN Team, which is an answer contact for DOLFIN.
Follow ups