trilinos / Trilinos

Primary repository for the Trilinos Project
https://trilinos.org/
Other
1.22k stars 570 forks source link

Cleanup Belos::LinearProblem #845

Closed tawiesn closed 7 years ago

tawiesn commented 8 years ago

@trilinos/belos Belos::LinearProblem has member variables LeftScale (boolean) and RightScale (boolean) which are by default false and have no meaning. The setLeftScale and setRightScale routines mentioned in the doxygen documentation seem not to exist. I'd like to left/right scale the linear system given a vector containing scaling values.

mhoemmen commented 8 years ago

Summary of phone discussion:

  1. Implementing this feature at the Belos level would call for adding new methods to OperatorTraits; this would break downstream code
  2. @tawiesn needs this for Thyra types; figuring out how to scale Thyra operators is hard (e.g., how do you get the diagonal entries?)
  3. Users can construct their own Operators that implement scaling
  4. Perhaps the best thing to do would be to remove these bools from Belos::LinearProblem and stop advertising the feature that does not exist
rppawlo commented 8 years ago

I'm not sure of your exact use case, but we did put explicit scaling support into thyra for a diagonal scaling matrix:

https://trilinos.org/docs/dev/packages/thyra/doc/html/classThyra_1_1ScaledLinearOpBase.html

you get the diagonal with the mix in interface:

https://trilinos.org/docs/dev/packages/thyra/doc/html/classThyra_1_1RowStatLinearOpBase.html

Concrete implementations exist for epetra and tpetra. Not sure how complete they were. Definitely supports CrsMatrix.

tawiesn commented 8 years ago

@rppawlo Thanks for your answer. I'll take a look.

The use case is a multiphysics problem in drekar where the blocks of the different physics are scaled differently. In order to use relaxation methods as multigrid smoothers it is important that the blocks are properly scaled. I hacked the scaling feature quickly into MueLu and it really helps for my application.

rppawlo commented 8 years ago

@tawiesn we use this capability to apply row sum scaling and user defined scaling to linear systems for Newton solves in Drekar. We apply the scalings before handing the matrix to the preconditioner.

tawiesn commented 8 years ago

@rppawlo Can you point me to the place in drekar/panzer/NOX/Thyra where you scale the linear systems for the Newton solves in Drekar. Maybe the functionality exists and i'm just not aware of it. Does it work for blocked multiphysics operators?

tawiesn commented 8 years ago

I found "Function Scaling" = "Row Sum" in NOX. Have to check whether this is doing what i need

rppawlo commented 8 years ago

The scaling is handled by nox. If you are running in drekar, you can enable it with the block:

   <ParameterList name="Thyra Group Options">
       <Parameter name="Function Scaling" type="string" value="Row Sum"/> 
       <!-- <Parameter name="Function Scaling" type="string" value="None"/>  -->
    </ParameterList>

See examples such as: sod_prb_vms_entropy_visc_bdf1.xml

tawiesn commented 8 years ago

@rppawlo thanks. That's exactly what i was looking for.

tawiesn commented 8 years ago

Renamed issue to cleanup some unused booleans as well as the doxygen documentation of Belos::LinearProblem

hkthorn commented 7 years ago

Left scale and right scale have been removed and also documentation.