How to specify exterior_facet_domains to NonlinearVariationalsolver in C++

Asked by Pietro Maximoff on 2013-02-22

Hi

In Python, you can write:
A = assemble( a, exterior_facet_domains=boundary_parts).

How can I do this in C++ for a NonlinearVariationalSolver in C++. Currently, I tried:
mysolver.solve( exterior_facet_domains=sub_domains );

where mysolver is a NonlinearVariationalsolver.

The error is: ‘exterior_facet_domains’ was not declared in this scope.

So, how do I define it?

Pietro

Question information

Language:
English Edit question
Status:
Solved
For:
DOLFIN Edit question
Assignee:
No assignee Edit question
Solved by:
Jan Blechta
Solved:
2013-02-25
Last query:
2013-02-25
Last reply:
2013-02-24
Best Jan Blechta (blechta) said : #1

There are few ways of specifying subdomains. Check http://fenicsproject.org/documentation/dolfin/1.1.0/cpp/programmers-reference/fem/Assembler.html. So you can attach subdomains to your forms or a mesh (method 2,3). You can also overload piece of code that calls assembler and specify subdomains there (method 1).

In Cahn-Hilliard demo there's shown how you overload NonlinearProblem::F,J methods - you could just supply subdomains to assembler there.

I'm not sure if it is possible for NonlineavariationalProblem but you would probably need to overload NonlinearVariationalSolver::
NonlinearDiscreteProblem::F,J methods. But you would need to check the source-code how to do this. So I would avoid this approach.

Jan

Pietro Maximoff (segment-x) said : #2

Thanks Jan Blechta, that solved my question.