Re: [deal.II] Re: dealii::SolverControl::NoConvergence with Bicgstab

2021-04-15 Thread Bruno Turcksin
Le jeu. 15 avr. 2021 à 11:57, bunel...@gmail.com  a
écrit :

> Hi,
>
> thank you very much for your answer.
> I have actually tried to solve using GMRES like this :
>
> SolverControl
> solver_control(phi_system_rhs.size()*2,1e-10);
> PreconditionJacobi<>   preconditioner;
> preconditioner.initialize(phi_system_matrix, 1.0);
> SolverGMRES> solver(solver_control );
> solver.solve(phi_system_matrix, phi_update, phi_system_rhs,
> preconditioner);
>
> and with this, I still get an error because the solver reached the max
> number of iteration and did not converge... :
>
> "Iterative method reported convergence failure in step 164354. The
> residual in the last step was 0.348567."
>

Let me rephrase what I said. Non-restarted GMRES is guaranteed to converge.
deal.II uses restarted gmres. You can increase the number of iterations
before a restart (see
https://dealii.org/developer/doxygen/deal.II/structSolverGMRES_1_1AdditionalData.html#ac385db0e8c853c02d828469d5a5bdcca
)

>
> Unfortunately, I did not find any literature on preconditioner for my
> specific system so I guess I am down to trying them all and seeing if one
> of them works...
>

If you have no idea which preconditioner to use, you can try a black-box
preconditioner, such as incomplete LU (ILU), algebraic multigrid (AMG), and
geometric multigrid (GMG). ILU and AMG require Trilinos or PETSc. For GMG,
there are a couple of tutorials you can look at.

Best,

Bruno


>
> Le jeudi 15 avril 2021 à 17:41:10 UTC+2, bruno.t...@gmail.com a écrit :
>
>> Hi,
>>
>> Bicgstab is not guaranteed to converge especially when using a bad
>> preconditioner. You are using Jacobi as preconditioner which is a simple
>> but not very good preconditioner. As you can see from the error message,
>> you performed 1959 bicgstab iterations. That's a lot and it probably
>> indicates that there was a breakdown. The easy fix to your problem is to
>> use gmres instead of bicgstab. Gmres is guaranteed to converge. The real
>> fix is to use a better preconditioner. With a bad preconditioner, gmres
>> will converge slowly. You should look in the literature what kind of
>> preconditioner you should use.
>>
>> Best,
>>
>> Bruno
>>
>> On Thursday, April 15, 2021 at 4:21:21 AM UTC-4 bunel...@gmail.com wrote:
>>
>>>
>>> Hi,
>>> I'm having a problem for some values of parameters in my code.
>>> I get an error "dealii::SolverControl::NoConvergence", almost instantly
>>> after the start of the solving process. The status at the end is this :
>>>
>>> "Iterative method reported convergence failure in step 1959. The
>>> residual in the last step was nan."
>>>
>>> Here is some details about my problem.
>>>
>>> I'm solving this equation in phi :
>>> [image: Screenshot from 2021-04-15 10-03-35.png]
>>> with u and v, speeds that are calculated in another part of the code.
>>>
>>> Since it is a non linear problem in phi, i'm using a Newton method to
>>> solve it.
>>> I have developped my Newton Method and calculated the part that I'm
>>> assembling.
>>> [image: Screenshot from 2021-04-15 10-05-29.png]
>>> As you can see, it is a non symmetric problem because of the advection
>>> term and as such, i'm using the Bicgstab solver like this :
>>>
>>> SolverControl
>>> solver_control(phi_system_rhs.size()*2,1e-10);
>>> SolverBicgstab> solver(solver_control);
>>> PreconditionJacobi<>   preconditioner;
>>>
>>> preconditioner.initialize(phi_system_matrix, 1.0);
>>> solver.solve(phi_system_matrix, phi_update, phi_system_rhs,
>>> preconditioner);
>>> phi_constraints.distribute(phi_update);
>>>
>>> Note that if I use a direct solver like this :
>>>
>>> SparseDirectUMFPACK A_direct;
>>> A_direct.initialize(phi_system_matrix);
>>> A_direct.vmult(phi_update, phi_system_rhs);
>>>
>>> phi_constraints.distribute(phi_update);
>>>
>>> I don't get an error but it is of course much slower (and the newton
>>> method painfully converge but I knew this was gonna be difficult).
>>>
>>>
>>> "The other situation where this error may occur is when your matrix is
>>> not invertible (e.g., your matrix has a null-space), or if you try to apply
>>> the wrong solver to a matrix (e.g., using CG for a matrix that is not
>>> symmetric or not positive definite). In these cases, the residual in the
>>> last iteration is likely going to be large."
>>>
>>> This message at the end of the error made me wonder if I was choosing a
>>> bad solver for this task and tried to find the Bicgstab recquirements.
>>> Unfortunately, I was not able to find the recquirements for the Bicgstab in
>>> the documentation.
>>>
>>> I found this page
>>> that
>>> tells me to go to the solver base for requirements but I could not find the
>>> solverBase page with this information.
>>>
>>> So could someone point me in the right direction and/or tell me if they
>>> have an idea of why th

