Symmetry-Preserving DirichletBCs

Asked by Peter Brune

I have gotten into a problem where it's important for the symmetry of my operator to be preserved during the application of boundary conditions. I was able to quickly write up an implementation of them that, when applied, made the following changes to A and b to create A_bc and b_bc (I still have to think about exactly what to do with the nonlinear x) where x_boundary is given as boundary conditions. the subscripts _boundary and _interior refer to the part of the vector or operator restricted to the boundary (both in rows and columns).

b_bc = (b - A(x_boundary + zero_interior))_interior + x_boundary
A_bc = A_interior + I_boundary

Is there any particular reason that DOLFIN does it just by setting certain rows to the identity? I'm trying to use solvers and preconditioners that only work on symmetric problems, so the present way of doing things won't work. I asked around about this with respect to matrix properties and apparently the way I described above (or variants) is the only way you can really prove anything about. This includes weak application.

My implementation works, but given that there is no reliable column access on the matrix classes it is potentially broken in parallel. Is there any reason why there are no facilities for column get/set in the matrix interface?

Question information

Language:
English Edit question
Status:
Answered
For:
DOLFIN Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Garth Wells (garth-wells) said :
#1

Look at SystemAssembler. It preserves any symmetries.

Garth

On 04/09/10 00:44, Peter Brune wrote:
> New question #124031 on DOLFIN:
> https://answers.launchpad.net/dolfin/+question/124031
>
> I have gotten into a problem where it's important for the symmetry of
> my operator to be preserved during the application of boundary
> conditions. I was able to quickly write up an implementation of them
> that, when applied, made the following changes to A and b to create
> A_bc and b_bc (I still have to think about exactly what to do with
> the nonlinear x) where x_boundary is given as boundary conditions.
> the subscripts _boundary and _interior refer to the part of the
> vector or operator restricted to the boundary (both in rows and
> columns).
>
> b_bc = (b - A(x_boundary + zero_interior))_interior + x_boundary A_bc
> = A_interior + I_boundary
>
> Is there any particular reason that DOLFIN does it just by setting
> certain rows to the identity? I'm trying to use solvers and
> preconditioners that only work on symmetric problems, so the present
> way of doing things won't work. I asked around about this with
> respect to matrix properties and apparently the way I described above
> (or variants) is the only way you can really prove anything about.
> This includes weak application.
>
> My implementation works, but given that there is no reliable column
> access on the matrix classes it is potentially broken in parallel.
> Is there any reason why there are no facilities for column get/set in
> the matrix interface?
>

Revision history for this message
Anders Logg (logg) said :
#2

On Fri, Sep 03, 2010 at 11:44:23PM -0000, Peter Brune wrote:
> New question #124031 on DOLFIN:
> https://answers.launchpad.net/dolfin/+question/124031
>
> I have gotten into a problem where it's important for the symmetry of my operator to be preserved during the application of boundary conditions. I was able to quickly write up an implementation of them that, when applied, made the following changes to A and b to create A_bc and b_bc (I still have to think about exactly what to do with the nonlinear x) where x_boundary is given as boundary conditions. the subscripts _boundary and _interior refer to the part of the vector or operator restricted to the boundary (both in rows and columns).
>
> b_bc = (b - A(x_boundary + zero_interior))_interior + x_boundary
> A_bc = A_interior + I_boundary
>
> Is there any particular reason that DOLFIN does it just by setting certain rows to the identity? I'm trying to use solvers and preconditioners that only work on symmetric problems, so the present way of doing things won't work. I asked around about this with respect to matrix properties and apparently the way I described above (or variants) is the only way you can really prove anything about. This includes weak application.

Have you tried the assemble_system function? It applies bcs
symmetrically.

> My implementation works, but given that there is no reliable column
> access on the matrix classes it is potentially broken in parallel. Is
> there any reason why there are no facilities for column get/set in the
> matrix interface?

Ask Matt. If he adds a MatSetValuesCol, I'll add a wrapper for it. ;-)

--
Anders

Revision history for this message
Peter Brune (prbrune) said :
#3

Cool. Thanks.

Why is this a special case (under VariationalProblem) rather than the normal
way of doing things? It should work for general operators and effectively
eliminates unnecessary unknowns from the system.

- Peter

