Multicomponent Linear Solve #2976
-
Hello AMReX folks, I have a question wrt the MC linear solve feature. I need to solve three Poisson equations in the form of What I do now is that I solve one Poisson equation independently for each component in a for loop. I was thinking to use the MC feature. My first question is that is there going to be any saving in computational time if I use the MC feature compared to what I have now? And my second question is that is there any sample implementation of MC linear solve for cell-centered data that I can refer to? Thank you. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Yes, I believe there will be saving if all three components are solved together. Although our cell-centered Poisson only supports one component, we do have another solver that can be used for this. In |
Beta Was this translation helpful? Give feedback.
Yes, I believe there will be saving if all three components are solved together. Although our cell-centered Poisson only supports one component, we do have another solver that can be used for this. In$a A u - b \nabla u = f$ . Here $a$ and $b$ are scalars (i.e., $A$ is a cell-centered $a$ is zero. Alternatively, you can extend
Src/LinearSolvers/MLMG/
, there isamrex::MLALaplacian
that can be used to solveamrex::Real
) andMultiFab
. If you usea_ncomp=3
in the constructor ofMLALaplacian
and callMLALaplacian::setScalars(0.0, -1.0)
, the system will become three Poisson equations. Note that you don't need to callMLALaplacian::setACoeffs
becauseamrex::MLPoisson
to support multiple componen…