[deal.II] deal.II Newsletter #162

2021-04-15 Thread 'Rene Gassmoeller' via deal.II User Group
Hello everyone!

This is deal.II newsletter #162.
It automatically reports recently merged features and discussions about the 
deal.II finite element library.


## Below you find a list of recently proposed or merged features:

#12046: Remove calls to create_triangulation_compatibility in GridGenerator. 
(proposed by drwells) https://github.com/dealii/dealii/pull/12046

#12045: Remove two more create_triangulation_compatibility calls. (proposed by 
drwells) https://github.com/dealii/dealii/pull/12045

#12044: CMake: FindKOKKOS: Work around configuration failure (proposed by 
tamiko; merged) https://github.com/dealii/dealii/pull/12044

#12043: Remove hp::DoFHandler from tutorial list. (proposed by marcfehling; 
merged) https://github.com/dealii/dealii/pull/12043

#12042: Get rid of create_triangulation_compatibility in the UCD reader. 
(proposed by drwells; merged) https://github.com/dealii/dealii/pull/12042

#12041: Bug in weighting_callback for uninitialized DoFHandlers. (proposed by 
marcfehling; merged) https://github.com/dealii/dealii/pull/12041

#12040: Fix process_dof_indices (for artificial faces in 
DoFTools::set_periodicity_constraints) (proposed by peterrum; merged) 
https://github.com/dealii/dealii/pull/12040

#12039: Get rid of create_triangulation_compatibility in the UNV reader. 
(proposed by drwells; merged) https://github.com/dealii/dealii/pull/12039

#12038: Clarify an issue in the introduction of step-61. (proposed by bangerth; 
merged) https://github.com/dealii/dealii/pull/12038

#12036: Make tooltips more uniform in style. (proposed by bangerth; merged) 
https://github.com/dealii/dealii/pull/12036

#12035: Step 78 (proposed by tyand96) 
https://github.com/dealii/dealii/pull/12035

#12034: Step 79: A topology optimization problem (proposed by juleoc02) 
https://github.com/dealii/dealii/pull/12034

#12033: Compare pointers in find_vector_in_mf (proposed by peterrum; merged) 
https://github.com/dealii/dealii/pull/12033

#12032: Do not allocate memory for DoFs on artificial cells (proposed by 
peterrum; merged) https://github.com/dealii/dealii/pull/12032

#12030: Support different KINSOL versions. (proposed by bangerth) 
https://github.com/dealii/dealii/pull/12030

#12028: Make cmake messages easier to read. (proposed by bangerth; merged) 
https://github.com/dealii/dealii/pull/12028

#12027: Improve error messages during configuration. (proposed by bangerth) 
https://github.com/dealii/dealii/pull/12027


## And this is a list of recently opened or closed discussions:

#12037: ExcNotImplemented in make_flux_sparsity_pattern with FENothing (opened) 
https://github.com/dealii/dealii/issues/12037

#12029: TransfiniteInterpolationManifold::initialize with <2,3> triangulations 
(opened) https://github.com/dealii/dealii/issues/12029


A list of all major changes since the last release can be found at 
https://www.dealii.org/developer/doxygen/deal.II/recent_changes.html.


Thanks for being part of the community!


Let us know about questions, problems, bugs or just share your experience by 
writing to dealii@googlegroups.com, or by opening issues or pull requests at 
https://www.github.com/dealii/dealii.
Additional information can be found at https://www.dealii.org/.

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/607864b7.1c69fb81.8ceff.974aSMTPIN_ADDED_MISSING%40gmr-mx.google.com.


