[dune-pdelab] Fwd: solver fails to reset correctly after FMatrixError (singular matrix)
Markus Blatt
markus at dr-blatt.de
Tue Jul 23 16:00:17 CEST 2019
Hi,
I am probably missing a lot here, but have you tried the poor-man's solution, below?
On Wed, Jul 10, 2019 at 11:55:45AM +0200, Shubhangi Gupta wrote:
> *// code layout*
>
> ...UG grid, generated using gmsh, GV, ...
>
> typedef Dune::PDELab::QkDGLocalFiniteElementMap<GV::Grid::ctype, double,
> 0, dim, Dune::PDELab::QkDGBasisPolynomial::lagrange> FEMP0;
> FEMP0 femp0;
> typedef Dune::PDELab::GridFunctionSpace<GV,FEMP0,Dune::PDELab::P0ParallelConstraints,Dune::PDELab::ISTL::VectorBackend<>>
> GFS0;
> GFS0 gfs0(gv,femp0);
> typedef Dune::PDELab::PowerGridFunctionSpace< GFS0,num_of_vars,
> Dune::PDELab::ISTL::VectorBackend<Dune::PDELab::ISTL::Blocking::fixed>,
> Dune::PDELab::EntityBlockedOrderingTag> GFS_TCH;
>
> ... LocalOperator LOP lop, TimeLocalOperator TOP top, GridOperator GO
> go, InstationaryGridOperator IGO igo, ...
>
> typedef Dune::PDELab::ISTLBackend_BCGS_AMG_SSOR<IGO> LS;
> LS ls(gfs,50,1,false,true);
> typedef Dune::PDELab::Newton< IGO, LS, U > PDESOLVER;
> PDESOLVER pdesolver( igo, ls );
> Dune::PDELab::ImplicitEulerParameter<double> method;
>
> Dune::PDELab::OneStepMethod< double, IGO, PDESOLVER, U, U > osm( method,
> igo, pdesolver );
>
> //TIME-LOOP
> while( time < t_END - 1e-8){
int applyWorked=0;
> try{
> //PDE-SOLVE
> osm.apply( time, dt, uold, unew );
> applyWorked=1
> }catch ( Dune::Exception &e ) {
> //RESET
> exceptionCaught = true;
> std::cout << "Catched Error, Dune reported error: " << e <<
> std::endl;
}
applyWorked = grid.comm().min(applyWorked);
if(applyWorked)
{
> unew = uold;
> dt *= 0.5;
> osm.getPDESolver().discardMatrix();
> continue;
> }
> uold = unew;
> time += dt;
> }
>
--
Dr. Markus Blatt - HPC-Simulation-Software & Services http://www.dr-blatt.de
Pedettistr. 38, 85072 Eichstätt, Germany
Tel.: +49 (0) 160 97590858
More information about the dune-pdelab
mailing list