On Fri, Sep 3, 2010 at 6:46 PM, Garth N. Wells <email address hidden> wrote:

> Look at SystemAssembler. It preserves any symmetries.
>
> Garth
>
>
> On 04/09/10 00:44, Peter Brune wrote:
>
>> New question #124031 on DOLFIN:
>> https://answers.launchpad.net/dolfin/+question/124031
>>
>> I have gotten into a problem where it's important for the symmetry of
>> my operator to be preserved during the application of boundary
>> conditions. I was able to quickly write up an implementation of them
>> that, when applied, made the following changes to A and b to create
>> A_bc and b_bc (I still have to think about exactly what to do with
>> the nonlinear x) where x_boundary is given as boundary conditions.
>> the subscripts _boundary and _interior refer to the part of the
>> vector or operator restricted to the boundary (both in rows and
>> columns).
>>
>> b_bc = (b - A(x_boundary + zero_interior))_interior + x_boundary A_bc
>> = A_interior + I_boundary
>>
>> Is there any particular reason that DOLFIN does it just by setting
>> certain rows to the identity? I'm trying to use solvers and
>> preconditioners that only work on symmetric problems, so the present
>> way of doing things won't work. I asked around about this with
>> respect to matrix properties and apparently the way I described above
>> (or variants) is the only way you can really prove anything about.
>> This includes weak application.
>>
>> My implementation works, but given that there is no reliable column
>> access on the matrix classes it is potentially broken in parallel.
>> Is there any reason why there are no facilities for column get/set in
>> the matrix interface?
>>
>>
> _______________________________________________
> Mailing list: https://launchpad.net/~dolfin<https://launchpad.net/%7Edolfin>
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~dolfin<https://launchpad.net/%7Edolfin>
> More help : https://help.launchpad.net/ListHelp
>

Revision history for this message
Garth Wells (garth-wells) said :
#4

On 04/09/10 01:00, Peter Brune wrote:
> Cool. Thanks.
>
> Why is this a special case (under VariationalProblem) rather than the
> normal way of doing things?

History, plus is hasn't been generalised to assemble just a matrix or
just a vector.

> It should work for general operators and
> effectively eliminates unnecessary unknowns from the system.
>

We don't eliminate the constrained dofs - eliminating them makes
handling the concept of a 'Function' difficult.

Garth

> - Peter
>
> On Fri, Sep 3, 2010 at 6:46 PM, Garth N. Wells <<email address hidden>
> <mailto:<email address hidden>>> wrote:
>
> Look at SystemAssembler. It preserves any symmetries.
>
> Garth
>
>
> On 04/09/10 00:44, Peter Brune wrote:
>
> New question #124031 on DOLFIN:
> https://answers.launchpad.net/dolfin/+question/124031
>
> I have gotten into a problem where it's important for the
> symmetry of
> my operator to be preserved during the application of boundary
> conditions. I was able to quickly write up an implementation of
> them
> that, when applied, made the following changes to A and b to create
> A_bc and b_bc (I still have to think about exactly what to do with
> the nonlinear x) where x_boundary is given as boundary conditions.
> the subscripts _boundary and _interior refer to the part of the
> vector or operator restricted to the boundary (both in rows and
> columns).
>
> b_bc = (b - A(x_boundary + zero_interior))_interior + x_boundary
> A_bc
> = A_interior + I_boundary
>
> Is there any particular reason that DOLFIN does it just by setting
> certain rows to the identity? I'm trying to use solvers and
> preconditioners that only work on symmetric problems, so the present
> way of doing things won't work. I asked around about this with
> respect to matrix properties and apparently the way I described
> above
> (or variants) is the only way you can really prove anything about.
> This includes weak application.
>
> My implementation works, but given that there is no reliable column
> access on the matrix classes it is potentially broken in parallel.
> Is there any reason why there are no facilities for column
> get/set in
> the matrix interface?
>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~dolfin
> <https://launchpad.net/%7Edolfin>
> Post to : <email address hidden>
> <mailto:<email address hidden>>
> Unsubscribe : https://launchpad.net/~dolfin
> <https://launchpad.net/%7Edolfin>
> More help : https://help.launchpad.net/ListHelp
>
>

Can you help with this problem?

Provide an answer of your own, or ask Peter Brune for more information if necessary.

To post a message you must log in.