[deal.II] Re: dealii::SolverControl::NoConvergence with Bicgstab

2021-04-15 Thread bunel...@gmail.com
Hi,

thank you very much for your answer. 
I have actually tried to solve using GMRES like this :

SolverControl  
solver_control(phi_system_rhs.size()*2,1e-10);
PreconditionJacobi<>   preconditioner;
preconditioner.initialize(phi_system_matrix, 1.0);
SolverGMRES> solver(solver_control );
solver.solve(phi_system_matrix, phi_update, phi_system_rhs, 
preconditioner); 

and with this, I still get an error because the solver reached the max 
number of iteration and did not converge... :

"Iterative method reported convergence failure in step 164354. The residual 
in the last step was 0.348567."

Unfortunately, I did not find any literature on preconditioner for my 
specific system so I guess I am down to trying them all and seeing if one 
of them works...

Le jeudi 15 avril 2021 à 17:41:10 UTC+2, bruno.t...@gmail.com a écrit :

> Hi,
>
> Bicgstab is not guaranteed to converge especially when using a bad 
> preconditioner. You are using Jacobi as preconditioner which is a simple 
> but not very good preconditioner. As you can see from the error message, 
> you performed 1959 bicgstab iterations. That's a lot and it probably 
> indicates that there was a breakdown. The easy fix to your problem is to 
> use gmres instead of bicgstab. Gmres is guaranteed to converge. The real 
> fix is to use a better preconditioner. With a bad preconditioner, gmres 
> will converge slowly. You should look in the literature what kind of 
> preconditioner you should use.
>
> Best,
>
> Bruno
>
> On Thursday, April 15, 2021 at 4:21:21 AM UTC-4 bunel...@gmail.com wrote:
>
>>
>> Hi, 
>> I'm having a problem for some values of parameters in my code.
>> I get an error "dealii::SolverControl::NoConvergence", almost instantly 
>> after the start of the solving process. The status at the end is this :
>>
>> "Iterative method reported convergence failure in step 1959. The residual 
>> in the last step was nan."
>>
>> Here is some details about my problem. 
>>
>> I'm solving this equation in phi :
>> [image: Screenshot from 2021-04-15 10-03-35.png]
>> with u and v, speeds that are calculated in another part of the code.
>>
>> Since it is a non linear problem in phi, i'm using a Newton method to 
>> solve it.
>> I have developped my Newton Method and calculated the part that I'm 
>> assembling.
>> [image: Screenshot from 2021-04-15 10-05-29.png]
>> As you can see, it is a non symmetric problem because of the advection 
>> term and as such, i'm using the Bicgstab solver like this :
>>
>> SolverControl  
>> solver_control(phi_system_rhs.size()*2,1e-10);
>> SolverBicgstab> solver(solver_control);
>> PreconditionJacobi<>   preconditioner;
>>
>> preconditioner.initialize(phi_system_matrix, 1.0);
>> solver.solve(phi_system_matrix, phi_update, phi_system_rhs, 
>> preconditioner); 
>> phi_constraints.distribute(phi_update);
>>
>> Note that if I use a direct solver like this : 
>>
>> SparseDirectUMFPACK A_direct;
>> A_direct.initialize(phi_system_matrix);
>> A_direct.vmult(phi_update, phi_system_rhs); 
>>
>> phi_constraints.distribute(phi_update);
>>
>> I don't get an error but it is of course much slower (and the newton 
>> method painfully converge but I knew this was gonna be difficult).
>>
>>
>> "The other situation where this error may occur is when your matrix is 
>> not invertible (e.g., your matrix has a null-space), or if you try to apply 
>> the wrong solver to a matrix (e.g., using CG for a matrix that is not 
>> symmetric or not positive definite). In these cases, the residual in the 
>> last iteration is likely going to be large."
>>
>> This message at the end of the error made me wonder if I was choosing a 
>> bad solver for this task and tried to find the Bicgstab recquirements. 
>> Unfortunately, I was not able to find the recquirements for the Bicgstab in 
>> the documentation. 
>>
>> I found this page 
>> that
>>  
>> tells me to go to the solver base for requirements but I could not find the 
>> solverBase page with this information. 
>>
>> So could someone point me in the right direction and/or tell me if they 
>> have an idea of why this solver is not converging in my case ?
>>
>> Thanks again for developing dealii that is very useful to my research.
>>
>>

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/2570a596-bc4c-401a-81e1-03ee929ef46fn%40googlegroups.com.


