Treatment of Dirichlet conditions in ElmerSolver revisited

Numerical methods and mathematical models of Elmer
Post Reply
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Treatment of Dirichlet conditions in ElmerSolver revisited

Post by raback »

Hi All,

The treatment of Dirichlet conditions was today updated at "devel" branch. The following mainly involves those writing their own modules.

In short, before the conditions were usually set directly to the matrix structures when the conditions where found. Now all the conditions are stored to A % Dvalues and a flag is raised at A % ConstraintDOF (here A is the stiffness matrix). Only at the end the matrix structure itself is manipulated.

The initial motivation for the change was the new treatment of orphan nodes in parallel introduced some time ago. There has been a risk that such orphans could be inconsistently treated in unfortunately partitionings. The new way requires the two vectors but has also several advantages:

1) The conditions are always communicated in parallel
2) Setting up symmetric conditions is much more efficient
3) Scaling need not to be considered while finding the conditions. Only when manipulating the matrix do we need to know about the scaling.
4) The code is simplified in many places and will be easier to further develop.
5) When direct manipulation of CRS matrices is eliminated the way the conditions are treated may be changed more easily in the future.

All the tests pass now but of course user codes may have problems. So what should you do?

a) If you have been calling "DefaultDirichletBCs" then everything should be as before. This is the recommended method.

b) If you have used direct calling of "ZeroRow" etc. in your code it will probably still work but you have risk of inconsistent treatment of shared
(orphan) nodes in parallel. You should rather change the "ZeroRow" calls to "CALL UpdateDirichletDof( A, ind, val )".

c) If you use lower level commands instead of DefaultDirichletBCs() in your code you may need to add "CALL EnforceDirichletConditions(Solver, A, b)" which does to setting of the conditions in the end.

If you face any problems please let us know.

-Peter
Post Reply