[deal.II] Re: dealii::SolverControl::NoConvergence with Bicgstab

2021-04-15 Thread Bruno Turcksin
Hi,

Bicgstab is not guaranteed to converge especially when using a bad 
preconditioner. You are using Jacobi as preconditioner which is a simple 
but not very good preconditioner. As you can see from the error message, 
you performed 1959 bicgstab iterations. That's a lot and it probably 
indicates that there was a breakdown. The easy fix to your problem is to 
use gmres instead of bicgstab. Gmres is guaranteed to converge. The real 
fix is to use a better preconditioner. With a bad preconditioner, gmres 
will converge slowly. You should look in the literature what kind of 
preconditioner you should use.

Best,

Bruno

On Thursday, April 15, 2021 at 4:21:21 AM UTC-4 bunel...@gmail.com wrote:

>
> Hi, 
> I'm having a problem for some values of parameters in my code.
> I get an error "dealii::SolverControl::NoConvergence", almost instantly 
> after the start of the solving process. The status at the end is this :
>
> "Iterative method reported convergence failure in step 1959. The residual 
> in the last step was nan."
>
> Here is some details about my problem. 
>
> I'm solving this equation in phi :
> [image: Screenshot from 2021-04-15 10-03-35.png]
> with u and v, speeds that are calculated in another part of the code.
>
> Since it is a non linear problem in phi, i'm using a Newton method to 
> solve it.
> I have developped my Newton Method and calculated the part that I'm 
> assembling.
> [image: Screenshot from 2021-04-15 10-05-29.png]
> As you can see, it is a non symmetric problem because of the advection 
> term and as such, i'm using the Bicgstab solver like this :
>
> SolverControl  
> solver_control(phi_system_rhs.size()*2,1e-10);
> SolverBicgstab> solver(solver_control);
> PreconditionJacobi<>   preconditioner;
>
> preconditioner.initialize(phi_system_matrix, 1.0);
> solver.solve(phi_system_matrix, phi_update, phi_system_rhs, 
> preconditioner); 
> phi_constraints.distribute(phi_update);
>
> Note that if I use a direct solver like this : 
>
> SparseDirectUMFPACK A_direct;
> A_direct.initialize(phi_system_matrix);
> A_direct.vmult(phi_update, phi_system_rhs); 
>
> phi_constraints.distribute(phi_update);
>
> I don't get an error but it is of course much slower (and the newton 
> method painfully converge but I knew this was gonna be difficult).
>
>
> "The other situation where this error may occur is when your matrix is not 
> invertible (e.g., your matrix has a null-space), or if you try to apply the 
> wrong solver to a matrix (e.g., using CG for a matrix that is not symmetric 
> or not positive definite). In these cases, the residual in the last 
> iteration is likely going to be large."
>
> This message at the end of the error made me wonder if I was choosing a 
> bad solver for this task and tried to find the Bicgstab recquirements. 
> Unfortunately, I was not able to find the recquirements for the Bicgstab in 
> the documentation. 
>
> I found this page 
> that 
> tells me to go to the solver base for requirements but I could not find the 
> solverBase page with this information. 
>
> So could someone point me in the right direction and/or tell me if they 
> have an idea of why this solver is not converging in my case ?
>
> Thanks again for developing dealii that is very useful to my research.
>
>

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/6550d9a8-ccbe-4d28-b24d-479b1488afa8n%40googlegroups.com.


[deal.II] Reading a list from parameter file

2021-04-15 Thread Paras Kumar
Dear All,

I am trying to read a list of integers from the parameter file using the 
dealii::Patterns::List class.
However, I get a runtime error which can be reproduced using the attached 
MWE.

I also tried the approach described (for tensor) in 
https://groups.google.com/g/dealii/c/TvtcOnxeVjw/m/9uaSAh-kAwAJ but it 
doesn't seem to work for the current case.

It would be great help if someone could help me understand where I go wrong?

Thanks in advance and best regards,
Paras



-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/a478ba5e-0150-4fb5-8e90-0faf1c86b9fbn%40googlegroups.com.
#include 
#include 
#include 

using UnsignedIntType = unsigned int;

 void Declare_blockNonlinearSolverParameters(dealii::ParameterHandler ¶meterHandler)
{
parameterHandler.declare_entry(
  "Num Max Newton Iters",
  "10|10",
  dealii::Patterns::List(dealii::Patterns::Integer(1), 2, 8, "|"),
  "Allowed maximum number of newton iterations for inner loops");
}

int main()
{
// decalre the parameters to be read
dealii::ParameterHandler paramHandler;
paramHandler.enter_subsection("Block Nonlinear Solver");
Declare_blockNonlinearSolverParameters(paramHandler);
paramHandler.leave_subsection();

// generate and read the param file
const std::string paramsBNlSolverTest01 =
  "subsection Block Nonlinear Solver   \n"
  "# Allowed maximum number of newton iterations for inner loops   \n"
  "set Num Max Newton Iters = 27|30|45 \n"
  "end \n";
std::stringstream paramFileString;
paramFileString << paramsBNlSolverTest01;
paramHandler.parse_input(paramFileString);

//extract the read params

paramHandler.enter_subsection("Block Nonlinear Solver");
const std::string nMaxItersString = paramHandler.get("Num Max Newton Iters");
std::cout << "nMaxItersString: " << nMaxItersString << std::endl;
std::vector nIters;
nIters = dealii::Patterns::Tools::Convert::to_value(nMaxItersString);
paramHandler.leave_subsection();
}



[deal.II] Re: LineMinimization and p-Laplace

2021-04-15 Thread Bruno Turcksin
Julie,

There is a tutorial in progress https://github.com/dealii/dealii/pull/11953 
that is based on step-15 but uses KINSOL 
. 
KINSOL is a package dedicated to non-linear solve. It's probably worth 
using it in complicated cases like yours.

Best,

Bruno

On Thursday, April 15, 2021 at 6:08:30 AM UTC-4 j.y.m...@rug.nl wrote:

> Dear all,
>
> I am trying to solve a p-Laplace Dirichlet problem with zero boundary and 
> used step-15 as the base. The code works well for p=1.1-2.9 with Newton and 
> standard linesearch procedure. But when p>=3 the program diverges, 
> continuation method brought me to p=2.99 but not beyond. Recently I have 
> used the LineMinimization class and got this error after a few iterations:
>
> using poly_fit and these param:
> const double a1= 1.0; 
> const double eta   = 0.9; 
> const double mu= 1e-4;
> const double a_max = 1.25; 
> const double max_evals = 100; 
> const bool debug_output = true;
>
>   
> An error occurred in line <457> of file 
> 
>  
> in function
> NumberType dealii::LineMinimization::poly_fit(NumberType, NumberType, 
> NumberType, NumberType, NumberType, NumberType, const 
> dealii::FiniteSizeHistory&, const 
> dealii::FiniteSizeHistory&, const 
> dealii::FiniteSizeHistory&, std::pair<_FIter, _FIter>) [with 
> NumberType = double]
> The violated condition was: 
> bounds.first < bounds.second
> Additional information: 
> Incorrect bounds
>
> I have looked into the source code and understood these bounds are meant 
> for the sectioning and bracketing intervals. I tried different settings of 
> the param and still get this error. I am running out of ideas how to debug 
> this...
>
> Any help is highly appreciated.
>
> Thanks a lot and best wishes,
> Julie
>
>
>

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/e2018a73-b617-456b-bae1-f84abdccffe2n%40googlegroups.com.


[deal.II] LineMinimization and p-Laplace

2021-04-15 Thread J.Y. Merten
Dear all,

I am trying to solve a p-Laplace Dirichlet problem with zero boundary and 
used step-15 as the base. The code works well for p=1.1-2.9 with Newton and 
standard linesearch procedure. But when p>=3 the program diverges, 
continuation method brought me to p=2.99 but not beyond. Recently I have 
used the LineMinimization class and got this error after a few iterations:

using poly_fit and these param:
const double a1= 1.0; 
const double eta   = 0.9; 
const double mu= 1e-4;
const double a_max = 1.25; 
const double max_evals = 100; 
const bool debug_output = true;

  
An error occurred in line <457> of file 

 
in function
NumberType dealii::LineMinimization::poly_fit(NumberType, NumberType, 
NumberType, NumberType, NumberType, NumberType, const 
dealii::FiniteSizeHistory&, const 
dealii::FiniteSizeHistory&, const 
dealii::FiniteSizeHistory&, std::pair<_FIter, _FIter>) [with 
NumberType = double]
The violated condition was: 
bounds.first < bounds.second
Additional information: 
Incorrect bounds

I have looked into the source code and understood these bounds are meant 
for the sectioning and bracketing intervals. I tried different settings of 
the param and still get this error. I am running out of ideas how to debug 
this...

Any help is highly appreciated.

Thanks a lot and best wishes,
Julie


-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/d8844ccc-1f9e-4669-ad03-c71abf33eadbn%40googlegroups.com.


Re: [deal.II] dealii/spack on apple m1

2021-04-15 Thread Praveen C
Thank you for sharing your experience.

So it looks like we cannot yet install spack natively, right ?

> On 15-Apr-2021, at 12:08 PM, Alberto Salvadori  
> wrote:
> 
> 1 - After opening a terminal rosetta, installing gcc, installing deal.ii via 
> spack and using gfortran from gcc installation, it works just fine

Here both gfortran and spack are under rosetta.

> 2 - Even in a rosetta terminal, the current dmg package does not seem to work
> 3 - After opening a terminal rosetta, NOT installing gcc, installing deal.ii 
> via spack and using gfortran from homebrew installation, deal.ii apparently 
> does not work

Here gfortran is native but spack is under emulation, which does not work.

> 4 - I had some issues with openmpi after installation, because of the dynamic 
> library that apparently conflicts with cmake. My skills are very limited, but 
> with some further work (that I cannot recall now)
> I made it, even with Xcode projects.

Best
praveen

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/2A8F616D-FF4B-4993-95B1-32BBEE43A00F%40gmail.com.


[deal.II] dealii::SolverControl::NoConvergence with Bicgstab

2021-04-15 Thread bunel...@gmail.com

Hi, 
I'm having a problem for some values of parameters in my code.
I get an error "dealii::SolverControl::NoConvergence", almost instantly 
after the start of the solving process. The status at the end is this :

"Iterative method reported convergence failure in step 1959. The residual 
in the last step was nan."

Here is some details about my problem. 

I'm solving this equation in phi :
[image: Screenshot from 2021-04-15 10-03-35.png]
with u and v, speeds that are calculated in another part of the code.

Since it is a non linear problem in phi, i'm using a Newton method to solve 
it.
I have developped my Newton Method and calculated the part that I'm 
assembling.
[image: Screenshot from 2021-04-15 10-05-29.png]
As you can see, it is a non symmetric problem because of the advection term 
and as such, i'm using the Bicgstab solver like this :
   
SolverControl  
solver_control(phi_system_rhs.size()*2,1e-10);
SolverBicgstab> solver(solver_control);
PreconditionJacobi<>   preconditioner;

preconditioner.initialize(phi_system_matrix, 1.0);
solver.solve(phi_system_matrix, phi_update, phi_system_rhs, 
preconditioner); 
phi_constraints.distribute(phi_update);

Note that if I use a direct solver like this : 
   
SparseDirectUMFPACK A_direct;
A_direct.initialize(phi_system_matrix);
A_direct.vmult(phi_update, phi_system_rhs); 

phi_constraints.distribute(phi_update);

I don't get an error but it is of course much slower (and the newton method 
painfully converge but I knew this was gonna be difficult).


"The other situation where this error may occur is when your matrix is not 
invertible (e.g., your matrix has a null-space), or if you try to apply the 
wrong solver to a matrix (e.g., using CG for a matrix that is not symmetric 
or not positive definite). In these cases, the residual in the last 
iteration is likely going to be large."

This message at the end of the error made me wonder if I was choosing a bad 
solver for this task and tried to find the Bicgstab recquirements. 
Unfortunately, I was not able to find the recquirements for the Bicgstab in 
the documentation. 

I found this page 
that 
tells me to go to the solver base for requirements but I could not find the 
solverBase page with this information. 

So could someone point me in the right direction and/or tell me if they 
have an idea of why this solver is not converging in my case ?

Thanks again for developing dealii that is very useful to my research.

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/50f5d9d3-f3bb-4755-aa3d-929087947b71n%40googlegroups.com.